diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 00:15:53 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 00:15:53 +0000 |
commit | 0aaa8e3fc8f8a1481333b564f0922277c8d8ad59 (patch) | |
tree | b95c0ca86c4876dd139af376b9f4afd8917cf0cd /src/common/gui/list_container.cpp | |
parent | b79a2c28534cf09987eeeba3077fff9236df182a (diff) | |
download | piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.tar.gz piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.zip |
TQt4 port piklab
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1238822 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/common/gui/list_container.cpp')
-rw-r--r-- | src/common/gui/list_container.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/common/gui/list_container.cpp b/src/common/gui/list_container.cpp index 0103175..78f5a65 100644 --- a/src/common/gui/list_container.cpp +++ b/src/common/gui/list_container.cpp @@ -9,27 +9,27 @@ #include "list_container.h" //---------------------------------------------------------------------------- -PopupContainer::PopupContainer(const QString &title, QWidget *parent, const char *name) - : KPopupMenu(parent, name) +PopupContainer::PopupContainer(const TQString &title, TQWidget *tqparent, const char *name) + : KPopupMenu(tqparent, name) { if ( !title.isEmpty() ) insertTitle(title); } -ListContainer *PopupContainer::appendBranch(const QString &title) +ListContainer *PopupContainer::appendBranch(const TQString &title) { PopupContainer *branch = new PopupContainer(title, this); insertItem(title, branch); return branch; } -ListContainer *PopupContainer::appendBranch(const QPixmap &pixmap, const QString &title) +ListContainer *PopupContainer::appendBranch(const TQPixmap &pixmap, const TQString &title) { PopupContainer *branch = new PopupContainer(title, this); insertItem(pixmap, title, branch); return branch; } -void PopupContainer::appendItem(const QPixmap &icon, const QString &label, uint id, ItemState state) +void PopupContainer::appendItem(const TQPixmap &icon, const TQString &label, uint id, ItemState state) { insertItem(icon, label, id); switch (state) { @@ -41,16 +41,16 @@ void PopupContainer::appendItem(const QPixmap &icon, const QString &label, uint } //---------------------------------------------------------------------------- -ListViewItemContainer::ListViewItemContainer(const QString &title, KListView *parent) - : KListViewItem(parent, title), _parent(0), _column(0) +ListViewItemContainer::ListViewItemContainer(const TQString &title, KListView *tqparent) + : KListViewItem(tqparent, title), _parent(0), _column(0) { - _ids = new QMap<const QListViewItem *, uint>; + _ids = new TQMap<const TQListViewItem *, uint>; } -ListViewItemContainer::ListViewItemContainer(const QString &title, ListViewItemContainer *parent) - : KListViewItem(parent, title), _parent(parent), _column(0) +ListViewItemContainer::ListViewItemContainer(const TQString &title, ListViewItemContainer *tqparent) + : KListViewItem(tqparent, title), _parent(tqparent), _column(0) { - _ids = parent->_ids; + _ids = tqparent->_ids; } ListViewItemContainer::~ListViewItemContainer() @@ -58,38 +58,38 @@ ListViewItemContainer::~ListViewItemContainer() if ( _parent==0 ) delete _ids; } -ListContainer *ListViewItemContainer::appendBranch(const QString &title) +ListContainer *ListViewItemContainer::appendBranch(const TQString &title) { ListViewItemContainer *branch = new ListViewItemContainer(title, this); branch->setColumn(_column); branch->setSelectable(false); // append instead of prepend - QListViewItem *litem=firstChild(); + TQListViewItem *litem=firstChild(); while ( litem && litem->nextSibling() ) litem = litem->nextSibling(); if (litem) branch->moveItem(litem); return branch; } -void ListViewItemContainer::appendItem(const QPixmap &icon, const QString &title, uint id, ItemState state) +void ListViewItemContainer::appendItem(const TQPixmap &icon, const TQString &title, uint id, ItemState state) { - QListViewItem *item = 0; + TQListViewItem *item = 0; if ( state==Normal || state==Disabled ) { item = new KListViewItem(this); item->setText(_column, title); } else { - item = new QCheckListItem(this, title, QCheckListItem::CheckBox); - static_cast<QCheckListItem *>(item)->setState(state==Checked ? QCheckListItem::On : QCheckListItem::Off); + item = new TQCheckListItem(this, title, TQCheckListItem::CheckBox); + static_cast<TQCheckListItem *>(item)->setState(state==Checked ? TQCheckListItem::On : TQCheckListItem::Off); } item->setPixmap(_column, icon); item->setSelectable(state==Normal); // append instead of prepend - QListViewItem *litem=firstChild(); + TQListViewItem *litem=firstChild(); while ( litem && litem->nextSibling() ) litem = litem->nextSibling(); if (litem) item->moveItem(litem); (*_ids)[item] = id; } -int ListViewItemContainer::id(const QListViewItem *item) const +int ListViewItemContainer::id(const TQListViewItem *item) const { - return (_ids->contains(item) ? int((*_ids)[item]) : -1); + return (_ids->tqcontains(item) ? int((*_ids)[item]) : -1); } |