diff options
Diffstat (limited to 'src/devices/gui')
-rw-r--r-- | src/devices/gui/device_group_ui.h | 14 | ||||
-rw-r--r-- | src/devices/gui/hex_view.cpp | 4 | ||||
-rw-r--r-- | src/devices/gui/hex_view.h | 3 | ||||
-rw-r--r-- | src/devices/gui/hex_word_editor.cpp | 18 | ||||
-rw-r--r-- | src/devices/gui/hex_word_editor.h | 16 | ||||
-rw-r--r-- | src/devices/gui/memory_editor.cpp | 104 | ||||
-rw-r--r-- | src/devices/gui/memory_editor.h | 54 | ||||
-rw-r--r-- | src/devices/gui/register_view.cpp | 82 | ||||
-rw-r--r-- | src/devices/gui/register_view.h | 34 |
9 files changed, 169 insertions, 160 deletions
diff --git a/src/devices/gui/device_group_ui.h b/src/devices/gui/device_group_ui.h index 3b2fa91..d123d7d 100644 --- a/src/devices/gui/device_group_ui.h +++ b/src/devices/gui/device_group_ui.h @@ -9,8 +9,8 @@ #ifndef DEVICE_GROUP_UI_H #define DEVICE_GROUP_UI_H -#include <qpixmap.h> -class QWidget; +#include <tqpixmap.h> +class TQWidget; class KPopupMenu; class KListViewItem; class KAction; @@ -31,11 +31,11 @@ class MemoryEditor; class GroupUI : public ::Group::BaseGui { public: - virtual HexView *createHexView(const HexEditor &editor, QWidget *parent) const = 0; - virtual Register::View *createRegisterView(QWidget *parent) const = 0; - virtual MemoryEditor *createConfigEditor(Device::Memory &memory, QWidget *parent) const = 0; - virtual void fillWatchListContainer(ListContainer *container, QValueVector<Register::TypeData> &ids) const = 0; - virtual Register::ListViewItem *createWatchItem(const Register::TypeData &data, KListViewItem *parent) const = 0; + virtual HexView *createHexView(const HexEditor &editor, TQWidget *tqparent) const = 0; + virtual Register::View *createRegisterView(TQWidget *tqparent) const = 0; + virtual MemoryEditor *createConfigEditor(Device::Memory &memory, TQWidget *tqparent) const = 0; + virtual void fillWatchListContainer(ListContainer *container, TQValueVector<Register::TypeData> &ids) const = 0; + virtual Register::ListViewItem *createWatchItem(const Register::TypeData &data, KListViewItem *tqparent) const = 0; }; inline const Device::GroupUI &groupui(const Device::Data &data) { return static_cast<const Device::GroupUI &>(*data.group().gui()); } diff --git a/src/devices/gui/hex_view.cpp b/src/devices/gui/hex_view.cpp index 6b26b0a..ac82ddf 100644 --- a/src/devices/gui/hex_view.cpp +++ b/src/devices/gui/hex_view.cpp @@ -9,8 +9,8 @@ ***************************************************************************/ #include "hex_view.h" -Device::HexView::HexView(const HexEditor &editor, QWidget *parent, const char *name) - : MemoryEditorGroup(0, parent, name), _editor(editor) +Device::HexView::HexView(const HexEditor &editor, TQWidget *tqparent, const char *name) + : MemoryEditorGroup(0, tqparent, name), _editor(editor) {} void Device::HexView::display(Memory *memory) diff --git a/src/devices/gui/hex_view.h b/src/devices/gui/hex_view.h index d73710e..f1b953b 100644 --- a/src/devices/gui/hex_view.h +++ b/src/devices/gui/hex_view.h @@ -19,8 +19,9 @@ namespace Device class HexView : public MemoryEditorGroup { Q_OBJECT + TQ_OBJECT public: - HexView(const HexEditor &editor, QWidget *parent, const char *name); + HexView(const HexEditor &editor, TQWidget *tqparent, const char *name); virtual void display(Memory *memory); virtual uint nbChecksumChars() const = 0; virtual BitValue checksum() const = 0; diff --git a/src/devices/gui/hex_word_editor.cpp b/src/devices/gui/hex_word_editor.cpp index fd64e13..5e8ab7a 100644 --- a/src/devices/gui/hex_word_editor.cpp +++ b/src/devices/gui/hex_word_editor.cpp @@ -9,15 +9,15 @@ ***************************************************************************/ #include "hex_word_editor.h" -#include <qframe.h> -#include <qgroupbox.h> -#include <qlabel.h> -#include <qapplication.h> -#include <qtimer.h> +#include <tqframe.h> +#include <tqgroupbox.h> +#include <tqlabel.h> +#include <tqapplication.h> +#include <tqtimer.h> //----------------------------------------------------------------------------- -Device::HexWordEditor::HexWordEditor(Memory &memory, uint nbChars, QWidget *parent) - : GenericHexWordEditor(nbChars, true, parent), _memory(memory) +Device::HexWordEditor::HexWordEditor(Memory &memory, uint nbChars, TQWidget *tqparent) + : GenericHexWordEditor(nbChars, true, tqparent), _memory(memory) { setOffset(-1); } @@ -29,8 +29,8 @@ void Device::HexWordEditor::setOffset(int offset) } //----------------------------------------------------------------------------- -Device::RegisterHexWordEditor::RegisterHexWordEditor(QWidget *parent, uint nbChars, BitValue mask) - : GenericHexWordEditor(nbChars, true, parent), _mask(mask) +Device::RegisterHexWordEditor::RegisterHexWordEditor(TQWidget *tqparent, uint nbChars, BitValue tqmask) + : GenericHexWordEditor(nbChars, true, tqparent), _tqmask(tqmask) { clear(); } diff --git a/src/devices/gui/hex_word_editor.h b/src/devices/gui/hex_word_editor.h index bd9fadb..db9374c 100644 --- a/src/devices/gui/hex_word_editor.h +++ b/src/devices/gui/hex_word_editor.h @@ -19,8 +19,9 @@ namespace Device class HexWordEditor : public GenericHexWordEditor { Q_OBJECT + TQ_OBJECT public: - HexWordEditor(Memory &memory, uint nbChars, QWidget *parent); + HexWordEditor(Memory &memory, uint nbChars, TQWidget *tqparent); void setOffset(int offset); int offset() const { return _offset; } @@ -29,7 +30,7 @@ protected: int _offset; virtual bool isValid() const { return _offset!=-1; } - virtual BitValue mask() const = 0; + virtual BitValue tqmask() const = 0; virtual BitValue normalizeWord(BitValue value) const = 0; virtual BitValue word() const = 0; virtual void setWord(BitValue value) = 0; @@ -40,20 +41,21 @@ protected: class RegisterHexWordEditor : public GenericHexWordEditor { Q_OBJECT + TQ_OBJECT public: - RegisterHexWordEditor(QWidget *parent, uint nbChars, BitValue mask); + RegisterHexWordEditor(TQWidget *tqparent, uint nbChars, BitValue tqmask); void clear() { setValue(BitValue()); } void setValue(BitValue word); BitValue value() const { return _word; } - void setColor(QColor color) { setPaletteForegroundColor(color); } + void setColor(TQColor color) { setPaletteForegroundColor(color); } void unsetColor() { unsetPalette(); } private: - BitValue _mask, _word; + BitValue _tqmask, _word; virtual bool isValid() const { return true; } - virtual BitValue mask() const { return _mask; } - virtual BitValue normalizeWord(BitValue value) const { return value.maskWith(_mask); } + virtual BitValue tqmask() const { return _tqmask; } + virtual BitValue normalizeWord(BitValue value) const { return value.tqmaskWith(_tqmask); } virtual BitValue word() const { return _word; } virtual void setWord(BitValue value) { _word = value; } virtual BitValue blankValue() const { return BitValue(); } diff --git a/src/devices/gui/memory_editor.cpp b/src/devices/gui/memory_editor.cpp index 175f011..4504e6b 100644 --- a/src/devices/gui/memory_editor.cpp +++ b/src/devices/gui/memory_editor.cpp @@ -9,12 +9,12 @@ ***************************************************************************/ #include "memory_editor.h" -#include <qlabel.h> -#include <qscrollbar.h> -#include <qlayout.h> -#include <qgrid.h> -#include <qtimer.h> -#include <qpopupmenu.h> +#include <tqlabel.h> +#include <tqscrollbar.h> +#include <tqlayout.h> +#include <tqgrid.h> +#include <tqtimer.h> +#include <tqpopupmenu.h> #include <klocale.h> #include <kpushbutton.h> #include <kaction.h> @@ -28,17 +28,17 @@ #include "libgui/gui_prog_manager.h" //----------------------------------------------------------------------------- -Device::MemoryEditor::MemoryEditor(Device::Memory *memory, QWidget *parent, const char *name) - : QFrame(parent, name), _memory(memory) +Device::MemoryEditor::MemoryEditor(Device::Memory *memory, TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name), _memory(memory) { - _top = new QVBoxLayout(this, 5, 10); + _top = new TQVBoxLayout(this, 5, 10); } //----------------------------------------------------------------------------- Device::MemoryRangeEditor::MemoryRangeEditor(Device::Memory &memory, uint nbLines, uint nbCols, uint offset, int nb, - QWidget *parent, const char *name) - : MemoryEditor(&memory, parent, name), + TQWidget *tqparent, const char *name) + : MemoryEditor(&memory, tqparent, name), _nbLines(nbLines), _nbCols(nbCols), _offset(offset), _nb(nb) {} @@ -48,60 +48,60 @@ void Device::MemoryRangeEditor::init() uint totalNbLines = _nb / _nbCols; if ( (_nb % _nbCols)!=0 ) totalNbLines++; - QHBoxLayout *hbox = new QHBoxLayout(_top); + TQHBoxLayout *hbox = new TQHBoxLayout(_top); - QVBoxLayout *vbox = new QVBoxLayout(hbox); - QFrame *frame = new QFrame(this); - frame->setFrameStyle(QFrame::Panel | QFrame::Raised); + TQVBoxLayout *vbox = new TQVBoxLayout(hbox); + TQFrame *frame = new TQFrame(this); + frame->setFrameStyle(TQFrame::Panel | TQFrame::Raised); frame->setMargin(5); vbox->addWidget(frame); vbox->addStretch(1); - QHBoxLayout *fbox = new QHBoxLayout(frame, 5, 5); - QGrid *grid = new QGrid(3+_nbCols, QGrid::Horizontal, frame, "memory_range_editor_grid"); + TQHBoxLayout *fbox = new TQHBoxLayout(frame, 5, 5); + TQGrid *grid = new TQGrid(3+_nbCols, Qt::Horizontal, frame, "memory_range_editor_grid"); fbox->addWidget(grid); grid->setSpacing(0); grid->setMargin(3); - QFont f("courier", font().pointSize()); + TQFont f("courier", font().pointSize()); grid->setFont(f); for (uint k=0; k<_nbLines; ++k) { // addresses - QWidget *w = new QWidget(grid); + TQWidget *w = new TQWidget(grid); w->setFixedWidth(10); _blocks.append(w); - QLabel *label = new QLabel(toHex(0, 2*_memory->device().nbBytesAddress()), grid, "address_label"); + TQLabel *label = new TQLabel(toHex(0, 2*_memory->device().nbBytesAddress()), grid, "address_label"); _addresses.append(label); - label = new QLabel(":", grid); + label = new TQLabel(":", grid); // memory for (uint i = 0; i<_nbCols; ++i) { HexWordEditor *h = createHexWordEditor(grid); _editors.append(h); - connect(h, SIGNAL(modified()), SIGNAL(modified())); - connect(h, SIGNAL(moveNext()), SLOT(moveNext())); - connect(h, SIGNAL(movePrev()), SLOT(movePrev())); - connect(h, SIGNAL(moveFirst()), SLOT(moveFirst())); - connect(h, SIGNAL(moveLast()), SLOT(moveLast())); - connect(h, SIGNAL(moveUp()), SLOT(moveUp())); - connect(h, SIGNAL(moveDown()), SLOT(moveDown())); - connect(h, SIGNAL(moveNextPage()), SLOT(moveNextPage())); - connect(h, SIGNAL(movePrevPage()), SLOT(movePrevPage())); + connect(h, TQT_SIGNAL(modified()), TQT_SIGNAL(modified())); + connect(h, TQT_SIGNAL(moveNext()), TQT_SLOT(moveNext())); + connect(h, TQT_SIGNAL(movePrev()), TQT_SLOT(movePrev())); + connect(h, TQT_SIGNAL(moveFirst()), TQT_SLOT(moveFirst())); + connect(h, TQT_SIGNAL(moveLast()), TQT_SLOT(moveLast())); + connect(h, TQT_SIGNAL(moveUp()), TQT_SLOT(moveUp())); + connect(h, TQT_SIGNAL(moveDown()), TQT_SLOT(moveDown())); + connect(h, TQT_SIGNAL(moveNextPage()), TQT_SLOT(moveNextPage())); + connect(h, TQT_SIGNAL(movePrevPage()), TQT_SLOT(movePrevPage())); } } // scrollbar if there are more lines to display than visible - _scrollbar = new QScrollBar(0, QMAX(_nbLines, totalNbLines)-_nbLines, 1, _nbLines, 0, - QScrollBar::Vertical, frame, "memory_range_editor_scrollbar"); - connect(_scrollbar, SIGNAL(valueChanged(int)), SLOT(setIndex(int))) ; + _scrollbar = new TQScrollBar(0, TQMAX(_nbLines, totalNbLines)-_nbLines, 1, _nbLines, 0, + Qt::Vertical, frame, "memory_range_editor_scrollbar"); + connect(_scrollbar, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(setIndex(int))) ; if ( totalNbLines<=_nbLines ) _scrollbar->hide(); fbox->addWidget(_scrollbar); fbox->addStretch(1); vbox->addStretch(1); - QVBoxLayout *vboxc = new QVBoxLayout(hbox); + TQVBoxLayout *vboxc = new TQVBoxLayout(hbox); vboxc->setSpacing(0); - _comment = new QLabel(this); + _comment = new TQLabel(this); _comment->hide(); vboxc->addWidget(_comment); - _spacer = new QLabel(this); + _spacer = new TQLabel(this); _spacer->setFixedHeight(10); _spacer->hide(); vboxc->addWidget(_spacer); @@ -113,7 +113,7 @@ void Device::MemoryRangeEditor::init() setIndex(0); } -void Device::MemoryRangeEditor::setComment(const QString &text) +void Device::MemoryRangeEditor::setComment(const TQString &text) { _comment->setText(text); _comment->show(); @@ -167,7 +167,7 @@ void Device::MemoryRangeEditor::setIndex(int index) void Device::MemoryRangeEditor::moveNext() { - QValueList<HexWordEditor *>::iterator it = _editors.find((HexWordEditor *)sender()); + TQValueList<HexWordEditor *>::iterator it = _editors.tqfind((HexWordEditor *)sender()); ++it; if ( it==_editors.end() || (*it)->offset()==-1 ) { if ( current()==uint(_scrollbar->maxValue()) ) return; // at end @@ -178,7 +178,7 @@ void Device::MemoryRangeEditor::moveNext() void Device::MemoryRangeEditor::movePrev() { - QValueList<HexWordEditor *>::iterator it = _editors.find((HexWordEditor *)sender()); + TQValueList<HexWordEditor *>::iterator it = _editors.tqfind((HexWordEditor *)sender()); if ( it==_editors.begin() ) { if ( current()==0 ) return; // at beginning setIndex(current()-1); @@ -209,7 +209,7 @@ void Device::MemoryRangeEditor::moveLast() void Device::MemoryRangeEditor::moveUp() { - int i = _editors.findIndex((HexWordEditor *)sender()); + int i = _editors.tqfindIndex((HexWordEditor *)sender()); uint line = i / _nbCols; if ( line==0 ) { if ( current()==0 ) return; // on first line @@ -220,7 +220,7 @@ void Device::MemoryRangeEditor::moveUp() void Device::MemoryRangeEditor::moveDown() { - int i = _editors.findIndex((HexWordEditor *)sender()); + int i = _editors.tqfindIndex((HexWordEditor *)sender()); uint line = i / _nbCols; if ( line+1==_nbLines ) { if ( current()==uint(_scrollbar->maxValue()) ) return; // on last line @@ -232,7 +232,7 @@ void Device::MemoryRangeEditor::moveDown() void Device::MemoryRangeEditor::moveNextPage() { - int i = _editors.findIndex((HexWordEditor *)sender()); + int i = _editors.tqfindIndex((HexWordEditor *)sender()); if ( _nbLines>(uint(_scrollbar->maxValue()) - current()) ) i = (_nbLines-1) * _nbCols + (i % _nbCols); else setIndex(current()+_nbLines); if ( _editors[i]->offset()==-1 ) _editors[i-_nbCols]->setFocus(); @@ -241,20 +241,20 @@ void Device::MemoryRangeEditor::moveNextPage() void Device::MemoryRangeEditor::movePrevPage() { - int i = _editors.findIndex((HexWordEditor *)sender()); + int i = _editors.tqfindIndex((HexWordEditor *)sender()); if ( current()<_nbLines ) i = (i % _nbCols); else setIndex(current()-_nbLines); _editors[i]->setFocus(); } //----------------------------------------------------------------------------- -Device::MemoryEditorGroup::MemoryEditorGroup(Device::Memory *memory, QWidget *parent, const char *name) - : MemoryEditor(memory, parent, name) +Device::MemoryEditorGroup::MemoryEditorGroup(Device::Memory *memory, TQWidget *tqparent, const char *name) + : MemoryEditor(memory, tqparent, name) {} void Device::MemoryEditorGroup::addEditor(MemoryEditor *editor) { - connect(editor, SIGNAL(modified()), SIGNAL(modified())); + connect(editor, TQT_SIGNAL(modified()), TQT_SIGNAL(modified())); _editors.append(editor); } @@ -284,8 +284,8 @@ const Device::ActionData Device::ACTION_DATA[Nb_Actions] = { }; Device::MemoryTypeEditor::MemoryTypeEditor(const HexView *hexview, Device::Memory &memory, - QWidget *parent, const char *name) - : MemoryEditorGroup(&memory, parent, name), + TQWidget *tqparent, const char *name) + : MemoryEditorGroup(&memory, tqparent, name), _title(0), _comment(0), _hexview(hexview) { for (uint i=0; i<Nb_Actions; i++) _actions[i] = 0; @@ -294,13 +294,13 @@ Device::MemoryTypeEditor::MemoryTypeEditor(const HexView *hexview, Device::Memor void Device::MemoryTypeEditor::init(bool first) { if ( !first ) _top->addWidget(new SeparatorWidget(this)); - QHBoxLayout *hbox = new QHBoxLayout(_top); + TQHBoxLayout *hbox = new TQHBoxLayout(_top); _title = new PopupButton(this); for (uint i=0; i<Nb_Actions; i++) { if ( hasAction(Action(i)) ) { _actions[i] = new KAction(i18n(ACTION_DATA[i].label), ACTION_DATA[i].icon, 0, - this, SLOT(doAction()), Main::toplevel().actionCollection()); + TQT_TQOBJECT(this), TQT_SLOT(doAction()), Main::toplevel().actionCollection()); addAction(_actions[i]); } if ( ACTION_DATA[i].properties & SeparatorAfter ) _title->appendSeparator(); @@ -308,11 +308,11 @@ void Device::MemoryTypeEditor::init(bool first) _title->appendSeparator(); hbox->addWidget(_title); - _comment = new QLabel(this); + _comment = new TQLabel(this); hbox->addWidget(_comment); hbox->addStretch(1); - connect(&Main::toplevel(), SIGNAL(stateChanged()), SLOT(stateChanged())); + connect(&Main::toplevel(), TQT_SIGNAL(stateChanged()), TQT_SLOT(stateChanged())); } void Device::MemoryTypeEditor::addAction(KAction *action) diff --git a/src/devices/gui/memory_editor.h b/src/devices/gui/memory_editor.h index 9836261..2ef60d8 100644 --- a/src/devices/gui/memory_editor.h +++ b/src/devices/gui/memory_editor.h @@ -9,14 +9,14 @@ #ifndef MEMORY_EDITOR_H #define MEMORY_EDITOR_H -#include <qframe.h> -#include <qscrollbar.h> -#include <qlabel.h> +#include <tqframe.h> +#include <tqscrollbar.h> +#include <tqlabel.h> #include "common/common/qflags.h" #include "common/common/bitvalue.h" -class QVBoxLayout; -class QHBoxLayout; -class QHBox; +class TQVBoxLayout; +class TQHBoxLayout; +class TQHBox; class KAction; class PopupButton; @@ -30,8 +30,8 @@ enum Action { Clear = 0, Zero, ChecksumCheck, Reload, Program, Verify, Read, Erase, BlankCheck, Nb_Actions }; enum ActionProperty { NoProperty = 0, SeparatorAfter = 1, NeedProgrammer = 2, NeedWrite = 4, NeedModified = 8 }; -Q_DECLARE_FLAGS(ActionProperties, ActionProperty) -Q_DECLARE_OPERATORS_FOR_FLAGS(ActionProperties) +TQ_DECLARE_FLAGS(ActionProperties, ActionProperty) +TQ_DECLARE_OPERATORS_FOR_FLAGS(ActionProperties) struct ActionData { const char *label, *icon; ActionProperties properties; @@ -39,11 +39,12 @@ struct ActionData { extern const ActionData ACTION_DATA[Nb_Actions]; //---------------------------------------------------------------------------- -class MemoryEditor : public QFrame +class MemoryEditor : public TQFrame { Q_OBJECT + TQ_OBJECT public: - MemoryEditor(Device::Memory *memory, QWidget *parent, const char *name); + MemoryEditor(Device::Memory *memory, TQWidget *tqparent, const char *name); virtual void setReadOnly(bool readOnly) = 0; public slots: @@ -54,19 +55,20 @@ signals: protected: Device::Memory *_memory; - QVBoxLayout *_top; + TQVBoxLayout *_top; }; //---------------------------------------------------------------------------- class MemoryRangeEditor : public MemoryEditor { Q_OBJECT + TQ_OBJECT public: MemoryRangeEditor(Device::Memory &memory, uint nbLines, uint nbCols, - uint offset, int nb, QWidget *parent, const char *name); + uint offset, int nb, TQWidget *tqparent, const char *name); virtual void init(); virtual void setReadOnly(bool readOnly); - void setComment(const QString &text); + void setComment(const TQString &text); public slots: virtual void updateDisplay(); @@ -87,30 +89,31 @@ protected slots: protected: uint _nbLines, _nbCols, _offset; int _nb; - QValueList<QLabel *> _addresses; - QValueList<QWidget *> _blocks; - QValueList<HexWordEditor *> _editors; - QScrollBar *_scrollbar; - QLabel *_comment; - QWidget *_spacer; + TQValueList<TQLabel *> _addresses; + TQValueList<TQWidget *> _blocks; + TQValueList<HexWordEditor *> _editors; + TQScrollBar *_scrollbar; + TQLabel *_comment; + TQWidget *_spacer; uint wordOffset() const { return _offset + current() * _nbCols; } uint current() const { return _scrollbar->value(); } virtual uint nbWords() const = 0; virtual uint addressIncrement() const = 0; virtual Address startAddress() const = 0; - virtual HexWordEditor *createHexWordEditor(QWidget *parent) = 0; + virtual HexWordEditor *createHexWordEditor(TQWidget *tqparent) = 0; virtual bool isRangeReadOnly() const = 0; virtual void updateAddressColor(uint i, Address address) { Q_UNUSED(i); Q_UNUSED(address); } - virtual void addLegend(QVBoxLayout *vbox) { Q_UNUSED(vbox); } + virtual void addLegend(TQVBoxLayout *vbox) { Q_UNUSED(vbox); } }; //---------------------------------------------------------------------------- class MemoryEditorGroup : public MemoryEditor { Q_OBJECT + TQ_OBJECT public: - MemoryEditorGroup(Device::Memory *memory, QWidget *parent, const char *name); + MemoryEditorGroup(Device::Memory *memory, TQWidget *tqparent, const char *name); void addEditor(MemoryEditor *editor); virtual void setReadOnly(bool readOnly); @@ -119,15 +122,16 @@ public slots: protected: bool _modified; - QValueList<MemoryEditor *> _editors; + TQValueList<MemoryEditor *> _editors; }; //---------------------------------------------------------------------------- class MemoryTypeEditor : public MemoryEditorGroup { Q_OBJECT + TQ_OBJECT public: - MemoryTypeEditor(const HexView *hexview, Device::Memory &memory, QWidget *parent, const char *name); + MemoryTypeEditor(const HexView *hexview, Device::Memory &memory, TQWidget *tqparent, const char *name); virtual void init(bool first); virtual void setReadOnly(bool readOnly); @@ -137,7 +141,7 @@ protected slots: protected: PopupButton *_title; - QLabel *_comment; + TQLabel *_comment; const HexView *_hexview; virtual bool internalDoAction(Action action) = 0; // return true if memory modified virtual bool hasAction(Action) const { return true; } diff --git a/src/devices/gui/register_view.cpp b/src/devices/gui/register_view.cpp index 70dedc9..bf49574 100644 --- a/src/devices/gui/register_view.cpp +++ b/src/devices/gui/register_view.cpp @@ -12,8 +12,8 @@ #include "libgui/gui_debug_manager.h" //---------------------------------------------------------------------------- -Register::PortBitListViewItem::PortBitListViewItem(uint index, uint bit, KListViewItem *parent) - : KListViewItem(parent), _index(index), _bit(bit) +Register::PortBitListViewItem::PortBitListViewItem(uint index, uint bit, KListViewItem *tqparent) + : KListViewItem(tqparent), _index(index), _bit(bit) { const Device::RegistersData *rdata = Main::deviceData()->registersData(); setText(1, rdata->portBitName(_index, _bit)); @@ -22,8 +22,8 @@ Register::PortBitListViewItem::PortBitListViewItem(uint index, uint bit, KListVi void Register::PortBitListViewItem::updateView() { - const QMap<uint, Device::PortBitData> &pdata = Register::list().portData(_index); - QString text; + const TQMap<uint, Device::PortBitData> &pdata = Register::list().portData(_index); + TQString text; if ( pdata.isEmpty() ) text = "--"; else { /* @@ -43,25 +43,25 @@ void Register::PortBitListViewItem::updateView() else text += (pdata[_bit].drivenState==Device::IoHigh ? "1" : "0"); } setText(2, text); - repaint(); + tqrepaint(); } -void Register::PortBitListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align) +void Register::PortBitListViewItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align) { - QColorGroup ncg = cg; - const QMap<uint, Device::PortBitData> &data = Register::list().portData(_index); - const QMap<uint, Device::PortBitData> &odata = Register::list().oldPortData(_index); + TQColorGroup ncg = cg; + const TQMap<uint, Device::PortBitData> &data = Register::list().portData(_index); + const TQMap<uint, Device::PortBitData> &odata = Register::list().oldPortData(_index); bool changed = ( !data.isEmpty() && data[_bit]!=odata[_bit] ); - if ( column==2 && changed ) ncg.setColor(QColorGroup::Text, red); + if ( column==2 && changed ) ncg.setColor(TQColorGroup::Text, red); KListViewItem::paintCell(p, ncg, column, width, align); } -QString Register::PortBitListViewItem::tooltip(int col) const +TQString Register::PortBitListViewItem::tooltip(int col) const { - if ( col!=2 ) return QString::null; - const QMap<uint, Device::PortBitData> &pdata = Register::list().portData(_index); - if ( pdata.isEmpty() ) return QString::null; - QString s = text(1) + ": "; + if ( col!=2 ) return TQString(); + const TQMap<uint, Device::PortBitData> &pdata = Register::list().portData(_index); + if ( pdata.isEmpty() ) return TQString(); + TQString s = text(1) + ": "; if (pdata[_bit].driving) { if ( pdata[_bit].drivingState!=Device::IoUnknown ) s += i18n("unknown state"); else s += (pdata[_bit].drivingState==Device::IoHigh ? i18n("driving high") : i18n("driving low")); @@ -75,8 +75,8 @@ QString Register::PortBitListViewItem::tooltip(int col) const } //----------------------------------------------------------------------------- -Register::ListViewItem::ListViewItem(const TypeData &data, KListViewItem *parent) - : EditListViewItem(parent), _data(data), _base(NumberBase::Hex) +Register::ListViewItem::ListViewItem(const TypeData &data, KListViewItem *tqparent) + : EditListViewItem(tqparent), _data(data), _base(NumberBase::Hex) { setSelectable(false); const Device::RegistersData *rdata = Main::deviceData()->registersData(); @@ -92,19 +92,19 @@ Register::ListViewItem::ListViewItem(const TypeData &data, KListViewItem *parent } } -QString Register::ListViewItem::text() const +TQString Register::ListViewItem::text() const { BitValue value = Register::list().value(_data); uint nbChars = convertNbChars(_data.nbChars(), NumberBase::Hex, _base); return (value.isInitialized() ? toLabel(_base, value, nbChars) : "--"); } -int Register::ListViewItem::compare(QListViewItem *item, int, bool) const +int Register::ListViewItem::compare(TQListViewItem *item, int, bool) const { const TypeData &data = static_cast<ListViewItem *>(item)->data(); - int i1 = list().watched().findIndex(data); + int i1 = list().watched().tqfindIndex(data); Q_ASSERT( i1!=-1 ); - int i2 = list().watched().findIndex(_data); + int i2 = list().watched().tqfindIndex(_data); Q_ASSERT( i2!=-1 ); return ( i1-i2 ); } @@ -114,7 +114,7 @@ void Register::ListViewItem::updateView() if ( _data.type()!=Special ) setText(0, toHexLabel(_data.address(), nbCharsAddress()) + ":"); setText(1, label()); setText(2, text()); - repaint(); + tqrepaint(); for (uint i=0; i<_items.count(); i++) _items[i]->updateView(); } @@ -124,38 +124,38 @@ void Register::ListViewItem::setBase(NumberBase base) updateView(); } -void Register::ListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align) +void Register::ListViewItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align) { - QColorGroup ncg = cg; + TQColorGroup ncg = cg; BitValue value = Register::list().value(_data); BitValue oldValue = Register::list().oldValue(_data); - if ( column==2 && value!=oldValue ) ncg.setColor(QColorGroup::Text, red); + if ( column==2 && value!=oldValue ) ncg.setColor(TQColorGroup::Text, red); EditListViewItem::paintCell(p, ncg, column, width, align); } -QString Register::ListViewItem::tooltip(int col) const +TQString Register::ListViewItem::tooltip(int col) const { - if ( col!=2 ) return QString::null; + if ( col!=2 ) return TQString(); BitValue value = Register::list().value(_data); - if ( !value.isInitialized() ) return QString::null; + if ( !value.isInitialized() ) return TQString(); BitValue v = value; - QString s; + TQString s; for (uint i=0; i<_data.nbChars(); i++) { char c = v.nybble(i); if ( isprint(c) ) s = c + s; else s = "." + s; } - return QString("%1 - %2 - \"%3\"").arg(toHexLabel(value, _data.nbChars())) - .arg(toLabel(NumberBase::Bin, value, 4*_data.nbChars())).arg(s); + return TQString("%1 - %2 - \"%3\"").tqarg(toHexLabel(value, _data.nbChars())) + .tqarg(toLabel(NumberBase::Bin, value, 4*_data.nbChars())).tqarg(s); } -QWidget *Register::ListViewItem::editWidgetFactory(int col) const +TQWidget *Register::ListViewItem::editWidgetFactory(int col) const { if ( col!=2 || Main::programmerState()!=Programmer::Halted ) return 0; return new NumberLineEdit(text(), 0); } -void Register::ListViewItem::editDone(int col, const QWidget *edit) +void Register::ListViewItem::editDone(int col, const TQWidget *edit) { if ( col!=2 ) return; bool ok; @@ -164,11 +164,11 @@ void Register::ListViewItem::editDone(int col, const QWidget *edit) } //---------------------------------------------------------------------------- -Register::LineEdit::LineEdit(QWidget *parent, const char *name) - : NumberLineEdit(parent, name), _base(NumberBase::Nb_Types) +Register::LineEdit::LineEdit(TQWidget *tqparent, const char *name) + : NumberLineEdit(tqparent, name), _base(NumberBase::Nb_Types) { - connect(this, SIGNAL(lostFocus()), SLOT(updateText())); - connect(this, SIGNAL(returnPressed()), SLOT(returnPressedSlot())); + connect(this, TQT_SIGNAL(lostFocus()), TQT_SLOT(updateText())); + connect(this, TQT_SIGNAL(returnPressed()), TQT_SLOT(returnPressedSlot())); } void Register::LineEdit::updateText() @@ -176,7 +176,7 @@ void Register::LineEdit::updateText() setText(_value.isInitialized() ? toLabel(_base, _value, _nbChars) : "--"); uint w = 2*frameWidth() + maxLabelWidth(_base, _nbChars, font()); setFixedWidth(w+5); - setFixedHeight(minimumSizeHint().height()); + setFixedHeight(tqminimumSizeHint().height()); } void Register::LineEdit::setValue(NumberBase base, BitValue value, uint nbChars) @@ -196,13 +196,13 @@ void Register::LineEdit::returnPressedSlot() emit modified(); } -void Register::LineEdit::keyPressEvent(QKeyEvent *e) +void Register::LineEdit::keyPressEvent(TQKeyEvent *e) { if ( e->key()==Key_Escape ) clearFocus(); else NumberLineEdit::keyPressEvent(e); } //---------------------------------------------------------------------------- -Register::View::View(QWidget *parent, const char *name) - : QFrame(parent, name), GenericView(list()) +Register::View::View(TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name), GenericView(list()) {} diff --git a/src/devices/gui/register_view.h b/src/devices/gui/register_view.h index 7ef8a54..60c8194 100644 --- a/src/devices/gui/register_view.h +++ b/src/devices/gui/register_view.h @@ -9,7 +9,7 @@ #ifndef REGISTER_VIEW_H #define REGISTER_VIEW_H -#include <qframe.h> +#include <tqframe.h> #include "devices/base/register.h" #include "common/gui/number_gui.h" @@ -23,15 +23,15 @@ enum { PortBitRtti = 1000, RegisterRtti = 1001 }; class PortBitListViewItem : public KListViewItem { public: - PortBitListViewItem(uint address, uint bit, KListViewItem *parent); + PortBitListViewItem(uint address, uint bit, KListViewItem *tqparent); virtual int rtti() const { return PortBitRtti; } void updateView(); - QString tooltip(int column) const; + TQString tooltip(int column) const; private: uint _index, _bit; - virtual void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align); + virtual void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align); }; //----------------------------------------------------------------------------- @@ -42,23 +42,23 @@ public: virtual int rtti() const { return RegisterRtti; } virtual void updateView(); const TypeData &data() const { return _data; } - QString tooltip(int column) const; + TQString tooltip(int column) const; NumberBase base() const { return _base; } void setBase(NumberBase base); - virtual QString label() const = 0; - virtual int compare(QListViewItem *item, int, bool) const; + virtual TQString label() const = 0; + virtual int compare(TQListViewItem *item, int, bool) const; protected: TypeData _data; - QValueList<PortBitListViewItem *> _items; + TQValueList<PortBitListViewItem *> _items; NumberBase _base; - virtual void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align); - virtual QWidget *editWidgetFactory(int col) const; + virtual void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align); + virtual TQWidget *editWidgetFactory(int col) const; virtual bool alwaysAcceptEdit(int) const { return false; } - virtual void editDone(int col, const QWidget *editWidget); + virtual void editDone(int col, const TQWidget *editWidget); virtual uint nbCharsAddress() const = 0; - virtual QString text() const; + virtual TQString text() const; virtual void activate() {} }; @@ -66,8 +66,9 @@ protected: class LineEdit : public NumberLineEdit { Q_OBJECT + TQ_OBJECT public: - LineEdit(QWidget *parent, const char *name = 0); + LineEdit(TQWidget *tqparent, const char *name = 0); void setValue(NumberBase base, BitValue value, uint nbChars); BitValue value() const { return _value; } @@ -75,7 +76,7 @@ signals: void modified(); protected: - virtual void keyPressEvent(QKeyEvent *e); + virtual void keyPressEvent(TQKeyEvent *e); private slots: void updateText(); @@ -88,11 +89,12 @@ private: }; //----------------------------------------------------------------------------- -class View : public QFrame, public GenericView +class View : public TQFrame, public GenericView { Q_OBJECT + TQ_OBJECT public: - View(QWidget *parent, const char *name); + View(TQWidget *tqparent, const char *name); signals: void readSignal(uint address); |