diff options
Diffstat (limited to 'src/libgui/watch_view.cpp')
-rw-r--r-- | src/libgui/watch_view.cpp | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/src/libgui/watch_view.cpp b/src/libgui/watch_view.cpp index 984dc7c..4f5ef89 100644 --- a/src/libgui/watch_view.cpp +++ b/src/libgui/watch_view.cpp @@ -8,8 +8,8 @@ ***************************************************************************/ #include "watch_view.h" -#include <qheader.h> -#include <qcombobox.h> +#include <tqheader.h> +#include <tqcombobox.h> #include <kiconloader.h> #include "main_global.h" @@ -21,25 +21,25 @@ #include "common/gui/list_container.h" //----------------------------------------------------------------------------- -Register::BaseListView::BaseListView(QWidget *parent) - : ListView(parent), _root(0) +Register::BaseListView::BaseListView(TQWidget *tqparent) + : ListView(tqparent), _root(0) { header()->hide(); setSorting(-1); setFullWidth(true); setRootIsDecorated(false); setAllColumnsShowFocus(true); - connect(this, SIGNAL(mouseButtonClicked(int, QListViewItem *, const QPoint &, int)), - SLOT(itemClicked(int, QListViewItem *, const QPoint &, int))); - connect(this, SIGNAL(contextMenuRequested(QListViewItem *, const QPoint &, int)), - SLOT(contextMenu(QListViewItem *, const QPoint &, int))); + connect(this, TQT_SIGNAL(mouseButtonClicked(int, TQListViewItem *, const TQPoint &, int)), + TQT_SLOT(itemClicked(int, TQListViewItem *, const TQPoint &, int))); + connect(this, TQT_SIGNAL(contextMenuRequested(TQListViewItem *, const TQPoint &, int)), + TQT_SLOT(contextMenu(TQListViewItem *, const TQPoint &, int))); } //----------------------------------------------------------------------------- -Register::RegisterListView::RegisterListView(QWidget *parent) - : BaseListView(parent) +Register::RegisterListView::RegisterListView(TQWidget *tqparent) + : BaseListView(tqparent) { - addColumn(QString::null); + addColumn(TQString()); } void Register::RegisterListView::init(const Device::Data *data) @@ -55,34 +55,34 @@ void Register::RegisterListView::init(const Device::Data *data) void Register::RegisterListView::updateView() { - QListViewItemIterator it(_root); + TQListViewItemIterator it(_root); for (; it.current(); ++it) { int id = _root->id(it.current()); if ( id==-1 || _ids[id].type()==Invalid ) continue; bool watched = Register::list().isWatched(_ids[id]); - static_cast<QCheckListItem *>(it.current())->setOn(watched); + static_cast<TQCheckListItem *>(it.current())->setOn(watched); } } -void Register::RegisterListView::itemClicked(int button, QListViewItem *item, const QPoint &, int) +void Register::RegisterListView::itemClicked(int button, TQListViewItem *item, const TQPoint &, int) { - if ( item==0 || button!=LeftButton ) return; + if ( item==0 || button!=Qt::LeftButton ) return; if ( item==firstChild() ) Main::editorManager().openEditor(EditorManager::RegisterEditor); int id = _root->id(item); if ( id==-1 || _ids[id].type()==Invalid ) return; bool watched = Register::list().isWatched(_ids[id]); - static_cast<QCheckListItem *>(item)->setOn(!watched); + static_cast<TQCheckListItem *>(item)->setOn(!watched); Debugger::manager->setRegisterWatched(_ids[id], !watched); } //----------------------------------------------------------------------------- -Register::WatchedListView::WatchedListView(QWidget *parent) - : BaseListView(parent), _popup(0), _base(NumberBase::Hex) +Register::WatchedListView::WatchedListView(TQWidget *tqparent) + : BaseListView(tqparent), _popup(0), _base(NumberBase::Hex) { setSorting(0); - addColumn(QString::null); - addColumn(QString::null); - addColumn(QString::null); + addColumn(TQString()); + addColumn(TQString()); + addColumn(TQString()); _root = new ListViewItemContainer(i18n("Watched"), this); KIconLoader loader; @@ -91,14 +91,14 @@ Register::WatchedListView::WatchedListView(QWidget *parent) _root->setOpen(true); } -KPopupMenu *Register::WatchedListView::appendFormatMenu(KPopupMenu *parent, uint offset) +KPopupMenu *Register::WatchedListView::appendFormatMenu(KPopupMenu *tqparent, uint offset) { KIconLoader loader; - QPixmap icon = loader.loadIcon("fonts", KIcon::Small); + TQPixmap icon = loader.loadIcon("fonts", KIcon::Small); KPopupMenu *popup = new KPopupMenu; popup->insertTitle(i18n("Format")); FOR_EACH(NumberBase, base) popup->insertItem(base.label(), offset + base.type()); - parent->insertItem(icon, i18n("Format"), popup); + tqparent->insertItem(icon, i18n("Format"), popup); return popup; } @@ -112,24 +112,24 @@ void Register::WatchedListView::init(const Device::Data *data) _popup->insertSeparator(); _formatPopup = appendFormatMenu(_popup, _ids.count()); KIconLoader loader; - QPixmap icon = loader.loadIcon("cancel", KIcon::Small); - _popup->insertItem(icon, i18n("Clear"), Debugger::manager, SLOT(stopWatchAll())); + TQPixmap icon = loader.loadIcon("cancel", KIcon::Small); + _popup->insertItem(icon, i18n("Clear"), Debugger::manager, TQT_SLOT(stopWatchAll())); } void Register::WatchedListView::updateView() { // delete items not watched anymore - for (QListViewItem *item=_root->firstChild(); item;) { + for (TQListViewItem *item=_root->firstChild(); item;) { ListViewItem *ritem = static_cast<ListViewItem *>(item); item = item->nextSibling(); if ( !Register::list().isWatched(ritem->data()) ) delete ritem; } // add new items bool added = false; - QValueList<Register::TypeData> watched = Register::list().watched(); - QValueVector<ListViewItem *> items(watched.count()); + TQValueList<Register::TypeData> watched = Register::list().watched(); + TQValueVector<ListViewItem *> items(watched.count()); for (uint k=0; k<watched.count(); k++) { - QListViewItem *item = _root->firstChild(); + TQListViewItem *item = _root->firstChild(); for (; item; item=item->nextSibling()) if ( static_cast<ListViewItem *>(item)->data()==watched[k] ) break; if (item) { @@ -143,23 +143,23 @@ void Register::WatchedListView::updateView() } } -QString Register::WatchedListView::tooltip(const QListViewItem &item, int col) const +TQString Register::WatchedListView::tooltip(const TQListViewItem &item, int col) const { if ( item.rtti()==Register::PortBitRtti ) return static_cast<const PortBitListViewItem &>(item).tooltip(col); if ( item.rtti()==Register::RegisterRtti ) return static_cast<const ListViewItem &>(item).tooltip(col); - return QString::null; + return TQString(); } -void Register::WatchedListView::itemClicked(int button, QListViewItem *item, const QPoint &, int col) +void Register::WatchedListView::itemClicked(int button, TQListViewItem *item, const TQPoint &, int col) { - if ( item==0 || button!=LeftButton ) return; + if ( item==0 || button!=Qt::LeftButton ) return; else if ( item->rtti()==RegisterRtti ) { if ( col==2 && Main::programmerState()==Programmer::Halted ) static_cast<ListViewItem *>(item)->startRename(); else item->setOpen(!item->isOpen()); } } -void Register::WatchedListView::contextMenu(QListViewItem *item, const QPoint &p, int) +void Register::WatchedListView::contextMenu(TQListViewItem *item, const TQPoint &p, int) { if ( item==0 ) return; if ( item==firstChild() ) { @@ -170,7 +170,7 @@ void Register::WatchedListView::contextMenu(QListViewItem *item, const QPoint &p if ( res<int(_ids.count()) ) Debugger::manager->setRegisterWatched(_ids[res], true); else { _base = NumberBase::Type(res-_ids.count()); - for (QListViewItem *item=_root->firstChild(); item; item=item->nextSibling()) + for (TQListViewItem *item=_root->firstChild(); item; item=item->nextSibling()) static_cast<ListViewItem *>(item)->setBase(_base); } } else { @@ -178,11 +178,11 @@ void Register::WatchedListView::contextMenu(QListViewItem *item, const QPoint &p Register::ListViewItem *ritem = static_cast<ListViewItem *>(item); KPopupMenu *pop = new KPopupMenu; pop->insertTitle(ritem->label()); - QPopupMenu *fpop = appendFormatMenu(pop, 0); + TQPopupMenu *fpop = appendFormatMenu(pop, 0); FOR_EACH(NumberBase, base) fpop->setItemChecked(base.type(), ritem->base()==base); pop->insertSeparator(); KIconLoader loader; - QPixmap icon = loader.loadIcon("edit", KIcon::Small); + TQPixmap icon = loader.loadIcon("edit", KIcon::Small); int editId = pop->insertItem(icon, i18n("Edit")); pop->setItemEnabled(editId, Main::programmerState()==Programmer::Halted); icon = loader.loadIcon("cancel", KIcon::Small); @@ -196,11 +196,11 @@ void Register::WatchedListView::contextMenu(QListViewItem *item, const QPoint &p } //----------------------------------------------------------------------------- -Register::WatchView::WatchView(QWidget *parent) - : QWidget(parent, "watch_view"), GenericView(Register::list()), _data(0) +Register::WatchView::WatchView(TQWidget *tqparent) + : TQWidget(tqparent, "watch_view"), GenericView(Register::list()), _data(0) { - QVBoxLayout *top = new QVBoxLayout(this); - QValueList<int> sizes; + TQVBoxLayout *top = new TQVBoxLayout(this); + TQValueList<int> sizes; sizes.append(50); Splitter *splitter = new Splitter(sizes, Qt::Vertical, this, "watch_window_splitter"); top->addWidget(splitter); |