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 | |
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')
-rw-r--r-- | src/common/gui/config_widget.h | 45 | ||||
-rw-r--r-- | src/common/gui/container.cpp | 34 | ||||
-rw-r--r-- | src/common/gui/container.h | 26 | ||||
-rw-r--r-- | src/common/gui/dialog.cpp | 118 | ||||
-rw-r--r-- | src/common/gui/dialog.h | 53 | ||||
-rw-r--r-- | src/common/gui/editlistbox.cpp | 106 | ||||
-rw-r--r-- | src/common/gui/editlistbox.h | 39 | ||||
-rw-r--r-- | src/common/gui/hexword_gui.cpp | 44 | ||||
-rw-r--r-- | src/common/gui/hexword_gui.h | 27 | ||||
-rw-r--r-- | src/common/gui/key_gui.h | 58 | ||||
-rw-r--r-- | src/common/gui/list_container.cpp | 40 | ||||
-rw-r--r-- | src/common/gui/list_container.h | 27 | ||||
-rw-r--r-- | src/common/gui/list_view.cpp | 80 | ||||
-rw-r--r-- | src/common/gui/list_view.h | 31 | ||||
-rw-r--r-- | src/common/gui/misc_gui.cpp | 162 | ||||
-rw-r--r-- | src/common/gui/misc_gui.h | 86 | ||||
-rw-r--r-- | src/common/gui/number_gui.cpp | 50 | ||||
-rw-r--r-- | src/common/gui/number_gui.h | 19 | ||||
-rw-r--r-- | src/common/gui/pfile_ext.cpp | 24 | ||||
-rw-r--r-- | src/common/gui/pfile_ext.h | 2 | ||||
-rw-r--r-- | src/common/gui/purl_ext.cpp | 20 | ||||
-rw-r--r-- | src/common/gui/purl_gui.cpp | 66 | ||||
-rw-r--r-- | src/common/gui/purl_gui.h | 59 |
23 files changed, 620 insertions, 596 deletions
diff --git a/src/common/gui/config_widget.h b/src/common/gui/config_widget.h index abfafab..787780b 100644 --- a/src/common/gui/config_widget.h +++ b/src/common/gui/config_widget.h @@ -10,10 +10,10 @@ #ifndef CONFIG_WIDGET_H #define CONFIG_WIDGET_H -#include <qpixmap.h> -#include <qcheckbox.h> -#include <qvaluevector.h> -#include <qvariant.h> +#include <tqpixmap.h> +#include <tqcheckbox.h> +#include <tqvaluevector.h> +#include <tqvariant.h> #include "container.h" @@ -21,11 +21,12 @@ class ConfigWidget : public Container { Q_OBJECT + TQ_OBJECT public: - ConfigWidget(QWidget *parent = 0) : Container(parent) {} - virtual QString title() const { return QString::null; } - virtual QString header() const { return QString::null; } - virtual QPixmap pixmap() const { return QPixmap(); } + ConfigWidget(TQWidget *tqparent = 0) : Container(tqparent) {} + virtual TQString title() const { return TQString(); } + virtual TQString header() const { return TQString(); } + virtual TQPixmap pixmap() const { return TQPixmap(); } public slots: virtual void loadConfig() = 0; @@ -52,40 +53,40 @@ public: } private: - QValueVector<QWidget *> _widgets; + TQValueVector<TQWidget *> _widgets; - static QWidget *createWidget(Type type, ConfigWidget *widget) { - QWidget *w = 0; + static TQWidget *createWidget(Type type, ConfigWidget *widget) { + TQWidget *w = 0; uint row = widget->numRows(); switch (type.data().defValue.type()) { - case QVariant::Bool: - w = new QCheckBox(type.label(), widget); + case TQVariant::Bool: + w = new TQCheckBox(type.label(), widget); widget->addWidget(w, row,row, 0,1); break; default: Q_ASSERT(false); break; } return w; } - void load(Type type, QWidget *widget) const { + void load(Type type, TQWidget *widget) const { switch (type.data().defValue.type()) { - case QVariant::Bool: - static_cast<QCheckBox *>(widget)->setChecked(readConfigEntry(type).toBool()); + case TQVariant::Bool: + static_cast<TQCheckBox *>(widget)->setChecked(readConfigEntry(type).toBool()); break; default: Q_ASSERT(false); break; } } - void save(Type type, QWidget *widget) { + void save(Type type, TQWidget *widget) { switch (type.data().defValue.type()) { - case QVariant::Bool: - writeConfigEntry(type, QVariant(static_cast<QCheckBox *>(widget)->isChecked(), 0)); + case TQVariant::Bool: + writeConfigEntry(type, TQVariant(static_cast<TQCheckBox *>(widget)->isChecked(), 0)); break; default: Q_ASSERT(false); break; } } - void setDefault(Type type, QWidget *widget) const { + void setDefault(Type type, TQWidget *widget) const { switch (type.data().defValue.type()) { - case QVariant::Bool: - static_cast<QCheckBox *>(widget)->setChecked(type.data().defValue.toBool()); + case TQVariant::Bool: + static_cast<TQCheckBox *>(widget)->setChecked(type.data().defValue.toBool()); break; default: Q_ASSERT(false); break; } diff --git a/src/common/gui/container.cpp b/src/common/gui/container.cpp index 881e265..960acca 100644 --- a/src/common/gui/container.cpp +++ b/src/common/gui/container.cpp @@ -11,21 +11,21 @@ #include "misc_gui.h" //---------------------------------------------------------------------------- -Container::Container(QWidget *parent, Type type) - : QFrame(parent), _type(type) +Container::Container(TQWidget *tqparent, Type type) + : TQFrame(tqparent), _type(type) { initLayout(); } -Container::Container(QWidgetStack *stack, uint index, Type type) - : QFrame(stack), _type(type) +Container::Container(TQWidgetStack *stack, uint index, Type type) + : TQFrame(stack), _type(type) { initLayout(); stack->addWidget(this, index); } -Container::Container(QTabWidget *tabw, const QString &title, Type type) - : QFrame(tabw), _type(type) +Container::Container(TQTabWidget *tabw, const TQString &title, Type type) + : TQFrame(tabw), _type(type) { initLayout(); tabw->addTab(this, title); @@ -36,43 +36,43 @@ void Container::setFrame(Type type) _type = type; switch (type) { case Flat: - setMargin(parent() && parent()->inherits("QTabWidget") ? 10 : 0); - setFrameStyle(QFrame::NoFrame); + setMargin(tqparent() && tqparent()->inherits(TQTABWIDGET_OBJECT_NAME_STRING) ? 10 : 0); + setFrameStyle(TQFrame::NoFrame); break; case Sunken: setMargin(10); - setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); + setFrameStyle(TQFrame::StyledPanel | TQFrame::Sunken); break; } } void Container::initLayout() { - _topLayout = new QGridLayout(this, 1, 1, 0, 10); - _gridLayout = new QGridLayout(1, 1, 10); + _topLayout = new TQGridLayout(this, 1, 1, 0, 10); + _gridLayout = new TQGridLayout(1, 1, 10); _topLayout->addLayout(_gridLayout, 0, 0); _topLayout->setRowStretch(1, 1); setFrame(_type); } -void Container::addWidget(QWidget *w, uint startRow, uint endRow, uint startCol, uint endCol, int alignment) +void Container::addWidget(TQWidget *w, uint startRow, uint endRow, uint startCol, uint endCol, int tqalignment) { Q_ASSERT( startRow<=endRow ); Q_ASSERT( startCol<=endCol ); w->show(); - _gridLayout->addMultiCellWidget(w, startRow, endRow, startCol, endCol, alignment); + _gridLayout->addMultiCellWidget(w, startRow, endRow, startCol, endCol, tqalignment); } -void Container::addLayout(QLayout *l, uint startRow, uint endRow, uint startCol, uint endCol, int alignment) +void Container::addLayout(TQLayout *l, uint startRow, uint endRow, uint startCol, uint endCol, int tqalignment) { Q_ASSERT( startRow<=endRow ); Q_ASSERT( startCol<=endCol ); - _gridLayout->addMultiCellLayout(l, startRow, endRow, startCol, endCol, alignment); + _gridLayout->addMultiCellLayout(l, startRow, endRow, startCol, endCol, tqalignment); } //---------------------------------------------------------------------------- -ButtonContainer::ButtonContainer(const QString &title, QWidget *parent) - : Container(parent, Sunken) +ButtonContainer::ButtonContainer(const TQString &title, TQWidget *tqparent) + : Container(tqparent, Sunken) { _button = new PopupButton(title, this); addWidget(_button, 0,0, 0,1); diff --git a/src/common/gui/container.h b/src/common/gui/container.h index d718c6f..e64d143 100644 --- a/src/common/gui/container.h +++ b/src/common/gui/container.h @@ -9,24 +9,25 @@ #ifndef CONTAINER_H #define CONTAINER_H -#include <qframe.h> -#include <qwidgetstack.h> -#include <qtabwidget.h> -#include <qlayout.h> +#include <tqframe.h> +#include <tqwidgetstack.h> +#include <tqtabwidget.h> +#include <tqlayout.h> class PopupButton; //---------------------------------------------------------------------------- -class Container : public QFrame +class Container : public TQFrame { Q_OBJECT + TQ_OBJECT public: enum Type { Flat, Sunken }; - Container(QWidget *parent = 0, Type type = Flat); - Container(QWidgetStack *stack, uint index, Type type = Flat); - Container(QTabWidget *tabw, const QString &title, Type type = Flat); - void addWidget(QWidget *widget, uint startRow, uint endRow, uint startCol, uint endCol, int alignment = 0); - void addLayout(QLayout *layout, uint startRow, uint endRow, uint startCol, uint endCol, int alignment = 0); + Container(TQWidget *tqparent = 0, Type type = Flat); + Container(TQWidgetStack *stack, uint index, Type type = Flat); + Container(TQTabWidget *tabw, const TQString &title, Type type = Flat); + void addWidget(TQWidget *widget, uint startRow, uint endRow, uint startCol, uint endCol, int tqalignment = 0); + void addLayout(TQLayout *tqlayout, uint startRow, uint endRow, uint startCol, uint endCol, int tqalignment = 0); uint numRows() const { return _gridLayout->numRows(); } uint numCols() const { return _gridLayout->numCols(); } void setFrame(Type type); @@ -38,7 +39,7 @@ public: private: Type _type; - QGridLayout *_topLayout, *_gridLayout; + TQGridLayout *_topLayout, *_gridLayout; void initLayout(); }; @@ -47,8 +48,9 @@ private: class ButtonContainer : public Container { Q_OBJECT + TQ_OBJECT public: - ButtonContainer(const QString &title, QWidget *parent); + ButtonContainer(const TQString &title, TQWidget *tqparent); PopupButton &button() { return *_button; } private: diff --git a/src/common/gui/dialog.cpp b/src/common/gui/dialog.cpp index 650b086..f8ee222 100644 --- a/src/common/gui/dialog.cpp +++ b/src/common/gui/dialog.cpp @@ -8,101 +8,101 @@ ***************************************************************************/ #include "dialog.h" -#include <qheader.h> -#include <qtimer.h> -#include <qlabel.h> -#include <qwidgetstack.h> +#include <tqheader.h> +#include <tqtimer.h> +#include <tqlabel.h> +#include <tqwidgetstack.h> #include <ktextedit.h> #include "misc_gui.h" //----------------------------------------------------------------------------- -Dialog::Dialog(QWidget *parent, const char *name, bool modal, - const QString &caption, int buttonMask, ButtonCode defaultButton, - bool separator, const QSize &defaultSize) - : KDialogBase(parent, name, modal, caption, buttonMask, defaultButton, separator), +Dialog::Dialog(TQWidget *tqparent, const char *name, bool modal, + const TQString &caption, int buttonMask, ButtonCode defaultButton, + bool separator, const TQSize &defaultSize) + : KDialogBase(tqparent, name, modal, caption, buttonMask, defaultButton, separator), _defaultSize(defaultSize) { - BusyCursor::start(); + PBusyCursor::start(); Q_ASSERT(name); - QWidget *main = new QWidget(this); + TQWidget *main = new TQWidget(this); setMainWidget(main); - QTimer::singleShot(0, this, SLOT(updateSize())); + TQTimer::singleShot(0, this, TQT_SLOT(updateSize())); } -Dialog::Dialog(DialogType type, const QString &caption, int buttonMask, ButtonCode defaultButton, - QWidget *parent, const char *name, bool modal, bool separator, const QSize &defaultSize) - : KDialogBase(type, caption, buttonMask, defaultButton, parent, name, modal, separator), +Dialog::Dialog(DialogType type, const TQString &caption, int buttonMask, ButtonCode defaultButton, + TQWidget *tqparent, const char *name, bool modal, bool separator, const TQSize &defaultSize) + : KDialogBase(type, caption, buttonMask, defaultButton, tqparent, name, modal, separator), _defaultSize(defaultSize) { - BusyCursor::start(); + PBusyCursor::start(); Q_ASSERT(name); - QTimer::singleShot(0, this, SLOT(updateSize())); + TQTimer::singleShot(0, this, TQT_SLOT(updateSize())); } Dialog::~Dialog() { GuiConfig gc; - gc.writeEntry(QString(name()) + "_size", size()); + gc.writeEntry(TQString(name()) + "_size", size()); } void Dialog::updateSize() { GuiConfig gc; - resize(gc.readSizeEntry(QString(name()) + "_size", &_defaultSize)); - BusyCursor::stop(); + resize(gc.readSizeEntry(TQString(name()) + "_size", &_defaultSize)); + PBusyCursor::stop(); } //----------------------------------------------------------------------------- -TreeListDialog::Item::Item(const QString &label, QWidget *page, const QString &title, QListView *listview) +TreeListDialog::Item::Item(const TQString &label, TQWidget *page, const TQString &title, TQListView *listview) : KListViewItem(listview, label), _page(page), _title(title) {} -TreeListDialog::Item::Item(const QString &label, QWidget *page, const QString &title, QListViewItem *item) +TreeListDialog::Item::Item(const TQString &label, TQWidget *page, const TQString &title, TQListViewItem *item) : KListViewItem(item, label), _page(page), _title(title) {} -TreeListDialog::TreeListDialog(QWidget *parent, const char *name, bool modal, - const QString &caption, int buttonMask, ButtonCode defaultButton, +TreeListDialog::TreeListDialog(TQWidget *tqparent, const char *name, bool modal, + const TQString &caption, int buttonMask, ButtonCode defaultButton, bool separator) - : Dialog(parent, name, modal, caption, buttonMask, defaultButton, separator) + : Dialog(tqparent, name, modal, caption, buttonMask, defaultButton, separator) { - QVBoxLayout *top = new QVBoxLayout(mainWidget(), 0, 10); + TQVBoxLayout *top = new TQVBoxLayout(mainWidget(), 0, 10); // list view - QValueList<int> widths; + TQValueList<int> widths; widths += 80; widths += 500; - Splitter *splitter = new Splitter(widths, Horizontal, mainWidget(), name); + Splitter *splitter = new Splitter(widths,Qt::Horizontal, mainWidget(), name); top->addWidget(splitter); _listView = new KListView(splitter); - connect(_listView, SIGNAL(currentChanged(QListViewItem *)), SLOT(currentChanged(QListViewItem *))); + connect(_listView, TQT_SIGNAL(currentChanged(TQListViewItem *)), TQT_SLOT(currentChanged(TQListViewItem *))); _listView->setAllColumnsShowFocus(true); _listView->setRootIsDecorated(true); _listView->setSorting(0); - _listView->addColumn(QString::null); + _listView->addColumn(TQString()); _listView->header()->hide(); - _listView->setResizeMode(QListView::LastColumn); + _listView->setResizeMode(TQListView::LastColumn); // pages - _frame = new QFrame(splitter); - QVBoxLayout *vbox = new QVBoxLayout(_frame, 10, 10); - _titleBox = new QHBoxLayout(vbox); - _label = new QLabel(_frame); + _frame = new TQFrame(splitter); + TQVBoxLayout *vbox = new TQVBoxLayout(_frame, 10, 10); + _titleBox = new TQHBoxLayout(vbox); + _label = new TQLabel(_frame); _titleBox->addWidget(_label); - _stack = new QWidgetStack(_frame); - connect(_stack, SIGNAL(aboutToShow(QWidget *)), SIGNAL(aboutToShowPage(QWidget *))); + _stack = new TQWidgetStack(_frame); + connect(_stack, TQT_SIGNAL(aboutToShow(TQWidget *)), TQT_SIGNAL(aboutToShowPage(TQWidget *))); vbox->addWidget(_stack); vbox->addStretch(1); } -QWidget *TreeListDialog::addPage(const QStringList &labels) +TQWidget *TreeListDialog::addPage(const TQStringList &labels) { Q_ASSERT( !labels.isEmpty() ); - QWidget *page = 0; - QListViewItem *item = 0; - QListViewItemIterator it(_listView); + TQWidget *page = 0; + TQListViewItem *item = 0; + TQListViewItemIterator it(_listView); for (; it.current(); ++it) { if ( it.current()->text(0)==labels[0] ) { item = it.current(); @@ -110,8 +110,8 @@ QWidget *TreeListDialog::addPage(const QStringList &labels) } } if ( item==0 ) { - page = new QWidget(_stack); - connect(page, SIGNAL(destroyed(QObject *)), SLOT(pageDestroyed(QObject *))); + page = new TQWidget(_stack); + connect(page, TQT_SIGNAL(destroyed(TQObject *)), TQT_SLOT(pageDestroyed(TQObject *))); _stack->addWidget(page); item = new Item(labels[0], page, labels[0], _listView); item->setOpen(true); @@ -119,9 +119,9 @@ QWidget *TreeListDialog::addPage(const QStringList &labels) item->setSelectable(last); } for (uint i=1; i<labels.count(); i++) { - QListViewItem *parent = item; + TQListViewItem *tqparent = item; item = 0; - QListViewItemIterator iti(parent); + TQListViewItemIterator iti(tqparent); for (; it.current(); ++it) { if ( it.current()->text(0)==labels[i] ) { item = it.current(); @@ -129,10 +129,10 @@ QWidget *TreeListDialog::addPage(const QStringList &labels) } } if ( item==0 ) { - page = new QWidget(_stack); - connect(page, SIGNAL(destroyed(QObject *)), SLOT(pageDestroyed(QObject *))); + page = new TQWidget(_stack); + connect(page, TQT_SIGNAL(destroyed(TQObject *)), TQT_SLOT(pageDestroyed(TQObject *))); _stack->addWidget(page); - item = new Item(labels[i], page, labels[i], parent); + item = new Item(labels[i], page, labels[i], tqparent); item->setOpen(true); bool last = ( labels.count()==i+1 ); item->setSelectable(last); @@ -142,7 +142,7 @@ QWidget *TreeListDialog::addPage(const QStringList &labels) return page; } -void TreeListDialog::currentChanged(QListViewItem *lvitem) +void TreeListDialog::currentChanged(TQListViewItem *lvitem) { if ( lvitem==0 ) return; Item *item = static_cast<Item *>(lvitem); @@ -151,9 +151,9 @@ void TreeListDialog::currentChanged(QListViewItem *lvitem) _stack->raiseWidget(item->_page); } -void TreeListDialog::showPage(QWidget *page) +void TreeListDialog::showPage(TQWidget *page) { - QListViewItemIterator it(_listView); + TQListViewItemIterator it(_listView); for (; it.current(); ++it) { Item *item = static_cast<Item *>(it.current()); if ( item->_page==page ) { @@ -164,7 +164,7 @@ void TreeListDialog::showPage(QWidget *page) } } -int TreeListDialog::pageIndex(QWidget *page) const +int TreeListDialog::pageIndex(TQWidget *page) const { return _stack->id(page); } @@ -176,24 +176,24 @@ int TreeListDialog::activePageIndex() const return pageIndex(item->_page); } -void TreeListDialog::pageDestroyed(QObject *object) +void TreeListDialog::pageDestroyed(TQObject *object) { - QListViewItemIterator it(_listView); + TQListViewItemIterator it(_listView); for (; it.current(); ++it) { Item *item = static_cast<Item *>(it.current()); - if ( item->_page!=object ) continue; + if ( TQT_BASE_OBJECT(item->_page)!=TQT_BASE_OBJECT(object) ) continue; delete item; break; } } //----------------------------------------------------------------------------- -TextEditorDialog::TextEditorDialog(const QString &text, const QString &caption, - bool wrapAtWidgetWidth, QWidget *parent) - : Dialog(parent, "text_editor_dialog", true, caption, Close, Close, false, QSize(200, 100)) +TextEditorDialog::TextEditorDialog(const TQString &text, const TQString &caption, + bool wrapAtWidgetWidth, TQWidget *tqparent) + : Dialog(tqparent, "text_editor_dialog", true, caption, Close, Close, false, TQSize(200, 100)) { - KTextEdit *w = new KTextEdit(text, QString::null, this); + KTextEdit *w = new KTextEdit(text, TQString(), this); w->setReadOnly(true); - w->setWordWrap(wrapAtWidgetWidth ? QTextEdit::WidgetWidth : QTextEdit::NoWrap); + w->setWordWrap(wrapAtWidgetWidth ? TQTextEdit::WidgetWidth : TQTextEdit::NoWrap); setMainWidget(w); } diff --git a/src/common/gui/dialog.h b/src/common/gui/dialog.h index 1227a7d..bc95d81 100644 --- a/src/common/gui/dialog.h +++ b/src/common/gui/dialog.h @@ -9,7 +9,7 @@ #ifndef DIALOG_H #define DIALOG_H -#include <qlayout.h> +#include <tqlayout.h> #include <kdialogbase.h> #include <klistview.h> @@ -17,51 +17,53 @@ class Dialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - Dialog(QWidget *parent, const char *name, bool modal, - const QString &caption, int buttonMask, ButtonCode defaultButton, bool separator, - const QSize &defaultSize = QSize()); - Dialog(DialogType type, const QString &caption, - int buttonMask, ButtonCode defaultButton, QWidget *parent, const char *name, - bool modal, bool separator, const QSize &defaultSize = QSize()); + Dialog(TQWidget *tqparent, const char *name, bool modal, + const TQString &caption, int buttonMask, ButtonCode defaultButton, bool separator, + const TQSize &defaultSize = TQSize()); + Dialog(DialogType type, const TQString &caption, + int buttonMask, ButtonCode defaultButton, TQWidget *tqparent, const char *name, + bool modal, bool separator, const TQSize &defaultSize = TQSize()); virtual ~Dialog(); private slots: void updateSize(); private: - QSize _defaultSize; + TQSize _defaultSize; }; //----------------------------------------------------------------------------- class TreeListDialog : public Dialog { Q_OBJECT + TQ_OBJECT public: - TreeListDialog(QWidget *parent, const char *name, bool modal, - const QString &caption, int buttonMask, ButtonCode defaultButton, bool separator); - QWidget *addPage(const QStringList &labels); - void showPage(QWidget *page); + TreeListDialog(TQWidget *tqparent, const char *name, bool modal, + const TQString &caption, int buttonMask, ButtonCode defaultButton, bool separator); + TQWidget *addPage(const TQStringList &labels); + void showPage(TQWidget *page); int activePageIndex() const; - int pageIndex(QWidget *page) const; + int pageIndex(TQWidget *page) const; protected slots: - virtual void currentChanged(QListViewItem *item); - void pageDestroyed(QObject *page); + virtual void currentChanged(TQListViewItem *item); + void pageDestroyed(TQObject *page); protected: - QFrame *_frame; + TQFrame *_frame; KListView *_listView; - QHBoxLayout *_titleBox; - QLabel *_label; - QWidgetStack *_stack; + TQHBoxLayout *_titleBox; + TQLabel *_label; + TQWidgetStack *_stack; class Item : public KListViewItem { public: - Item(const QString &label, QWidget *page, const QString &title, QListView *listview); - Item(const QString &label, QWidget *page, const QString &title, QListViewItem *item); - QWidget *_page; - QString _title; + Item(const TQString &label, TQWidget *page, const TQString &title, TQListView *listview); + Item(const TQString &label, TQWidget *page, const TQString &title, TQListViewItem *item); + TQWidget *_page; + TQString _title; }; }; @@ -69,9 +71,10 @@ protected: class TextEditorDialog : public Dialog { Q_OBJECT + TQ_OBJECT public: - TextEditorDialog(const QString &text, const QString &caption, - bool wrapAtWidgetWidth, QWidget *parent); + TextEditorDialog(const TQString &text, const TQString &caption, + bool wrapAtWidgetWidth, TQWidget *tqparent); }; #endif diff --git a/src/common/gui/editlistbox.cpp b/src/common/gui/editlistbox.cpp index 1d2916d..2e40b8a 100644 --- a/src/common/gui/editlistbox.cpp +++ b/src/common/gui/editlistbox.cpp @@ -19,9 +19,9 @@ */ #include "editlistbox.h" -#include <qstringlist.h> -#include <qlabel.h> -#include <qheader.h> +#include <tqstringlist.h> +#include <tqlabel.h> +#include <tqheader.h> #include <kdialog.h> #include <klocale.h> @@ -30,22 +30,22 @@ #include <kiconloader.h> #include <kstdguiitem.h> -EditListBox::EditListBox(uint nbColumns, QWidget *parent, const char *name, Mode mode, Buttons buttons) - : QFrame(parent, name), _mode(mode), _buttons(buttons) +EditListBox::EditListBox(uint nbColumns, TQWidget *tqparent, const char *name, Mode mode, Buttons buttons) + : TQFrame(tqparent, name), _mode(mode), _buttons(buttons) { m_lineEdit = new KLineEdit; init(nbColumns, m_lineEdit); } -EditListBox::EditListBox(uint nbColumns, QWidget *view, KLineEdit *lineEdit, QWidget *parent, const char *name, +EditListBox::EditListBox(uint nbColumns, TQWidget *view, KLineEdit *lineEdit, TQWidget *tqparent, const char *name, Mode mode, Buttons buttons) - : QFrame(parent, name), _mode(mode), _buttons(buttons) + : TQFrame(tqparent, name), _mode(mode), _buttons(buttons) { m_lineEdit = lineEdit; init(nbColumns, view); } -void EditListBox::init(uint nbColumns, QWidget *view) +void EditListBox::init(uint nbColumns, TQWidget *view) { _addButton = 0; _removeButton = 0; @@ -53,48 +53,48 @@ void EditListBox::init(uint nbColumns, QWidget *view) _moveDownButton = 0; _removeAllButton = 0; _resetButton = 0; - setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); + tqsetSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding)); - QGridLayout *grid = new QGridLayout(this, 1, 1, 0, KDialog::spacingHint()); + TQGridLayout *grid = new TQGridLayout(this, 1, 1, 0, KDialog::spacingHint()); uint row = 0; if (view) { - QHBoxLayout *hbox = new QHBoxLayout(KDialog::spacingHint()); + TQHBoxLayout *hbox = new TQHBoxLayout(KDialog::spacingHint()); grid->addMultiCellLayout(hbox, row,row, 0,1); if (m_lineEdit) { KIconLoader loader; - QIconSet iconset = loader.loadIcon("locationbar_erase", KIcon::Toolbar); - KPushButton *button = new KPushButton(iconset, QString::null, this); - connect(button, SIGNAL(clicked()), SLOT(clearEdit())); + TQIconSet iconset = loader.loadIcon("locationbar_erase", KIcon::Toolbar); + KPushButton *button = new KPushButton(iconset, TQString(), this); + connect(button, TQT_SIGNAL(clicked()), TQT_SLOT(clearEdit())); hbox->addWidget(button); } - view->reparent( this, QPoint(0,0) ); + view->reparent( this, TQPoint(0,0) ); hbox->addWidget(view); row++; } _listView= new KListView(this); - for (uint i=0; i<nbColumns; i++) _listView->addColumn(QString::null); + for (uint i=0; i<nbColumns; i++) _listView->addColumn(TQString()); _listView->header()->hide(); _listView->setSorting(-1); _listView->setResizeMode(KListView::LastColumn); _listView->setColumnWidthMode(nbColumns-1, KListView::Maximum); grid->addWidget(_listView, row, 0); - QVBoxLayout *vbox = new QVBoxLayout(10); + TQVBoxLayout *vbox = new TQVBoxLayout(10); grid->addLayout(vbox, row, 1); - _buttonsLayout = new QVBoxLayout(10); + _buttonsLayout = new TQVBoxLayout(10); vbox->addLayout(_buttonsLayout); vbox->addStretch(1); setButtons(_buttons); if (m_lineEdit) { - connect(m_lineEdit,SIGNAL(textChanged(const QString&)),this,SLOT(typedSomething(const QString&))); + connect(m_lineEdit,TQT_SIGNAL(textChanged(const TQString&)),this,TQT_SLOT(typedSomething(const TQString&))); m_lineEdit->setTrapReturnKey(true); - connect(m_lineEdit,SIGNAL(returnPressed()),this,SLOT(addItem())); + connect(m_lineEdit,TQT_SIGNAL(returnPressed()),this,TQT_SLOT(addItem())); } - connect(_listView, SIGNAL(selectionChanged()), SLOT(selectionChanged())); + connect(_listView, TQT_SIGNAL(selectionChanged()), TQT_SLOT(selectionChanged())); // maybe supplied lineedit has some text already - typedSomething(m_lineEdit ? m_lineEdit->text() : QString::null); + typedSomething(m_lineEdit ? m_lineEdit->text() : TQString()); } void EditListBox::setButtons(Buttons buttons) @@ -111,7 +111,7 @@ void EditListBox::setButtons(Buttons buttons) #endif _addButton->setEnabled(false); _addButton->show(); - connect(_addButton, SIGNAL(clicked()), SLOT(addItem())); + connect(_addButton, TQT_SIGNAL(clicked()), TQT_SLOT(addItem())); _buttonsLayout->addWidget(_addButton); } @@ -121,7 +121,7 @@ void EditListBox::setButtons(Buttons buttons) _removeButton = new KPushButton(KGuiItem(i18n("Remove"), "clear"), this); _removeButton->setEnabled(false); _removeButton->show(); - connect(_removeButton, SIGNAL(clicked()), SLOT(removeItem())); + connect(_removeButton, TQT_SIGNAL(clicked()), TQT_SLOT(removeItem())); _buttonsLayout->addWidget(_removeButton); } @@ -130,7 +130,7 @@ void EditListBox::setButtons(Buttons buttons) if ( buttons & RemoveAll ) { _removeAllButton = new KPushButton(KGuiItem(i18n("Remove All"), "delete"), this); _removeAllButton->show(); - connect(_removeAllButton, SIGNAL(clicked()), SLOT(clear())); + connect(_removeAllButton, TQT_SIGNAL(clicked()), TQT_SLOT(clear())); _buttonsLayout->addWidget(_removeAllButton); } @@ -142,12 +142,12 @@ void EditListBox::setButtons(Buttons buttons) _moveUpButton = new KPushButton(KGuiItem(i18n("Move &Up"), "up"), this); _moveUpButton->setEnabled(false); _moveUpButton->show(); - connect(_moveUpButton, SIGNAL(clicked()), SLOT(moveItemUp())); + connect(_moveUpButton, TQT_SIGNAL(clicked()), TQT_SLOT(moveItemUp())); _buttonsLayout->addWidget(_moveUpButton); _moveDownButton = new KPushButton(KGuiItem(i18n("Move &Down"), "down"), this); _moveDownButton->setEnabled(false); _moveDownButton->show(); - connect(_moveDownButton, SIGNAL(clicked()), SLOT(moveItemDown())); + connect(_moveDownButton, TQT_SIGNAL(clicked()), TQT_SLOT(moveItemDown())); _buttonsLayout->addWidget(_moveDownButton); } @@ -156,14 +156,14 @@ void EditListBox::setButtons(Buttons buttons) if ( buttons & Reset ) { _resetButton = new KPushButton(KStdGuiItem::reset(), this); _resetButton->show(); - connect(_resetButton, SIGNAL(clicked()), SIGNAL(reset())); + connect(_resetButton, TQT_SIGNAL(clicked()), TQT_SIGNAL(reset())); _buttonsLayout->addWidget(_resetButton); } } -void EditListBox::typedSomething(const QString& text) +void EditListBox::typedSomething(const TQString& text) { - QListViewItem *item = _listView->selectedItem(); + TQListViewItem *item = _listView->selectedItem(); if (item) { if( selectedText()!=text ) { item->setText(textColumn(), text); @@ -175,7 +175,7 @@ void EditListBox::typedSomething(const QString& text) void EditListBox::moveItemUp() { - QListViewItem *item = _listView->selectedItem(); + TQListViewItem *item = _listView->selectedItem(); if ( item==0 || item->itemAbove()==0 ) return; item->itemAbove()->moveItem(item); updateButtons(); @@ -184,7 +184,7 @@ void EditListBox::moveItemUp() void EditListBox::moveItemDown() { - QListViewItem *item = _listView->selectedItem(); + TQListViewItem *item = _listView->selectedItem(); if ( item==0 || item->itemBelow()==0 ) return; item->moveItem(item->itemBelow()); updateButtons(); @@ -201,11 +201,11 @@ void EditListBox::addItem() addItem(m_lineEdit->text()); } -void EditListBox::addItem(const QString &text) +void EditListBox::addItem(const TQString &text) { bool alreadyInList(false); //if we didn't check for dupes at the inserting we have to do it now - if ( _mode==DuplicatesDisallowed ) alreadyInList = _listView->findItem(text, textColumn()); + if ( _mode==DuplicatesDisallowed ) alreadyInList = _listView->tqfindItem(text, textColumn()); if (m_lineEdit) { bool block = m_lineEdit->signalsBlocked(); @@ -216,7 +216,7 @@ void EditListBox::addItem(const QString &text) _listView->clearSelection(); if (!alreadyInList) { - QListViewItem *item = createItem(); + TQListViewItem *item = createItem(); item->setText(textColumn(), text); if ( _listView->lastItem() ) item->moveItem(_listView->lastItem()); emit changed(); @@ -237,9 +237,9 @@ void EditListBox::clearEdit() void EditListBox::removeItem() { - QListViewItem *item = _listView->selectedItem(); + TQListViewItem *item = _listView->selectedItem(); if (item) { - QString text = item->text(textColumn()); + TQString text = item->text(textColumn()); delete item; emit changed(); emit removed(text); @@ -267,15 +267,15 @@ void EditListBox::clear() uint EditListBox::count() const { uint nb = 0; - QListViewItemIterator it(_listView); + TQListViewItemIterator it(_listView); for (; it.current(); ++it) nb++; return nb; } -const QListViewItem *EditListBox::item(uint i) const +const TQListViewItem *EditListBox::item(uint i) const { uint k = 0; - QListViewItemIterator it(_listView); + TQListViewItemIterator it(_listView); for (; it.current(); ++it) { if ( k==i ) return it.current(); k++; @@ -283,19 +283,19 @@ const QListViewItem *EditListBox::item(uint i) const return 0; } -QStringList EditListBox::texts() const +TQStringList EditListBox::texts() const { - QStringList list; - QListViewItemIterator it(_listView); + TQStringList list; + TQListViewItemIterator it(_listView); for (; it.current(); ++it) list.append(it.current()->text(textColumn())); return list; } -void EditListBox::setTexts(const QStringList& items) +void EditListBox::setTexts(const TQStringList& items) { _listView->clear(); for (int i=items.count()-1; i>=0; i--) { - QListViewItem *item = createItem(); + TQListViewItem *item = createItem(); item->setText(textColumn(), items[i]); } if (m_lineEdit) m_lineEdit->clear(); @@ -304,14 +304,14 @@ void EditListBox::setTexts(const QStringList& items) void EditListBox::updateButtons() { - QListViewItem *item = _listView->selectedItem(); + TQListViewItem *item = _listView->selectedItem(); if (_addButton) { if ( m_lineEdit==0 ) _addButton->setEnabled(true); else { - QString text = m_lineEdit->text(); + TQString text = m_lineEdit->text(); if ( _mode!=DuplicatesCheckedAtEntering ) _addButton->setEnabled(!text.isEmpty()); else if ( text.isEmpty() ) _addButton->setEnabled(false); - else _addButton->setEnabled(!_listView->findItem(text, textColumn())); + else _addButton->setEnabled(!_listView->tqfindItem(text, textColumn())); } } if (_removeButton) _removeButton->setEnabled(item); @@ -320,21 +320,21 @@ void EditListBox::updateButtons() if (_removeAllButton) _removeAllButton->setEnabled(_listView->firstChild()); } -void EditListBox::setEditText(const QString &text) +void EditListBox::setEditText(const TQString &text) { _listView->clearSelection(); if (m_lineEdit) m_lineEdit->setText(text); updateButtons(); } -QListViewItem *EditListBox::createItem() +TQListViewItem *EditListBox::createItem() { return new KListViewItem(_listView); } -QString EditListBox::selectedText() const +TQString EditListBox::selectedText() const { - QListViewItem *item = _listView->selectedItem(); - if ( item==0 ) return QString::null; + TQListViewItem *item = _listView->selectedItem(); + if ( item==0 ) return TQString(); return item->text(textColumn()); } diff --git a/src/common/gui/editlistbox.h b/src/common/gui/editlistbox.h index c259278..3e7a26d 100644 --- a/src/common/gui/editlistbox.h +++ b/src/common/gui/editlistbox.h @@ -19,7 +19,7 @@ #ifndef EDITLISTBOX_H #define EDITLISTBOX_H -#include <qlayout.h> +#include <tqlayout.h> #include <klineedit.h> #include <kpushbutton.h> #include <klistview.h> @@ -32,33 +32,34 @@ // * use KStdGuiItem for buttons // * support for New, Clear, Reset buttons // * use KListView -class EditListBox : public QFrame +class EditListBox : public TQFrame { Q_OBJECT + TQ_OBJECT public: enum Mode { DuplicatesDisallowed, DuplicatesAllowed, DuplicatesCheckedAtEntering }; enum Button { Add = 1, Remove = 2, UpDown = 4, RemoveAll = 8, Reset = 16 }; - Q_DECLARE_FLAGS(Buttons, Button) + TQ_DECLARE_FLAGS(Buttons, Button) - EditListBox(uint nbColumns, QWidget *parent = 0, const char *name = 0, Mode mode = DuplicatesDisallowed, + EditListBox(uint nbColumns, TQWidget *tqparent = 0, const char *name = 0, Mode mode = DuplicatesDisallowed, Buttons buttons = Buttons(Add|Remove|RemoveAll|UpDown) ); - EditListBox(uint nbColumns, QWidget *view, KLineEdit *lineEdit, QWidget *parent = 0, const char *name = 0, + EditListBox(uint nbColumns, TQWidget *view, KLineEdit *lineEdit, TQWidget *tqparent = 0, const char *name = 0, Mode mode = DuplicatesDisallowed, Buttons buttons = Buttons(Add|Remove|RemoveAll|UpDown) ); - void setTexts(const QStringList& items); - QStringList texts() const; + void setTexts(const TQStringList& items); + TQStringList texts() const; uint count() const; - QString text(uint i) const { return item(i)->text(textColumn()); } - const QListViewItem *item(uint i) const; + TQString text(uint i) const { return item(i)->text(textColumn()); } + const TQListViewItem *item(uint i) const; Buttons buttons() const { return _buttons; } void setButtons(Buttons buttons); - void setEditText(const QString &text); - void addItem(const QString &text); + void setEditText(const TQString &text); + void addItem(const TQString &text); signals: void reset(); void changed(); - void added( const QString & text ); - void removed( const QString & text ); + void added( const TQString & text ); + void removed( const TQString & text ); public slots: void clear(); @@ -70,26 +71,26 @@ Q_OBJECT virtual void addItem(); virtual void removeItem(); void selectionChanged(); - void typedSomething(const QString& text); + void typedSomething(const TQString& text); protected: KListView *_listView; - virtual QListViewItem *createItem(); + virtual TQListViewItem *createItem(); virtual uint textColumn() const { return 0; } - QString selectedText() const; + TQString selectedText() const; private: Mode _mode; Buttons _buttons; - QVBoxLayout *_buttonsLayout; + TQVBoxLayout *_buttonsLayout; KLineEdit *m_lineEdit; KPushButton *_addButton, *_removeButton, *_moveUpButton, *_moveDownButton, *_removeAllButton, *_resetButton; - void init(uint nbColumns, QWidget *view); + void init(uint nbColumns, TQWidget *view); void updateButtons(); }; -Q_DECLARE_OPERATORS_FOR_FLAGS(EditListBox::Buttons) +TQ_DECLARE_OPERATORS_FOR_FLAGS(EditListBox::Buttons) #endif diff --git a/src/common/gui/hexword_gui.cpp b/src/common/gui/hexword_gui.cpp index d794a11..b85e829 100644 --- a/src/common/gui/hexword_gui.cpp +++ b/src/common/gui/hexword_gui.cpp @@ -9,16 +9,16 @@ ***************************************************************************/ #include "hexword_gui.h" -#include <qtimer.h> +#include <tqtimer.h> #include "common/gui/number_gui.h" #include "common/common/misc.h" //----------------------------------------------------------------------------- -HexValueValidator::HexValueValidator(uint nbChars, QObject *parent) - : QValidator(parent, "hex_value_validator"), _nbChars(nbChars) {} +HexValueValidator::HexValueValidator(uint nbChars, TQObject *tqparent) + : TQValidator(tqparent, "hex_value_validator"), _nbChars(nbChars) {} -QValidator::State HexValueValidator::validate(QString &input, int &) const +TQValidator::State HexValueValidator::validate(TQString &input, int &) const { if ( input.length()==0 ) return Acceptable; if ( input.length()>_nbChars ) return Invalid; @@ -28,12 +28,12 @@ QValidator::State HexValueValidator::validate(QString &input, int &) const } //----------------------------------------------------------------------------- -GenericHexWordEditor::GenericHexWordEditor(uint nbChars, bool hasBlankValue, QWidget *parent) - : KLineEdit(parent, "hex_word_editor"), _nbChars(nbChars), _hasBlankValue(hasBlankValue) +GenericHexWordEditor::GenericHexWordEditor(uint nbChars, bool hasBlankValue, TQWidget *tqparent) + : KLineEdit(tqparent, "hex_word_editor"), _nbChars(nbChars), _hasBlankValue(hasBlankValue) { - setFocusPolicy(ClickFocus); - setValidator(new HexValueValidator(nbChars, this)); - connect(this, SIGNAL(textChanged(const QString &)), SLOT(slotTextChanged())); + setFocusPolicy(TQ_ClickFocus); + setValidator(new HexValueValidator(nbChars, TQT_TQOBJECT(this))); + connect(this, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(slotTextChanged())); setFrame(false); } @@ -46,9 +46,9 @@ void GenericHexWordEditor::slotTextChanged() bool GenericHexWordEditor::changeValue() { if ( !isValid() ) return false; - QString s = text(); + TQString s = text(); BitValue v = blankValue(); - if ( s!=QString(repeat("-", _nbChars)) ) { + if ( s!=TQString(repeat("-", _nbChars)) ) { s = s.leftJustify(_nbChars, '0', true); for (uint i=0; i<_nbChars; i++) if ( !isxdigit(s[i].latin1()) ) s[i] = '0'; @@ -74,17 +74,17 @@ void GenericHexWordEditor::set() blockSignals(false); } -bool GenericHexWordEditor::event(QEvent *e) +bool GenericHexWordEditor::event(TQEvent *e) { switch (e->type()) { - case QEvent::FocusOut: + case TQEvent::FocusOut: changeValue(); break; - case QEvent::FocusIn: - QTimer::singleShot(0, this, SLOT(selectAll())); // ugly but it works + case TQEvent::FocusIn: + TQTimer::singleShot(0, this, TQT_SLOT(selectAll())); // ugly but it works break; - case QEvent::KeyPress: - switch ( static_cast<QKeyEvent *>(e)->key() ) { + case TQEvent::KeyPress: + switch ( TQT_TQKEYEVENT(e)->key() ) { case Key_Next: emit moveNextPage(); return true; @@ -122,15 +122,15 @@ bool GenericHexWordEditor::event(QEvent *e) } default: break; } - return QLineEdit::event(e); + return TQLineEdit::event(e); } -QSize GenericHexWordEditor::sizeHint() const +TQSize GenericHexWordEditor::tqsizeHint() const { - return QSize(maxCharWidth(NumberBase::Hex, font()) * (_nbChars+1), fontMetrics().height()); + return TQSize(maxCharWidth(NumberBase::Hex, font()) * (_nbChars+1), fontMetrics().height()); } -QSize GenericHexWordEditor::minimumSizeHint() const +TQSize GenericHexWordEditor::tqminimumSizeHint() const { - return QSize(maxCharWidth(NumberBase::Hex, font()) * (_nbChars+1), fontMetrics().height()); + return TQSize(maxCharWidth(NumberBase::Hex, font()) * (_nbChars+1), fontMetrics().height()); } diff --git a/src/common/gui/hexword_gui.h b/src/common/gui/hexword_gui.h index 5da6840..f607f07 100644 --- a/src/common/gui/hexword_gui.h +++ b/src/common/gui/hexword_gui.h @@ -10,18 +10,19 @@ #ifndef HEXWORD_GUI_H #define HEXWORD_GUI_H -#include <qvalidator.h> +#include <tqvalidator.h> #include <klineedit.h> #include "common/common/bitvalue.h" //----------------------------------------------------------------------------- -class HexValueValidator : public QValidator +class HexValueValidator : public TQValidator { Q_OBJECT + TQ_OBJECT public: - HexValueValidator(uint nbChars, QObject *parent); - virtual State validate(QString &input, int &pos) const; + HexValueValidator(uint nbChars, TQObject *tqparent); + virtual State validate(TQString &input, int &pos) const; private: uint _nbChars; @@ -31,10 +32,11 @@ private: class GenericHexWordEditor : public KLineEdit { Q_OBJECT + TQ_OBJECT public: - GenericHexWordEditor(uint nbChars, bool hasBlankValue, QWidget *parent); - virtual QSize sizeHint() const; - virtual QSize minimumSizeHint() const; + GenericHexWordEditor(uint nbChars, bool hasBlankValue, TQWidget *tqparent); + virtual TQSize tqsizeHint() const; + virtual TQSize tqminimumSizeHint() const; signals: void modified(); @@ -56,9 +58,9 @@ protected: bool _hasBlankValue; virtual bool isValid() const = 0; - virtual BitValue mask() const = 0; + virtual BitValue tqmask() const = 0; virtual BitValue normalizeWord(BitValue value) const = 0; - virtual bool event(QEvent *e); + virtual bool event(TQEvent *e); virtual void set(); virtual BitValue word() const = 0; virtual void setWord(BitValue value) = 0; @@ -69,8 +71,9 @@ protected: class HexWordEditor : public GenericHexWordEditor { Q_OBJECT + TQ_OBJECT public: - HexWordEditor(uint nbChars, QWidget *parent) : GenericHexWordEditor(nbChars, false, parent) {} + HexWordEditor(uint nbChars, TQWidget *tqparent) : GenericHexWordEditor(nbChars, false, tqparent) {} void setValue(BitValue word) { _word = word; set(); } BitValue value() const { return _word; } @@ -78,8 +81,8 @@ protected: BitValue _word; virtual bool isValid() const { return true; } - virtual BitValue mask() const { return maxValue(NumberBase::Hex, _nbChars); } - virtual BitValue normalizeWord(BitValue value) const { return value.maskWith(mask()); } + virtual BitValue tqmask() const { return maxValue(NumberBase::Hex, _nbChars); } + 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 0; } diff --git a/src/common/gui/key_gui.h b/src/common/gui/key_gui.h index fb8a9f5..5ae0a84 100644 --- a/src/common/gui/key_gui.h +++ b/src/common/gui/key_gui.h @@ -9,9 +9,9 @@ #ifndef KEY_GUI_H #define KEY_GUI_H -#include <qcombobox.h> -#include <qwidgetstack.h> -#include <qpopupmenu.h> +#include <tqcombobox.h> +#include <tqwidgetstack.h> +#include <tqpopupmenu.h> #include "common/gui/misc_gui.h" #include "common/common/misc.h" @@ -21,10 +21,10 @@ template <typename KeyType, typename Type, typename WidgetType> class KeyWidget { public: - typedef QMapConstIterator<KeyType, int> ConstIterator; + typedef TQMapConstIterator<KeyType, int> ConstIterator; public: - KeyWidget(QWidget *parent) { _widget = new WidgetType(parent); } + KeyWidget(TQWidget *tqparent) { _widget = new WidgetType(tqparent); } virtual ~KeyWidget() { delete _widget; } virtual WidgetType *widget() { return _widget; } virtual void clear() { _ids.clear(); } @@ -32,16 +32,16 @@ public: ConstIterator end() const { return _ids.end(); } uint count() const { return _ids.count(); } void appendItem(const KeyType &key, Type type) { - CRASH_ASSERT( !_ids.contains(key) ); + CRASH_ASSERT( !_ids.tqcontains(key) ); _ids[key] = append(type); } KeyType currentItem() const { return key(currentId()); } void setCurrentItem(const KeyType &key) { - if ( _ids.contains(key) ) setCurrentId(_ids[key]); + if ( _ids.tqcontains(key) ) setCurrentId(_ids[key]); } - bool contains(const KeyType &key) const { return _ids.contains(key); } + bool tqcontains(const KeyType &key) const { return _ids.tqcontains(key); } Type item(const KeyType &key) const { - CRASH_ASSERT( _ids.contains(key) ); + CRASH_ASSERT( _ids.tqcontains(key) ); return get(_ids[key]); } Type item(ConstIterator it) const { @@ -60,64 +60,64 @@ protected: virtual void setCurrentId(int id) = 0; virtual Type get(int id) const = 0; - QWidget *_parent; - QMap<KeyType, int> _ids; + TQWidget *_parent; + TQMap<KeyType, int> _ids; WidgetType *_widget; }; //----------------------------------------------------------------------------- template <typename KeyType> -class KeyComboBox : public KeyWidget<KeyType, QString, QComboBox> +class KeyComboBox : public KeyWidget<KeyType, TQString, TQComboBox> { public: - typedef KeyWidget<KeyType, QString, QComboBox> ParentType; - KeyComboBox(QWidget *parent = 0) : ParentType(parent) {} + typedef KeyWidget<KeyType, TQString, TQComboBox> ParentType; + KeyComboBox(TQWidget *tqparent = 0) : ParentType(tqparent) {} virtual void clear() { ParentType::clear(); ParentType::_widget->clear(); } void fixMinimumWidth() { - ParentType::_widget->setMinimumWidth(ParentType::_widget->sizeHint().width()); + ParentType::_widget->setMinimumWidth(ParentType::_widget->tqsizeHint().width()); } protected: - virtual int append(QString label) { ParentType::_widget->insertItem(label); return ParentType::_widget->count()-1; } + virtual int append(TQString label) { ParentType::_widget->insertItem(label); return ParentType::_widget->count()-1; } virtual int currentId() const { return ParentType::_widget->currentItem(); } virtual void setCurrentId(int id) { ParentType::_widget->setCurrentItem(id); } - virtual QString get(int id) const { return ParentType::_widget->text(id); } + virtual TQString get(int id) const { return ParentType::_widget->text(id); } }; //----------------------------------------------------------------------------- template <typename KeyType> -class KeyWidgetStack : public KeyWidget<KeyType, QWidget *, QWidgetStack> +class KeyWidgetStack : public KeyWidget<KeyType, TQWidget *, TQWidgetStack> { public: - typedef KeyWidget<KeyType, QWidget *, QWidgetStack> ParentType; - KeyWidgetStack(QWidget *parent = 0) : ParentType(parent) {} + typedef KeyWidget<KeyType, TQWidget *, TQWidgetStack> ParentType; + KeyWidgetStack(TQWidget *tqparent = 0) : ParentType(tqparent) {} protected: - virtual int append(QWidget *widget) { return ParentType::_widget->addWidget(widget); } + virtual int append(TQWidget *widget) { return ParentType::_widget->addWidget(widget); } virtual int currentId() const { return ParentType::_widget->id(ParentType::_widget->visibleWidget()); } virtual void setCurrentId(int id) { ParentType::_widget->raiseWidget(id); } - virtual QWidget *get(int id) const { return ParentType::_widget->widget(id); } + virtual TQWidget *get(int id) const { return ParentType::_widget->widget(id); } }; //----------------------------------------------------------------------------- template <typename KeyType> -class KeyPopupButton : public KeyWidget<KeyType, QString, PopupButton> +class KeyPopupButton : public KeyWidget<KeyType, TQString, PopupButton> { public: - typedef KeyWidget<KeyType, QString, PopupButton> ParentType; - KeyPopupButton(QWidget *parent = 0) : ParentType(parent) {} + typedef KeyWidget<KeyType, TQString, PopupButton> ParentType; + KeyPopupButton(TQWidget *tqparent = 0) : ParentType(tqparent) {} protected: - virtual int append(QString label) { return ParentType::_widget->appendItem(label, QPixmap()); } - virtual QString get(int id) const { return ParentType::_widget->popup()->text(id); } + virtual int append(TQString label) { return ParentType::_widget->appendItem(label, TQPixmap()); } + virtual TQString get(int id) const { return ParentType::_widget->popup()->text(id); } private: // disabled - QString currentItem() const; - void setCurrentItem(const QString &key); + TQString currentItem() const; + void setCurrentItem(const TQString &key); virtual int currentId() const { return 0; } virtual void setCurrentId(int) {} }; 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); } diff --git a/src/common/gui/list_container.h b/src/common/gui/list_container.h index b70db57..138b9ea 100644 --- a/src/common/gui/list_container.h +++ b/src/common/gui/list_container.h @@ -17,39 +17,40 @@ class ListContainer { public: virtual ~ListContainer() {} - virtual ListContainer *appendBranch(const QString &title) = 0; + virtual ListContainer *appendBranch(const TQString &title) = 0; enum ItemState { Normal, Checked, UnChecked, Disabled }; - void appendItem(const QString &label, uint id, ItemState state) { appendItem(QPixmap(), label, id, state); } - virtual void appendItem(const QPixmap &icon, const QString &label, uint id, ItemState state) = 0; + void appendItem(const TQString &label, uint id, ItemState state) { appendItem(TQPixmap(), label, id, state); } + virtual void appendItem(const TQPixmap &icon, const TQString &label, uint id, ItemState state) = 0; }; //---------------------------------------------------------------------------- class PopupContainer : public KPopupMenu, public ListContainer { Q_OBJECT + TQ_OBJECT public: - PopupContainer(const QString &title, QWidget *parent = 0, const char *name = 0); - virtual ListContainer *appendBranch(const QString &title); - virtual ListContainer *appendBranch(const QPixmap &icon, const QString &title); - virtual void appendItem(const QPixmap &icon, const QString &label, uint id, ItemState state); + PopupContainer(const TQString &title, TQWidget *tqparent = 0, const char *name = 0); + virtual ListContainer *appendBranch(const TQString &title); + virtual ListContainer *appendBranch(const TQPixmap &icon, const TQString &title); + virtual void appendItem(const TQPixmap &icon, const TQString &label, uint id, ItemState state); }; //---------------------------------------------------------------------------- class ListViewItemContainer : public KListViewItem, public ListContainer { public: - ListViewItemContainer(const QString &title, KListView *parent); - ListViewItemContainer(const QString &title, ListViewItemContainer *parent); + ListViewItemContainer(const TQString &title, KListView *tqparent); + ListViewItemContainer(const TQString &title, ListViewItemContainer *tqparent); virtual ~ListViewItemContainer(); void setColumn(uint column) { _column = column; } - virtual ListContainer *appendBranch(const QString &title); - virtual void appendItem(const QPixmap &icon, const QString &label, uint id, ItemState state); - int id(const QListViewItem* item) const; // -1 if not known + virtual ListContainer *appendBranch(const TQString &title); + virtual void appendItem(const TQPixmap &icon, const TQString &label, uint id, ItemState state); + int id(const TQListViewItem* item) const; // -1 if not known private: ListViewItemContainer *_parent; uint _column; - QMap<const QListViewItem *, uint> *_ids; + TQMap<const TQListViewItem *, uint> *_ids; }; #endif diff --git a/src/common/gui/list_view.cpp b/src/common/gui/list_view.cpp index c9434f3..4d5ac14 100644 --- a/src/common/gui/list_view.cpp +++ b/src/common/gui/list_view.cpp @@ -9,18 +9,18 @@ ***************************************************************************/ #include "list_view.h" -#include <qapplication.h> -#include <qpainter.h> -#include <qlineedit.h> -#include <qheader.h> -#include <qmetaobject.h> -#include <qvariant.h> +#include <tqapplication.h> +#include <tqpainter.h> +#include <tqlineedit.h> +#include <tqheader.h> +#include <tqmetaobject.h> +#include <tqvariant.h> //---------------------------------------------------------------------------- -ListView::ListView(QWidget *parent, const char *name) - : KListView(parent, name) +ListView::ListView(TQWidget *tqparent, const char *name) + : KListView(tqparent, name) { - QToolTip::remove(this); + TQToolTip::remove(this); _tooltip = new ListViewToolTip(this); } @@ -29,9 +29,9 @@ ListView::~ListView() delete _tooltip; } -QString ListView::tooltip(const QListViewItem &, int) const +TQString ListView::tooltip(const TQListViewItem &, int) const { - return QString::null; + return TQString(); } void ListView::clear() @@ -40,16 +40,16 @@ void ListView::clear() KListView::clear(); } -bool ListView::eventFilter(QObject *o, QEvent *e) +bool ListView::eventFilter(TQObject *o, TQEvent *e) { - QValueList<EditListViewItem *>::const_iterator it; + TQValueList<EditListViewItem *>::const_iterator it; for (it=_editItems.begin(); it!=_editItems.end(); ++it) { for (uint i=0; i<(*it)->_editWidgets.count(); i++) { - if ( (*it)->_editWidgets[i]==o ) { + if ( TQT_BASE_OBJECT((*it)->_editWidgets[i])==TQT_BASE_OBJECT(o) ) { //qDebug("event %i", e->type()); switch (e->type()) { - case QEvent::KeyPress: { - QKeyEvent *ke = static_cast<QKeyEvent *>(e); + case TQEvent::KeyPress: { + TQKeyEvent *ke = TQT_TQKEYEVENT(e); switch (ke->key()) { case Key_Enter: case Key_Return: @@ -61,12 +61,12 @@ bool ListView::eventFilter(QObject *o, QEvent *e) } break; } - case QEvent::FocusOut: { - //qDebug("focus out %i %i=%i", qApp->focusWidget(), focusWidget(), (*it)->_editWidgets[i]); - if ( qApp->focusWidget() && focusWidget()==(*it)->_editWidgets[i] ) break; + case TQEvent::FocusOut: { + //qDebug("focus out %i %i=%i", tqApp->tqfocusWidget(), tqfocusWidget(), (*it)->_editWidgets[i]); + if ( tqApp->tqfocusWidget() && tqfocusWidget()==(*it)->_editWidgets[i] ) break; //qDebug("ext"); - QCustomEvent *e = new QCustomEvent(9999); - QApplication::postEvent(o, e); + TQCustomEvent *e = new TQCustomEvent(9999); + TQApplication::postEvent(o, e); return true; } case 9999: @@ -84,21 +84,21 @@ bool ListView::eventFilter(QObject *o, QEvent *e) void ListView::stopRenaming(bool force) { - QValueList<EditListViewItem *>::const_iterator it; + TQValueList<EditListViewItem *>::const_iterator it; for (it=_editItems.begin(); it!=_editItems.end(); ++it) if ( (*it)->isRenaming() ) (*it)->renameDone(force); } //---------------------------------------------------------------------------- -void ListViewToolTip::maybeTip(const QPoint &p) +void ListViewToolTip::maybeTip(const TQPoint &p) { if ( _listView==0 ) return; - const QListViewItem* item = _listView->itemAt(p); + const TQListViewItem* item = _listView->itemAt(p); if ( item==0 ) return; - QRect rect = _listView->itemRect(item); + TQRect rect = _listView->tqitemRect(item); if ( !rect.isValid() ) return; int col = _listView->header()->sectionAt(p.x()); - QString text = _listView->tooltip(*item, col); + TQString text = _listView->tooltip(*item, col); if ( !text.isEmpty() ) { int hpos = _listView->header()->sectionPos(col); rect.setLeft(hpos); @@ -128,17 +128,17 @@ EditListViewItem::~EditListViewItem() for (uint i=0; i<_editWidgets.count(); i++) delete _editWidgets[i]; } -void EditListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align) +void EditListViewItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align) { if ( column<int(_editWidgets.count()) && _editWidgets[column] ) - p->fillRect(0, 0, width, height(), cg.color(QColorGroup::Background)); + p->fillRect(0, 0, width, height(), cg.color(TQColorGroup::Background)); else KListViewItem::paintCell(p, cg, column, width, align); } void EditListViewItem::startRename() { if ( !renameEnabled(0) ) return; - QListView *lv = listView(); + TQListView *lv = listView(); if ( !lv ) return; KListViewItem::startRename(0); if (renameBox) { @@ -149,8 +149,8 @@ void EditListViewItem::startRename() _renaming = true; _editWidgets.resize(lv->columns()); for (uint i=0; i<_editWidgets.count(); i++) { - QRect r = lv->itemRect(this); - r = QRect(lv->viewportToContents(r.topLeft()), r.size()); + TQRect r = lv->tqitemRect(this); + r = TQRect(lv->viewportToContents(r.topLeft()), r.size()); r.setLeft(lv->header()->sectionPos(i)); r.setWidth(lv->header()->sectionSize(i) - 1); if ( i==0 ) r.setLeft(r.left() + lv->itemMargin() + (depth() + (lv->rootIsDecorated() ? 1 : 0)) * lv->treeStepSize() - 1); @@ -162,7 +162,7 @@ void EditListViewItem::startRename() if ( _editWidgets[i]==0 ) continue; _editWidgets[i]->installEventFilter(lv); lv->addChild(_editWidgets[i], r.x(), r.y()); - uint w = QMIN(r.width(), _editWidgets[i]->sizeHint().width()); + uint w = TQMIN(r.width(), _editWidgets[i]->tqsizeHint().width()); _editWidgets[i]->resize(w, r.height()); lv->viewport()->setFocusProxy(_editWidgets[i]); _editWidgets[i]->setFocus(); @@ -172,7 +172,7 @@ void EditListViewItem::startRename() void EditListViewItem::removeEditBox() { - QListView *lv = listView(); + TQListView *lv = listView(); if ( !lv ) return; _renaming = false; bool resetFocus = false; @@ -189,17 +189,17 @@ void EditListViewItem::removeEditBox() } } -void EditListViewItem::editDone(int col, const QWidget *edit) +void EditListViewItem::editDone(int col, const TQWidget *edit) { - if ( edit->metaObject()->findProperty("text", true)!=-1 ) + if ( edit->tqmetaObject()->tqfindProperty("text", true)!=-1 ) emit listView()->itemRenamed(this, col, edit->property("text").toString()); - else if ( edit->metaObject()->findProperty("currentText", true)!=-1 ) + else if ( edit->tqmetaObject()->tqfindProperty("currentText", true)!=-1 ) emit listView()->itemRenamed(this, col, edit->property("currentText").toString()); } void EditListViewItem::renameDone(bool force) { - QListView *lv = listView(); + TQListView *lv = listView(); if ( !lv || !_renaming ) return; _renaming = false; for (uint i=0; i<_editWidgets.count(); i++) { @@ -210,12 +210,12 @@ void EditListViewItem::renameDone(bool force) removeEditBox(); } -int EditListViewItem::width(const QFontMetrics &fm, const QListView *lv, int col) const +int EditListViewItem::width(const TQFontMetrics &fm, const TQListView *lv, int col) const { int w = KListViewItem::width(fm, lv, col); - QWidget *edit = editWidgetFactory(col); + TQWidget *edit = editWidgetFactory(col); if ( edit==0 ) return w; - w = QMAX(w, edit->sizeHint().width()); + w = TQMAX(w, edit->tqsizeHint().width()); delete edit; return w; } diff --git a/src/common/gui/list_view.h b/src/common/gui/list_view.h index 09ca984..c76ef46 100644 --- a/src/common/gui/list_view.h +++ b/src/common/gui/list_view.h @@ -9,8 +9,8 @@ #ifndef LIST_VIEW_H #define LIST_VIEW_H -#include <qtooltip.h> -#include <qvaluevector.h> +#include <tqtooltip.h> +#include <tqvaluevector.h> #define private public #define protected public #include <klistview.h> @@ -24,36 +24,37 @@ class ListViewToolTip; class ListView : public KListView { Q_OBJECT + TQ_OBJECT public: - ListView(QWidget *parent = 0, const char *name = 0); + ListView(TQWidget *tqparent = 0, const char *name = 0); virtual ~ListView(); virtual void clear(); void stopRenaming(bool force); - virtual QString tooltip(const QListViewItem &item, int column) const; + virtual TQString tooltip(const TQListViewItem &item, int column) const; public slots: void cancelRenaming() { stopRenaming(false); } void finishRenaming() { stopRenaming(true); } protected: - virtual bool eventFilter(QObject *o, QEvent *e); + virtual bool eventFilter(TQObject *o, TQEvent *e); private: ListViewToolTip *_tooltip; - QValueList<EditListViewItem *> _editItems; + TQValueList<EditListViewItem *> _editItems; friend class EditListViewItem; }; //----------------------------------------------------------------------------- -class ListViewToolTip : public QToolTip +class ListViewToolTip : public TQToolTip { public: - ListViewToolTip(ListView *parent) - : QToolTip(parent->viewport()), _listView(parent) {} + ListViewToolTip(ListView *tqparent) + : TQToolTip(tqparent->viewport()), _listView(tqparent) {} protected: - virtual void maybeTip(const QPoint &p); + virtual void maybeTip(const TQPoint &p); private: ListView *_listView; @@ -70,15 +71,15 @@ public: bool isRenaming() const { return _renaming; } protected: - virtual QWidget *editWidgetFactory(int col) const = 0; + virtual TQWidget *editWidgetFactory(int col) const = 0; virtual bool alwaysAcceptEdit(int col) const = 0; - virtual int width(const QFontMetrics &fm, const QListView *lv, int c) const; - virtual void editDone(int col, const QWidget *editWidget); - virtual void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align); + virtual int width(const TQFontMetrics &fm, const TQListView *lv, int c) const; + virtual void editDone(int col, const TQWidget *editWidget); + virtual void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align); private: bool _renaming; - QValueVector<QWidget *> _editWidgets; + TQValueVector<TQWidget *> _editWidgets; virtual void activate() { startRename(); } virtual void startRename(int) { startRename(); } diff --git a/src/common/gui/misc_gui.cpp b/src/common/gui/misc_gui.cpp index 00f4997..fadf7a9 100644 --- a/src/common/gui/misc_gui.cpp +++ b/src/common/gui/misc_gui.cpp @@ -8,16 +8,16 @@ ***************************************************************************/ #include "misc_gui.h" -#include <qapplication.h> -#include <qpushbutton.h> -#include <qtimer.h> -#include <qwidgetstack.h> -#include <qobjectlist.h> -#include <qpainter.h> -#include <qheader.h> -#include <qmetaobject.h> -#include <qvariant.h> -#include <qpopupmenu.h> +#include <tqapplication.h> +#include <tqpushbutton.h> +#include <tqtimer.h> +#include <tqwidgetstack.h> +#include <tqobjectlist.h> +#include <tqpainter.h> +#include <tqheader.h> +#include <tqmetaobject.h> +#include <tqvariant.h> +#include <tqpopupmenu.h> #include <kcursor.h> #include <kiconloader.h> @@ -31,92 +31,92 @@ #include "common/gui/number_gui.h" //----------------------------------------------------------------------------- -bool BusyCursor::_overridePaused = false; +bool PBusyCursor::_overridePaused = false; -void BusyCursor::start() +void PBusyCursor::start() { - QApplication::setOverrideCursor(KCursor::waitCursor(), true); + TQApplication::setOverrideCursor(KCursor::waitCursor(), true); } -void BusyCursor::stop() +void PBusyCursor::stop() { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } -void BusyCursor::pause() +void PBusyCursor::pause() { - _overridePaused = QApplication::overrideCursor(); + _overridePaused = TQApplication::overrideCursor(); stop(); } -void BusyCursor::restore() +void PBusyCursor::restore() { if (_overridePaused) start(); } //----------------------------------------------------------------------------- -void MessageBox::information(const QString &text, Log::ShowMode show, const QString &dontShowAgainName) +void MessageBox::information(const TQString &text, Log::ShowMode show, const TQString &dontShowAgainName) { if ( show==Log::DontShow ) return; - BusyCursor::pause(); - KMessageBox::information(qApp->mainWidget(), text, QString::null, dontShowAgainName, KMessageBox::Notify | KMessageBox::AllowLink); - BusyCursor::restore(); + PBusyCursor::pause(); + KMessageBox::information(tqApp->mainWidget(), text, TQString(), dontShowAgainName, KMessageBox::Notify | KMessageBox::AllowLink); + PBusyCursor::restore(); } -void MessageBox::detailedSorry(const QString &text, const QString &details, Log::ShowMode show) +void MessageBox::detailedSorry(const TQString &text, const TQString &details, Log::ShowMode show) { if ( show==Log::DontShow ) return; - BusyCursor::pause(); - if ( details.isEmpty() ) KMessageBox::sorry(qApp->mainWidget(), text, QString::null, KMessageBox::Notify | KMessageBox::AllowLink); - else KMessageBox::detailedSorry(qApp->mainWidget(), text, details, QString::null, KMessageBox::Notify | KMessageBox::AllowLink); - BusyCursor::restore(); + PBusyCursor::pause(); + if ( details.isEmpty() ) KMessageBox::sorry(tqApp->mainWidget(), text, TQString(), KMessageBox::Notify | KMessageBox::AllowLink); + else KMessageBox::detailedSorry(tqApp->mainWidget(), text, details, TQString(), KMessageBox::Notify | KMessageBox::AllowLink); + PBusyCursor::restore(); } -bool MessageBox::askContinue(const QString &text, const KGuiItem &buttonContinue, const QString &caption) +bool MessageBox::askContinue(const TQString &text, const KGuiItem &buttonContinue, const TQString &caption) { - ::BusyCursor::pause(); - int res = KMessageBox::warningContinueCancel(qApp->mainWidget(), text, caption, buttonContinue); - ::BusyCursor::restore(); + ::PBusyCursor::pause(); + int res = KMessageBox::warningContinueCancel(tqApp->mainWidget(), text, caption, buttonContinue); + ::PBusyCursor::restore(); return ( res==KMessageBox::Continue ); } -bool MessageBox::questionYesNo(const QString &text, const KGuiItem &yesButton,const KGuiItem &noButton, const QString &caption) +bool MessageBox::questionYesNo(const TQString &text, const KGuiItem &yesButton,const KGuiItem &noButton, const TQString &caption) { - ::BusyCursor::pause(); - int res = KMessageBox::questionYesNo(qApp->mainWidget(), text, caption, yesButton, noButton); - ::BusyCursor::restore(); + ::PBusyCursor::pause(); + int res = KMessageBox::questionYesNo(tqApp->mainWidget(), text, caption, yesButton, noButton); + ::PBusyCursor::restore(); return ( res==KMessageBox::Yes ); } -MessageBox::Result MessageBox::questionYesNoCancel(const QString &text, const KGuiItem &yesButton, const KGuiItem &noButton, - const QString &caption) +MessageBox::Result MessageBox::questionYesNoCancel(const TQString &text, const KGuiItem &yesButton, const KGuiItem &noButton, + const TQString &caption) { - ::BusyCursor::pause(); - int res = KMessageBox::questionYesNoCancel(qApp->mainWidget(), text, caption, yesButton, noButton); - ::BusyCursor::restore(); + ::PBusyCursor::pause(); + int res = KMessageBox::questionYesNoCancel(tqApp->mainWidget(), text, caption, yesButton, noButton); + ::PBusyCursor::restore(); if ( res==KMessageBox::Yes ) return Yes; if ( res==KMessageBox::No ) return No; return Cancel; } -void MessageBox::text(const QString &text, Log::ShowMode show) +void MessageBox::text(const TQString &text, Log::ShowMode show) { if ( show==Log::DontShow ) return; - BusyCursor::pause(); - TextEditorDialog dialog(text, QString::null, false, qApp->mainWidget()); + PBusyCursor::pause(); + TextEditorDialog dialog(text, TQString(), false, tqApp->mainWidget()); dialog.exec(); - BusyCursor::restore(); + PBusyCursor::restore(); } //---------------------------------------------------------------------------- -PopupButton::PopupButton(QWidget *parent, const char *name) - : KPushButton(parent, name) +PopupButton::PopupButton(TQWidget *tqparent, const char *name) + : KPushButton(tqparent, name) { init(); } -PopupButton::PopupButton(const QString &text, QWidget *parent, const char *name) - : KPushButton(text, parent, name) +PopupButton::PopupButton(const TQString &text, TQWidget *tqparent, const char *name) + : KPushButton(text, tqparent, name) { init(); } @@ -125,8 +125,8 @@ void PopupButton::init() { _separator = false; setFlat(true); - QPopupMenu *popup = new QPopupMenu(this); - connect(popup, SIGNAL(activated(int)), SIGNAL(activated(int))); + TQPopupMenu *popup = new TQPopupMenu(this); + connect(popup, TQT_SIGNAL(activated(int)), TQT_SIGNAL(activated(int))); setPopup(popup); } @@ -137,20 +137,20 @@ void PopupButton::appendAction(KAction *action) action->plug(popup()); } -void PopupButton::appendAction(const QString &label, const QString &icon, - QObject *receiver, const char *slot) +void PopupButton::appendAction(const TQString &label, const TQString &icon, + TQObject *receiver, const char *slot) { appendAction(new KAction(label, icon, 0, receiver, slot, (KActionCollection *)0)); } -int PopupButton::appendItem(const QString &label, const QString &icon, int id) +int PopupButton::appendItem(const TQString &label, const TQString &icon, int id) { KIconLoader loader; - QPixmap pixmap = loader.loadIcon(icon, KIcon::Small); + TQPixmap pixmap = loader.loadIcon(icon, KIcon::Small); return appendItem(label, pixmap, id); } -int PopupButton::appendItem(const QString &label, const QPixmap &icon, int id) +int PopupButton::appendItem(const TQString &label, const TQPixmap &icon, int id) { if ( _separator && popup()->count()!=0 ) popup()->insertSeparator(); _separator = false; @@ -158,41 +158,41 @@ int PopupButton::appendItem(const QString &label, const QPixmap &icon, int id) } //----------------------------------------------------------------------------- -Splitter::Splitter(const QValueList<int> &defaultSizes, Orientation o, QWidget *parent, const char *name) - : QSplitter(o, parent, name), _defaultSizes(defaultSizes) +Splitter::Splitter(const TQValueList<int> &defaultSizes, Qt::Orientation o, TQWidget *tqparent, const char *name) + : TQSplitter(o, tqparent, name), _defaultSizes(defaultSizes) { Q_ASSERT(name); setOpaqueResize(true); - QTimer::singleShot(0, this, SLOT(updateSizes())); + TQTimer::singleShot(0, this, TQT_SLOT(updateSizes())); } Splitter::~Splitter() { GuiConfig gc; - gc.writeEntry(QString(name()) + "_sizes", sizes()); + gc.writeEntry(TQString(name()) + "_sizes", sizes()); } void Splitter::updateSizes() { GuiConfig gc; - QValueList<int> sizes = gc.readIntListEntry(QString(name()) + "_sizes"); + TQValueList<int> sizes = gc.readIntListEntry(TQString(name()) + "_sizes"); for (uint i=sizes.count(); i<_defaultSizes.count(); i++) sizes.append(_defaultSizes[i]); setSizes(sizes); } //----------------------------------------------------------------------------- -TabBar::TabBar(QWidget *parent, const char *name) - : KTabBar(parent, name), _ignoreWheelEvent(false) +TabBar::TabBar(TQWidget *tqparent, const char *name) + : KTabBar(tqparent, name), _ignoreWheelEvent(false) {} -void TabBar::wheelEvent(QWheelEvent *e) +void TabBar::wheelEvent(TQWheelEvent *e) { - if (_ignoreWheelEvent) QApplication::sendEvent(parent(), e); // #### not sure why ignoring is not enough... + if (_ignoreWheelEvent) TQApplication::sendEvent(tqparent(), e); // #### not sure why ignoring is not enough... else KTabBar::wheelEvent(e); } -TabWidget::TabWidget(QWidget *parent, const char *name) - : KTabWidget(parent, name) +TabWidget::TabWidget(TQWidget *tqparent, const char *name) + : KTabWidget(tqparent, name) { setTabBar(new TabBar(this)); } @@ -202,7 +202,7 @@ void TabWidget::setIgnoreWheelEvent(bool ignore) static_cast<TabBar *>(tabBar())->_ignoreWheelEvent = ignore; } -void TabWidget::wheelEvent(QWheelEvent *e) +void TabWidget::wheelEvent(TQWheelEvent *e) { if (static_cast<TabBar *>(tabBar())->_ignoreWheelEvent) e->ignore(); else KTabWidget::wheelEvent(e); @@ -211,24 +211,24 @@ void TabWidget::wheelEvent(QWheelEvent *e) void TabWidget::setTabBar(TabBar *tabbar) { KTabWidget::setTabBar(tabbar); - connect(tabBar(), SIGNAL(contextMenu( int, const QPoint & )), SLOT(contextMenu( int, const QPoint & ))); - connect(tabBar(), SIGNAL(mouseDoubleClick( int )), SLOT(mouseDoubleClick( int ))); - connect(tabBar(), SIGNAL(mouseMiddleClick( int )), SLOT(mouseMiddleClick( int ))); - connect(tabBar(), SIGNAL(initiateDrag( int )), SLOT(initiateDrag( int ))); - connect(tabBar(), SIGNAL(testCanDecode(const QDragMoveEvent *, bool & )), SIGNAL(testCanDecode(const QDragMoveEvent *, bool & ))); - connect(tabBar(), SIGNAL(receivedDropEvent( int, QDropEvent * )), SLOT(receivedDropEvent( int, QDropEvent * ))); - connect(tabBar(), SIGNAL(moveTab( int, int )), SLOT(moveTab( int, int ))); - connect(tabBar(), SIGNAL(closeRequest( int )), SLOT(closeRequest( int ))); - connect(tabBar(), SIGNAL(wheelDelta( int )), SLOT(wheelDelta( int ))); + connect(tabBar(), TQT_SIGNAL(contextMenu( int, const TQPoint & )), TQT_SLOT(contextMenu( int, const TQPoint & ))); + connect(tabBar(), TQT_SIGNAL(mouseDoubleClick( int )), TQT_SLOT(mouseDoubleClick( int ))); + connect(tabBar(), TQT_SIGNAL(mouseMiddleClick( int )), TQT_SLOT(mouseMiddleClick( int ))); + connect(tabBar(), TQT_SIGNAL(initiateDrag( int )), TQT_SLOT(initiateDrag( int ))); + connect(tabBar(), TQT_SIGNAL(testCanDecode(const TQDragMoveEvent *, bool & )), TQT_SIGNAL(testCanDecode(const TQDragMoveEvent *, bool & ))); + connect(tabBar(), TQT_SIGNAL(receivedDropEvent( int, TQDropEvent * )), TQT_SLOT(receivedDropEvent( int, TQDropEvent * ))); + connect(tabBar(), TQT_SIGNAL(moveTab( int, int )), TQT_SLOT(moveTab( int, int ))); + connect(tabBar(), TQT_SIGNAL(closeRequest( int )), TQT_SLOT(closeRequest( int ))); + connect(tabBar(), TQT_SIGNAL(wheelDelta( int )), TQT_SLOT(wheelDelta( int ))); } //----------------------------------------------------------------------------- -ComboBox::ComboBox(QWidget *parent, const char *name) - : QComboBox(parent, name), _ignoreWheelEvent(false) +ComboBox::ComboBox(TQWidget *tqparent, const char *name) + : TQComboBox(tqparent, name), _ignoreWheelEvent(false) {} -void ComboBox::wheelEvent(QWheelEvent *e) +void ComboBox::wheelEvent(TQWheelEvent *e) { - if (_ignoreWheelEvent) QApplication::sendEvent(parent(), e); // #### not sure why ignoring is not enough... - else QComboBox::wheelEvent(e); + if (_ignoreWheelEvent) TQApplication::sendEvent(tqparent(), e); // #### not sure why ignoring is not enough... + else TQComboBox::wheelEvent(e); } diff --git a/src/common/gui/misc_gui.h b/src/common/gui/misc_gui.h index 2d58569..7003f91 100644 --- a/src/common/gui/misc_gui.h +++ b/src/common/gui/misc_gui.h @@ -9,12 +9,12 @@ #ifndef MISC_GUI_H #define MISC_GUI_H -#include <qlayout.h> -#include <qsplitter.h> -#include <qvaluevector.h> -#include <qvalidator.h> -#include <qcombobox.h> -#include <qwidgetstack.h> +#include <tqlayout.h> +#include <tqsplitter.h> +#include <tqvaluevector.h> +#include <tqvalidator.h> +#include <tqcombobox.h> +#include <tqwidgetstack.h> #include <klocale.h> #include <kpushbutton.h> @@ -29,11 +29,11 @@ class KAction; #include "common/common/number.h" //----------------------------------------------------------------------------- -class BusyCursor +class PBusyCursor { public: - BusyCursor() { start(); } - ~BusyCursor() { stop(); } + PBusyCursor() { start(); } + ~PBusyCursor() { stop(); } static void start(); static void stop(); static void pause(); @@ -46,32 +46,33 @@ private: //----------------------------------------------------------------------------- namespace MessageBox { -extern void information(const QString &text, Log::ShowMode show, const QString &dontShowAgainName = QString::null); -extern void detailedSorry(const QString &text, const QString &details, Log::ShowMode show); -inline void sorry(const QString &text, Log::ShowMode show) { detailedSorry(text, QString::null, show); } -extern bool askContinue(const QString &text, const KGuiItem &continueButton = KStdGuiItem::cont(), - const QString &caption = i18n("Warning")); -extern bool questionYesNo(const QString &text, const KGuiItem &yesButton, const KGuiItem &noButton, - const QString &caption = i18n("Warning")); +extern void information(const TQString &text, Log::ShowMode show, const TQString &dontShowAgainName = TQString()); +extern void detailedSorry(const TQString &text, const TQString &details, Log::ShowMode show); +inline void sorry(const TQString &text, Log::ShowMode show) { detailedSorry(text, TQString(), show); } +extern bool askContinue(const TQString &text, const KGuiItem &continueButton = KStdGuiItem::cont(), + const TQString &caption = i18n("Warning")); +extern bool questionYesNo(const TQString &text, const KGuiItem &yesButton, const KGuiItem &noButton, + const TQString &caption = i18n("Warning")); enum Result { Yes, No, Cancel }; -extern Result questionYesNoCancel(const QString &text, const KGuiItem &yesButton, const KGuiItem &noButton, - const QString &caption = i18n("Warning")); -extern void text(const QString &text, Log::ShowMode show); +extern Result questionYesNoCancel(const TQString &text, const KGuiItem &yesButton, const KGuiItem &noButton, + const TQString &caption = i18n("Warning")); +extern void text(const TQString &text, Log::ShowMode show); } //---------------------------------------------------------------------------- class PopupButton : public KPushButton { Q_OBJECT + TQ_OBJECT public: - PopupButton(QWidget *parent = 0, const char *name = 0); - PopupButton(const QString &text, QWidget *parent = 0, const char *name = 0); + PopupButton(TQWidget *tqparent = 0, const char *name = 0); + PopupButton(const TQString &text, TQWidget *tqparent = 0, const char *name = 0); void appendAction(KAction *action); - void appendAction(const QString &label, const QString &icon = QString::null, - QObject *receiver = 0, const char *slot = 0); - int appendItem(const QString &label, uint id) { return appendItem(label, QPixmap(), id); } - int appendItem(const QString &label, const QString &icon, int id = -1); - int appendItem(const QString &label, const QPixmap &icon, int id = -1); + void appendAction(const TQString &label, const TQString &icon = TQString(), + TQObject *receiver = 0, const char *slot = 0); + int appendItem(const TQString &label, uint id) { return appendItem(label, TQPixmap(), id); } + int appendItem(const TQString &label, const TQString &icon, int id = -1); + int appendItem(const TQString &label, const TQPixmap &icon, int id = -1); void appendSeparator() { _separator = true; } signals: @@ -84,19 +85,20 @@ private: }; //----------------------------------------------------------------------------- -class Splitter : public QSplitter +class Splitter : public TQSplitter { Q_OBJECT + TQ_OBJECT public: - Splitter(const QValueList<int> &defaultSizes, Orientation orientation, - QWidget *parent, const char *name); + Splitter(const TQValueList<int> &defaultSizes, Qt::Orientation orientation, + TQWidget *tqparent, const char *name); virtual ~Splitter(); private slots: void updateSizes(); private: - QValueList<int> _defaultSizes; + TQValueList<int> _defaultSizes; }; //----------------------------------------------------------------------------- @@ -107,12 +109,13 @@ public: }; //----------------------------------------------------------------------------- -class SeparatorWidget : public QFrame +class SeparatorWidget : public TQFrame { Q_OBJECT + TQ_OBJECT public: - SeparatorWidget(QWidget *parent) : QFrame(parent, "separator") { - setFrameStyle(QFrame::Panel | QFrame::Sunken); + SeparatorWidget(TQWidget *tqparent) : TQFrame(tqparent, "separator") { + setFrameStyle(TQFrame::Panel | TQFrame::Sunken); setMargin(2); setFixedHeight(2*2); } @@ -122,11 +125,12 @@ public: class TabBar : public KTabBar { Q_OBJECT + TQ_OBJECT public: - TabBar(QWidget *parent = 0, const char *name = 0); + TabBar(TQWidget *tqparent = 0, const char *name = 0); protected: - virtual void wheelEvent(QWheelEvent *e); + virtual void wheelEvent(TQWheelEvent *e); private: bool _ignoreWheelEvent; @@ -137,25 +141,27 @@ private: class TabWidget : public KTabWidget { Q_OBJECT + TQ_OBJECT public: - TabWidget(QWidget *parent = 0, const char *name = 0); + TabWidget(TQWidget *tqparent = 0, const char *name = 0); void setIgnoreWheelEvent(bool ignore); protected: - virtual void wheelEvent(QWheelEvent *e); + virtual void wheelEvent(TQWheelEvent *e); void setTabBar(TabBar *tabbar); }; //----------------------------------------------------------------------------- -class ComboBox : public QComboBox +class ComboBox : public TQComboBox { Q_OBJECT + TQ_OBJECT public: - ComboBox(QWidget *parent = 0, const char *name = 0); + ComboBox(TQWidget *tqparent = 0, const char *name = 0); void setIgnoreWheelEvent(bool ignore) { _ignoreWheelEvent = ignore; } protected: - virtual void wheelEvent(QWheelEvent *e); + virtual void wheelEvent(TQWheelEvent *e); private: bool _ignoreWheelEvent; diff --git a/src/common/gui/number_gui.cpp b/src/common/gui/number_gui.cpp index d855407..1a84a36 100644 --- a/src/common/gui/number_gui.cpp +++ b/src/common/gui/number_gui.cpp @@ -8,65 +8,65 @@ ***************************************************************************/ #include "number_gui.h" -#include <qfontmetrics.h> +#include <tqfontmetrics.h> //----------------------------------------------------------------------------- -uint maxCharWidth(const QString &s, const QFont &font) +uint maxCharWidth(const TQString &s, const TQFont &font) { - QFontMetrics fm(font); + TQFontMetrics fm(font); uint w = 0; for (uint i=0; i<uint(s.length()); i++) - w = QMAX(w, uint(fm.width(s[i]))); + w = TQMAX(w, uint(fm.width(s[i]))); return w; } -uint maxCharWidth(NumberBase base, const QFont &font) +uint maxCharWidth(NumberBase base, const TQFont &font) { - QString s; + TQString s; for (uint i=0; i<base.data().base; i++) s += toChar(base, i); return maxCharWidth(s, font); } -uint maxLabelWidth(NumberBase base, uint nbChars, const QFont &font) +uint maxLabelWidth(NumberBase base, uint nbChars, const TQFont &font) { uint w = maxStringWidth(base, nbChars, font); - QFontMetrics fm(font); + TQFontMetrics fm(font); if ( base==NumberBase::String ) return w + 2 * fm.width("\""); return w + fm.width(base.data().prefix); } //----------------------------------------------------------------------------- -NumberLineEdit::NumberLineEdit(QWidget *parent, const char *name) - : KLineEdit(parent, name) +NumberLineEdit::NumberLineEdit(TQWidget *tqparent, const char *name) + : KLineEdit(tqparent, name) { - connect(this, SIGNAL(textChanged(const QString &)), SLOT(textChangedSlot())); + connect(this, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(textChangedSlot())); } -NumberLineEdit::NumberLineEdit(const QString &text, QWidget *parent, const char *name) - : KLineEdit(text, parent, name) +NumberLineEdit::NumberLineEdit(const TQString &text, TQWidget *tqparent, const char *name) + : KLineEdit(text, tqparent, name) { - connect(this, SIGNAL(textChanged(const QString &)), SLOT(textChangedSlot())); + connect(this, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(textChangedSlot())); } -QValidator::State validateNumber(const QString &input) +TQValidator::State validateNumber(const TQString &input) { - if ( input.isEmpty() ) return QValidator::Intermediate; + if ( input.isEmpty() ) return TQValidator::Intermediate; bool ok; (void)fromAnyLabel(input, &ok); - if (ok) return QValidator::Acceptable; + if (ok) return TQValidator::Acceptable; FOR_EACH(NumberBase, base) - if ( input==base.data().prefix ) return QValidator::Intermediate; - if ( input[0]=='\"' ) return QValidator::Intermediate; - if ( input[0]=='\'' ) return QValidator::Intermediate; - return QValidator::Invalid; + if ( input==base.data().prefix ) return TQValidator::Intermediate; + if ( input[0]=='\"' ) return TQValidator::Intermediate; + if ( input[0]=='\'' ) return TQValidator::Intermediate; + return TQValidator::Invalid; } void NumberLineEdit::textChangedSlot() { - QValidator::State state = validateNumber(text()); + TQValidator::State state = validateNumber(text()); switch (state) { - case QValidator::Acceptable: unsetColor(); break; - case QValidator::Intermediate: setColor(QColor("#FF9900")); break; - case QValidator::Invalid: setColor(red); break; + case TQValidator::Acceptable: unsetColor(); break; + case TQValidator::Intermediate: setColor(TQColor("#FF9900")); break; + case TQValidator::Invalid: setColor(red); break; } } diff --git a/src/common/gui/number_gui.h b/src/common/gui/number_gui.h index f910820..2b23d2b 100644 --- a/src/common/gui/number_gui.h +++ b/src/common/gui/number_gui.h @@ -9,28 +9,29 @@ #ifndef NUMBER_GUI_H #define NUMBER_GUI_H -#include <qvalidator.h> +#include <tqvalidator.h> #include <klineedit.h> #include "common/common/number.h" //----------------------------------------------------------------------------- -extern uint maxCharWidth(const QString &s, const QFont &font); -extern uint maxCharWidth(NumberBase base, const QFont &font); -inline uint maxStringWidth(NumberBase base, uint nbChars, const QFont &font) { return nbChars * maxCharWidth(base, font); } -extern uint maxLabelWidth(NumberBase base, uint nbChars, const QFont &font); +extern uint maxCharWidth(const TQString &s, const TQFont &font); +extern uint maxCharWidth(NumberBase base, const TQFont &font); +inline uint maxStringWidth(NumberBase base, uint nbChars, const TQFont &font) { return nbChars * maxCharWidth(base, font); } +extern uint maxLabelWidth(NumberBase base, uint nbChars, const TQFont &font); -extern QValidator::State validateNumber(const QString &s); +extern TQValidator::State validateNumber(const TQString &s); //----------------------------------------------------------------------------- class NumberLineEdit : public KLineEdit { Q_OBJECT + TQ_OBJECT public: - NumberLineEdit(QWidget *parent = 0, const char *name = 0); - NumberLineEdit(const QString &text, QWidget *parent = 0, const char *name = 0); + NumberLineEdit(TQWidget *tqparent = 0, const char *name = 0); + NumberLineEdit(const TQString &text, TQWidget *tqparent = 0, const char *name = 0); uint value(bool *ok = 0) const { return fromAnyLabel(text(), ok); } - void setColor(const QColor &color) { setPaletteForegroundColor(color); } + void setColor(const TQColor &color) { setPaletteForegroundColor(color); } void unsetColor() { unsetPalette(); } private slots: diff --git a/src/common/gui/pfile_ext.cpp b/src/common/gui/pfile_ext.cpp index d42de16..43f9e81 100644 --- a/src/common/gui/pfile_ext.cpp +++ b/src/common/gui/pfile_ext.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ #include "pfile_ext.h" -#include <qfile.h> +#include <tqfile.h> #include <kio/netaccess.h> #include <ktempfile.h> #include "common/gui/misc_gui.h" @@ -18,11 +18,11 @@ bool PURL::File::openForWrite() { close(); if (_tmp) delete _tmp; - _tmp = new KTempFile(QString::null, _extension); + _tmp = new KTempFile(TQString(), _extension); _tmp->setAutoDelete(true); if ( _tmp->status()!=0 ) { _error = i18n("Could not create temporary file."); - _log.sorry(_error, i18n("File: %1").arg(_tmp->name())); + _log.sorry(_error, i18n("File: %1").tqarg(_tmp->name())); return false; } return true; @@ -35,11 +35,11 @@ bool PURL::File::close() bool ok = (_tmp ? _tmp->status() : _file->status())==IO_Ok; if ( !_file->name().isEmpty() ) { KIO::NetAccess::removeTempFile(_file->name()); - _file->setName(QString::null); + _file->setName(TQString()); } delete _stream; _stream = 0; - if ( ok && _tmp && !_url.isEmpty() && !KIO::NetAccess::upload(_tmp->name(), _url.kurl(), qApp->mainWidget()) ) { + if ( ok && _tmp && !_url.isEmpty() && !KIO::NetAccess::upload(_tmp->name(), _url.kurl(), tqApp->mainWidget()) ) { _error = KIO::NetAccess::lastErrorString(); ok = false; _log.sorry(i18n("Could not save file."), errorString()); @@ -52,8 +52,8 @@ bool PURL::File::close() bool PURL::File::openForRead() { close(); - QString tmp; - if ( !KIO::NetAccess::download(_url.kurl(), tmp, qApp->mainWidget()) ) { + TQString tmp; + if ( !KIO::NetAccess::download(_url.kurl(), tmp, tqApp->mainWidget()) ) { _error = KIO::NetAccess::lastErrorString(); _log.sorry(i18n("Could not open file for reading."), errorString()); return false; @@ -61,7 +61,7 @@ bool PURL::File::openForRead() _file->setName(tmp); if ( !_file->open(IO_ReadOnly) ) { _error = i18n("Could not open temporary file."); - _log.sorry(_error, i18n("File: %1").arg(_file->name())); + _log.sorry(_error, i18n("File: %1").tqarg(_file->name())); return false; } return true; @@ -75,7 +75,7 @@ bool PURL::File::remove() } //----------------------------------------------------------------------------- -PURL::TempFile::TempFile(Log::Generic &log, const QString &extension) +PURL::TempFile::TempFile(Log::Generic &log, const TQString &extension) : FileBase(log, extension) {} @@ -92,7 +92,7 @@ bool PURL::TempFile::close() _tmp->close(); if ( _tmp->status()!=IO_Ok ) { _error = i18n("Could not write to temporary file."); - _log.sorry(_error, i18n("File: %1").arg(_tmp->name())); + _log.sorry(_error, i18n("File: %1").tqarg(_tmp->name())); return false; } } @@ -103,11 +103,11 @@ bool PURL::TempFile::openForWrite() { close(); if (_tmp) delete _tmp; - _tmp = new KTempFile(QString::null, _extension); + _tmp = new KTempFile(TQString(), _extension); _tmp->setAutoDelete(true); if ( _tmp->status()!=0 ) { _error = i18n("Could not create temporary file."); - _log.sorry(_error, i18n("File: %1").arg(_tmp->name())); + _log.sorry(_error, i18n("File: %1").tqarg(_tmp->name())); return false; } return true; diff --git a/src/common/gui/pfile_ext.h b/src/common/gui/pfile_ext.h index 14c007a..0158ee4 100644 --- a/src/common/gui/pfile_ext.h +++ b/src/common/gui/pfile_ext.h @@ -17,7 +17,7 @@ namespace PURL class TempFile : public FileBase { public: - TempFile(Log::Generic &log, const QString &extension = QString::null); + TempFile(Log::Generic &log, const TQString &extension = TQString()); ~TempFile() { close(); } Url url() const; bool close(); diff --git a/src/common/gui/purl_ext.cpp b/src/common/gui/purl_ext.cpp index 5d69d05..df657a7 100644 --- a/src/common/gui/purl_ext.cpp +++ b/src/common/gui/purl_ext.cpp @@ -8,8 +8,8 @@ ***************************************************************************/ #include "common/global/purl.h" -#include <qfile.h> -#include <qapplication.h> +#include <tqfile.h> +#include <tqapplication.h> #include <kio/netaccess.h> #include <kfileitem.h> #include <ktempfile.h> @@ -27,7 +27,7 @@ bool PURL::Url::copyTo(const Url &destination, Log::Generic &log) const // } //#else // do not overwrite - bool ok = KIO::NetAccess::file_copy(_url, destination._url, -1, false, false, qApp->mainWidget()); + bool ok = KIO::NetAccess::file_copy(_url, destination._url, -1, false, false, tqApp->mainWidget()); if ( !ok ) log.sorry(i18n("Could not copy file"), KIO::NetAccess::lastErrorString()); return ok; //#endif @@ -36,7 +36,7 @@ bool PURL::Url::copyTo(const Url &destination, Log::Generic &log) const bool PURL::Url::create(Log::Generic &log) const { //#if defined(NO_KDE) -// QByteArray a; +// TQByteArray a; // Synchronous sync; // if ( sync.op().put(a, _url.filepath()) && sync.execute() ) { // if ( show==Log::Show ) ConsoleView::sorry(i18n("Could not create file"), sync.error()); @@ -44,17 +44,17 @@ bool PURL::Url::create(Log::Generic &log) const // } //#else // assume file do no exist if ioslave cannot tell... - if ( KIO::NetAccess::exists(_url, false, qApp->mainWidget()) ) return true; + if ( KIO::NetAccess::exists(_url, false, tqApp->mainWidget()) ) return true; KTempFile tmp; tmp.setAutoDelete(true); // do not overwrite - bool ok = KIO::NetAccess::file_copy(tmp.name(), _url, -1, false, false, qApp->mainWidget()); + bool ok = KIO::NetAccess::file_copy(tmp.name(), _url, -1, false, false, tqApp->mainWidget()); if ( !ok ) log.sorry(i18n("Could not create file"), KIO::NetAccess::lastErrorString()); //#endif return ok; } -bool PURL::Url::write(const QString &text, Log::Generic &log) const +bool PURL::Url::write(const TQString &text, Log::Generic &log) const { File file(*this, log); if ( !file.openForWrite() ) return false; @@ -71,7 +71,7 @@ bool PURL::Url::del(Log::Generic &log) const // return false; // } //#else - bool ok = KIO::NetAccess::del(_url, qApp->mainWidget()); + bool ok = KIO::NetAccess::del(_url, tqApp->mainWidget()); if ( !ok ) log.sorry(i18n("Could not delete file."), KIO::NetAccess::lastErrorString()); return ok; //#endif @@ -103,8 +103,8 @@ bool PURL::Directory::create(Log::Generic &log) const // } //#else // assume dir do no exist if ioslave cannot tell... - if ( KIO::NetAccess::exists(_url, false, qApp->mainWidget()) ) return true; - bool ok = KIO::NetAccess::mkdir(_url, qApp->mainWidget()); + if ( KIO::NetAccess::exists(_url, false, tqApp->mainWidget()) ) return true; + bool ok = KIO::NetAccess::mkdir(_url, tqApp->mainWidget()); if ( !ok ) log.sorry(i18n("Could not create directory"), KIO::NetAccess::lastErrorString()); //#endif return ok; diff --git a/src/common/gui/purl_gui.cpp b/src/common/gui/purl_gui.cpp index d81fdb6..f93e11c 100644 --- a/src/common/gui/purl_gui.cpp +++ b/src/common/gui/purl_gui.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ #include "purl_gui.h" -#include <qlayout.h> +#include <tqlayout.h> #include <kiconloader.h> #include <kpushbutton.h> #include <krun.h> @@ -18,20 +18,20 @@ #include "misc_gui.h" //----------------------------------------------------------------------------- -PURL::Url PURL::getOpenUrl(const QString &startDir, const QString &filter, - QWidget *widget, const QString &caption) +PURL::Url PURL::getOpenUrl(const TQString &startDir, const TQString &filter, + TQWidget *widget, const TQString &caption) { return KFileDialog::getOpenURL(startDir, filter, widget, caption); } -PURL::UrlList PURL::getOpenUrls(const QString &startDir, const QString &filter, - QWidget *widget, const QString &caption) +PURL::UrlList PURL::getOpenUrls(const TQString &startDir, const TQString &filter, + TQWidget *widget, const TQString &caption) { return KFileDialog::getOpenURLs(startDir, filter, widget, caption); } -PURL::Url PURL::getSaveUrl(const QString &startDir, const QString &filter, - QWidget *widget, const QString &caption, +PURL::Url PURL::getSaveUrl(const TQString &startDir, const TQString &filter, + TQWidget *widget, const TQString &caption, SaveAction action) { Url url = KFileDialog::getSaveURL(startDir, filter, widget, caption); @@ -40,7 +40,7 @@ PURL::Url PURL::getSaveUrl(const QString &startDir, const QString &filter, case NoSaveAction: break; case AskOverwrite: if ( url.exists() ) { - if ( !MessageBox::askContinue(i18n("File \"%1\" already exists. Overwrite ?").arg(url.pretty())) ) return Url(); + if ( !MessageBox::askContinue(i18n("File \"%1\" already exists. Overwrite ?").tqarg(url.pretty())) ) return Url(); } break; case CancelIfExists: @@ -50,19 +50,19 @@ PURL::Url PURL::getSaveUrl(const QString &startDir, const QString &filter, return url; } -PURL::Directory PURL::getExistingDirectory(const QString &startDir, QWidget *widget, - const QString &caption) +PURL::Directory PURL::getExistingDirectory(const TQString &startDir, TQWidget *widget, + const TQString &caption) { KURL kurl = KDirSelectDialog::selectDirectory(startDir, false, widget, caption); if ( kurl.isEmpty() ) return Directory(); return Directory(kurl.path(1)); } -QPixmap PURL::icon(FileType type) +TQPixmap PURL::icon(FileType type) { - if (type.data().xpm_icon) return QPixmap(type.data().xpm_icon); + if (type.data().xpm_icon) return TQPixmap(type.data().xpm_icon); if ( hasMimetype(type) ) return KMimeType::mimeType(type.data().mimetype)->pixmap(KIcon::Small); - return QPixmap(); + return TQPixmap(); } bool PURL::hasMimetype(FileType type) @@ -73,11 +73,11 @@ bool PURL::hasMimetype(FileType type) } //----------------------------------------------------------------------------- -PURL::Label::Label(const QString &url, const QString &text, - QWidget *parent, const char *name) - : KURLLabel(url, text, parent, name) +PURL::Label::Label(const TQString &url, const TQString &text, + TQWidget *tqparent, const char *name) + : KURLLabel(url, text, tqparent, name) { - connect(this, SIGNAL(leftClickedURL()), SLOT(urlClickedSlot())); + connect(this, TQT_SIGNAL(leftClickedURL()), TQT_SLOT(urlClickedSlot())); } void PURL::Label::urlClickedSlot() @@ -86,29 +86,29 @@ void PURL::Label::urlClickedSlot() } //----------------------------------------------------------------------------- -PURL::BaseWidget::BaseWidget(QWidget *parent, const char *name) - : QWidget(parent, name) +PURL::BaseWidget::BaseWidget(TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name) { init(); } -PURL::BaseWidget::BaseWidget(const QString &defaultDir, QWidget *parent, const char *name) - : QWidget(parent, name), _defaultDir(defaultDir) +PURL::BaseWidget::BaseWidget(const TQString &defaultDir, TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name), _defaultDir(defaultDir) { init(); } void PURL::BaseWidget::init() { - QHBoxLayout *top = new QHBoxLayout(this, 0, 10); + TQHBoxLayout *top = new TQHBoxLayout(this, 0, 10); _edit = new KLineEdit(this); - connect(_edit, SIGNAL(textChanged(const QString &)), SIGNAL(changed())); + connect(_edit, TQT_SIGNAL(textChanged(const TQString &)), TQT_SIGNAL(changed())); top->addWidget(_edit); KIconLoader loader; - QIconSet iconset = loader.loadIcon("fileopen", KIcon::Toolbar); - QPushButton *button = new KPushButton(iconset, QString::null, this); - connect(button, SIGNAL(clicked()), SLOT(buttonClicked())); + TQIconSet iconset = loader.loadIcon("fileopen", KIcon::Toolbar); + TQPushButton *button = new KPushButton(iconset, TQString(), this); + connect(button, TQT_SIGNAL(clicked()), TQT_SLOT(buttonClicked())); top->addWidget(button); } @@ -122,23 +122,23 @@ void PURL::DirectoryWidget::buttonClicked() } //---------------------------------------------------------------------------- -PURL::DirectoriesWidget::DirectoriesWidget(const QString &title, QWidget *parent, const char *name) - : QVGroupBox(title, parent, name) +PURL::DirectoriesWidget::DirectoriesWidget(const TQString &title, TQWidget *tqparent, const char *name) + : TQVGroupBox(title, tqparent, name) { - init(QString::null); + init(TQString()); } -PURL::DirectoriesWidget::DirectoriesWidget(const QString &title, const QString &defaultDir, QWidget *parent, const char *name) - : QVGroupBox(title, parent, name) +PURL::DirectoriesWidget::DirectoriesWidget(const TQString &title, const TQString &defaultDir, TQWidget *tqparent, const char *name) + : TQVGroupBox(title, tqparent, name) { init(defaultDir); } -void PURL::DirectoriesWidget::init(const QString &defaultDir) +void PURL::DirectoriesWidget::init(const TQString &defaultDir) { DirectoryWidget *edit = new DirectoryWidget(defaultDir); _editListBox = new EditListBox(1, edit, edit->lineEdit(), this, "directories_editlistbox"); - connect(_editListBox, SIGNAL(changed()), SIGNAL(changed())); + connect(_editListBox, TQT_SIGNAL(changed()), TQT_SIGNAL(changed())); } //---------------------------------------------------------------------------- diff --git a/src/common/gui/purl_gui.h b/src/common/gui/purl_gui.h index a11bedf..d554636 100644 --- a/src/common/gui/purl_gui.h +++ b/src/common/gui/purl_gui.h @@ -9,7 +9,7 @@ #ifndef PURL_GUI_H #define PURL_GUI_H -#include <qvgroupbox.h> +#include <tqvgroupbox.h> #include <klineedit.h> #include <klocale.h> #include <kurllabel.h> @@ -21,34 +21,36 @@ namespace PURL { //----------------------------------------------------------------------------- extern bool hasMimetype(FileType type); -extern QPixmap icon(FileType type); -extern Directory getExistingDirectory(const QString &startDir, QWidget *widget, const QString &caption); -extern Url getOpenUrl(const QString &startDir, const QString &filter, QWidget *widget, - const QString &caption); -extern UrlList getOpenUrls(const QString &startDir, const QString &filter, QWidget *widget, - const QString &caption); +extern TQPixmap icon(FileType type); +extern Directory getExistingDirectory(const TQString &startDir, TQWidget *widget, const TQString &caption); +extern Url getOpenUrl(const TQString &startDir, const TQString &filter, TQWidget *widget, + const TQString &caption); +extern UrlList getOpenUrls(const TQString &startDir, const TQString &filter, TQWidget *widget, + const TQString &caption); enum SaveAction { NoSaveAction, AskOverwrite, CancelIfExists }; -extern Url getSaveUrl(const QString &startDir, const QString &filter, QWidget *widget, - const QString &caption, SaveAction action); +extern Url getSaveUrl(const TQString &startDir, const TQString &filter, TQWidget *widget, + const TQString &caption, SaveAction action); //----------------------------------------------------------------------------- class Label : public KURLLabel { Q_OBJECT + TQ_OBJECT public: - Label(const QString &url, const QString &text, QWidget *parent = 0, const char *name = 0); + Label(const TQString &url, const TQString &text, TQWidget *tqparent = 0, const char *name = 0); private slots: void urlClickedSlot(); }; //----------------------------------------------------------------------------- -class BaseWidget : public QWidget +class BaseWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - BaseWidget(QWidget *parent = 0, const char *name = 0); - BaseWidget(const QString &defaultDir, QWidget *parent = 0, const char *name = 0); + BaseWidget(TQWidget *tqparent = 0, const char *name = 0); + BaseWidget(const TQString &defaultDir, TQWidget *tqparent = 0, const char *name = 0); KLineEdit *lineEdit() { return _edit; } signals: @@ -58,7 +60,7 @@ protected slots: virtual void buttonClicked() = 0; protected: - QString _defaultDir; + TQString _defaultDir; KLineEdit *_edit; void init(); @@ -68,9 +70,10 @@ protected: class DirectoryWidget : public BaseWidget { Q_OBJECT + TQ_OBJECT public: - DirectoryWidget(QWidget *parent = 0, const char *name = 0) : BaseWidget(parent, name) {} - DirectoryWidget(const QString &defaultDir, QWidget *parent = 0, const char *name = 0) : BaseWidget(defaultDir, parent, name) {} + DirectoryWidget(TQWidget *tqparent = 0, const char *name = 0) : BaseWidget(tqparent, name) {} + DirectoryWidget(const TQString &defaultDir, TQWidget *tqparent = 0, const char *name = 0) : BaseWidget(defaultDir, tqparent, name) {} void setDirectory(const Directory &dir) { _edit->setText(dir.path()); } Directory directory() const { return _edit->text(); } @@ -79,32 +82,34 @@ protected slots: }; //----------------------------------------------------------------------------- -class DirectoriesWidget : public QVGroupBox +class DirectoriesWidget : public TQVGroupBox { Q_OBJECT + TQ_OBJECT public: - DirectoriesWidget(const QString &title, QWidget *parent = 0, const char *name = 0); - DirectoriesWidget(const QString &title, const QString &defaultDir, QWidget *parent = 0, const char *name = 0); - void setDirectories(const QStringList &dirs) { _editListBox->setTexts(dirs); } - QStringList directories() const { return _editListBox->texts(); } + DirectoriesWidget(const TQString &title, TQWidget *tqparent = 0, const char *name = 0); + DirectoriesWidget(const TQString &title, const TQString &defaultDir, TQWidget *tqparent = 0, const char *name = 0); + void setDirectories(const TQStringList &dirs) { _editListBox->setTexts(dirs); } + TQStringList directories() const { return _editListBox->texts(); } signals: void changed(); private: EditListBox *_editListBox; - void init(const QString &defaultDir); + void init(const TQString &defaultDir); }; //----------------------------------------------------------------------------- class UrlWidget : public BaseWidget { Q_OBJECT + TQ_OBJECT public: - UrlWidget(const QString &filter, QWidget *parent = 0, const char *name = 0) - : BaseWidget(parent, name), _filter(filter) {} - UrlWidget(const QString &defaultDir, const QString &filter, QWidget *parent = 0, const char *name = 0) - : BaseWidget(defaultDir, parent, name), _filter(filter) {} + UrlWidget(const TQString &filter, TQWidget *tqparent = 0, const char *name = 0) + : BaseWidget(tqparent, name), _filter(filter) {} + UrlWidget(const TQString &defaultDir, const TQString &filter, TQWidget *tqparent = 0, const char *name = 0) + : BaseWidget(defaultDir, tqparent, name), _filter(filter) {} Url url() const { return PURL::Url::fromPathOrUrl(_edit->text()); } void setUrl(const Url &url) { _edit->setText(url.filepath()); } @@ -112,7 +117,7 @@ protected slots: virtual void buttonClicked(); private: - QString _filter; + TQString _filter; }; } // namespace |