diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
commit | d6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch) | |
tree | d109539636691d7b03036ca1c0ed29dbae6577cf /lib/widgets | |
parent | 3331a47a9cad24795c7440ee8107143ce444ef34 (diff) | |
download | tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/widgets')
89 files changed, 1673 insertions, 1673 deletions
diff --git a/lib/widgets/fancylistviewitem.cpp b/lib/widgets/fancylistviewitem.cpp index a327ac04..6e60f1a4 100644 --- a/lib/widgets/fancylistviewitem.cpp +++ b/lib/widgets/fancylistviewitem.cpp @@ -17,15 +17,15 @@ Boston, MA 02110-1301, USA. */ -#include <qpixmap.h> -#include <qapplication.h> -#include <qnamespace.h> +#include <tqpixmap.h> +#include <tqapplication.h> +#include <tqnamespace.h> #include <kdeversion.h> #include "fancylistviewitem.h" -void FancyListViewItem::init(const QString& label1, const QString& /*label2*/) { +void FancyListViewItem::init(const TQString& label1, const TQString& /*label2*/) { if( !label1.isEmpty() ) { setText(0, label1); } @@ -41,7 +41,7 @@ void FancyListViewItem::setItem(int column, TextPaintItem item) { } -void FancyListViewItem::setText ( int column, const QString & text ) { +void FancyListViewItem::setText ( int column, const TQString & text ) { if( column >= int(m_items.size()) ) { m_items.append( TextPaintItem(text) ); }else{ @@ -50,60 +50,60 @@ void FancyListViewItem::setText ( int column, const QString & text ) { } -QString FancyListViewItem::text(int column) const { +TQString FancyListViewItem::text(int column) const { if( m_items.isEmpty() ) return ""; - return (QString)m_items[column]; + return (TQString)m_items[column]; } -QColor FancyListViewItem::backgroundColor(int col) { +TQColor FancyListViewItem::backgroundColor(int col) { return KListViewItem::backgroundColor(col); } -///this is a modified version of the original QListViewItem::paintCell from the qt source +///this is a modified version of the original TQListViewItem::paintCell from the qt source ///multiline is not supported! -void FancyListViewItem::paintCell( QPainter *painter, const QColorGroup &cg, +void FancyListViewItem::paintCell( TQPainter *painter, const TQColorGroup &cg, int column, int width, int align) { if(column < 0 || column >= int(m_items.size()) || m_items[column].items().isEmpty()) { - QListViewItem::paintCell(painter, cg, column, width, align); + TQListViewItem::paintCell(painter, cg, column, width, align); return; } painter->save(); - QColorGroup grp(cg); + TQColorGroup grp(cg); int styleNum = m_items[column].items()[0].style; TextPaintStyleStore::Item& style = m_styles.getStyle( styleNum ); ///currently only the first background-color is used if( style.bgValid() ) { - grp.setColor( QColorGroup::Base, style.background ); + grp.setColor( TQColorGroup::Base, style.background ); }else{ if(backgroundColor(column).isValid()) - grp.setColor( QColorGroup::Base, backgroundColor(column) ); ///use the nice kde background-color + grp.setColor( TQColorGroup::Base, backgroundColor(column) ); ///use the nice kde background-color } - QListView *lv = listView(); + TQListView *lv = listView(); if ( !lv ) return; - QPainter* p = painter; - QFontMetrics fm( p->fontMetrics() ); + TQPainter* p = painter; + TQFontMetrics fm( p->fontMetrics() ); - QString t = text( column ); + TQString t = text( column ); int marg = lv->itemMargin(); int r = marg; - const QPixmap * icon = pixmap( column ); + const TQPixmap * icon = pixmap( column ); const BackgroundMode bgmode = lv->viewport()->backgroundMode(); - const QColorGroup::ColorRole crole = QPalette::backgroundRoleFromMode( bgmode ); + const TQColorGroup::ColorRole crole = TQPalette::backgroundRoleFromMode( bgmode ); p->fillRect( 0, 0, width, height(), grp.brush( crole ) ); if ( isSelected() && (column == 0 || lv->allColumnsShowFocus()) ) { - p->fillRect( r - marg, 0, width - r + marg, height(), cg.brush( QColorGroup::Highlight ) ); + p->fillRect( r - marg, 0, width - r + marg, height(), cg.brush( TQColorGroup::Highlight ) ); if ( isEnabled() || !lv ) p->setPen( cg.highlightedText() ); @@ -164,9 +164,9 @@ void FancyListViewItem::paintCell( QPainter *painter, const QColorGroup &cg, } -int FancyListViewItem::textWidth(const QFont& font, const QString& text) +int FancyListViewItem::textWidth(const TQFont& font, const TQString& text) { - QFontMetrics fm( font ); + TQFontMetrics fm( font ); if ( multiLinesEnabled() ) return fm.size( AlignVCenter, text ).width(); else @@ -175,7 +175,7 @@ int FancyListViewItem::textWidth(const QFont& font, const QString& text) } -int FancyListViewItem::width(const QFontMetrics &fm, const QListView *lv, int column) +int FancyListViewItem::width(const TQFontMetrics &fm, const TQListView *lv, int column) { int width = 0; if (column >= 0 && column < (int)m_items.size() && !multiLinesEnabled()) { @@ -189,14 +189,14 @@ int FancyListViewItem::width(const QFontMetrics &fm, const QListView *lv, int co } width += lv->itemMargin() * 2;// - lv->d->minLeftBearing - lv->d->minRightBearing; - const QPixmap * pm = pixmap( column ); + const TQPixmap * pm = pixmap( column ); if ( pm ) width += pm->width() + lv->itemMargin(); - width = QMAX( width, QApplication::globalStrut().width() ); + width = QMAX( width, TQApplication::globalStrut().width() ); } else - width = QListViewItem::width(fm, lv, column); + width = TQListViewItem::width(fm, lv, column); return width; } diff --git a/lib/widgets/fancylistviewitem.h b/lib/widgets/fancylistviewitem.h index 55ac11e4..ab8b3310 100644 --- a/lib/widgets/fancylistviewitem.h +++ b/lib/widgets/fancylistviewitem.h @@ -20,21 +20,21 @@ #ifndef FANCYLISTVIEWITEM #define FANCYLISTVIEWITEM -#include <qvaluevector.h> -#include <qpainter.h> -#include <qfont.h> -#include <qlistview.h> +#include <tqvaluevector.h> +#include <tqpainter.h> +#include <tqfont.h> +#include <tqlistview.h> #include <klistview.h> class TextPaintStyleStore { public: class Item { public: - QFont font; - QColor color; - QColor background; + TQFont font; + TQColor color; + TQColor background; - Item(const QFont& f = QFont(), const QColor& c = QColor(), const QColor b = QColor() ) : font(f), color(c), background(b) { + Item(const TQFont& f = TQFont(), const TQColor& c = TQColor(), const TQColor b = TQColor() ) : font(f), color(c), background(b) { } bool bgValid() { @@ -46,9 +46,9 @@ class TextPaintStyleStore { } }; - typedef QMap<int, Item> Store ; + typedef TQMap<int, Item> Store ; - TextPaintStyleStore( QFont defaultFont=QFont() ) { + TextPaintStyleStore( TQFont defaultFont=TQFont() ) { m_styles.insert( 0, Item( defaultFont ) ); } @@ -62,7 +62,7 @@ class TextPaintStyleStore { m_styles[num] = style; } - void addStyle( int num, const QFont& font ) { + void addStyle( int num, const TQFont& font ) { m_styles[num] = Item( font ); } @@ -78,24 +78,24 @@ class TextPaintStyleStore { class TextPaintItem { public: struct Item { - QString text; + TQString text; int style; - Item( const QString& t = "", int st = 0 ) : text(t), style(st) { + Item( const TQString& t = "", int st = 0 ) : text(t), style(st) { } }; - typedef QValueList<Item> Chain; + typedef TQValueList<Item> Chain; Chain& items() { return m_chain; } - TextPaintItem(const QString& text="") { + TextPaintItem(const TQString& text="") { addItem( text ); } - Item& addItem(const QString& item, int style = 0) { + Item& addItem(const TQString& item, int style = 0) { m_chain.append( Item(item, style) ); return m_chain.back(); } @@ -104,8 +104,8 @@ class TextPaintItem { m_chain.clear(); } - operator QString () const { - QString ret; + operator TQString () const { + TQString ret; Chain::const_iterator it = m_chain.begin(); while(it != m_chain.end()) { ret += (*it).text; @@ -124,18 +124,18 @@ class TextPaintItem { class FancyListViewItem : public KListViewItem { public: - FancyListViewItem(TextPaintStyleStore& styles, QListView *parent, const QString &label1, const QString &label2="") : KListViewItem(parent, label1, label2), m_styles(styles) { + FancyListViewItem(TextPaintStyleStore& styles, TQListView *parent, const TQString &label1, const TQString &label2="") : KListViewItem(parent, label1, label2), m_styles(styles) { init(label1, label2); } - FancyListViewItem(TextPaintStyleStore& styles, QListViewItem *parent, const QString &label1, const QString &label2="") : KListViewItem(parent, label1, label2), m_styles(styles) { + FancyListViewItem(TextPaintStyleStore& styles, TQListViewItem *parent, const TQString &label1, const TQString &label2="") : KListViewItem(parent, label1, label2), m_styles(styles) { init(label1, label2); } - virtual void paintCell(QPainter *painter, const QColorGroup &cg, int column, int width, int align); - virtual int width(const QFontMetrics &fm, const QListView *lv, int column); - virtual void setText ( int column, const QString & text ); - virtual QString text(int column) const; + virtual void paintCell(TQPainter *painter, const TQColorGroup &cg, int column, int width, int align); + virtual int width(const TQFontMetrics &fm, const TQListView *lv, int column); + virtual void setText ( int column, const TQString & text ); + virtual TQString text(int column) const; inline void clear() { m_items.clear(); @@ -151,10 +151,10 @@ class FancyListViewItem : public KListViewItem void setItem(int column, TextPaintItem item); private: - virtual QColor backgroundColor(int col); - void init(const QString& label1, const QString& label2); - int textWidth(const QFont& font, const QString& text); - QValueVector<TextPaintItem> m_items; + virtual TQColor backgroundColor(int col); + void init(const TQString& label1, const TQString& label2); + int textWidth(const TQFont& font, const TQString& text); + TQValueVector<TextPaintItem> m_items; protected: TextPaintStyleStore& m_styles; }; diff --git a/lib/widgets/flagboxes.cpp b/lib/widgets/flagboxes.cpp index 92303b3f..e109a36d 100644 --- a/lib/widgets/flagboxes.cpp +++ b/lib/widgets/flagboxes.cpp @@ -24,22 +24,22 @@ #include <kdialogbase.h> #include <kdeversion.h> -#include <qapplication.h> -#include <qtooltip.h> -#include <qheader.h> -#include <qstringlist.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qregexp.h> -#include <qspinbox.h> +#include <tqapplication.h> +#include <tqtooltip.h> +#include <tqheader.h> +#include <tqstringlist.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqregexp.h> +#include <tqspinbox.h> #include "flagboxes.h" // partial copy of Qt-3.1 for back-compatibility to KDE-3.0 -QString QRegExp_escape( const QString& str ) +TQString QRegExp_escape( const TQString& str ) { static const char meta[] = "$()*+.?[\\]^{|}"; - QString quoted = str; + TQString quoted = str; int i = 0; while ( i < (int) quoted.length() ) { @@ -54,21 +54,21 @@ QString QRegExp_escape( const QString& str ) class FlagListToolTip : public QToolTip { public: - FlagListToolTip(QWidget *parent); + FlagListToolTip(TQWidget *parent); protected: - void maybeTip(const QPoint &p); + void maybeTip(const TQPoint &p); }; -FlagListToolTip::FlagListToolTip(QWidget *parent) - : QToolTip(parent) +FlagListToolTip::FlagListToolTip(TQWidget *parent) + : TQToolTip(parent) {} -void FlagListToolTip::maybeTip(const QPoint &pos) +void FlagListToolTip::maybeTip(const TQPoint &pos) { FlagListBox *listbox = static_cast<FlagListBox*>(parentWidget()); - QListViewItem *item = listbox->itemAt(pos); + TQListViewItem *item = listbox->itemAt(pos); FlagListItem *flitem = static_cast<FlagListItem*>(item); if (item) @@ -76,22 +76,22 @@ void FlagListToolTip::maybeTip(const QPoint &pos) } -FlagListItem::FlagListItem(FlagListBox *parent, const QString &flagstr, - const QString &description) - : QCheckListItem(parent, flagstr, QCheckListItem::CheckBox), +FlagListItem::FlagListItem(FlagListBox *parent, const TQString &flagstr, + const TQString &description) + : TQCheckListItem(parent, flagstr, TQCheckListItem::CheckBox), flag(flagstr), desc(description) {} -FlagListItem::FlagListItem(FlagListBox *parent, const QString &flagstr, - const QString &description, const QString &offstr) - : QCheckListItem(parent, flagstr, QCheckListItem::CheckBox), +FlagListItem::FlagListItem(FlagListBox *parent, const TQString &flagstr, + const TQString &description, const TQString &offstr) + : TQCheckListItem(parent, flagstr, TQCheckListItem::CheckBox), flag(flagstr), off(offstr), desc(description) {} -FlagListBox::FlagListBox(QWidget *parent, const char *name) - : QListView(parent, name) +FlagListBox::FlagListBox(TQWidget *parent, const char *name) + : TQListView(parent, name) { setResizeMode(LastColumn); header()->hide(); @@ -100,12 +100,12 @@ FlagListBox::FlagListBox(QWidget *parent, const char *name) } -void FlagListBox::readFlags(QStringList *list) +void FlagListBox::readFlags(TQStringList *list) { - QListViewItem *item = firstChild(); + TQListViewItem *item = firstChild(); for (; item; item = item->nextSibling()) { FlagListItem *flitem = static_cast<FlagListItem*>(item); - QStringList::Iterator sli = list->find(flitem->flag); + TQStringList::Iterator sli = list->find(flitem->flag); if (sli != list->end()) { flitem->setOn(true); list->remove(sli); @@ -119,9 +119,9 @@ void FlagListBox::readFlags(QStringList *list) } -void FlagListBox::writeFlags(QStringList *list) +void FlagListBox::writeFlags(TQStringList *list) { - QListViewItem *item = firstChild(); + TQListViewItem *item = firstChild(); for (; item; item = item->nextSibling()) { FlagListItem *flitem = static_cast<FlagListItem*>(item); if (flitem->isOn()) @@ -130,34 +130,34 @@ void FlagListBox::writeFlags(QStringList *list) } -FlagCheckBox::FlagCheckBox(QWidget *parent, FlagCheckBoxController *controller, - const QString &flagstr, const QString &description) - : QCheckBox(description, parent), flag(flagstr), includeOff(false), useDef(false), defSet(false) +FlagCheckBox::FlagCheckBox(TQWidget *parent, FlagCheckBoxController *controller, + const TQString &flagstr, const TQString &description) + : TQCheckBox(description, parent), flag(flagstr), includeOff(false), useDef(false), defSet(false) { - QToolTip::add(this, flagstr); + TQToolTip::add(this, flagstr); controller->addCheckBox(this); } -FlagCheckBox::FlagCheckBox(QWidget *parent, FlagCheckBoxController *controller, - const QString &flagstr, const QString &description, - const QString &offstr) - : QCheckBox(description, parent), flag(flagstr), off(offstr), includeOff(false), useDef(false), defSet(false) +FlagCheckBox::FlagCheckBox(TQWidget *parent, FlagCheckBoxController *controller, + const TQString &flagstr, const TQString &description, + const TQString &offstr) + : TQCheckBox(description, parent), flag(flagstr), off(offstr), includeOff(false), useDef(false), defSet(false) { - QToolTip::add(this, flagstr); + TQToolTip::add(this, flagstr); controller->addCheckBox(this); } -FlagCheckBox::FlagCheckBox(QWidget *parent, FlagCheckBoxController *controller, - const QString &flagstr, const QString &description, - const QString &offstr, const QString &defstr) - : QCheckBox(description, parent), flag(flagstr), off(offstr), def(defstr), includeOff(false), useDef(true), defSet(false) +FlagCheckBox::FlagCheckBox(TQWidget *parent, FlagCheckBoxController *controller, + const TQString &flagstr, const TQString &description, + const TQString &offstr, const TQString &defstr) + : TQCheckBox(description, parent), flag(flagstr), off(offstr), def(defstr), includeOff(false), useDef(true), defSet(false) { - QToolTip::add(this, flagstr); + TQToolTip::add(this, flagstr); controller->addCheckBox(this); } -FlagCheckBoxController::FlagCheckBoxController(QStringList multiKeys) +FlagCheckBoxController::FlagCheckBoxController(TQStringList multiKeys) :m_multiKeys(multiKeys) { } @@ -169,17 +169,17 @@ void FlagCheckBoxController::addCheckBox(FlagCheckBox *item) } -void FlagCheckBoxController::readFlags(QStringList *list) +void FlagCheckBoxController::readFlags(TQStringList *list) { //handle keys like -vxyz -> transform they into -vx -vy -vz //very "effective" algo :( -/* QStringList addons; - for (QStringList::Iterator mk = m_multiKeys.begin(); mk != m_multiKeys.end(); ++ mk) +/* TQStringList addons; + for (TQStringList::Iterator mk = m_multiKeys.begin(); mk != m_multiKeys.end(); ++ mk) { kdDebug() << "multikey " << *mk << endl; - for (QStringList::Iterator sli = list->begin(); sli != list->end(); ++sli) + for (TQStringList::Iterator sli = list->begin(); sli != list->end(); ++sli) { - QString key = *sli; + TQString key = *sli; kdDebug() << "current key: " << key << endl; if ( (key.length() > 3) && (key.startsWith(*mk)) ) { @@ -197,15 +197,15 @@ void FlagCheckBoxController::readFlags(QStringList *list) kdDebug() << "good" << endl; *list += addons; - for (QStringList::Iterator sli = list->begin(); sli != list->end(); ++sli) + for (TQStringList::Iterator sli = list->begin(); sli != list->end(); ++sli) { kdDebug() << "KEYS: " << *sli << endl; } */ - QPtrListIterator<FlagCheckBox> it(cblist); + TQPtrListIterator<FlagCheckBox> it(cblist); for (; it.current(); ++it) { FlagCheckBox *fitem = it.current(); - QStringList::Iterator sli = list->find(fitem->flag); + TQStringList::Iterator sli = list->find(fitem->flag); if (sli != list->end()) { fitem->setChecked(true); fitem->useDef = false; @@ -230,9 +230,9 @@ void FlagCheckBoxController::readFlags(QStringList *list) } -void FlagCheckBoxController::writeFlags(QStringList *list) +void FlagCheckBoxController::writeFlags(TQStringList *list) { - QPtrListIterator<FlagCheckBox> it(cblist); + TQPtrListIterator<FlagCheckBox> it(cblist); for (; it.current(); ++it) { FlagCheckBox *fitem = it.current(); if (fitem->isChecked() && (!fitem->useDef)) @@ -256,27 +256,27 @@ void FlagCheckBoxController::writeFlags(QStringList *list) { } -void FlagPathEditController::readFlags( QStringList * list ) +void FlagPathEditController::readFlags( TQStringList * list ) { // kdDebug() << "read path flags" << endl; - QPtrListIterator<FlagPathEdit> it(plist); + TQPtrListIterator<FlagPathEdit> it(plist); for (; it.current(); ++it) { FlagPathEdit *peitem = it.current(); - QStringList::Iterator sli = list->begin(); + TQStringList::Iterator sli = list->begin(); while ( sli != list->end() ) { // kdDebug() << "option: " << (*sli) << " flag is: " << peitem->flag << endl; if ((*sli).startsWith(peitem->flag)) { // kdDebug() << "Processing.." << endl; - peitem->setText((*sli).replace(QRegExp(QRegExp_escape(peitem->flag)),"")); + peitem->setText((*sli).replace(TQRegExp(QRegExp_escape(peitem->flag)),"")); sli = list->remove(sli); continue; } ++sli; } -/* QStringList::Iterator sli = list->find(peitem->flag); +/* TQStringList::Iterator sli = list->find(peitem->flag); if (sli != list->end()) { peitem->setText((*sli).remove(peitem->flag)); list->remove(sli); @@ -284,9 +284,9 @@ void FlagPathEditController::readFlags( QStringList * list ) } } -void FlagPathEditController::writeFlags( QStringList * list ) +void FlagPathEditController::writeFlags( TQStringList * list ) { - QPtrListIterator<FlagPathEdit> it(plist); + TQPtrListIterator<FlagPathEdit> it(plist); for (; it.current(); ++it) { FlagPathEdit *pitem = it.current(); if (!pitem->isEmpty()) @@ -299,14 +299,14 @@ void FlagPathEditController::addPathEdit( FlagPathEdit * item ) plist.append(item); } -FlagPathEdit::FlagPathEdit( QWidget * parent, QString pathDelimiter, - FlagPathEditController * controller, const QString & flagstr, const QString & description, +FlagPathEdit::FlagPathEdit( TQWidget * parent, TQString pathDelimiter, + FlagPathEditController * controller, const TQString & flagstr, const TQString & description, KFile::Mode mode ) - : QWidget(parent), delimiter(pathDelimiter), flag(flagstr), m_description(description) + : TQWidget(parent), delimiter(pathDelimiter), flag(flagstr), m_description(description) { - QBoxLayout *topLayout = new QVBoxLayout(this, 0, 1); - topLayout->addWidget(new QLabel(description, this)); - QBoxLayout *layout = new QHBoxLayout(topLayout, KDialog::spacingHint()); + TQBoxLayout *topLayout = new TQVBoxLayout(this, 0, 1); + topLayout->addWidget(new TQLabel(description, this)); + TQBoxLayout *layout = new TQHBoxLayout(topLayout, KDialog::spacingHint()); if (delimiter.isEmpty()) { @@ -318,15 +318,15 @@ FlagPathEdit::FlagPathEdit( QWidget * parent, QString pathDelimiter, { edit = new KLineEdit(this); layout->addWidget(edit); - details = new QPushButton("...", this); + details = new TQPushButton("...", this); details->setMaximumWidth(30); - connect(details, SIGNAL(clicked()), this, SLOT(showPathDetails())); + connect(details, TQT_SIGNAL(clicked()), this, TQT_SLOT(showPathDetails())); layout->addWidget(details); } - QApplication::sendPostedEvents(this, QEvent::ChildInserted); + TQApplication::sendPostedEvents(this, TQEvent::ChildInserted); - QToolTip::add(this, flagstr); + TQToolTip::add(this, flagstr); controller->addPathEdit(this); } @@ -335,7 +335,7 @@ void FlagPathEdit::showPathDetails( ) KDialogBase *dia = new KDialogBase(0, "flag_path_edit_dia", true, m_description, KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true); - QBoxLayout *diaLayout = new QVBoxLayout(dia, KDialog::marginHint(), KDialog::spacingHint()); + TQBoxLayout *diaLayout = new TQVBoxLayout(dia, KDialog::marginHint(), KDialog::spacingHint()); diaLayout->setAutoAdd(true); KURLRequester *req = new KURLRequester( dia ); @@ -345,9 +345,9 @@ void FlagPathEdit::showPathDetails( ) KEditListBox *elb = new KEditListBox( "", pCustomEditor, dia ); dia->setMainWidget(elb); - elb->insertStringList(QStringList::split(delimiter, text())); + elb->insertStringList(TQStringList::split(delimiter, text())); - if (dia->exec() == QDialog::Accepted) + if (dia->exec() == TQDialog::Accepted) { setText(elb->items().join(delimiter)); } @@ -355,7 +355,7 @@ void FlagPathEdit::showPathDetails( ) delete dia; } -void FlagPathEdit::setText( const QString text ) +void FlagPathEdit::setText( const TQString text ) { if (delimiter.isEmpty()) url->setURL(text); @@ -363,7 +363,7 @@ void FlagPathEdit::setText( const QString text ) edit->setText(text); } -QString FlagPathEdit::text( ) +TQString FlagPathEdit::text( ) { if (delimiter.isEmpty()) return url->url(); @@ -379,14 +379,14 @@ bool FlagPathEdit::isEmpty( ) return edit->text().isEmpty(); } -FlagRadioButton::FlagRadioButton( QWidget * parent, FlagRadioButtonController * controller, const QString & flagstr, const QString & description ) - : QRadioButton(description, parent), flag(flagstr) +FlagRadioButton::FlagRadioButton( TQWidget * parent, FlagRadioButtonController * controller, const TQString & flagstr, const TQString & description ) + : TQRadioButton(description, parent), flag(flagstr) { - QToolTip::add(this, flagstr); + TQToolTip::add(this, flagstr); controller->addRadioButton(this); } -FlagRadioButtonController::FlagRadioButtonController(QStringList multiKeys) +FlagRadioButtonController::FlagRadioButtonController(TQStringList multiKeys) :m_multiKeys(multiKeys) { } @@ -397,17 +397,17 @@ void FlagRadioButtonController::addRadioButton(FlagRadioButton *item) } -void FlagRadioButtonController::readFlags(QStringList *list) +void FlagRadioButtonController::readFlags(TQStringList *list) { //handle keys like -vxyz -> transform they into -vx -vy -vz //very "effective" algo :( -/* QStringList addons; - for (QStringList::Iterator mk = m_multiKeys.begin(); mk != m_multiKeys.end(); ++ mk) +/* TQStringList addons; + for (TQStringList::Iterator mk = m_multiKeys.begin(); mk != m_multiKeys.end(); ++ mk) { kdDebug() << "multikey " << *mk << endl; - for (QStringList::Iterator sli = list->begin(); sli != list->end(); ++sli) + for (TQStringList::Iterator sli = list->begin(); sli != list->end(); ++sli) { - QString key = *sli; + TQString key = *sli; kdDebug() << "current key: " << key << endl; if ( (key.length() > 3) && (key.startsWith(*mk)) ) { @@ -425,15 +425,15 @@ void FlagRadioButtonController::readFlags(QStringList *list) kdDebug() << "good" << endl; *list += addons; - for (QStringList::Iterator sli = list->begin(); sli != list->end(); ++sli) + for (TQStringList::Iterator sli = list->begin(); sli != list->end(); ++sli) { kdDebug() << "KEYS: " << *sli << endl; } */ - QPtrListIterator<FlagRadioButton> it(cblist); + TQPtrListIterator<FlagRadioButton> it(cblist); for (; it.current(); ++it) { FlagRadioButton *fitem = it.current(); - QStringList::Iterator sli = list->find(fitem->flag); + TQStringList::Iterator sli = list->find(fitem->flag); if (sli != list->end()) { fitem->setChecked(true); list->remove(sli); @@ -442,9 +442,9 @@ void FlagRadioButtonController::readFlags(QStringList *list) } -void FlagRadioButtonController::writeFlags(QStringList *list) +void FlagRadioButtonController::writeFlags(TQStringList *list) { - QPtrListIterator<FlagRadioButton> it(cblist); + TQPtrListIterator<FlagRadioButton> it(cblist); for (; it.current(); ++it) { FlagRadioButton *fitem = it.current(); if (fitem->isChecked()) @@ -460,18 +460,18 @@ void FlagRadioButtonController::writeFlags(QStringList *list) { } -void FlagEditController::readFlags( QStringList * list ) +void FlagEditController::readFlags( TQStringList * list ) { - QPtrListIterator<FlagListEdit> it(plist); + TQPtrListIterator<FlagListEdit> it(plist); for (; it.current(); ++it) { FlagListEdit *peitem = it.current(); - QStringList::Iterator sli = list->begin(); + TQStringList::Iterator sli = list->begin(); while (sli != list->end()) { if ((*sli).startsWith(peitem->flag)) { - peitem->appendText((*sli).replace(QRegExp(QRegExp_escape(peitem->flag)),"")); + peitem->appendText((*sli).replace(TQRegExp(QRegExp_escape(peitem->flag)),"")); sli = list->remove(sli); continue; } @@ -480,16 +480,16 @@ void FlagEditController::readFlags( QStringList * list ) } - QPtrListIterator<FlagSpinEdit> it2(slist); + TQPtrListIterator<FlagSpinEdit> it2(slist); for (; it2.current(); ++it2) { FlagSpinEdit *sitem = it2.current(); - QStringList::Iterator sli = list->begin(); + TQStringList::Iterator sli = list->begin(); while ( sli != list->end() ) { if ((*sli).startsWith(sitem->flag)) { - sitem->setText((*sli).replace(QRegExp(QRegExp_escape(sitem->flag)),"")); + sitem->setText((*sli).replace(TQRegExp(QRegExp_escape(sitem->flag)),"")); sli = list->remove(sli); continue; } @@ -498,16 +498,16 @@ void FlagEditController::readFlags( QStringList * list ) } } -void FlagEditController::writeFlags( QStringList * list ) +void FlagEditController::writeFlags( TQStringList * list ) { - QPtrListIterator<FlagListEdit> it(plist); + TQPtrListIterator<FlagListEdit> it(plist); for (; it.current(); ++it) { FlagListEdit *pitem = it.current(); if (!pitem->isEmpty()) (*list) += pitem->flags(); } - QPtrListIterator<FlagSpinEdit> it2(slist); + TQPtrListIterator<FlagSpinEdit> it2(slist); for (; it2.current(); ++it2) { FlagSpinEdit *sitem = it2.current(); if (!sitem->isDefault()) @@ -526,31 +526,31 @@ void FlagEditController::addSpinBox(FlagSpinEdit *item) } -FlagListEdit::FlagListEdit( QWidget * parent, QString listDelimiter, FlagEditController * controller, - const QString & flagstr, const QString & description) - : QWidget(parent), delimiter(listDelimiter), flag(flagstr), m_description(description) +FlagListEdit::FlagListEdit( TQWidget * parent, TQString listDelimiter, FlagEditController * controller, + const TQString & flagstr, const TQString & description) + : TQWidget(parent), delimiter(listDelimiter), flag(flagstr), m_description(description) { - QBoxLayout *topLayout = new QVBoxLayout(this, 0, 1); - topLayout->addWidget(new QLabel(description, this)); - QBoxLayout *layout = new QHBoxLayout(topLayout, KDialog::spacingHint()); + TQBoxLayout *topLayout = new TQVBoxLayout(this, 0, 1); + topLayout->addWidget(new TQLabel(description, this)); + TQBoxLayout *layout = new TQHBoxLayout(topLayout, KDialog::spacingHint()); edit = new KLineEdit(this); layout->addWidget(edit); if (! listDelimiter.isEmpty()) { - details = new QPushButton("...", this); + details = new TQPushButton("...", this); details->setMaximumWidth(30); - connect(details, SIGNAL(clicked()), this, SLOT(showListDetails())); + connect(details, TQT_SIGNAL(clicked()), this, TQT_SLOT(showListDetails())); layout->addWidget(details); } - QApplication::sendPostedEvents(this, QEvent::ChildInserted); + TQApplication::sendPostedEvents(this, TQEvent::ChildInserted); - QToolTip::add(this, flagstr); + TQToolTip::add(this, flagstr); controller->addListEdit(this); } -void FlagListEdit::setText( const QString text ) +void FlagListEdit::setText( const TQString text ) { edit->setText(text); } @@ -560,7 +560,7 @@ bool FlagListEdit::isEmpty( ) return edit->text().isEmpty(); } -QString FlagListEdit::text( ) +TQString FlagListEdit::text( ) { return edit->text(); } @@ -570,15 +570,15 @@ void FlagListEdit::showListDetails( ) KDialogBase *dia = new KDialogBase(0, "flag_list_edit_dia", true, m_description, KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true); - QBoxLayout *diaLayout = new QVBoxLayout(dia, KDialog::marginHint(), KDialog::spacingHint()); + TQBoxLayout *diaLayout = new TQVBoxLayout(dia, KDialog::marginHint(), KDialog::spacingHint()); diaLayout->setAutoAdd(true); KEditListBox *elb = new KEditListBox( "", dia ); dia->setMainWidget(elb); - elb->insertStringList(QStringList::split(delimiter, text())); + elb->insertStringList(TQStringList::split(delimiter, text())); - if (dia->exec() == QDialog::Accepted) + if (dia->exec() == TQDialog::Accepted) { setText(elb->items().join(delimiter)); } @@ -586,48 +586,48 @@ void FlagListEdit::showListDetails( ) delete dia; } -void FlagListEdit::appendText( const QString text ) +void FlagListEdit::appendText( const TQString text ) { - edit->setText(edit->text() + (edit->text().isEmpty()?QString(""):delimiter) + text); + edit->setText(edit->text() + (edit->text().isEmpty()?TQString(""):delimiter) + text); } -QStringList FlagListEdit::flags( ) +TQStringList FlagListEdit::flags( ) { - QStringList fl = QStringList::split(delimiter, text()); - for (QStringList::iterator it = fl.begin(); it != fl.end(); ++it) + TQStringList fl = TQStringList::split(delimiter, text()); + for (TQStringList::iterator it = fl.begin(); it != fl.end(); ++it) { (*it).prepend(flag); } return fl; } -FlagSpinEdit::FlagSpinEdit( QWidget * parent, int minVal, int maxVal, int incr, int defaultVal, FlagEditController * controller, const QString & flagstr, const QString & description ) - :QWidget(parent), m_defaultVal(defaultVal), flag(flagstr) +FlagSpinEdit::FlagSpinEdit( TQWidget * parent, int minVal, int maxVal, int incr, int defaultVal, FlagEditController * controller, const TQString & flagstr, const TQString & description ) + :TQWidget(parent), m_defaultVal(defaultVal), flag(flagstr) { - QBoxLayout *topLayout = new QVBoxLayout(this, 0, 1); - topLayout->addWidget(new QLabel(description, this)); + TQBoxLayout *topLayout = new TQVBoxLayout(this, 0, 1); + topLayout->addWidget(new TQLabel(description, this)); - spb = new QSpinBox(minVal, maxVal, incr, this); + spb = new TQSpinBox(minVal, maxVal, incr, this); spb->setValue(defaultVal); topLayout->addWidget(spb); - QApplication::sendPostedEvents(this, QEvent::ChildInserted); + TQApplication::sendPostedEvents(this, TQEvent::ChildInserted); - QToolTip::add(this, flagstr); + TQToolTip::add(this, flagstr); controller->addSpinBox(this); } -void FlagSpinEdit::setText( const QString text ) +void FlagSpinEdit::setText( const TQString text ) { spb->setValue(text.toInt()); } -QString FlagSpinEdit::text( ) +TQString FlagSpinEdit::text( ) { - return QString("%1").arg(spb->value()); + return TQString("%1").arg(spb->value()); } -QString FlagSpinEdit::flags( ) +TQString FlagSpinEdit::flags( ) { return flag + text(); } diff --git a/lib/widgets/flagboxes.h b/lib/widgets/flagboxes.h index dc64f296..234cf3a5 100644 --- a/lib/widgets/flagboxes.h +++ b/lib/widgets/flagboxes.h @@ -28,11 +28,11 @@ Support classes for compiler plugins. */ -#include <qlistview.h> -#include <qcheckbox.h> -#include <qradiobutton.h> -#include <qptrlist.h> -#include <qstringlist.h> +#include <tqlistview.h> +#include <tqcheckbox.h> +#include <tqradiobutton.h> +#include <tqptrlist.h> +#include <tqstringlist.h> class QSpinBox; class FlagListBox; @@ -49,16 +49,16 @@ class KURLRequester; class FlagListItem : public QCheckListItem { public: - FlagListItem(FlagListBox *parent, const QString &flagstr, - const QString &description); - FlagListItem(FlagListBox *parent, const QString &flagstr, - const QString &description, const QString &offstr); + FlagListItem(FlagListBox *parent, const TQString &flagstr, + const TQString &description); + FlagListItem(FlagListBox *parent, const TQString &flagstr, + const TQString &description, const TQString &offstr); ~FlagListItem() {} private: - QString flag; - QString off; - QString desc; + TQString flag; + TQString off; + TQString desc; friend class FlagListToolTip; friend class FlagListBox; }; @@ -69,12 +69,12 @@ class FlagListBox : public QListView { Q_OBJECT public: - FlagListBox( QWidget *parent=0, const char *name=0 ); + FlagListBox( TQWidget *parent=0, const char *name=0 ); ~FlagListBox() {} - void readFlags(QStringList *list); - void writeFlags(QStringList *list); + void readFlags(TQStringList *list); + void writeFlags(TQStringList *list); }; @@ -83,21 +83,21 @@ class FlagCheckBox : public QCheckBox { Q_OBJECT public: - FlagCheckBox(QWidget *parent, FlagCheckBoxController *controller, - const QString &flagstr, const QString &description); - FlagCheckBox(QWidget *parent, FlagCheckBoxController *controller, - const QString &flagstr, const QString &description, - const QString &offstr); - FlagCheckBox(QWidget *parent, FlagCheckBoxController *controller, - const QString &flagstr, const QString &description, - const QString &offstr, const QString &defstr); + FlagCheckBox(TQWidget *parent, FlagCheckBoxController *controller, + const TQString &flagstr, const TQString &description); + FlagCheckBox(TQWidget *parent, FlagCheckBoxController *controller, + const TQString &flagstr, const TQString &description, + const TQString &offstr); + FlagCheckBox(TQWidget *parent, FlagCheckBoxController *controller, + const TQString &flagstr, const TQString &description, + const TQString &offstr, const TQString &defstr); ~FlagCheckBox() {} private: - QString flag; - QString off; - QString def; + TQString flag; + TQString off; + TQString def; bool includeOff; bool useDef; bool defSet; @@ -109,13 +109,13 @@ class FlagRadioButton : public QRadioButton { Q_OBJECT public: - FlagRadioButton(QWidget *parent, FlagRadioButtonController *controller, - const QString &flagstr, const QString &description); + FlagRadioButton(TQWidget *parent, FlagRadioButtonController *controller, + const TQString &flagstr, const TQString &description); ~FlagRadioButton() {} private: - QString flag; + TQString flag; friend class FlagRadioButtonController; }; @@ -125,26 +125,26 @@ class FlagPathEdit: public QWidget Q_OBJECT public: /**If the pathDelimiter is not empty then path edit can contain a list of paths*/ - FlagPathEdit(QWidget *parent, QString pathDelimiter, FlagPathEditController *controller, - const QString &flagstr, const QString &description, KFile::Mode mode = KFile::Directory); + FlagPathEdit(TQWidget *parent, TQString pathDelimiter, FlagPathEditController *controller, + const TQString &flagstr, const TQString &description, KFile::Mode mode = KFile::Directory); ~FlagPathEdit() {} - void setText(const QString text); + void setText(const TQString text); bool isEmpty(); - QString text(); + TQString text(); private slots: void showPathDetails(); private: KLineEdit *edit; - QPushButton *details; + TQPushButton *details; KURLRequester *url; - QString delimiter; - QString flag; - QString m_description; + TQString delimiter; + TQString flag; + TQString m_description; friend class FlagPathEditController; }; @@ -154,27 +154,27 @@ class FlagListEdit: public QWidget Q_OBJECT public: /**If the listDelimiter is not empty then list edit can contain a list of entries*/ - FlagListEdit(QWidget *parent, QString listDelimiter, FlagEditController *controller, - const QString &flagstr, const QString &description); + FlagListEdit(TQWidget *parent, TQString listDelimiter, FlagEditController *controller, + const TQString &flagstr, const TQString &description); ~FlagListEdit() {} - void setText(const QString text); - void appendText(const QString text); + void setText(const TQString text); + void appendText(const TQString text); bool isEmpty(); - QString text(); - QStringList flags(); + TQString text(); + TQStringList flags(); private slots: void showListDetails(); private: KLineEdit *edit; - QPushButton *details; + TQPushButton *details; - QString delimiter; - QString flag; - QString m_description; + TQString delimiter; + TQString flag; + TQString m_description; friend class FlagEditController; }; @@ -182,21 +182,21 @@ private: class FlagSpinEdit: public QWidget { public: - FlagSpinEdit(QWidget *parent, int minVal, int maxVal, int incr, int defaultVal, FlagEditController *controller, - const QString &flagstr, const QString &description); + FlagSpinEdit(TQWidget *parent, int minVal, int maxVal, int incr, int defaultVal, FlagEditController *controller, + const TQString &flagstr, const TQString &description); ~FlagSpinEdit() {} - void setText(const QString text); - QString text(); + void setText(const TQString text); + TQString text(); bool isDefault(); - QString flags(); + TQString flags(); private: int m_defaultVal; - QString flag; + TQString flag; - QSpinBox *spb; + TQSpinBox *spb; friend class FlagEditController; }; @@ -208,12 +208,12 @@ public: FlagPathEditController(); ~FlagPathEditController(); - void readFlags(QStringList *list); - void writeFlags(QStringList *list); + void readFlags(TQStringList *list); + void writeFlags(TQStringList *list); private: void addPathEdit(FlagPathEdit *item); - QPtrList<FlagPathEdit> plist; + TQPtrList<FlagPathEdit> plist; friend class FlagPathEdit; }; @@ -224,14 +224,14 @@ public: FlagEditController(); ~FlagEditController(); - void readFlags(QStringList *list); - void writeFlags(QStringList *list); + void readFlags(TQStringList *list); + void writeFlags(TQStringList *list); private: void addListEdit(FlagListEdit *item); void addSpinBox(FlagSpinEdit *item); - QPtrList<FlagListEdit> plist; - QPtrList<FlagSpinEdit> slist; + TQPtrList<FlagListEdit> plist; + TQPtrList<FlagSpinEdit> slist; friend class FlagListEdit; friend class FlagSpinEdit; }; @@ -244,18 +244,18 @@ public: multiKeys must contain a list of option names like {-v} in the above example. */ - FlagCheckBoxController(QStringList multiKeys = QStringList()); + FlagCheckBoxController(TQStringList multiKeys = TQStringList()); ~FlagCheckBoxController() {} - void readFlags(QStringList *list); - void writeFlags(QStringList *list); + void readFlags(TQStringList *list); + void writeFlags(TQStringList *list); void addCheckBox(FlagCheckBox *item); private: - QPtrList<FlagCheckBox> cblist; + TQPtrList<FlagCheckBox> cblist; - QStringList m_multiKeys; + TQStringList m_multiKeys; }; /**Controller for radiobutton editors.*/ @@ -266,18 +266,18 @@ public: multiKeys must contain a list of option names like {-v} in the above example. */ - FlagRadioButtonController(QStringList multiKeys = QStringList()); + FlagRadioButtonController(TQStringList multiKeys = TQStringList()); ~FlagRadioButtonController() {} - void readFlags(QStringList *list); - void writeFlags(QStringList *list); + void readFlags(TQStringList *list); + void writeFlags(TQStringList *list); void addRadioButton(FlagRadioButton *item); private: - QPtrList<FlagRadioButton> cblist; + TQPtrList<FlagRadioButton> cblist; - QStringList m_multiKeys; + TQStringList m_multiKeys; }; #endif diff --git a/lib/widgets/kcomboview.cpp b/lib/widgets/kcomboview.cpp index ddb3123c..2576ed0c 100644 --- a/lib/widgets/kcomboview.cpp +++ b/lib/widgets/kcomboview.cpp @@ -19,13 +19,13 @@ #include <klineedit.h> #include <klistview.h> #include <kcompletionbox.h> -#include <qheader.h> -#include <qmap.h> +#include <tqheader.h> +#include <tqmap.h> #include "kcomboview.h" -KComboView::KComboView( bool rw, int defaultWidth, QWidget* parent, const char* name , CustomCompleter* comp) +KComboView::KComboView( bool rw, int defaultWidth, TQWidget* parent, const char* name , CustomCompleter* comp) :QComboView(rw, parent, name), m_comp( comp ), m_defaultWidth(defaultWidth) { if (rw) @@ -33,7 +33,7 @@ KComboView::KComboView( bool rw, int defaultWidth, QWidget* parent, const char* KLineEdit *ed = new KLineEdit(this, "combo edit"); ed->setCompletionMode(KGlobalSettings::CompletionPopup); ed->setCompletionObject(m_comp); - ed->completionBox()->setHScrollBarMode(QListBox::Auto); + ed->completionBox()->setHScrollBarMode(TQListBox::Auto); setLineEdit(ed); } setMinimumWidth(defaultWidth); @@ -43,12 +43,12 @@ KComboView::~KComboView() { delete m_comp; } -void KComboView::addItem(QListViewItem *it) +void KComboView::addItem(TQListViewItem *it) { m_comp->addItem(it->text(0)); } -void KComboView::removeItem(QListViewItem *it) +void KComboView::removeItem(TQListViewItem *it) { if (it == currentItem()) { @@ -59,7 +59,7 @@ void KComboView::removeItem(QListViewItem *it) delete it; } -void KComboView::renameItem(QListViewItem *it, const QString &newName) +void KComboView::renameItem(TQListViewItem *it, const TQString &newName) { m_comp->removeItem(it->text(0)); it->setText(0, newName); @@ -79,7 +79,7 @@ int KComboView::defaultWidth( ) return m_defaultWidth; } -void KComboView::setDefaultText( const QString & text ) +void KComboView::setDefaultText( const TQString & text ) { m_defaultText = text; } @@ -90,7 +90,7 @@ void KComboView::setUpListView() listView->setRootIsDecorated( false ); listView->setAllColumnsShowFocus(true); listView->addColumn(""); - listView->setResizeMode(QListView::LastColumn); + listView->setResizeMode(TQListView::LastColumn); listView->header()->hide(); diff --git a/lib/widgets/kcomboview.h b/lib/widgets/kcomboview.h index cb08e158..e0230b52 100644 --- a/lib/widgets/kcomboview.h +++ b/lib/widgets/kcomboview.h @@ -29,7 +29,7 @@ KComboView class. */ /** -KComboView - a combo with a QListView as a popup widget. +KComboView - a combo with a TQListView as a popup widget. KComboView provides text completion. @sa QComboView for a description. */ @@ -38,11 +38,11 @@ KComboView provides text completion. ///This can be used to insert own KCompletion-implementations class CustomCompleter : public KCompletion { public: - virtual void addItem (const QString &item) { + virtual void addItem (const TQString &item) { KCompletion::addItem( item ); } - virtual void removeItem (const QString &item) { + virtual void removeItem (const TQString &item) { KCompletion::removeItem( item ); } @@ -57,14 +57,14 @@ class KComboView: public QComboView Q_OBJECT public: ///The combo-view takes the ownership of the completer and deletes it on destruction - KComboView( bool rw, int defaultWidth = 100, QWidget* parent=0, const char* name=0, CustomCompleter* completer = new CustomCompleter() ); + KComboView( bool rw, int defaultWidth = 100, TQWidget* parent=0, const char* name=0, CustomCompleter* completer = new CustomCompleter() ); virtual ~KComboView(); - virtual void addItem(QListViewItem *it); - virtual void removeItem(QListViewItem *it); - virtual void renameItem(QListViewItem *it, const QString &newName); + virtual void addItem(TQListViewItem *it); + virtual void removeItem(TQListViewItem *it); + virtual void renameItem(TQListViewItem *it, const TQString &newName); - virtual void setDefaultText(const QString &text); + virtual void setDefaultText(const TQString &text); virtual void clear(); @@ -74,7 +74,7 @@ private: CustomCompleter* m_comp; int m_defaultWidth; - QString m_defaultText; + TQString m_defaultText; }; #endif diff --git a/lib/widgets/kdevhtmlpart.cpp b/lib/widgets/kdevhtmlpart.cpp index 688e373a..c99dcf36 100644 --- a/lib/widgets/kdevhtmlpart.cpp +++ b/lib/widgets/kdevhtmlpart.cpp @@ -1,6 +1,6 @@ -#include <qfile.h> -#include <qclipboard.h> -#include <qapplication.h> +#include <tqfile.h> +#include <tqclipboard.h> +#include <tqapplication.h> #include <kxmlguiclient.h> #include <kaction.h> @@ -24,54 +24,54 @@ KDevHTMLPart::KDevHTMLPart() { setXMLFile(locate("data", "kdevelop/kdevhtml_partui.rc"), true); - connect(browserExtension(), SIGNAL(openURLRequestDelayed(const KURL &,const KParts::URLArgs &)), - this, SLOT(openURLRequest(const KURL &)) ); + connect(browserExtension(), TQT_SIGNAL(openURLRequestDelayed(const KURL &,const KParts::URLArgs &)), + this, TQT_SLOT(openURLRequest(const KURL &)) ); - connect(this, SIGNAL(started(KIO::Job *)), this, SLOT(slotStarted(KIO::Job* ))); - connect(this, SIGNAL(completed()), this, SLOT(slotCompleted())); - connect(this, SIGNAL(canceled(const QString &)), this, SLOT(slotCancelled(const QString &))); + connect(this, TQT_SIGNAL(started(KIO::Job *)), this, TQT_SLOT(slotStarted(KIO::Job* ))); + connect(this, TQT_SIGNAL(completed()), this, TQT_SLOT(slotCompleted())); + connect(this, TQT_SIGNAL(canceled(const TQString &)), this, TQT_SLOT(slotCancelled(const TQString &))); KActionCollection * actions = actionCollection();// new KActionCollection( this ); reloadAction = new KAction( i18n( "Reload" ), "reload", 0, - this, SLOT( slotReload() ), actions, "doc_reload" ); + this, TQT_SLOT( slotReload() ), actions, "doc_reload" ); reloadAction->setWhatsThis(i18n("<b>Reload</b><p>Reloads the current document.")); stopAction = new KAction( i18n( "Stop" ), "stop", 0, - this, SLOT( slotStop() ), actions, "doc_stop" ); + this, TQT_SLOT( slotStop() ), actions, "doc_stop" ); stopAction->setWhatsThis(i18n("<b>Stop</b><p>Stops the loading of current document.")); duplicateAction = new KAction( i18n( "Duplicate Tab" ), "window_new", 0, - this, SLOT( slotDuplicate() ), actions, "doc_dup" ); + this, TQT_SLOT( slotDuplicate() ), actions, "doc_dup" ); duplicateAction->setWhatsThis(i18n("<b>Duplicate window</b><p>Opens current document in a new window.")); - printAction = KStdAction::print(this, SLOT(slotPrint()), actions, "print_doc"); - copyAction = KStdAction::copy(this, SLOT(slotCopy()), actions, "copy_doc_selection"); + printAction = KStdAction::print(this, TQT_SLOT(slotPrint()), actions, "print_doc"); + copyAction = KStdAction::copy(this, TQT_SLOT(slotCopy()), actions, "copy_doc_selection"); - connect( this, SIGNAL(popupMenu(const QString &, const QPoint &)), this, SLOT(popup(const QString &, const QPoint &))); - connect(this, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged())); + connect( this, TQT_SIGNAL(popupMenu(const TQString &, const TQPoint &)), this, TQT_SLOT(popup(const TQString &, const TQPoint &))); + connect(this, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotSelectionChanged())); //BEGIN documentation history stuff m_backAction = new KToolBarPopupAction(i18n("Back"), "back", 0, - this, SLOT(slotBack()), + this, TQT_SLOT(slotBack()), actions, "browser_back"); m_backAction->setEnabled( false ); m_backAction->setToolTip(i18n("Back")); m_backAction->setWhatsThis(i18n("<b>Back</b><p>Moves backwards one step in the <b>documentation</b> browsing history.")); - connect(m_backAction->popupMenu(), SIGNAL(aboutToShow()), - this, SLOT(slotBackAboutToShow())); - connect(m_backAction->popupMenu(), SIGNAL(activated(int)), - this, SLOT(slotPopupActivated(int))); + connect(m_backAction->popupMenu(), TQT_SIGNAL(aboutToShow()), + this, TQT_SLOT(slotBackAboutToShow())); + connect(m_backAction->popupMenu(), TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotPopupActivated(int))); m_forwardAction = new KToolBarPopupAction(i18n("Forward"), "forward", 0, - this, SLOT(slotForward()), + this, TQT_SLOT(slotForward()), actions, "browser_forward"); m_forwardAction->setEnabled( false ); m_forwardAction->setToolTip(i18n("Forward")); m_forwardAction->setWhatsThis(i18n("<b>Forward</b><p>Moves forward one step in the <b>documentation</b> browsing history.")); - connect(m_forwardAction->popupMenu(), SIGNAL(aboutToShow()), - this, SLOT(slotForwardAboutToShow())); - connect(m_forwardAction->popupMenu(), SIGNAL(activated(int)), - this, SLOT(slotPopupActivated(int))); + connect(m_forwardAction->popupMenu(), TQT_SIGNAL(aboutToShow()), + this, TQT_SLOT(slotForwardAboutToShow())); + connect(m_forwardAction->popupMenu(), TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotPopupActivated(int))); m_restoring = false; m_Current = m_history.end(); @@ -87,7 +87,7 @@ KDevHTMLPart::KDevHTMLPart() setZoomFactor(appConfig->readEntry("Zoom", "100").toInt()); } -void KDevHTMLPart::popup( const QString & url, const QPoint & p ) +void KDevHTMLPart::popup( const TQString & url, const TQPoint & p ) { // KPopupMenu popup( i18n( "Documentation Viewer" ), this->widget() ); KPopupMenu popup(this->widget()); @@ -157,13 +157,13 @@ void KDevHTMLPart::popup( const QString & url, const QPoint & p ) } } -void KDevHTMLPart::setContext(const QString &context) +void KDevHTMLPart::setContext(const TQString &context) { m_context = context; } -QString KDevHTMLPart::context() const +TQString KDevHTMLPart::context() const { return m_context; } @@ -250,10 +250,10 @@ done: #undef I #undef X -QString KDevHTMLPart::resolveEnvVarsInURL(const QString& url) +TQString KDevHTMLPart::resolveEnvVarsInURL(const TQString& url) { // check for environment variables and make necessary translations - QString path = url; + TQString path = url; int nDollarPos = path.find( '$' ); // Note: the while loop below is a copy of code in kdecore/kconfigbase.cpp ;) @@ -265,13 +265,13 @@ QString KDevHTMLPart::resolveEnvVarsInURL(const QString& url) while ( (nEndPos <= path.length()) && (path[nEndPos]!=')') ) nEndPos++; nEndPos++; - QString cmd = path.mid( nDollarPos+2, nEndPos-nDollarPos-3 ); + TQString cmd = path.mid( nDollarPos+2, nEndPos-nDollarPos-3 ); - QString result; - FILE *fs = popen(QFile::encodeName(cmd).data(), "r"); + TQString result; + FILE *fs = popen(TQFile::encodeName(cmd).data(), "r"); if (fs) { - QTextStream ts(fs, IO_ReadOnly); + TQTextStream ts(fs, IO_ReadOnly); result = ts.read().stripWhiteSpace(); pclose(fs); } @@ -279,7 +279,7 @@ QString KDevHTMLPart::resolveEnvVarsInURL(const QString& url) } else if( (path)[nDollarPos+1] != '$' ) { uint nEndPos = nDollarPos+1; // the next character is no $ - QString aVarName; + TQString aVarName; if (path[nEndPos]=='{') { while ( (nEndPos <= path.length()) && (path[nEndPos]!='}') ) @@ -302,9 +302,9 @@ QString KDevHTMLPart::resolveEnvVarsInURL(const QString& url) // A environment variables may contain values in 8bit // locale cpecified encoding or in UTF8 encoding. if (isUtf8( pEnv )) - path.replace( nDollarPos, nEndPos-nDollarPos, QString::fromUtf8(pEnv) ); + path.replace( nDollarPos, nEndPos-nDollarPos, TQString::fromUtf8(pEnv) ); else - path.replace( nDollarPos, nEndPos-nDollarPos, QString::fromLocal8Bit(pEnv) ); + path.replace( nDollarPos, nEndPos-nDollarPos, TQString::fromLocal8Bit(pEnv) ); } else path.remove( nDollarPos, nEndPos-nDollarPos ); } else { @@ -320,7 +320,7 @@ QString KDevHTMLPart::resolveEnvVarsInURL(const QString& url) bool KDevHTMLPart::openURL(const KURL &url) { - QString path = resolveEnvVarsInURL(url.url()); + TQString path = resolveEnvVarsInURL(url.url()); KURL newUrl(path); bool retval = KHTMLPart::openURL(newUrl); @@ -364,7 +364,7 @@ void KDevHTMLPart::slotCompleted( ) stopAction->setEnabled(false); } -void KDevHTMLPart::slotCancelled( const QString & /*errMsg*/ ) +void KDevHTMLPart::slotCancelled( const TQString & /*errMsg*/ ) { stopAction->setEnabled(false); } @@ -408,7 +408,7 @@ void KDevHTMLPart::slotBackAboutToShow() if ( m_Current == m_history.begin() ) return; - QValueList<DocumentationHistoryEntry>::Iterator it = m_Current; + TQValueList<DocumentationHistoryEntry>::Iterator it = m_Current; --it; int i = 0; @@ -433,7 +433,7 @@ void KDevHTMLPart::slotForwardAboutToShow() if ( m_Current == m_history.fromLast() ) return; - QValueList<DocumentationHistoryEntry>::Iterator it = m_Current; + TQValueList<DocumentationHistoryEntry>::Iterator it = m_Current; ++it; int i = 0; @@ -455,7 +455,7 @@ void KDevHTMLPart::slotPopupActivated( int id ) { kdDebug(9000) << "id: " << id << endl; - QValueList<DocumentationHistoryEntry>::Iterator it = m_history.begin(); + TQValueList<DocumentationHistoryEntry>::Iterator it = m_history.begin(); while( it != m_history.end() ) { kdDebug(9000) << "(*it).id: " << (*it).id << endl; @@ -473,7 +473,7 @@ void KDevHTMLPart::slotPopupActivated( int id ) void KDevHTMLPart::addHistoryEntry() { - QValueList<DocumentationHistoryEntry>::Iterator it = m_Current; + TQValueList<DocumentationHistoryEntry>::Iterator it = m_Current; // if We're not already the last entry, we truncate the list here before adding an entry if ( it != m_history.end() && it != m_history.fromLast() ) @@ -493,12 +493,12 @@ void KDevHTMLPart::addHistoryEntry() void KDevHTMLPart::slotCopy( ) { - QString text = selectedText(); - text.replace( QChar( 0xa0 ), ' ' ); - QClipboard *cb = QApplication::clipboard(); - disconnect( cb, SIGNAL( selectionChanged() ), this, SLOT( slotClearSelection() ) ); + TQString text = selectedText(); + text.replace( TQChar( 0xa0 ), ' ' ); + QClipboard *cb = TQApplication::clipboard(); + disconnect( cb, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( slotClearSelection() ) ); cb->setText(text); - connect( cb, SIGNAL( selectionChanged() ), this, SLOT( slotClearSelection() ) ); + connect( cb, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( slotClearSelection() ) ); } void KDevHTMLPart::slotSelectionChanged( ) diff --git a/lib/widgets/kdevhtmlpart.h b/lib/widgets/kdevhtmlpart.h index 944f1e9b..465fb0a3 100644 --- a/lib/widgets/kdevhtmlpart.h +++ b/lib/widgets/kdevhtmlpart.h @@ -3,7 +3,7 @@ #include <stdlib.h> -#include <qdatetime.h> +#include <tqdatetime.h> #include <khtml_part.h> @@ -23,7 +23,7 @@ struct DocumentationHistoryEntry { DocumentationHistoryEntry() {} DocumentationHistoryEntry( const KURL& u ): url( u ) { - id = abs( QTime::currentTime().msecsTo( QTime() ) ); // nasty, but should provide a reasonably unique number + id = abs( TQTime::currentTime().msecsTo( TQTime() ) ); // nasty, but should provide a reasonably unique number } }; @@ -52,10 +52,10 @@ public: KDevHTMLPart(); - void setContext(const QString &context); - QString context() const; + void setContext(const TQString &context); + TQString context() const; virtual bool openURL(const KURL &url); - static QString resolveEnvVarsInURL(const QString& url); + static TQString resolveEnvVarsInURL(const TQString& url); void setOptions(int options) { m_options = options; } @@ -66,10 +66,10 @@ protected slots: void slotStarted(KIO::Job *); void slotCompleted(); - void slotCancelled(const QString &errMsg); + void slotCancelled(const TQString &errMsg); void openURLRequest(const KURL &url); - void popup( const QString & url, const QPoint & p ); + void popup( const TQString & url, const TQPoint & p ); void slotReload(); void slotStop(); @@ -90,15 +90,15 @@ protected slots: private: - QValueList< DocumentationHistoryEntry > m_history; - QValueList< DocumentationHistoryEntry >::Iterator m_Current; + TQValueList< DocumentationHistoryEntry > m_history; + TQValueList< DocumentationHistoryEntry >::Iterator m_Current; KToolBarPopupAction* m_backAction; KToolBarPopupAction* m_forwardAction; bool m_restoring; - QString m_context; + TQString m_context; KAction *stopAction; KAction *reloadAction; KAction *duplicateAction; diff --git a/lib/widgets/kdevtabwidget.cpp b/lib/widgets/kdevtabwidget.cpp index 49925115..a7d12348 100644 --- a/lib/widgets/kdevtabwidget.cpp +++ b/lib/widgets/kdevtabwidget.cpp @@ -9,7 +9,7 @@ * * ***************************************************************************/ -#include <qpopupmenu.h> +#include <tqpopupmenu.h> #include <kglobal.h> #include <klocale.h> @@ -18,24 +18,24 @@ #include "kdevtabwidget.h" -KDevTabWidget::KDevTabWidget(QWidget *parent, const char *name) : QTabWidget(parent,name) +KDevTabWidget::KDevTabWidget(TQWidget *parent, const char *name) : TQTabWidget(parent,name) { m_pTabBar = new KTabBar(this, "tabbar"); setTabBar(m_pTabBar); - connect(m_pTabBar, SIGNAL(closeWindow(const QWidget*)), this, SIGNAL(closeWindow(const QWidget*))); - connect(m_pTabBar, SIGNAL(closeOthers(QWidget*)), this, SIGNAL(closeOthers(QWidget*))); + connect(m_pTabBar, TQT_SIGNAL(closeWindow(const TQWidget*)), this, TQT_SIGNAL(closeWindow(const TQWidget*))); + connect(m_pTabBar, TQT_SIGNAL(closeOthers(TQWidget*)), this, TQT_SIGNAL(closeOthers(TQWidget*))); } -KTabBar::KTabBar(QWidget *parent, const char *name) : QTabBar(parent,name) +KTabBar::KTabBar(TQWidget *parent, const char *name) : TQTabBar(parent,name) { - m_pPopupMenu = new QPopupMenu(this); + m_pPopupMenu = new TQPopupMenu(this); - QPixmap closePixmap = KGlobal::instance()->iconLoader()->loadIcon( "tab_remove", KIcon::Small, 0, KIcon::DefaultState, 0, true ); + TQPixmap closePixmap = KGlobal::instance()->iconLoader()->loadIcon( "tab_remove", KIcon::Small, 0, KIcon::DefaultState, 0, true ); if (closePixmap.isNull()) closePixmap = SmallIcon("fileclose"); - m_pPopupMenu->insertItem(closePixmap, i18n("&Close"), this, SLOT(closeWindowSlot())); - m_pPopupMenu->insertItem(i18n("Close &Others"), this, SLOT(closeOthersSlot())); + m_pPopupMenu->insertItem(closePixmap, i18n("&Close"), this, TQT_SLOT(closeWindowSlot())); + m_pPopupMenu->insertItem(i18n("Close &Others"), this, TQT_SLOT(closeOthersSlot())); } void KTabBar::closeWindowSlot() @@ -48,11 +48,11 @@ void KTabBar::closeOthersSlot() emit closeOthers(m_pPage); } -void KTabBar::mousePressEvent(QMouseEvent *e) +void KTabBar::mousePressEvent(TQMouseEvent *e) { if(e->button() == Qt::RightButton) { - QTab *tab = selectTab(e->pos() ); + TQTab *tab = selectTab(e->pos() ); if( tab == 0L ) return; m_pPage = ((KDevTabWidget*)parent())->page(indexOf(tab->identifier() ) ); @@ -60,7 +60,7 @@ void KTabBar::mousePressEvent(QMouseEvent *e) m_pPopupMenu->exec(mapToGlobal(e->pos())); } - QTabBar::mousePressEvent(e); + TQTabBar::mousePressEvent(e); } #include "kdevtabwidget.moc" diff --git a/lib/widgets/klistviewaction.cpp b/lib/widgets/klistviewaction.cpp index 23bc653b..0a219da5 100644 --- a/lib/widgets/klistviewaction.cpp +++ b/lib/widgets/klistviewaction.cpp @@ -20,8 +20,8 @@ #include "kcomboview.h" #include "resizablecombo.h" -#include <qtooltip.h> -#include <qwhatsthis.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> #include <kconfig.h> #include <kglobal.h> @@ -37,8 +37,8 @@ KListViewAction::~KListViewAction() delete m_view; } -KListViewAction::KListViewAction(KComboView *view, const QString & text, const KShortcut & cut, - const QObject * receiver, const char * slot, KActionCollection * parent, const char * name ): +KListViewAction::KListViewAction(KComboView *view, const TQString & text, const KShortcut & cut, + const TQObject * receiver, const char * slot, KActionCollection * parent, const char * name ): KWidgetAction(view, text, cut, receiver, slot, parent, name), m_view(view) { m_view->setDuplicatesEnabled(false); @@ -47,8 +47,8 @@ KListViewAction::KListViewAction(KComboView *view, const QString & text, const K loadComboWidth(); } -KListViewAction::KListViewAction( KComboView * view, const QString & text, const KShortcut & cut, - const QObject * receiver, const char * slot, KActionCollection * parent, const char * name, const bool /*dummy*/ ): +KListViewAction::KListViewAction( KComboView * view, const TQString & text, const KShortcut & cut, + const TQObject * receiver, const char * slot, KActionCollection * parent, const char * name, const bool /*dummy*/ ): KWidgetAction(new ResizableCombo(view), text, cut, receiver, slot, parent, name), m_view(view) { m_view->setDuplicatesEnabled(false); @@ -62,16 +62,16 @@ KComboView * KListViewAction::view( ) const return m_view; } -void KListViewAction::setToolTip( const QString & str ) +void KListViewAction::setToolTip( const TQString & str ) { - QToolTip::remove(m_view); - QToolTip::add(m_view, str); + TQToolTip::remove(m_view); + TQToolTip::add(m_view, str); } -void KListViewAction::setWhatsThis( const QString & str ) +void KListViewAction::setWhatsThis( const TQString & str ) { - QWhatsThis::remove(m_view); - QWhatsThis::add(m_view, str); + TQWhatsThis::remove(m_view); + TQWhatsThis::add(m_view, str); } void KListViewAction::loadComboWidth( ) diff --git a/lib/widgets/klistviewaction.h b/lib/widgets/klistviewaction.h index 72a78dd0..d8f53eb8 100644 --- a/lib/widgets/klistviewaction.h +++ b/lib/widgets/klistviewaction.h @@ -38,14 +38,14 @@ Can be used on toolbars. It appears as @ref ResizableCombo. class KListViewAction: public KWidgetAction { public: - KListViewAction(KComboView *view, const QString &text, const KShortcut &cut, const QObject *receiver, const char *slot, KActionCollection *parent, const char *name); - KListViewAction(KComboView *view, const QString &text, const KShortcut &cut, const QObject *receiver, const char *slot, KActionCollection *parent, const char *name, const bool); + KListViewAction(KComboView *view, const TQString &text, const KShortcut &cut, const TQObject *receiver, const char *slot, KActionCollection *parent, const char *name); + KListViewAction(KComboView *view, const TQString &text, const KShortcut &cut, const TQObject *receiver, const char *slot, KActionCollection *parent, const char *name, const bool); ~KListViewAction(); KComboView *view() const; - void setToolTip(const QString & str); - void setWhatsThis(const QString &str); + void setToolTip(const TQString & str); + void setWhatsThis(const TQString &str); private: void loadComboWidth(); diff --git a/lib/widgets/ksavealldialog.cpp b/lib/widgets/ksavealldialog.cpp index 81d9ed38..8ddb5c89 100644 --- a/lib/widgets/ksavealldialog.cpp +++ b/lib/widgets/ksavealldialog.cpp @@ -17,9 +17,9 @@ Boston, MA 02110-1301, USA. */ -#include <qvbox.h> -#include <qlabel.h> -#include <qheader.h> +#include <tqvbox.h> +#include <tqlabel.h> +#include <tqheader.h> #include <klocale.h> #include <kpushbutton.h> @@ -35,8 +35,8 @@ namespace class CheckURL : public QCheckListItem { public: - CheckURL( QListView * lv, KURL const & url ) - : QCheckListItem( lv, url.path(), QCheckListItem::CheckBox), + CheckURL( TQListView * lv, KURL const & url ) + : TQCheckListItem( lv, url.path(), TQCheckListItem::CheckBox), _url( url ) {} @@ -49,20 +49,20 @@ private: } -KSaveSelectDialog::KSaveSelectDialog( KURL::List const & filelist, KURL::List const & ignorelist, QWidget * parent ) : +KSaveSelectDialog::KSaveSelectDialog( KURL::List const & filelist, KURL::List const & ignorelist, TQWidget * parent ) : KDialogBase( parent, "SaveAllDialog", true, i18n("Save Modified Files?"), Ok | User1 | Close ) { - QVBox *top = makeVBoxMainWidget(); + TQVBox *top = makeVBoxMainWidget(); - (void)new QLabel( i18n("The following files have been modified. Save them?"), top ); + (void)new TQLabel( i18n("The following files have been modified. Save them?"), top ); _listview = new KListView( top ); _listview->addColumn( "" ); _listview->header()->hide(); - _listview->setResizeMode( QListView::LastColumn ); + _listview->setResizeMode( TQListView::LastColumn ); - setButtonOK( KGuiItem(i18n("Save &Selected"), QString::null, i18n("Saves all selected files")) ); + setButtonOK( KGuiItem(i18n("Save &Selected"), TQString::null, i18n("Saves all selected files")) ); setButtonText( User1, i18n("Save &None") ); setButtonText( Close, KStdGuiItem::cancel().text() ); setButtonTip( User1, i18n("Lose all modifications") ); @@ -73,15 +73,15 @@ KSaveSelectDialog::KSaveSelectDialog( KURL::List const & filelist, KURL::List co { if ( !ignorelist.contains( *it ) ) { - QCheckListItem * x = new CheckURL( _listview, *it ); + TQCheckListItem * x = new CheckURL( _listview, *it ); x->setOn( true ); } ++it; } - connect( this, SIGNAL(closeClicked()), this, SLOT(cancel()) ); - connect( this, SIGNAL(okClicked()), this, SLOT(save()) ); - connect( this, SIGNAL(user1Clicked()), this, SLOT(saveNone()) ); + connect( this, TQT_SIGNAL(closeClicked()), this, TQT_SLOT(cancel()) ); + connect( this, TQT_SIGNAL(okClicked()), this, TQT_SLOT(save()) ); + connect( this, TQT_SIGNAL(user1Clicked()), this, TQT_SLOT(saveNone()) ); } KSaveSelectDialog::~KSaveSelectDialog() {} @@ -96,17 +96,17 @@ void KSaveSelectDialog::saveNone( ) item = static_cast<CheckURL*>( item->nextSibling() ); } - QDialog::accept(); + TQDialog::accept(); } void KSaveSelectDialog::save( ) { - QDialog::accept(); + TQDialog::accept(); } void KSaveSelectDialog::cancel( ) { - QDialog::reject(); + TQDialog::reject(); } KURL::List KSaveSelectDialog::filesToSave( ) @@ -140,28 +140,28 @@ KURL::List KSaveSelectDialog::filesNotToSave( ) } -KSaveAllDialog::KSaveAllDialog( const QStringList& filenames, QWidget* parent ) : +KSaveAllDialog::KSaveAllDialog( const TQStringList& filenames, TQWidget* parent ) : KDialogBase( parent, "SaveAllDialog", true, i18n("Save Modified Files?"), Ok | User1 | Close ) { m_result = Cancel; - QVBox *top = makeVBoxMainWidget(); + TQVBox *top = makeVBoxMainWidget(); - (void)new QLabel( i18n("The following files have been modified. Save them?"), top ); + (void)new TQLabel( i18n("The following files have been modified. Save them?"), top ); KListBox* lb = new KListBox( top ); lb->setMinimumHeight( lb->fontMetrics().height() * 5 ); lb->insertStringList( filenames ); - setButtonOK( KGuiItem(i18n("Save &All"), QString::null, i18n("Saves all modified files")) ); + setButtonOK( KGuiItem(i18n("Save &All"), TQString::null, i18n("Saves all modified files")) ); setButtonText( User1, i18n("Save &None") ); setButtonText( Close, KStdGuiItem::cancel().text() ); setButtonTip( User1, i18n("Lose all modifications") ); setButtonTip( Close, i18n("Cancels the action") ); - connect( this, SIGNAL(closeClicked()), this, SLOT(cancel()) ); - connect( this, SIGNAL(okClicked()), this, SLOT(saveAll()) ); - connect( this, SIGNAL(user1Clicked()), this, SLOT(revert()) ); + connect( this, TQT_SIGNAL(closeClicked()), this, TQT_SLOT(cancel()) ); + connect( this, TQT_SIGNAL(okClicked()), this, TQT_SLOT(saveAll()) ); + connect( this, TQT_SIGNAL(user1Clicked()), this, TQT_SLOT(revert()) ); } KSaveAllDialog::~KSaveAllDialog() @@ -171,19 +171,19 @@ KSaveAllDialog::~KSaveAllDialog() void KSaveAllDialog::revert() { m_result = Revert; - QDialog::accept(); + TQDialog::accept(); } void KSaveAllDialog::saveAll() { m_result = SaveAll; - QDialog::accept(); + TQDialog::accept(); } void KSaveAllDialog::cancel() { m_result = Cancel; - QDialog::reject(); + TQDialog::reject(); } #include "ksavealldialog.moc" diff --git a/lib/widgets/ksavealldialog.h b/lib/widgets/ksavealldialog.h index 9d7860cf..c6592b4a 100644 --- a/lib/widgets/ksavealldialog.h +++ b/lib/widgets/ksavealldialog.h @@ -20,7 +20,7 @@ #ifndef SAVEALLDIALOG_H #define SAVEALLDIALOG_H -#include <qstringlist.h> +#include <tqstringlist.h> #include <kdialogbase.h> #include <kurl.h> @@ -38,7 +38,7 @@ class KSaveSelectDialog : public KDialogBase Q_OBJECT public: - KSaveSelectDialog( KURL::List const & filelist, KURL::List const & ignorelist, QWidget * parent ); + KSaveSelectDialog( KURL::List const & filelist, KURL::List const & ignorelist, TQWidget * parent ); virtual ~KSaveSelectDialog(); KURL::List filesToSave(); @@ -65,7 +65,7 @@ class KSaveAllDialog : public KDialogBase public: enum SaveAllResult{ SaveAll, Cancel, Revert }; - KSaveAllDialog( const QStringList& filenames, QWidget* parent ); + KSaveAllDialog( const TQStringList& filenames, TQWidget* parent ); virtual ~KSaveAllDialog(); SaveAllResult result() const { return m_result; } diff --git a/lib/widgets/processlinemaker.cpp b/lib/widgets/processlinemaker.cpp index e4f7e08d..8fdbc5d2 100644 --- a/lib/widgets/processlinemaker.cpp +++ b/lib/widgets/processlinemaker.cpp @@ -28,11 +28,11 @@ ProcessLineMaker::ProcessLineMaker() ProcessLineMaker::ProcessLineMaker( const KProcess* proc ) { - connect(proc, SIGNAL(receivedStdout(KProcess*,char*,int)), - this, SLOT(slotReceivedStdout(KProcess*,char*,int)) ); + connect(proc, TQT_SIGNAL(receivedStdout(KProcess*,char*,int)), + this, TQT_SLOT(slotReceivedStdout(KProcess*,char*,int)) ); - connect(proc, SIGNAL(receivedStderr(KProcess*,char*,int)), - this, SLOT(slotReceivedStderr(KProcess*,char*,int)) ); + connect(proc, TQT_SIGNAL(receivedStderr(KProcess*,char*,int)), + this, TQT_SLOT(slotReceivedStderr(KProcess*,char*,int)) ); } void ProcessLineMaker::slotReceivedStdout( const char *buffer ) @@ -40,7 +40,7 @@ void ProcessLineMaker::slotReceivedStdout( const char *buffer ) stdoutbuf += buffer; int pos; while ( (pos = stdoutbuf.find('\n')) != -1) { - QCString line = stdoutbuf.left( pos ); + TQCString line = stdoutbuf.left( pos ); emit receivedStdoutLine(line); stdoutbuf.remove(0, pos+1); } @@ -61,7 +61,7 @@ void ProcessLineMaker::slotReceivedStderr( const char *buffer ) stderrbuf += buffer; int pos; while ( (pos = stderrbuf.find('\n')) != -1) { - QCString line = stderrbuf.left( pos ); + TQCString line = stderrbuf.left( pos ); emit receivedStderrLine(line); stderrbuf.remove(0, pos+1); } diff --git a/lib/widgets/processlinemaker.h b/lib/widgets/processlinemaker.h index 7efa508a..d124e2ed 100644 --- a/lib/widgets/processlinemaker.h +++ b/lib/widgets/processlinemaker.h @@ -20,7 +20,7 @@ #ifndef _PROCESSLINEMAKER_H_ #define _PROCESSLINEMAKER_H_ -#include <qobject.h> +#include <tqobject.h> /** @file processlinemaker.h @@ -52,14 +52,14 @@ protected slots: void slotReceivedStderr(KProcess *, char *buffer, int buflen); signals: - void receivedStdoutLine( const QCString& line ); - void receivedStderrLine( const QCString& line ); - void receivedPartialStdoutLine( const QCString& line ); - void receivedPartialStderrLine( const QCString& line ); + void receivedStdoutLine( const TQCString& line ); + void receivedStderrLine( const TQCString& line ); + void receivedPartialStdoutLine( const TQCString& line ); + void receivedPartialStderrLine( const TQCString& line ); private: - QCString stdoutbuf; - QCString stderrbuf; + TQCString stdoutbuf; + TQCString stderrbuf; }; #endif diff --git a/lib/widgets/processwidget.cpp b/lib/widgets/processwidget.cpp index 3edbf161..a49a1078 100644 --- a/lib/widgets/processwidget.cpp +++ b/lib/widgets/processwidget.cpp @@ -21,21 +21,21 @@ #include "processlinemaker.h" #include <kdeversion.h> -#include <qdir.h> +#include <tqdir.h> #include <kdebug.h> #include <klocale.h> #include <kprocess.h> -#include <qpainter.h> -#include <qapplication.h> +#include <tqpainter.h> +#include <tqapplication.h> -ProcessListBoxItem::ProcessListBoxItem(const QString &s, Type type) - : QListBoxText(s), t(type) +ProcessListBoxItem::ProcessListBoxItem(const TQString &s, Type type) + : TQListBoxText(s), t(type) { - QString clean = s; - clean.replace( QChar('\t'), QString(" ") ); - clean.replace( QChar('\n'), QString() ); - clean.replace( QChar('\r'), QString() ); + TQString clean = s; + clean.replace( TQChar('\t'), TQString(" ") ); + clean.replace( TQChar('\n'), TQString() ); + clean.replace( TQChar('\r'), TQString() ); setText( clean ); setCustomHighlighting(true); @@ -57,7 +57,7 @@ static inline double blend1(double a, double b, double k) return a + (b - a) * k; } -QColor ProcessListBoxItem::blend(const QColor &c1, const QColor &c2, double k) const +TQColor ProcessListBoxItem::blend(const TQColor &c1, const TQColor &c2, double k) const { if (k < 0.0) return c1; if (k > 1.0) return c2; @@ -66,14 +66,14 @@ QColor ProcessListBoxItem::blend(const QColor &c1, const QColor &c2, double k) c int g = normalize((int)blend1((double)c1.green(), (double)c2.green(), k)); int b = normalize((int)blend1((double)c1.blue(), (double)c2.blue(), k)); - return QColor(qRgb(r, g, b)); + return TQColor(qRgb(r, g, b)); } -void ProcessListBoxItem::paint(QPainter *p) +void ProcessListBoxItem::paint(TQPainter *p) { - QColor dim, warn, err, back; + TQColor dim, warn, err, back; if (listBox()) { - const QColorGroup& group = listBox()->palette().active(); + const TQColorGroup& group = listBox()->palette().active(); if (isSelected()) { back = group.button(); warn = group.buttonText(); @@ -96,17 +96,17 @@ void ProcessListBoxItem::paint(QPainter *p) else back = Qt::white; } - p->fillRect(p->window(), QBrush(back)); + p->fillRect(p->window(), TQBrush(back)); p->setPen((t==Error)? err : (t==Diagnostic)? warn : dim); - QListBoxText::paint(p); + TQListBoxText::paint(p); } -ProcessWidget::ProcessWidget(QWidget *parent, const char *name) +ProcessWidget::ProcessWidget(TQWidget *parent, const char *name) : KListBox(parent, name) { - setFocusPolicy(QWidget::NoFocus); + setFocusPolicy(TQWidget::NoFocus); // Don't override the palette, as that can mess up styles. Instead, draw // the background ourselves (see ProcessListBoxItem::paint). @@ -117,17 +117,17 @@ ProcessWidget::ProcessWidget(QWidget *parent, const char *name) procLineMaker = new ProcessLineMaker( childproc ); - connect( procLineMaker, SIGNAL(receivedStdoutLine(const QCString&)), - this, SLOT(insertStdoutLine(const QCString&) )); - connect( procLineMaker, SIGNAL(receivedStderrLine(const QCString&)), - this, SLOT(insertStderrLine(const QCString&) )); - connect( procLineMaker, SIGNAL(receivedPartialStdoutLine(const QCString&)), - this, SLOT(addPartialStdoutLine(const QCString&) )); - connect( procLineMaker, SIGNAL(receivedPartialStderrLine(const QCString&)), - this, SLOT(addPartialStderrLine(const QCString&) )); - - connect(childproc, SIGNAL(processExited(KProcess*)), - this, SLOT(slotProcessExited(KProcess*) )) ; + connect( procLineMaker, TQT_SIGNAL(receivedStdoutLine(const TQCString&)), + this, TQT_SLOT(insertStdoutLine(const TQCString&) )); + connect( procLineMaker, TQT_SIGNAL(receivedStderrLine(const TQCString&)), + this, TQT_SLOT(insertStderrLine(const TQCString&) )); + connect( procLineMaker, TQT_SIGNAL(receivedPartialStdoutLine(const TQCString&)), + this, TQT_SLOT(addPartialStdoutLine(const TQCString&) )); + connect( procLineMaker, TQT_SIGNAL(receivedPartialStderrLine(const TQCString&)), + this, TQT_SLOT(addPartialStderrLine(const TQCString&) )); + + connect(childproc, TQT_SIGNAL(processExited(KProcess*)), + this, TQT_SLOT(slotProcessExited(KProcess*) )) ; } @@ -138,7 +138,7 @@ ProcessWidget::~ProcessWidget() } -void ProcessWidget::startJob(const QString &dir, const QString &command) +void ProcessWidget::startJob(const TQString &dir, const TQString &command) { procLineMaker->clearBuffers(); procLineMaker->blockSignals( false ); @@ -182,18 +182,18 @@ void ProcessWidget::slotProcessExited(KProcess *) } -void ProcessWidget::insertStdoutLine(const QCString &line) +void ProcessWidget::insertStdoutLine(const TQCString &line) { if( !stdoutbuf.isEmpty() ) { stdoutbuf += line; - insertItem( new ProcessListBoxItem( QString::fromLocal8Bit(stdoutbuf), + insertItem( new ProcessListBoxItem( TQString::fromLocal8Bit(stdoutbuf), ProcessListBoxItem::Normal ), lastRowStdout+1 ); stdoutbuf.truncate( 0 ); }else { - insertItem( new ProcessListBoxItem( QString::fromLocal8Bit( line ), + insertItem( new ProcessListBoxItem( TQString::fromLocal8Bit( line ), ProcessListBoxItem::Normal) ); } lastRowStdout = count() - 1; @@ -201,18 +201,18 @@ void ProcessWidget::insertStdoutLine(const QCString &line) } -void ProcessWidget::insertStderrLine(const QCString &line) +void ProcessWidget::insertStderrLine(const TQCString &line) { if( !stderrbuf.isEmpty() ) { stderrbuf += line; - insertItem( new ProcessListBoxItem( QString::fromLocal8Bit( stderrbuf ), + insertItem( new ProcessListBoxItem( TQString::fromLocal8Bit( stderrbuf ), ProcessListBoxItem::Error ), lastRowStderr+1 ); stderrbuf.truncate( 0 ); } else { - insertItem( new ProcessListBoxItem( QString::fromLocal8Bit( line ), + insertItem( new ProcessListBoxItem( TQString::fromLocal8Bit( line ), ProcessListBoxItem::Error) ); } lastRowStderr = count() - 1; @@ -222,7 +222,7 @@ void ProcessWidget::insertStderrLine(const QCString &line) void ProcessWidget::childFinished(bool normal, int status) { - QString s; + TQString s; ProcessListBoxItem::Type t; if (normal) { @@ -249,12 +249,12 @@ void ProcessWidget::childFinished(bool normal, int status) } -QSize ProcessWidget::minimumSizeHint() const +TQSize ProcessWidget::minimumSizeHint() const { // I'm not sure about this, but when I don't use override minimumSizeHint(), // the initial size in clearly too small - return QSize( QListBox::sizeHint().width(), + return TQSize( TQListBox::sizeHint().width(), (fontMetrics().lineSpacing()+2)*4 ); } @@ -270,12 +270,12 @@ void ProcessWidget::maybeScrollToBottom() } } -void ProcessWidget::addPartialStderrLine(const QCString& linepart) +void ProcessWidget::addPartialStderrLine(const TQCString& linepart) { stderrbuf += linepart; } -void ProcessWidget::addPartialStdoutLine(const QCString& linepart) +void ProcessWidget::addPartialStdoutLine(const TQCString& linepart) { stdoutbuf += linepart; } diff --git a/lib/widgets/processwidget.h b/lib/widgets/processwidget.h index f1e28a57..ee1a6012 100644 --- a/lib/widgets/processwidget.h +++ b/lib/widgets/processwidget.h @@ -38,15 +38,15 @@ class ProcessListBoxItem : public QListBoxText public: enum Type { Diagnostic, Normal, Error }; - ProcessListBoxItem(const QString &s, Type type); + ProcessListBoxItem(const TQString &s, Type type); virtual bool isCustomItem(); protected: - QColor blend(const QColor &c1, const QColor &c2, double k = 0.25) const; + TQColor blend(const TQColor &c1, const TQColor &c2, double k = 0.25) const; private: - virtual void paint(QPainter *p); + virtual void paint(TQPainter *p); Type t; }; @@ -60,7 +60,7 @@ class ProcessWidget : public KListBox Q_OBJECT public: - ProcessWidget(QWidget *parent, const char *name=0); + ProcessWidget(TQWidget *parent, const char *name=0); ~ProcessWidget(); /** @@ -72,7 +72,7 @@ public slots: /** * Starts the child process. */ - void startJob(const QString &dir, const QString &command); + void startJob(const TQString &dir, const TQString &command); /** * Kills the child processss. */ @@ -82,17 +82,17 @@ public slots: * be overridden by subclasses to implement * syntax highlighting. */ - virtual void insertStdoutLine(const QCString &line); + virtual void insertStdoutLine(const TQCString &line); /** * Inserts one line from stderr into the listbox. This can * be overridden by subclasses to implement * syntax highlighting. By default, a ProcessListBoxItem * is used. */ - virtual void insertStderrLine(const QCString &line); + virtual void insertStderrLine(const TQCString &line); - virtual void addPartialStdoutLine(const QCString&); - virtual void addPartialStderrLine(const QCString&); + virtual void addPartialStdoutLine(const TQCString&); + virtual void addPartialStderrLine(const TQCString&); protected: /** @@ -108,7 +108,7 @@ signals: void rowSelected(int row); protected: - virtual QSize minimumSizeHint() const; + virtual TQSize minimumSizeHint() const; void maybeScrollToBottom(); protected slots: @@ -117,8 +117,8 @@ protected slots: private: KProcess *childproc; ProcessLineMaker* procLineMaker; - QCString stderrbuf; - QCString stdoutbuf; + TQCString stderrbuf; + TQCString stdoutbuf; int lastRowStdout; int lastRowStderr; }; diff --git a/lib/widgets/propeditor/childproperty.cpp b/lib/widgets/propeditor/childproperty.cpp index 12b7f4d9..ac53936a 100644 --- a/lib/widgets/propeditor/childproperty.cpp +++ b/lib/widgets/propeditor/childproperty.cpp @@ -19,29 +19,29 @@ ***************************************************************************/ #include "childproperty.h" -#include <qsize.h> -#include <qpoint.h> -#include <qrect.h> -#include <qsizepolicy.h> +#include <tqsize.h> +#include <tqpoint.h> +#include <tqrect.h> +#include <tqsizepolicy.h> #include "multiproperty.h" namespace PropertyLib{ -ChildProperty::ChildProperty(MultiProperty *parent, int type, ChildPropertyType childType, const QString &name, - const QString &description, const QVariant &value, bool save, bool readOnly) +ChildProperty::ChildProperty(MultiProperty *parent, int type, ChildPropertyType childType, const TQString &name, + const TQString &description, const TQVariant &value, bool save, bool readOnly) :Property(type, name, description, value, save, readOnly), m_parent(parent), m_childType(childType) { } -ChildProperty::ChildProperty(MultiProperty *parent, const QString & name, ChildPropertyType childType, - const QMap<QString, QVariant> &v_valueList, const QString &description, - const QVariant &value, bool save, bool readOnly) +ChildProperty::ChildProperty(MultiProperty *parent, const TQString & name, ChildPropertyType childType, + const TQMap<TQString, TQVariant> &v_valueList, const TQString &description, + const TQVariant &value, bool save, bool readOnly) :Property(name, v_valueList, description, value, save, readOnly), m_parent(parent), m_childType(childType) { } -void ChildProperty::setValue(const QVariant &value, bool // rememberOldValue +void ChildProperty::setValue(const TQVariant &value, bool // rememberOldValue ) { qWarning("ChildProperty::setValue"); @@ -51,8 +51,8 @@ void ChildProperty::setValue(const QVariant &value, bool // rememberOldValue { case Size: { - qWarning("ChildProperty::setValue for QSize"); - QSize v = m_parent->value().toSize(); + qWarning("ChildProperty::setValue for TQSize"); + TQSize v = m_parent->value().toSize(); if (m_childType == Size_Height) v.setHeight(value.toInt()); else if (m_childType == Size_Width) @@ -62,8 +62,8 @@ void ChildProperty::setValue(const QVariant &value, bool // rememberOldValue } case Point: { - qWarning("ChildProperty::setValue for QPoint"); - QPoint v = m_parent->value().toPoint(); + qWarning("ChildProperty::setValue for TQPoint"); + TQPoint v = m_parent->value().toPoint(); if (m_childType == Point_X) v.setX(value.toInt()); else if (m_childType == Point_Y) @@ -73,8 +73,8 @@ void ChildProperty::setValue(const QVariant &value, bool // rememberOldValue } case Rect: { - qWarning("ChildProperty::setValue for QRect"); - QRect v = m_parent->value().toRect(); + qWarning("ChildProperty::setValue for TQRect"); + TQRect v = m_parent->value().toRect(); if (m_childType == Rect_X) v.setX(value.toInt()); else if (m_childType == Rect_Y) @@ -88,12 +88,12 @@ void ChildProperty::setValue(const QVariant &value, bool // rememberOldValue } case SizePolicy: { - qWarning("ChildProperty::setValue for QSizePolicy"); - QSizePolicy v = m_parent->value().toSizePolicy(); + qWarning("ChildProperty::setValue for TQSizePolicy"); + TQSizePolicy v = m_parent->value().toSizePolicy(); if (m_childType == SizePolicy_HorData) - v.setHorData(QSizePolicy::SizeType(value.toInt())); + v.setHorData(TQSizePolicy::SizeType(value.toInt())); else if (m_childType == SizePolicy_VerData) - v.setVerData(QSizePolicy::SizeType(value.toInt())); + v.setVerData(TQSizePolicy::SizeType(value.toInt())); else if (m_childType == SizePolicy_HorStretch) v.setHorStretch(value.toInt()); else if (m_childType == SizePolicy_VerStretch) @@ -104,10 +104,10 @@ void ChildProperty::setValue(const QVariant &value, bool // rememberOldValue } } -QVariant ChildProperty::value( ) const +TQVariant ChildProperty::value( ) const { if (!m_parent->valid()) - return QVariant(); + return TQVariant(); switch (m_parent->type()) { case Size: @@ -139,7 +139,7 @@ QVariant ChildProperty::value( ) const else if (m_childType == SizePolicy_VerStretch) return m_parent->value().toSizePolicy().verStretch(); } - return QVariant(); + return TQVariant(); } } diff --git a/lib/widgets/propeditor/childproperty.h b/lib/widgets/propeditor/childproperty.h index fc43553a..6e247fd3 100644 --- a/lib/widgets/propeditor/childproperty.h +++ b/lib/widgets/propeditor/childproperty.h @@ -60,18 +60,18 @@ public: /**Constructs empty property.*/ ChildProperty() {} /**Constructs property.*/ - ChildProperty(MultiProperty *parent, int type, ChildPropertyType childType, const QString &name, - const QString &description, const QVariant &value = QVariant(), + ChildProperty(MultiProperty *parent, int type, ChildPropertyType childType, const TQString &name, + const TQString &description, const TQVariant &value = TQVariant(), bool save = true, bool readOnly = false); /**Constructs property with @ref ValueFromList type.*/ - ChildProperty(MultiProperty *parent, const QString &name, ChildPropertyType childType, - const QMap<QString, QVariant> &v_valueList, const QString &description, - const QVariant &value = QVariant(), bool save = true, bool readOnly = false); + ChildProperty(MultiProperty *parent, const TQString &name, ChildPropertyType childType, + const TQMap<TQString, TQVariant> &v_valueList, const TQString &description, + const TQVariant &value = TQVariant(), bool save = true, bool readOnly = false); /**@return the value of the property.*/ - virtual QVariant value() const; + virtual TQVariant value() const; /**Sets the value of the property.*/ - virtual void setValue(const QVariant &value, bool rememberOldValue = true); + virtual void setValue(const TQVariant &value, bool rememberOldValue = true); private: MultiProperty *m_parent; diff --git a/lib/widgets/propeditor/compat_tools.h b/lib/widgets/propeditor/compat_tools.h index 1a1a8735..a932b24a 100644 --- a/lib/widgets/propeditor/compat_tools.h +++ b/lib/widgets/propeditor/compat_tools.h @@ -1,6 +1,6 @@ #ifndef COMPAT_TOOLS_H #define COMPAT_TOOLS_H -#define i18n QObject::tr +#define i18n TQObject::tr #endif diff --git a/lib/widgets/propeditor/multiproperty.cpp b/lib/widgets/propeditor/multiproperty.cpp index 17b05797..9c3b04c4 100644 --- a/lib/widgets/propeditor/multiproperty.cpp +++ b/lib/widgets/propeditor/multiproperty.cpp @@ -43,50 +43,50 @@ MultiProperty::~MultiProperty() { } -QString MultiProperty::name() const +TQString MultiProperty::name() const { if (list.count() >= 1) return list.getFirst()->name(); - return QString::null; + return TQString::null; } int MultiProperty::type() const { if (list.count() >= 1) return list.getFirst()->type(); - return QVariant::Invalid; + return TQVariant::Invalid; } -QVariant MultiProperty::value() const +TQVariant MultiProperty::value() const { - QVariant value; + TQVariant value; if (list.count() >= 1) value = list.getFirst()->value(); - QPtrListIterator<Property> it(list); + TQPtrListIterator<Property> it(list); Property *property; while ((property = it.current()) != 0) { if (property->value() != value) - return QVariant::Invalid; + return TQVariant::Invalid; ++it; } return value; } -QString MultiProperty::description() const +TQString MultiProperty::description() const { - QString description; + TQString description; if (list.count() >= 1) description = list.getFirst()->description(); - QPtrListIterator<Property> it(list); + TQPtrListIterator<Property> it(list); Property *property; while ((property = it.current()) != 0) { if (property->description() != description) - return QString::null; + return TQString::null; ++it; } @@ -99,7 +99,7 @@ bool MultiProperty::readOnly() const if (list.count() >= 1) v = list.getFirst()->readOnly(); - QPtrListIterator<Property> it(list); + TQPtrListIterator<Property> it(list); Property *property; while ((property = it.current()) != 0) { @@ -117,7 +117,7 @@ bool MultiProperty::visible() const if (list.count() >= 1) v = list.getFirst()->readOnly(); - QPtrListIterator<Property> it(list); + TQPtrListIterator<Property> it(list); Property *property; while ((property = it.current()) != 0) { @@ -129,21 +129,21 @@ bool MultiProperty::visible() const return v; } -QMap<QString, QVariant> MultiProperty::valueList() const +TQMap<TQString, TQVariant> MultiProperty::valueList() const { if (list.count() >= 1) return list.getFirst()->valueList; - return QMap<QString, QVariant>(); + return TQMap<TQString, TQVariant>(); } -void MultiProperty::setDescription(const QString &description) +void MultiProperty::setDescription(const TQString &description) { Property *property; for (property = list.first(); property; property = list.next()) property->setDescription(description); } -/*void MultiProperty::setName(const QString &name) +/*void MultiProperty::setName(const TQString &name) { } @@ -151,7 +151,7 @@ void MultiProperty::setType(int type) { } */ -void MultiProperty::setValue(const QVariant &value) +void MultiProperty::setValue(const TQVariant &value) { Property *property; for (property = list.first(); property; property = list.next()) @@ -165,7 +165,7 @@ void MultiProperty::setValue(const QVariant &value) } } -void MultiProperty::setValue(const QVariant &value, bool emitChange) +void MultiProperty::setValue(const TQVariant &value, bool emitChange) { Property *property; for (property = list.first(); property; property = list.next()) @@ -176,7 +176,7 @@ void MultiProperty::setValue(const QVariant &value, bool emitChange) } } -void MultiProperty::setValueList(const QMap<QString, QVariant> &valueList) +void MultiProperty::setValueList(const TQMap<TQString, TQVariant> &valueList) { Property *property; for (property = list.first(); property; property = list.next()) @@ -227,13 +227,13 @@ void MultiProperty::removeProperty( MultiProperty *prop) removeProperty(property); } -QVariant MultiProperty::findValueDescription() const +TQVariant MultiProperty::findValueDescription() const { - QVariant val = value(); + TQVariant val = value(); if (type() != Property::ValueFromList) return val; - QMap<QString, QVariant> vl = valueList(); - for (QMap<QString, QVariant>::const_iterator it = vl.begin(); it != vl.end(); ++ it) + TQMap<TQString, TQVariant> vl = valueList(); + for (TQMap<TQString, TQVariant>::const_iterator it = vl.begin(); it != vl.end(); ++ it) { if (it.data() == val) return it.key(); @@ -241,12 +241,12 @@ QVariant MultiProperty::findValueDescription() const return ""; } -QVariant MultiProperty::findValueDescription(QVariant val) const +TQVariant MultiProperty::findValueDescription(TQVariant val) const { if (type() != Property::ValueFromList) return val; - QMap<QString, QVariant> vl = valueList(); - for (QMap<QString, QVariant>::const_iterator it = vl.begin(); it != vl.end(); ++ it) + TQMap<TQString, TQVariant> vl = valueList(); + for (TQMap<TQString, TQVariant>::const_iterator it = vl.begin(); it != vl.end(); ++ it) { if (it.data() == val) return it.key(); diff --git a/lib/widgets/propeditor/multiproperty.h b/lib/widgets/propeditor/multiproperty.h index a0d63c64..49410a04 100644 --- a/lib/widgets/propeditor/multiproperty.h +++ b/lib/widgets/propeditor/multiproperty.h @@ -19,9 +19,9 @@ #ifndef MULTIPROPERTY_H #define MULTIPROPERTY_H -#include <qptrlist.h> -#include <qmap.h> -#include <qvariant.h> +#include <tqptrlist.h> +#include <tqmap.h> +#include <tqvariant.h> #include "property.h" #include "childproperty.h" @@ -72,36 +72,36 @@ public: void removeProperty(MultiProperty *prop); /**Returns the name of a %property.*/ - QString name() const; + TQString name() const; /**Returns the type of a %property.*/ int type() const; /**Returns the value of a %property.*/ - QVariant value() const; + TQVariant value() const; /**Returns the description of a %property.*/ - QString description() const; + TQString description() const; /**Returns the readonly attribute of a %property.*/ bool readOnly() const; /**Returns the visibility attribute of a %property.*/ bool visible() const; /**The string-to-value correspondence list of the %property.*/ - QMap<QString, QVariant> valueList() const; + TQMap<TQString, TQVariant> valueList() const; /**Sets the value of a %property.*/ - void setValue(const QVariant& value); + void setValue(const TQVariant& value); /**Sets the value of a %property. @param value new value of thus %multiproperty @param emitChange if set to true then %property list which owns this %multiproperty emits propertyValueChanged signal.*/ - void setValue(const QVariant& value, bool emitChange); + void setValue(const TQVariant& value, bool emitChange); /**Sets the description of a %property.*/ - void setDescription(const QString &description); + void setDescription(const TQString &description); /**Sets the list of possible values of a %property.*/ - void setValueList(const QMap< QString, QVariant >& valueList); + void setValueList(const TQMap< TQString, TQVariant >& valueList); /**Finds string description for a value.*/ - QVariant findValueDescription() const; + TQVariant findValueDescription() const; /**Finds string description for a value.*/ - QVariant findValueDescription(QVariant val) const; + TQVariant findValueDescription(TQVariant val) const; /**Returns true if the %multiproperty has no properties in the list (i.e. it's invalid).*/ bool valid() const; @@ -110,10 +110,10 @@ public: void undo(); /**The list of child properties.*/ - QValueList<ChildProperty> details; + TQValueList<ChildProperty> details; private: - QPtrList<Property> list; + TQPtrList<Property> list; PropertyList *m_propertyList; diff --git a/lib/widgets/propeditor/pcheckbox.cpp b/lib/widgets/propeditor/pcheckbox.cpp index 15aacbff..3f406e4d 100644 --- a/lib/widgets/propeditor/pcheckbox.cpp +++ b/lib/widgets/propeditor/pcheckbox.cpp @@ -19,9 +19,9 @@ ***************************************************************************/ #include "pcheckbox.h" -#include <qlayout.h> -#include <qcheckbox.h> -#include <qpainter.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqpainter.h> #ifndef PURE_QT #include <klocale.h> @@ -31,37 +31,37 @@ namespace PropertyLib{ -PCheckBox::PCheckBox(MultiProperty *property, QWidget *parent, const char *name) +PCheckBox::PCheckBox(MultiProperty *property, TQWidget *parent, const char *name) :PropertyWidget(property, parent, name) { - QHBoxLayout *l = new QHBoxLayout(this, 0, 0); - m_edit = new QCheckBox(this); - m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0); + m_edit = new TQCheckBox(this); + m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); l->addWidget(m_edit); - connect(m_edit, SIGNAL(toggled(bool)), this, SLOT(updateProperty(bool))); + connect(m_edit, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(updateProperty(bool))); } -QVariant PCheckBox::value() const +TQVariant PCheckBox::value() const { - return QVariant(m_edit->isChecked()); + return TQVariant(m_edit->isChecked()); } -void PCheckBox::setValue(const QVariant &value, bool emitChange) +void PCheckBox::setValue(const TQVariant &value, bool emitChange) { - disconnect(m_edit, SIGNAL(toggled(bool)), this, SLOT(updateProperty(bool))); + disconnect(m_edit, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(updateProperty(bool))); m_edit->setChecked(value.toBool()); - connect(m_edit, SIGNAL(toggled(bool)), this, SLOT(updateProperty(bool))); + connect(m_edit, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(updateProperty(bool))); if (emitChange) emit propertyChanged(m_property, value); } void PCheckBox::updateProperty(bool val) { - emit propertyChanged(m_property, QVariant(val)); + emit propertyChanged(m_property, TQVariant(val)); } -void PCheckBox::drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value) +void PCheckBox::drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRect &r, const TQVariant &value) { p->setBrush(cg.background()); p->setPen(Qt::NoPen); diff --git a/lib/widgets/propeditor/pcheckbox.h b/lib/widgets/propeditor/pcheckbox.h index 0ea56498..53cefe57 100644 --- a/lib/widgets/propeditor/pcheckbox.h +++ b/lib/widgets/propeditor/pcheckbox.h @@ -32,21 +32,21 @@ namespace PropertyLib{ class PCheckBox: public PropertyWidget{ Q_OBJECT public: - PCheckBox(MultiProperty *property, QWidget *parent = 0, const char *name = 0); + PCheckBox(MultiProperty *property, TQWidget *parent = 0, const char *name = 0); /**@return the value currently entered in the editor widget.*/ - virtual QVariant value() const; + virtual TQVariant value() const; /**Sets the value shown in the editor widget. Set emitChange to false if you don't want to emit propertyChanged signal.*/ - virtual void setValue(const QVariant &value, bool emitChange=true); + virtual void setValue(const TQVariant &value, bool emitChange=true); /**Function to draw a property viewer when the editor isn't shown.*/ - virtual void drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value); + virtual void drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRect &r, const TQVariant &value); private slots: void updateProperty(bool val); private: - QCheckBox *m_edit; + TQCheckBox *m_edit; }; } diff --git a/lib/widgets/propeditor/pcolorbutton.cpp b/lib/widgets/propeditor/pcolorbutton.cpp index 84063e8b..9609442f 100644 --- a/lib/widgets/propeditor/pcolorbutton.cpp +++ b/lib/widgets/propeditor/pcolorbutton.cpp @@ -19,46 +19,46 @@ ***************************************************************************/ #include "pcolorbutton.h" -#include <qlayout.h> -#include <qpainter.h> +#include <tqlayout.h> +#include <tqpainter.h> #ifndef PURE_QT #include <kcolorbutton.h> #else -#include <qpushbutton.h> -#include <qpixmap.h> -#include <qiconset.h> +#include <tqpushbutton.h> +#include <tqpixmap.h> +#include <tqiconset.h> #endif -#include <qcolordialog.h> +#include <tqcolordialog.h> namespace PropertyLib { -PColorButton::PColorButton(MultiProperty* property, QWidget* parent, const char* name) +PColorButton::PColorButton(MultiProperty* property, TQWidget* parent, const char* name) :PropertyWidget(property, parent, name) { - QHBoxLayout *l = new QHBoxLayout(this, 0, 0); + TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0); #ifndef PURE_QT m_edit = new KColorButton(this); - connect(m_edit, SIGNAL(changed(const QColor&)), this, SLOT(updateProperty(const QColor&))); + connect(m_edit, TQT_SIGNAL(changed(const TQColor&)), this, TQT_SLOT(updateProperty(const TQColor&))); #else - m_edit = new QPushButton(this); - connect(m_edit, SIGNAL(clicked()), this, SLOT(changeColor())); + m_edit = new TQPushButton(this); + connect(m_edit, TQT_SIGNAL(clicked()), this, TQT_SLOT(changeColor())); #endif - m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); l->addWidget(m_edit); } -QVariant PColorButton::value() const +TQVariant PColorButton::value() const { #ifndef PURE_QT - return QVariant(m_edit->color()); + return TQVariant(m_edit->color()); #else - return QVariant(m_color); + return TQVariant(m_color); #endif } -void PColorButton::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value) +void PColorButton::drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value) { /* p->setBrush(value.toColor()); p->setPen(Qt::NoPen); @@ -69,22 +69,22 @@ void PColorButton::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r p->setBrush(value.toColor()); p->setPen(Qt::SolidLine); - QRect r2(r); - r2.setTopLeft(r.topLeft() + QPoint(5,5)); - r2.setBottomRight(r.bottomRight() - QPoint(5,5)); + TQRect r2(r); + r2.setTopLeft(r.topLeft() + TQPoint(5,5)); + r2.setBottomRight(r.bottomRight() - TQPoint(5,5)); p->drawRect(r2); } -void PColorButton::setValue(const QVariant& value, bool emitChange) +void PColorButton::setValue(const TQVariant& value, bool emitChange) { #ifndef PURE_QT - disconnect(m_edit, SIGNAL(changed(const QColor&)), this, SLOT(updateProperty(const QColor&))); + disconnect(m_edit, TQT_SIGNAL(changed(const TQColor&)), this, TQT_SLOT(updateProperty(const TQColor&))); m_edit->setColor(value.toColor()); - connect(m_edit, SIGNAL(changed(const QColor&)), this, SLOT(updateProperty(const QColor&))); + connect(m_edit, TQT_SIGNAL(changed(const TQColor&)), this, TQT_SLOT(updateProperty(const TQColor&))); #else m_color = value.toColor(); m_edit->setText(m_color.name()); - QPixmap px; + TQPixmap px; px.resize(14,14); px.fill(m_color); m_edit->setIconSet(px); @@ -94,7 +94,7 @@ void PColorButton::setValue(const QVariant& value, bool emitChange) } -void PColorButton::updateProperty(const QColor &// color +void PColorButton::updateProperty(const TQColor &// color ) { emit propertyChanged(m_property, value()); @@ -106,7 +106,7 @@ void PColorButton::changeColor() m_color = QColorDialog::getColor(m_color,this); updateProperty(m_color); m_edit->setText(m_color.name()); - QPixmap px; + TQPixmap px; px.resize(14,14); px.fill(m_color); m_edit->setIconSet(px); diff --git a/lib/widgets/propeditor/pcolorbutton.h b/lib/widgets/propeditor/pcolorbutton.h index 8c2ec49d..04126a50 100644 --- a/lib/widgets/propeditor/pcolorbutton.h +++ b/lib/widgets/propeditor/pcolorbutton.h @@ -26,7 +26,7 @@ class KColorButton; #else class QPushButton; -#include <qcolor.h> +#include <tqcolor.h> #endif namespace PropertyLib{ @@ -37,14 +37,14 @@ class PColorButton: public PropertyWidget { Q_OBJECT public: - PColorButton(MultiProperty *property, QWidget *parent = 0, const char *name = 0); + PColorButton(MultiProperty *property, TQWidget *parent = 0, const char *name = 0); - virtual QVariant value() const; - virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value); - virtual void setValue(const QVariant& value, bool emitChange); + virtual TQVariant value() const; + virtual void drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value); + virtual void setValue(const TQVariant& value, bool emitChange); protected slots: - void updateProperty(const QColor& color); + void updateProperty(const TQColor& color); void changeColor(); @@ -52,8 +52,8 @@ private: #ifndef PURE_QT KColorButton *m_edit; #else - QPushButton *m_edit; - QColor m_color; + TQPushButton *m_edit; + TQColor m_color; #endif }; diff --git a/lib/widgets/propeditor/pcolorcombo.cpp b/lib/widgets/propeditor/pcolorcombo.cpp index ecb3e618..eeac7de8 100644 --- a/lib/widgets/propeditor/pcolorcombo.cpp +++ b/lib/widgets/propeditor/pcolorcombo.cpp @@ -19,34 +19,34 @@ ***************************************************************************/ #include "pcolorcombo.h" -#include <qlayout.h> -#include <qpainter.h> +#include <tqlayout.h> +#include <tqpainter.h> #include <kcolorcombo.h> namespace PropertyLib{ -PColorCombo::PColorCombo(MultiProperty *property, QWidget *parent, const char *name) +PColorCombo::PColorCombo(MultiProperty *property, TQWidget *parent, const char *name) :PropertyWidget(property, parent, name) { - QHBoxLayout *l = new QHBoxLayout(this, 0, 0); + TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0); m_edit = new KColorCombo(this); - m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); l->addWidget(m_edit); - connect(m_edit, SIGNAL(activated(int)), this, SLOT(updateProperty(int))); + connect(m_edit, TQT_SIGNAL(activated(int)), this, TQT_SLOT(updateProperty(int))); } -QVariant PColorCombo::value() const +TQVariant PColorCombo::value() const { - return QVariant(m_edit->color()); + return TQVariant(m_edit->color()); } -void PColorCombo::setValue(const QVariant &value, bool emitChange) +void PColorCombo::setValue(const TQVariant &value, bool emitChange) { - disconnect(m_edit, SIGNAL(activated(int)), this, SLOT(updateProperty(int))); + disconnect(m_edit, TQT_SIGNAL(activated(int)), this, TQT_SLOT(updateProperty(int))); m_edit->setColor(value.toColor()); - connect(m_edit, SIGNAL(activated(int)), this, SLOT(updateProperty(int))); + connect(m_edit, TQT_SIGNAL(activated(int)), this, TQT_SLOT(updateProperty(int))); if (emitChange) emit propertyChanged(m_property, value); } @@ -56,7 +56,7 @@ void PColorCombo::updateProperty(int /*val*/) emit propertyChanged(m_property, value()); } -void PColorCombo::drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value) +void PColorCombo::drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRect &r, const TQVariant &value) { p->setPen(Qt::NoPen); p->setBrush(cg.background()); @@ -64,9 +64,9 @@ void PColorCombo::drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, p->setBrush(value.toColor()); p->setPen(Qt::SolidLine); - QRect r2(r); - r2.setTopLeft(r.topLeft() + QPoint(5,5)); - r2.setBottomRight(r.bottomRight() - QPoint(5,5)); + TQRect r2(r); + r2.setTopLeft(r.topLeft() + TQPoint(5,5)); + r2.setBottomRight(r.bottomRight() - TQPoint(5,5)); p->drawRect(r2); } diff --git a/lib/widgets/propeditor/pcolorcombo.h b/lib/widgets/propeditor/pcolorcombo.h index 203058c0..68f19e58 100644 --- a/lib/widgets/propeditor/pcolorcombo.h +++ b/lib/widgets/propeditor/pcolorcombo.h @@ -32,15 +32,15 @@ namespace PropertyLib{ class PColorCombo: public PropertyWidget{ Q_OBJECT public: - PColorCombo(MultiProperty *property, QWidget *parent = 0, const char *name = 0); + PColorCombo(MultiProperty *property, TQWidget *parent = 0, const char *name = 0); /**@return the value currently entered in the editor widget.*/ - virtual QVariant value() const; + virtual TQVariant value() const; /**Sets the value shown in the editor widget. Set emitChange to false if you don't want to emit propertyChanged signal.*/ - virtual void setValue(const QVariant &value, bool emitChange=true); + virtual void setValue(const TQVariant &value, bool emitChange=true); /**Function to draw a property viewer when the editor isn't shown.*/ - virtual void drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value); + virtual void drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRect &r, const TQVariant &value); private slots: void updateProperty(int val); diff --git a/lib/widgets/propeditor/pcombobox.cpp b/lib/widgets/propeditor/pcombobox.cpp index 36296a25..958ba34d 100644 --- a/lib/widgets/propeditor/pcombobox.cpp +++ b/lib/widgets/propeditor/pcombobox.cpp @@ -19,18 +19,18 @@ ***************************************************************************/ #include "pcombobox.h" -#include <qcombobox.h> -#include <qlayout.h> +#include <tqcombobox.h> +#include <tqlayout.h> namespace PropertyLib{ -PComboBox::PComboBox(MultiProperty *property, const QMap<QString, QVariant> &list, QWidget *parent, const char *name) +PComboBox::PComboBox(MultiProperty *property, const TQMap<TQString, TQVariant> &list, TQWidget *parent, const char *name) :PropertyWidget(property, parent, name), m_valueList(list) { init(false); } -PComboBox::PComboBox(MultiProperty *property, const QMap<QString, QVariant> &list, bool rw, QWidget *parent, const char *name) +PComboBox::PComboBox(MultiProperty *property, const TQMap<TQString, TQVariant> &list, bool rw, TQWidget *parent, const char *name) :PropertyWidget(property, parent, name), m_valueList(list) { init(rw); @@ -38,43 +38,43 @@ PComboBox::PComboBox(MultiProperty *property, const QMap<QString, QVariant> &lis void PComboBox::init(bool rw) { - QHBoxLayout *l = new QHBoxLayout(this, 0, 0); - m_edit = new QComboBox(rw, this); - m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0); + m_edit = new TQComboBox(rw, this); + m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); l->addWidget(m_edit); fillBox(); - connect(m_edit, SIGNAL(activated(int)), this, SLOT(updateProperty(int))); + connect(m_edit, TQT_SIGNAL(activated(int)), this, TQT_SLOT(updateProperty(int))); } void PComboBox::fillBox() { - for (QMap<QString, QVariant>::const_iterator it = m_valueList.begin(); it != m_valueList.end(); it++) + for (TQMap<TQString, TQVariant>::const_iterator it = m_valueList.begin(); it != m_valueList.end(); it++) { m_edit->insertItem(it.key()); } } -QVariant PComboBox::value() const +TQVariant PComboBox::value() const { - QMap<QString, QVariant>::const_iterator it = m_valueList.find(m_edit->currentText()); + TQMap<TQString, TQVariant>::const_iterator it = m_valueList.find(m_edit->currentText()); if (it == m_valueList.end()) - return QVariant(""); - return QVariant(it.data()); + return TQVariant(""); + return TQVariant(it.data()); } -void PComboBox::setValue(const QVariant &value, bool emitChange) +void PComboBox::setValue(const TQVariant &value, bool emitChange) { #if QT_VERSION >= 0x030100 if (!value.isNull()) #else - if (value.canCast(QVariant::String)) + if (value.canCast(TQVariant::String)) #endif { - disconnect(m_edit, SIGNAL(activated(int)), this, SLOT(updateProperty(int))); + disconnect(m_edit, TQT_SIGNAL(activated(int)), this, TQT_SLOT(updateProperty(int))); m_edit->setCurrentText(findDescription(value)); - connect(m_edit, SIGNAL(activated(int)), this, SLOT(updateProperty(int))); + connect(m_edit, TQT_SIGNAL(activated(int)), this, TQT_SLOT(updateProperty(int))); if (emitChange) emit propertyChanged(m_property, value); } @@ -85,9 +85,9 @@ void PComboBox::updateProperty(int /*val*/) emit propertyChanged(m_property, value()); } -QString PComboBox::findDescription(const QVariant &value) +TQString PComboBox::findDescription(const TQVariant &value) { - for (QMap<QString, QVariant>::const_iterator it = m_valueList.begin(); it != m_valueList.end(); ++ it) + for (TQMap<TQString, TQVariant>::const_iterator it = m_valueList.begin(); it != m_valueList.end(); ++ it) { if (it.data() == value) return it.key(); @@ -95,7 +95,7 @@ QString PComboBox::findDescription(const QVariant &value) return ""; } -void PComboBox::setValueList(const QMap<QString, QVariant> &valueList) +void PComboBox::setValueList(const TQMap<TQString, TQVariant> &valueList) { m_valueList = valueList; m_edit->clear(); diff --git a/lib/widgets/propeditor/pcombobox.h b/lib/widgets/propeditor/pcombobox.h index c74869f3..71deb388 100644 --- a/lib/widgets/propeditor/pcombobox.h +++ b/lib/widgets/propeditor/pcombobox.h @@ -20,9 +20,9 @@ #ifndef PCOMBOBOX_H #define PCOMBOBOX_H -#include <qmap.h> +#include <tqmap.h> -#include <qcombobox.h> +#include <tqcombobox.h> #include "propertywidget.h" @@ -37,22 +37,22 @@ class PComboBox: public PropertyWidget{ Q_OBJECT public: /**This constructor is used for read-only selection combo. It provides a value from valueList*/ - PComboBox(MultiProperty *property, const QMap<QString, QVariant> &list, QWidget *parent = 0, const char *name = 0); + PComboBox(MultiProperty *property, const TQMap<TQString, TQVariant> &list, TQWidget *parent = 0, const char *name = 0); /**This constructor is used for read-write selection combo. It provides a value from valueList*/ - PComboBox(MultiProperty *property, const QMap<QString, QVariant> &list, bool rw, QWidget *parent = 0, const char *name = 0); + PComboBox(MultiProperty *property, const TQMap<TQString, TQVariant> &list, bool rw, TQWidget *parent = 0, const char *name = 0); /**@return the value currently entered in the editor widget.*/ - virtual QVariant value() const; + virtual TQVariant value() const; /**Sets the value shown in the editor widget. Set emitChange to false if you don't want to emit propertyChanged signal.*/ - virtual void setValue(const QVariant &value, bool emitChange=true); + virtual void setValue(const TQVariant &value, bool emitChange=true); /**Sets the list of possible values shown in the editor widget. This method does not emit propertyChanged signal. Reimplemented because combobox is used to display possible values from valueList.*/ - virtual void setValueList(const QMap<QString, QVariant> &valueList); + virtual void setValueList(const TQMap<TQString, TQVariant> &valueList); protected: - QString findDescription(const QVariant &value); + TQString findDescription(const TQVariant &value); protected slots: void updateProperty(int val); @@ -62,9 +62,9 @@ private: void init(bool rw = false); /** map<description, value>*/ - QMap<QString, QVariant> m_valueList; + TQMap<TQString, TQVariant> m_valueList; - QComboBox *m_edit; + TQComboBox *m_edit; }; } diff --git a/lib/widgets/propeditor/pcursoredit.cpp b/lib/widgets/propeditor/pcursoredit.cpp index 7147d317..85aefd5e 100644 --- a/lib/widgets/propeditor/pcursoredit.cpp +++ b/lib/widgets/propeditor/pcursoredit.cpp @@ -19,17 +19,17 @@ ***************************************************************************/ #include "pcursoredit.h" -#include <qpainter.h> +#include <tqpainter.h> namespace PropertyLib{ -PCursorEdit::PCursorEdit(MultiProperty* property, const QMap<QString, QVariant> &spValues, - QWidget* parent, const char* name) +PCursorEdit::PCursorEdit(MultiProperty* property, const TQMap<TQString, TQVariant> &spValues, + TQWidget* parent, const char* name) :PComboBox(property, spValues, parent, name) { } -void PCursorEdit::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value) +void PCursorEdit::drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value) { PropertyWidget::drawViewer(p, cg, r, findDescription(value)); } diff --git a/lib/widgets/propeditor/pcursoredit.h b/lib/widgets/propeditor/pcursoredit.h index bdd063f4..6149bce7 100644 --- a/lib/widgets/propeditor/pcursoredit.h +++ b/lib/widgets/propeditor/pcursoredit.h @@ -25,16 +25,16 @@ namespace PropertyLib{ /** -@short %Property editor for QCursor values. +@short %Property editor for TQCursor values. */ class PCursorEdit: public PComboBox { Q_OBJECT public: - PCursorEdit(MultiProperty* property, const QMap<QString, QVariant> &spValues, - QWidget* parent = 0, const char* name = 0); + PCursorEdit(MultiProperty* property, const TQMap<TQString, TQVariant> &spValues, + TQWidget* parent = 0, const char* name = 0); - virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value); + virtual void drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value); }; } diff --git a/lib/widgets/propeditor/pdateedit.cpp b/lib/widgets/propeditor/pdateedit.cpp index 5aa5231c..141eef20 100644 --- a/lib/widgets/propeditor/pdateedit.cpp +++ b/lib/widgets/propeditor/pdateedit.cpp @@ -19,29 +19,29 @@ ***************************************************************************/ #include "pdateedit.h" -#include <qdatetimeedit.h> -#include <qpainter.h> -#include <qlayout.h> +#include <tqdatetimeedit.h> +#include <tqpainter.h> +#include <tqlayout.h> namespace PropertyLib{ -PDateEdit::PDateEdit(MultiProperty* property, QWidget* parent, const char* name) +PDateEdit::PDateEdit(MultiProperty* property, TQWidget* parent, const char* name) :PropertyWidget(property, parent, name) { - QHBoxLayout *l = new QHBoxLayout(this, 0, 0); + TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0); m_edit = new QDateEdit(this); - m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); l->addWidget(m_edit); - connect(m_edit, SIGNAL(valueChanged(const QDate&)), this, SLOT(updateProperty(const QDate&))); + connect(m_edit, TQT_SIGNAL(valueChanged(const TQDate&)), this, TQT_SLOT(updateProperty(const TQDate&))); } -QVariant PDateEdit::value() const +TQVariant PDateEdit::value() const { - return QVariant(m_edit->date()); + return TQVariant(m_edit->date()); } -void PDateEdit::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value) +void PDateEdit::drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value) { p->setPen(Qt::NoPen); p->setBrush(cg.background()); @@ -49,18 +49,18 @@ void PDateEdit::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, c p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, value.toDate().toString(Qt::LocalDate)); } -void PDateEdit::setValue(const QVariant& value, bool emitChange) +void PDateEdit::setValue(const TQVariant& value, bool emitChange) { - disconnect(m_edit, SIGNAL(valueChanged(const QDate&)), this, SLOT(updateProperty(const QDate&))); + disconnect(m_edit, TQT_SIGNAL(valueChanged(const TQDate&)), this, TQT_SLOT(updateProperty(const TQDate&))); m_edit->setDate(value.toDate()); - connect(m_edit, SIGNAL(valueChanged(const QDate&)), this, SLOT(updateProperty(const QDate&))); + connect(m_edit, TQT_SIGNAL(valueChanged(const TQDate&)), this, TQT_SLOT(updateProperty(const TQDate&))); if (emitChange) emit propertyChanged(m_property, value); } -void PDateEdit::updateProperty(const QDate &val) +void PDateEdit::updateProperty(const TQDate &val) { - emit propertyChanged(m_property, QVariant(val)); + emit propertyChanged(m_property, TQVariant(val)); } } diff --git a/lib/widgets/propeditor/pdateedit.h b/lib/widgets/propeditor/pdateedit.h index dd876557..da458737 100644 --- a/lib/widgets/propeditor/pdateedit.h +++ b/lib/widgets/propeditor/pdateedit.h @@ -27,20 +27,20 @@ class QDateEdit; namespace PropertyLib{ /** -@short %Property editor for QDate values. +@short %Property editor for TQDate values. */ class PDateEdit : public PropertyWidget { Q_OBJECT public: - PDateEdit(MultiProperty* property, QWidget* parent=0, const char* name=0); + PDateEdit(MultiProperty* property, TQWidget* parent=0, const char* name=0); - virtual QVariant value() const; - virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value); - virtual void setValue(const QVariant& value, bool emitChange); + virtual TQVariant value() const; + virtual void drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value); + virtual void setValue(const TQVariant& value, bool emitChange); private slots: - void updateProperty(const QDate &val); + void updateProperty(const TQDate &val); private: QDateEdit *m_edit; diff --git a/lib/widgets/propeditor/pdatetimeedit.cpp b/lib/widgets/propeditor/pdatetimeedit.cpp index 8f561888..5e414c77 100644 --- a/lib/widgets/propeditor/pdatetimeedit.cpp +++ b/lib/widgets/propeditor/pdatetimeedit.cpp @@ -19,28 +19,28 @@ ***************************************************************************/ #include "pdatetimeedit.h" -#include <qdatetimeedit.h> -#include <qpainter.h> -#include <qlayout.h> +#include <tqdatetimeedit.h> +#include <tqpainter.h> +#include <tqlayout.h> namespace PropertyLib{ -PDateTimeEdit::PDateTimeEdit(MultiProperty* property, QWidget* parent, const char* name): PropertyWidget(property, parent, name) +PDateTimeEdit::PDateTimeEdit(MultiProperty* property, TQWidget* parent, const char* name): PropertyWidget(property, parent, name) { - QHBoxLayout *l = new QHBoxLayout(this, 0, 0); + TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0); m_edit = new QDateTimeEdit(this); - m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); l->addWidget(m_edit); - connect(m_edit, SIGNAL(valueChanged(const QDateTime&)), this, SLOT(updateProperty(const QDateTime&))); + connect(m_edit, TQT_SIGNAL(valueChanged(const TQDateTime&)), this, TQT_SLOT(updateProperty(const TQDateTime&))); } -QVariant PDateTimeEdit::value() const +TQVariant PDateTimeEdit::value() const { - return QVariant(m_edit->dateTime()); + return TQVariant(m_edit->dateTime()); } -void PDateTimeEdit::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value) +void PDateTimeEdit::drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value) { p->setPen(Qt::NoPen); p->setBrush(cg.background()); @@ -48,18 +48,18 @@ void PDateTimeEdit::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, value.toDateTime().toString(Qt::LocalDate)); } -void PDateTimeEdit::setValue(const QVariant& value, bool emitChange) +void PDateTimeEdit::setValue(const TQVariant& value, bool emitChange) { - disconnect(m_edit, SIGNAL(valueChanged(const QDateTime&)), this, SLOT(updateProperty(const QDateTime&))); + disconnect(m_edit, TQT_SIGNAL(valueChanged(const TQDateTime&)), this, TQT_SLOT(updateProperty(const TQDateTime&))); m_edit->setDateTime(value.toDateTime()); - connect(m_edit, SIGNAL(valueChanged(const QDateTime&)), this, SLOT(updateProperty(const QDateTime&))); + connect(m_edit, TQT_SIGNAL(valueChanged(const TQDateTime&)), this, TQT_SLOT(updateProperty(const TQDateTime&))); if (emitChange) emit propertyChanged(m_property, value); } -void PDateTimeEdit::updateProperty(const QDateTime &val) +void PDateTimeEdit::updateProperty(const TQDateTime &val) { - emit propertyChanged(m_property, QVariant(val)); + emit propertyChanged(m_property, TQVariant(val)); } } diff --git a/lib/widgets/propeditor/pdatetimeedit.h b/lib/widgets/propeditor/pdatetimeedit.h index 39d9acba..40e8b428 100644 --- a/lib/widgets/propeditor/pdatetimeedit.h +++ b/lib/widgets/propeditor/pdatetimeedit.h @@ -27,20 +27,20 @@ class QDateTimeEdit; namespace PropertyLib{ /** -@short %Property editor for QDateTime values. +@short %Property editor for TQDateTime values. */ class PDateTimeEdit : public PropertyWidget { Q_OBJECT public: - PDateTimeEdit(MultiProperty* property, QWidget* parent=0, const char* name=0); + PDateTimeEdit(MultiProperty* property, TQWidget* parent=0, const char* name=0); - virtual QVariant value() const; - virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value); - virtual void setValue(const QVariant& value, bool emitChange); + virtual TQVariant value() const; + virtual void drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value); + virtual void setValue(const TQVariant& value, bool emitChange); private slots: - void updateProperty(const QDateTime &val); + void updateProperty(const TQDateTime &val); private: QDateTimeEdit *m_edit; diff --git a/lib/widgets/propeditor/pdoublenuminput.cpp b/lib/widgets/propeditor/pdoublenuminput.cpp index aa4f72aa..df6b3bcb 100644 --- a/lib/widgets/propeditor/pdoublenuminput.cpp +++ b/lib/widgets/propeditor/pdoublenuminput.cpp @@ -27,23 +27,23 @@ #include <limits.h> #include <math.h> -#include <qlayout.h> +#include <tqlayout.h> namespace PropertyLib{ -PDoubleNumInput::PDoubleNumInput(MultiProperty *property, QWidget *parent, const char *name) +PDoubleNumInput::PDoubleNumInput(MultiProperty *property, TQWidget *parent, const char *name) :PropertyWidget(property, parent, name) { - QHBoxLayout *l = new QHBoxLayout(this, 0, 0); + TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0); #ifndef PURE_QT m_edit = new KDoubleNumInput(-999999.0, 999999.0, 0.0, 0.01, 2, this); - m_edit->setLabel(QString::null); - connect(m_edit, SIGNAL(valueChanged(double)), this, SLOT(updateProperty(double))); + m_edit->setLabel(TQString::null); + connect(m_edit, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(updateProperty(double))); #else m_edit = new QFloatInput(-999999, 999999, 0.01, 2, this ); - connect(m_edit, SIGNAL(valueChanged(int)), this, SLOT(updateProperty(int))); + connect(m_edit, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(updateProperty(int))); #endif - m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); /* m_edit->setMinValue(-999999999); m_edit->setMaxValue(+999999999); m_edit->setPrecision(2);*/ @@ -51,21 +51,21 @@ PDoubleNumInput::PDoubleNumInput(MultiProperty *property, QWidget *parent, const } -QVariant PDoubleNumInput::value() const +TQVariant PDoubleNumInput::value() const { - return QVariant(m_edit->value()); + return TQVariant(m_edit->value()); } -void PDoubleNumInput::setValue(const QVariant &value, bool emitChange) +void PDoubleNumInput::setValue(const TQVariant &value, bool emitChange) { #ifndef PURE_QT - disconnect(m_edit, SIGNAL(valueChanged(double)), this, SLOT(updateProperty(double))); + disconnect(m_edit, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(updateProperty(double))); m_edit->setValue(value.toDouble()); - connect(m_edit, SIGNAL(valueChanged(double)), this, SLOT(updateProperty(double))); + connect(m_edit, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(updateProperty(double))); #else - disconnect(m_edit, SIGNAL(valueChanged(int)), this, SLOT(updateProperty(int))); + disconnect(m_edit, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(updateProperty(int))); m_edit->setValue(int(value.toDouble()*pow(m_edit->digits(),10))); - connect(m_edit, SIGNAL(valueChanged(int)), this, SLOT(updateProperty(int))); + connect(m_edit, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(updateProperty(int))); #endif if (emitChange) emit propertyChanged(m_property, value); @@ -73,15 +73,15 @@ void PDoubleNumInput::setValue(const QVariant &value, bool emitChange) void PDoubleNumInput::updateProperty(double val) { - emit propertyChanged(m_property, QVariant(val)); + emit propertyChanged(m_property, TQVariant(val)); } void PDoubleNumInput::updateProperty(int val) { #ifdef PURE_QT - QString format = QString("%.%1f").arg( m_edit->digits() ); - QString strVal = QString().sprintf(format.latin1(), + TQString format = TQString("%.%1f").arg( m_edit->digits() ); + TQString strVal = TQString().sprintf(format.latin1(), (val/(float)pow(m_edit->digits(),10)) ); - emit propertyChanged(m_property, QVariant(strVal)); + emit propertyChanged(m_property, TQVariant(strVal)); #else Q_UNUSED(val); #endif diff --git a/lib/widgets/propeditor/pdoublenuminput.h b/lib/widgets/propeditor/pdoublenuminput.h index a612601a..83849335 100644 --- a/lib/widgets/propeditor/pdoublenuminput.h +++ b/lib/widgets/propeditor/pdoublenuminput.h @@ -37,13 +37,13 @@ class PDoubleNumInput: public PropertyWidget { Q_OBJECT public: - PDoubleNumInput(MultiProperty *property, QWidget *parent = 0, const char *name = 0); + PDoubleNumInput(MultiProperty *property, TQWidget *parent = 0, const char *name = 0); /**@return the value currently entered in the editor widget.*/ - virtual QVariant value() const; + virtual TQVariant value() const; /**Sets the value shown in the editor widget. Set emitChange to false if you don't want to emit propertyChanged signal.*/ - virtual void setValue(const QVariant &value, bool emitChange=true); + virtual void setValue(const TQVariant &value, bool emitChange=true); private slots: //because of a bug in moc which doesn't detect conditional slots diff --git a/lib/widgets/propeditor/pdummywidget.cpp b/lib/widgets/propeditor/pdummywidget.cpp index b27f7476..65ec35e3 100644 --- a/lib/widgets/propeditor/pdummywidget.cpp +++ b/lib/widgets/propeditor/pdummywidget.cpp @@ -19,28 +19,28 @@ ***************************************************************************/ #include "pdummywidget.h" -#include <qpainter.h> +#include <tqpainter.h> namespace PropertyLib{ -PDummyWidget::PDummyWidget(MultiProperty *property, QWidget *parent, const char *name) +PDummyWidget::PDummyWidget(MultiProperty *property, TQWidget *parent, const char *name) :PropertyWidget(property, parent, name) { } -QVariant PDummyWidget::value() const +TQVariant PDummyWidget::value() const { return m_value; } -void PDummyWidget::setValue(const QVariant &value, bool emitChange) +void PDummyWidget::setValue(const TQVariant &value, bool emitChange) { m_value = value; if (emitChange) emit propertyChanged(m_property, value); } -void PDummyWidget::drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &/*value*/) +void PDummyWidget::drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRect &r, const TQVariant &/*value*/) { p->setBrush(cg.background()); p->setPen(Qt::NoPen); diff --git a/lib/widgets/propeditor/pdummywidget.h b/lib/widgets/propeditor/pdummywidget.h index 6fcca0a5..7e94428a 100644 --- a/lib/widgets/propeditor/pdummywidget.h +++ b/lib/widgets/propeditor/pdummywidget.h @@ -41,18 +41,18 @@ class PDummyWidget: public PropertyWidget { Q_OBJECT public: - PDummyWidget(MultiProperty *property, QWidget *parent = 0, const char *name = 0); + PDummyWidget(MultiProperty *property, TQWidget *parent = 0, const char *name = 0); /**@return the value currently entered in the editor widget.*/ - virtual QVariant value() const; + virtual TQVariant value() const; /**Sets the value shown in the editor widget. Set emitChange to false if you don't want to emit propertyChanged signal.*/ - virtual void setValue(const QVariant& value, bool emitChange); + virtual void setValue(const TQVariant& value, bool emitChange); /**Function to draw a property viewer when the editor isn't shown.*/ - virtual void drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value); + virtual void drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRect &r, const TQVariant &value); private: - QVariant m_value; + TQVariant m_value; }; } diff --git a/lib/widgets/propeditor/pfontbutton.cpp b/lib/widgets/propeditor/pfontbutton.cpp index e4fdf7eb..dc976b8f 100644 --- a/lib/widgets/propeditor/pfontbutton.cpp +++ b/lib/widgets/propeditor/pfontbutton.cpp @@ -19,9 +19,9 @@ ***************************************************************************/ #include "pfontbutton.h" -#include <qlayout.h> -#include <qpainter.h> -#include <qpushbutton.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqpushbutton.h> #include <kfontrequester.h> @@ -33,47 +33,47 @@ namespace PropertyLib{ -PFontButton::PFontButton(MultiProperty* property, QWidget* parent, const char* name) +PFontButton::PFontButton(MultiProperty* property, TQWidget* parent, const char* name) :PropertyWidget(property, parent, name) { - QHBoxLayout *l = new QHBoxLayout(this, 0, 0); + TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0); m_edit = new KFontRequester(this); - m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); #ifndef PURE_QT m_edit->button()->setText(i18n("...")); #endif l->addWidget(m_edit); - connect(m_edit, SIGNAL(fontSelected(const QFont& )), this, SLOT(updateProperty(const QFont& ))); + connect(m_edit, TQT_SIGNAL(fontSelected(const TQFont& )), this, TQT_SLOT(updateProperty(const TQFont& ))); } -QVariant PFontButton::value() const +TQVariant PFontButton::value() const { - return QVariant(m_edit->font()); + return TQVariant(m_edit->font()); } -void PFontButton::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value) +void PFontButton::drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value) { p->setPen(Qt::NoPen); p->setBrush(cg.background()); p->drawRect(r); - QFontInfo fi(value.toFont()); + TQFontInfo fi(value.toFont()); p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, - fi.family() + (fi.bold() ? i18n(" Bold") : QString("")) + - (fi.italic() ? i18n(" Italic") : QString("")) + - " " + QString("%1").arg(fi.pointSize()) ); + fi.family() + (fi.bold() ? i18n(" Bold") : TQString("")) + + (fi.italic() ? i18n(" Italic") : TQString("")) + + " " + TQString("%1").arg(fi.pointSize()) ); } -void PFontButton::setValue(const QVariant& value, bool emitChange) +void PFontButton::setValue(const TQVariant& value, bool emitChange) { - disconnect(m_edit, SIGNAL(fontSelected(const QFont&)), this, SLOT(updateProperty(const QFont&))); + disconnect(m_edit, TQT_SIGNAL(fontSelected(const TQFont&)), this, TQT_SLOT(updateProperty(const TQFont&))); m_edit->setFont(value.toFont()); - connect(m_edit, SIGNAL(fontSelected(const QFont& )), this, SLOT(updateProperty(const QFont& ))); + connect(m_edit, TQT_SIGNAL(fontSelected(const TQFont& )), this, TQT_SLOT(updateProperty(const TQFont& ))); if (emitChange) emit propertyChanged(m_property, value); } -void PFontButton::updateProperty(const QFont &// font +void PFontButton::updateProperty(const TQFont &// font ) { emit propertyChanged(m_property, value()); diff --git a/lib/widgets/propeditor/pfontbutton.h b/lib/widgets/propeditor/pfontbutton.h index 54ada141..6538f5ae 100644 --- a/lib/widgets/propeditor/pfontbutton.h +++ b/lib/widgets/propeditor/pfontbutton.h @@ -33,14 +33,14 @@ class PFontButton : public PropertyWidget { Q_OBJECT public: - PFontButton(MultiProperty* property, QWidget* parent = 0, const char* name = 0); + PFontButton(MultiProperty* property, TQWidget* parent = 0, const char* name = 0); - virtual QVariant value() const; - virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value); - virtual void setValue(const QVariant& value, bool emitChange); + virtual TQVariant value() const; + virtual void drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value); + virtual void setValue(const TQVariant& value, bool emitChange); protected slots: - void updateProperty(const QFont& font); + void updateProperty(const TQFont& font); private: KFontRequester *m_edit; diff --git a/lib/widgets/propeditor/pfontcombo.cpp b/lib/widgets/propeditor/pfontcombo.cpp index 368f18d9..8b0ee7a7 100644 --- a/lib/widgets/propeditor/pfontcombo.cpp +++ b/lib/widgets/propeditor/pfontcombo.cpp @@ -22,61 +22,61 @@ #ifndef PURE_QT #include <kfontcombo.h> #else -#include <qcombobox.h> +#include <tqcombobox.h> #endif -#include <qlayout.h> +#include <tqlayout.h> #ifdef PURE_QT -#include <qfontdatabase.h> +#include <tqfontdatabase.h> #endif namespace PropertyLib{ -PFontCombo::PFontCombo(MultiProperty *property, QWidget *parent, const char *name) +PFontCombo::PFontCombo(MultiProperty *property, TQWidget *parent, const char *name) :PropertyWidget(property, parent, name) { - QHBoxLayout *l = new QHBoxLayout(this, 0, 0); + TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0); m_edit = new KFontCombo(this); - m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); l->addWidget(m_edit); /*adymo: KFontCombo seems to have a bug: when it is not editable, the signals - activated(int) and textChanged(const QString &) are not emitted*/ + activated(int) and textChanged(const TQString &) are not emitted*/ #ifdef PURE_QT - QFontDatabase fonts; + TQFontDatabase fonts; m_edit->insertStringList(fonts.families()); - connect(m_edit, SIGNAL(activated(const QString &)), this, SLOT(updateProperty(const QString&))); + connect(m_edit, TQT_SIGNAL(activated(const TQString &)), this, TQT_SLOT(updateProperty(const TQString&))); #else - connect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&))); + connect(m_edit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateProperty(const TQString&))); #endif } -QVariant PFontCombo::value() const +TQVariant PFontCombo::value() const { #ifndef PURE_QT - return QVariant(m_edit->currentFont()); + return TQVariant(m_edit->currentFont()); #else - return QVariant(m_edit->currentText()); + return TQVariant(m_edit->currentText()); #endif } -void PFontCombo::setValue(const QVariant &value, bool emitChange) +void PFontCombo::setValue(const TQVariant &value, bool emitChange) { - disconnect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&))); + disconnect(m_edit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateProperty(const TQString&))); #ifndef PURE_QT m_edit->setCurrentFont(value.toString()); #else m_edit->setCurrentText(value.toString()); #endif - connect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&))); + connect(m_edit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateProperty(const TQString&))); if (emitChange) emit propertyChanged(m_property, value); } -void PFontCombo::updateProperty(const QString &val) +void PFontCombo::updateProperty(const TQString &val) { - emit propertyChanged(m_property, QVariant(val)); + emit propertyChanged(m_property, TQVariant(val)); } } diff --git a/lib/widgets/propeditor/pfontcombo.h b/lib/widgets/propeditor/pfontcombo.h index c2aa1948..a703c99d 100644 --- a/lib/widgets/propeditor/pfontcombo.h +++ b/lib/widgets/propeditor/pfontcombo.h @@ -36,16 +36,16 @@ namespace PropertyLib{ class PFontCombo: public PropertyWidget{ Q_OBJECT public: - PFontCombo(MultiProperty *property, QWidget *parent = 0, const char *name = 0); + PFontCombo(MultiProperty *property, TQWidget *parent = 0, const char *name = 0); /**@return the value currently entered in the editor widget.*/ - virtual QVariant value() const; + virtual TQVariant value() const; /**Sets the value shown in the editor widget. Set emitChange to false if you don't want to emit propertyChanged signal.*/ - virtual void setValue(const QVariant &value, bool emitChange=true); + virtual void setValue(const TQVariant &value, bool emitChange=true); private slots: - void updateProperty(const QString &val); + void updateProperty(const TQString &val); private: KFontCombo *m_edit; diff --git a/lib/widgets/propeditor/plineedit.cpp b/lib/widgets/propeditor/plineedit.cpp index ebd8d848..f5e1ecb0 100644 --- a/lib/widgets/propeditor/plineedit.cpp +++ b/lib/widgets/propeditor/plineedit.cpp @@ -20,38 +20,38 @@ #include "plineedit.h" #include <klineedit.h> -#include <qlayout.h> +#include <tqlayout.h> namespace PropertyLib{ -PLineEdit::PLineEdit(MultiProperty *property, QWidget *parent, const char *name) +PLineEdit::PLineEdit(MultiProperty *property, TQWidget *parent, const char *name) :PropertyWidget(property, parent, name) { - QHBoxLayout *l = new QHBoxLayout(this, 0, 0); + TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0); m_edit = new KLineEdit(this); - m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); l->addWidget(m_edit); - connect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&))); + connect(m_edit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateProperty(const TQString&))); } -QVariant PLineEdit::value() const +TQVariant PLineEdit::value() const { - return QVariant(m_edit->text()); + return TQVariant(m_edit->text()); } -void PLineEdit::setValue(const QVariant &value, bool emitChange) +void PLineEdit::setValue(const TQVariant &value, bool emitChange) { - disconnect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&))); + disconnect(m_edit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateProperty(const TQString&))); m_edit->setText(value.toString()); - connect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&))); + connect(m_edit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateProperty(const TQString&))); if (emitChange) emit propertyChanged(m_property, value); } -void PLineEdit::updateProperty(const QString& val) +void PLineEdit::updateProperty(const TQString& val) { - emit propertyChanged(m_property, QVariant(val)); + emit propertyChanged(m_property, TQVariant(val)); } } diff --git a/lib/widgets/propeditor/plineedit.h b/lib/widgets/propeditor/plineedit.h index f28ba191..6feb2a7b 100644 --- a/lib/widgets/propeditor/plineedit.h +++ b/lib/widgets/propeditor/plineedit.h @@ -32,16 +32,16 @@ namespace PropertyLib{ class PLineEdit: public PropertyWidget{ Q_OBJECT public: - PLineEdit(MultiProperty *property, QWidget *parent = 0, const char *name = 0); + PLineEdit(MultiProperty *property, TQWidget *parent = 0, const char *name = 0); /**@return the value currently entered in the editor widget.*/ - virtual QVariant value() const; + virtual TQVariant value() const; /**Sets the value shown in the editor widget. Set emitChange to false if you don't want to emit propertyChanged signal.*/ - virtual void setValue(const QVariant &value, bool emitChange=true); + virtual void setValue(const TQVariant &value, bool emitChange=true); private slots: - void updateProperty(const QString &val); + void updateProperty(const TQString &val); private: KLineEdit *m_edit; diff --git a/lib/widgets/propeditor/plinestyleedit.cpp b/lib/widgets/propeditor/plinestyleedit.cpp index 50f55e5d..adee930e 100644 --- a/lib/widgets/propeditor/plinestyleedit.cpp +++ b/lib/widgets/propeditor/plinestyleedit.cpp @@ -19,10 +19,10 @@ ***************************************************************************/ #include "plinestyleedit.h" -#include <qpainter.h> -#include <qpixmap.h> -#include <qcombobox.h> -#include <qlayout.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqcombobox.h> +#include <tqlayout.h> namespace PropertyLib { @@ -127,75 +127,75 @@ namespace PropertyLib { "................................................"}; -PLineStyleEdit::PLineStyleEdit(MultiProperty* property, QWidget* parent, const char* name): PropertyWidget(property, parent, name) +PLineStyleEdit::PLineStyleEdit(MultiProperty* property, TQWidget* parent, const char* name): PropertyWidget(property, parent, name) { - QHBoxLayout *l = new QHBoxLayout(this, 0, 0); - m_edit = new QComboBox(this); - m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0); + m_edit = new TQComboBox(this); + m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); l->addWidget(m_edit); - m_edit->insertItem(QPixmap(nopen)); - m_edit->insertItem(QPixmap(solid)); - m_edit->insertItem(QPixmap(dash)); - m_edit->insertItem(QPixmap(dashdot)); - m_edit->insertItem(QPixmap(dashdotdot)); + m_edit->insertItem(TQPixmap(nopen)); + m_edit->insertItem(TQPixmap(solid)); + m_edit->insertItem(TQPixmap(dash)); + m_edit->insertItem(TQPixmap(dashdot)); + m_edit->insertItem(TQPixmap(dashdotdot)); - connect(m_edit, SIGNAL(activated(int)), this, SLOT(updateProperty(int))); + connect(m_edit, TQT_SIGNAL(activated(int)), this, TQT_SLOT(updateProperty(int))); } -QVariant PLineStyleEdit::value() const +TQVariant PLineStyleEdit::value() const { return m_edit->currentItem(); } -void PLineStyleEdit::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value) +void PLineStyleEdit::drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value) { p->setPen(Qt::NoPen); p->setBrush(cg.background()); p->drawRect(r); - if (!value.canCast(QVariant::Int)) + if (!value.canCast(TQVariant::Int)) if ((value.toInt() > 5) || (value.toInt() < 0)) return; switch (value.toInt()) { case 0: - p->drawPixmap(r, QPixmap(nopen)); + p->drawPixmap(r, TQPixmap(nopen)); break; case 1: - p->drawPixmap(r, QPixmap(solid)); + p->drawPixmap(r, TQPixmap(solid)); break; case 2: - p->drawPixmap(r, QPixmap(dash)); + p->drawPixmap(r, TQPixmap(dash)); break; case 3: - p->drawPixmap(r, QPixmap(dashdot)); + p->drawPixmap(r, TQPixmap(dashdot)); break; case 4: - p->drawPixmap(r, QPixmap(dashdot)); + p->drawPixmap(r, TQPixmap(dashdot)); break; case 5: - p->drawPixmap(r, QPixmap(dashdotdot)); + p->drawPixmap(r, TQPixmap(dashdotdot)); break; } } -void PLineStyleEdit::setValue(const QVariant& value, bool emitChange) +void PLineStyleEdit::setValue(const TQVariant& value, bool emitChange) { - if (!value.canCast(QVariant::Int)) + if (!value.canCast(TQVariant::Int)) return; if ((value.toInt() > 5) || (value.toInt() < 0)) return; - disconnect(m_edit, SIGNAL(activated(int)), this, SLOT(updateProperty(int))); + disconnect(m_edit, TQT_SIGNAL(activated(int)), this, TQT_SLOT(updateProperty(int))); m_edit->setCurrentItem(value.toInt()); - connect(m_edit, SIGNAL(activated(int)), this, SLOT(updateProperty(int))); + connect(m_edit, TQT_SIGNAL(activated(int)), this, TQT_SLOT(updateProperty(int))); if (emitChange) emit propertyChanged(m_property, value); } void PLineStyleEdit::updateProperty(int val) { - emit propertyChanged(m_property, QVariant(val)); + emit propertyChanged(m_property, TQVariant(val)); } } diff --git a/lib/widgets/propeditor/plinestyleedit.h b/lib/widgets/propeditor/plinestyleedit.h index 16441273..00b546c6 100644 --- a/lib/widgets/propeditor/plinestyleedit.h +++ b/lib/widgets/propeditor/plinestyleedit.h @@ -32,17 +32,17 @@ namespace PropertyLib { class PLineStyleEdit : public PropertyWidget { Q_OBJECT public: - PLineStyleEdit(MultiProperty* property, QWidget* parent = 0, const char* name = 0); + PLineStyleEdit(MultiProperty* property, TQWidget* parent = 0, const char* name = 0); - virtual QVariant value() const; - virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value); - virtual void setValue(const QVariant& value, bool emitChange); + virtual TQVariant value() const; + virtual void drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value); + virtual void setValue(const TQVariant& value, bool emitChange); private slots: void updateProperty(int val); private: - QComboBox *m_edit; + TQComboBox *m_edit; }; } diff --git a/lib/widgets/propeditor/ppixmapedit.cpp b/lib/widgets/propeditor/ppixmapedit.cpp index db6a69d3..a4c18791 100644 --- a/lib/widgets/propeditor/ppixmapedit.cpp +++ b/lib/widgets/propeditor/ppixmapedit.cpp @@ -21,10 +21,10 @@ ***************************************************************************/ #include "ppixmapedit.h" -#include <qlayout.h> -#include <qpainter.h> -#include <qlabel.h> -#include <qcursor.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqlabel.h> +#include <tqcursor.h> #ifndef PURE_QT #include <klocale.h> @@ -35,41 +35,41 @@ #ifndef PURE_QT #include <kfiledialog.h> #else -#include <qfiledialog.h> +#include <tqfiledialog.h> #endif -#include <qpushbutton.h> +#include <tqpushbutton.h> namespace PropertyLib{ -PPixmapEdit::PPixmapEdit(MultiProperty* property, QWidget* parent, const char* name) +PPixmapEdit::PPixmapEdit(MultiProperty* property, TQWidget* parent, const char* name) :PropertyWidget(property, parent, name) { - QHBoxLayout *l = new QHBoxLayout(this, 0, 0); - m_edit = new QLabel(this); + TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0); + m_edit = new TQLabel(this); m_edit->setAlignment(Qt::AlignTop); m_edit->resize(width(), height()-1); m_edit->setBackgroundMode(Qt::PaletteBase); m_edit->installEventFilter(this); - m_button = new QPushButton(i18n("..."), this); + m_button = new TQPushButton(i18n("..."), this); m_button->resize(height(), height()-8); m_button->move(width() - m_button->width() -1, 0); - m_button->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed); + m_button->setSizePolicy(TQSizePolicy::Maximum, TQSizePolicy::Fixed); l->addWidget(m_edit); l->addWidget(m_button); - m_popup = new QLabel(0, 0, Qt::WStyle_NoBorder|Qt::WX11BypassWM|WStyle_StaysOnTop); + m_popup = new TQLabel(0, 0, Qt::WStyle_NoBorder|Qt::WX11BypassWM|WStyle_StaysOnTop); m_popup->hide(); - connect(m_button, SIGNAL(clicked()), this, SLOT(updateProperty())); + connect(m_button, TQT_SIGNAL(clicked()), this, TQT_SLOT(updateProperty())); } -QVariant PPixmapEdit::value() const +TQVariant PPixmapEdit::value() const { - return QVariant(*(m_edit->pixmap())); + return TQVariant(*(m_edit->pixmap())); } -void PPixmapEdit::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value) +void PPixmapEdit::drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value) { p->setPen(Qt::NoPen); p->setBrush(cg.background()); @@ -77,7 +77,7 @@ void PPixmapEdit::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, p->drawPixmap(r.topLeft().x(), r.topLeft().y(), value.toPixmap()); } -void PPixmapEdit::setValue(const QVariant& value, bool emitChange) +void PPixmapEdit::setValue(const TQVariant& value, bool emitChange) { m_edit->setPixmap(value.toPixmap()); if (emitChange) @@ -87,51 +87,51 @@ void PPixmapEdit::setValue(const QVariant& value, bool emitChange) void PPixmapEdit::updateProperty() { #ifndef PURE_QT - KURL url = KFileDialog::getImageOpenURL(QString::null, this); + KURL url = KFileDialog::getImageOpenURL(TQString::null, this); if (!url.isEmpty()) { - m_edit->setPixmap(QPixmap(url.path())); + m_edit->setPixmap(TQPixmap(url.path())); emit propertyChanged(m_property, value()); } #else - QString url = QFileDialog::getOpenFileName(); + TQString url = TQFileDialog::getOpenFileName(); if (!url.isEmpty()) { - m_edit->setPixmap(QPixmap(url)); + m_edit->setPixmap(TQPixmap(url)); emit propertyChanged(m_property, value()); } #endif } -void PPixmapEdit::resizeEvent(QResizeEvent *ev) +void PPixmapEdit::resizeEvent(TQResizeEvent *ev) { m_edit->resize(ev->size().width(), ev->size().height()-1); m_button->move(ev->size().width() - m_button->width(), 0); m_edit->setMaximumHeight(m_button->height()); } -bool PPixmapEdit::eventFilter(QObject *o, QEvent *ev) +bool PPixmapEdit::eventFilter(TQObject *o, TQEvent *ev) { if(o == m_edit) { - if(ev->type() == QEvent::MouseButtonPress) + if(ev->type() == TQEvent::MouseButtonPress) { if(m_edit->pixmap()->size().height() < height()-2 && m_edit->pixmap()->size().width() < width()-20) return false; m_popup->setPixmap(*(m_edit->pixmap())); m_popup->resize(m_edit->pixmap()->size()); - m_popup->move(QCursor::pos()); + m_popup->move(TQCursor::pos()); m_popup->show(); } - if(ev->type() == QEvent::MouseButtonRelease) + if(ev->type() == TQEvent::MouseButtonRelease) { if(m_popup->isVisible()) m_popup->hide(); } - if(ev->type() == QEvent::KeyPress) + if(ev->type() == TQEvent::KeyPress) { - QKeyEvent* e = static_cast<QKeyEvent*>(ev); + TQKeyEvent* e = static_cast<TQKeyEvent*>(ev); if((e->key() == Key_Enter) || (e->key()== Key_Space) || (e->key() == Key_Return)) { m_button->animateClick(); diff --git a/lib/widgets/propeditor/ppixmapedit.h b/lib/widgets/propeditor/ppixmapedit.h index bf7b1bfc..aacc0be8 100644 --- a/lib/widgets/propeditor/ppixmapedit.h +++ b/lib/widgets/propeditor/ppixmapedit.h @@ -34,22 +34,22 @@ class PPixmapEdit : public PropertyWidget { Q_OBJECT public: - PPixmapEdit(MultiProperty* property, QWidget* parent = 0, const char* name = 0); + PPixmapEdit(MultiProperty* property, TQWidget* parent = 0, const char* name = 0); - virtual QVariant value() const; - virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value); - virtual void setValue(const QVariant& value, bool emitChange); + virtual TQVariant value() const; + virtual void drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value); + virtual void setValue(const TQVariant& value, bool emitChange); - virtual void resizeEvent(QResizeEvent *ev); - virtual bool eventFilter(QObject *o, QEvent *ev); + virtual void resizeEvent(TQResizeEvent *ev); + virtual bool eventFilter(TQObject *o, TQEvent *ev); protected slots: void updateProperty(); private: - QLabel *m_edit; - QLabel *m_popup; - QPushButton *m_button; + TQLabel *m_edit; + TQLabel *m_popup; + TQPushButton *m_button; }; } diff --git a/lib/widgets/propeditor/ppointedit.cpp b/lib/widgets/propeditor/ppointedit.cpp index a76f881a..eb1a382e 100644 --- a/lib/widgets/propeditor/ppointedit.cpp +++ b/lib/widgets/propeditor/ppointedit.cpp @@ -20,38 +20,38 @@ #include "ppointedit.h" #include <klineedit.h> -#include <qlayout.h> -#include <qpainter.h> +#include <tqlayout.h> +#include <tqpainter.h> namespace PropertyLib{ -PPointEdit::PPointEdit(MultiProperty* property, QWidget* parent, const char* name): PropertyWidget(property, parent, name) +PPointEdit::PPointEdit(MultiProperty* property, TQWidget* parent, const char* name): PropertyWidget(property, parent, name) { - QHBoxLayout *l = new QHBoxLayout(this, 0, 0); + TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0); m_edit = new KLineEdit(this); - m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); l->addWidget(m_edit); m_edit->setReadOnly(true); } -QVariant PPointEdit::value() const +TQVariant PPointEdit::value() const { return m_value; } -void PPointEdit::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value) +void PPointEdit::drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value) { p->setPen(Qt::NoPen); p->setBrush(cg.background()); p->drawRect(r); - p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, QString("[ %1, %2 ]").arg(value.toPoint().x()).arg(value.toPoint().y())); + p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, TQString("[ %1, %2 ]").arg(value.toPoint().x()).arg(value.toPoint().y())); } -void PPointEdit::setValue(const QVariant& value, bool emitChange) +void PPointEdit::setValue(const TQVariant& value, bool emitChange) { m_value = value; - m_edit->setText(QString("[ %1, %2 ]").arg(value.toPoint().x()).arg(value.toPoint().y())); + m_edit->setText(TQString("[ %1, %2 ]").arg(value.toPoint().x()).arg(value.toPoint().y())); if (emitChange) emit propertyChanged(m_property, value); diff --git a/lib/widgets/propeditor/ppointedit.h b/lib/widgets/propeditor/ppointedit.h index 754e1c79..e78f9928 100644 --- a/lib/widgets/propeditor/ppointedit.h +++ b/lib/widgets/propeditor/ppointedit.h @@ -27,21 +27,21 @@ class KLineEdit; namespace PropertyLib{ /** -@short %Property editor for QPoint values. +@short %Property editor for TQPoint values. */ class PPointEdit : public PropertyWidget { Q_OBJECT public: - PPointEdit(MultiProperty* property, QWidget* parent=0, const char* name=0); + PPointEdit(MultiProperty* property, TQWidget* parent=0, const char* name=0); - virtual QVariant value() const; - virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value); - virtual void setValue(const QVariant& value, bool emitChange); + virtual TQVariant value() const; + virtual void drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value); + virtual void setValue(const TQVariant& value, bool emitChange); private: KLineEdit *m_edit; - QVariant m_value; + TQVariant m_value; }; diff --git a/lib/widgets/propeditor/prectedit.cpp b/lib/widgets/propeditor/prectedit.cpp index 4fd57fc2..6b7de9ce 100644 --- a/lib/widgets/propeditor/prectedit.cpp +++ b/lib/widgets/propeditor/prectedit.cpp @@ -20,38 +20,38 @@ #include "prectedit.h" #include <klineedit.h> -#include <qlayout.h> -#include <qpainter.h> +#include <tqlayout.h> +#include <tqpainter.h> namespace PropertyLib{ -PRectEdit::PRectEdit(MultiProperty* property, QWidget* parent, const char* name): PropertyWidget(property, parent, name) +PRectEdit::PRectEdit(MultiProperty* property, TQWidget* parent, const char* name): PropertyWidget(property, parent, name) { - QHBoxLayout *l = new QHBoxLayout(this, 0, 0); + TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0); m_edit = new KLineEdit(this); - m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); l->addWidget(m_edit); m_edit->setReadOnly(true); } -QVariant PRectEdit::value() const +TQVariant PRectEdit::value() const { return m_value; } -void PRectEdit::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value) +void PRectEdit::drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value) { p->setPen(Qt::NoPen); p->setBrush(cg.background()); p->drawRect(r); - p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, QString("[ %1, %2, %3, %4 ]").arg(value.toRect().x()).arg(value.toRect().y()).arg(value.toRect().width()).arg(value.toRect().height())); + p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, TQString("[ %1, %2, %3, %4 ]").arg(value.toRect().x()).arg(value.toRect().y()).arg(value.toRect().width()).arg(value.toRect().height())); } -void PRectEdit::setValue(const QVariant& value, bool emitChange) +void PRectEdit::setValue(const TQVariant& value, bool emitChange) { m_value = value; - m_edit->setText(QString("[ %1, %2, %3, %4 ]").arg(value.toRect().x()).arg(value.toRect().y()).arg(value.toRect().width()).arg(value.toRect().height())); + m_edit->setText(TQString("[ %1, %2, %3, %4 ]").arg(value.toRect().x()).arg(value.toRect().y()).arg(value.toRect().width()).arg(value.toRect().height())); if (emitChange) emit propertyChanged(m_property, value); diff --git a/lib/widgets/propeditor/prectedit.h b/lib/widgets/propeditor/prectedit.h index 3f8995b1..116ee668 100644 --- a/lib/widgets/propeditor/prectedit.h +++ b/lib/widgets/propeditor/prectedit.h @@ -27,21 +27,21 @@ class KLineEdit; namespace PropertyLib{ /** -@short %Property editor for QRect values. +@short %Property editor for TQRect values. */ class PRectEdit : public PropertyWidget { Q_OBJECT public: - PRectEdit(MultiProperty* property, QWidget* parent=0, const char* name=0); + PRectEdit(MultiProperty* property, TQWidget* parent=0, const char* name=0); - virtual QVariant value() const; - virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value); - virtual void setValue(const QVariant& value, bool emitChange); + virtual TQVariant value() const; + virtual void drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value); + virtual void setValue(const TQVariant& value, bool emitChange); private: KLineEdit *m_edit; - QVariant m_value; + TQVariant m_value; }; diff --git a/lib/widgets/propeditor/property.cpp b/lib/widgets/propeditor/property.cpp index 621a2cc9..d219b8c3 100644 --- a/lib/widgets/propeditor/property.cpp +++ b/lib/widgets/propeditor/property.cpp @@ -18,19 +18,19 @@ ***************************************************************************/ #include "property.h" -#include <qstring.h> +#include <tqstring.h> namespace PropertyLib{ -Property::Property(int type, const QString &name, const QString &description, - const QVariant &value, bool save, bool readOnly): +Property::Property(int type, const TQString &name, const TQString &description, + const TQVariant &value, bool save, bool readOnly): m_type(type), m_name(name), m_description(description), m_value(value), m_save(save), m_readOnly(readOnly), m_visible(true) { } -Property::Property(const QString &name, const QMap<QString, QVariant> &v_valueList, - const QString &description, const QVariant &value, bool save, bool readOnly): +Property::Property(const TQString &name, const TQMap<TQString, TQVariant> &v_valueList, + const TQString &description, const TQVariant &value, bool save, bool readOnly): valueList(v_valueList), m_type(ValueFromList), m_name(name), m_description(description), m_value(value), m_save(save), m_readOnly(readOnly), m_visible(true) @@ -54,12 +54,12 @@ bool Property::operator<(const Property &prop) const return false; } -QString Property::name() const +TQString Property::name() const { return m_name; } -void Property::setName(const QString &name) +void Property::setName(const TQString &name) { m_name = name; } @@ -74,12 +74,12 @@ void Property::setType(int type) m_type = type; } -QVariant Property::value() const +TQVariant Property::value() const { return m_value; } -void Property::setValue(const QVariant &value, bool rememberOldValue) +void Property::setValue(const TQVariant &value, bool rememberOldValue) { if (rememberOldValue) m_oldValue = m_value; @@ -88,17 +88,17 @@ void Property::setValue(const QVariant &value, bool rememberOldValue) m_value = value; } -QString Property::description() const +TQString Property::description() const { return m_description; } -void Property::setDescription(const QString &description) +void Property::setDescription(const TQString &description) { m_description = description; } -void Property::setValueList(const QMap<QString, QVariant> &v_valueList) +void Property::setValueList(const TQMap<TQString, TQVariant> &v_valueList) { valueList = v_valueList; } @@ -118,7 +118,7 @@ void Property::setVisible( const bool visible ) m_visible = visible; } -QVariant Property::oldValue() const +TQVariant Property::oldValue() const { if (m_oldValue.isNull()) return m_value; diff --git a/lib/widgets/propeditor/property.h b/lib/widgets/propeditor/property.h index 06f39c66..74fcb890 100644 --- a/lib/widgets/propeditor/property.h +++ b/lib/widgets/propeditor/property.h @@ -19,9 +19,9 @@ #ifndef PROPERTY_H #define PROPERTY_H -#include <qvariant.h> +#include <tqvariant.h> -#include <qmap.h> +#include <tqmap.h> class QWidget; class QString; @@ -36,14 +36,14 @@ namespace PropertyLib{ /** @short Property. -It includes support for QStringList properties, an i18n'ed label and stores an old value to allow undo. +It includes support for TQStringList properties, an i18n'ed label and stores an old value to allow undo. Contains name, type and value. -Type can be one of predefined types (including standard @ref QVariant types) by @ref PropertyLib::Property::PropertyType +Type can be one of predefined types (including standard @ref TQVariant types) by @ref PropertyLib::Property::PropertyType enum or custom user type. User defined types should have values more than 3000. -Value is a @ref QVariant. +Value is a @ref TQVariant. Property can optionally have a list of possible values. In that case use @ref ValueFromList type and valueList member. @@ -64,43 +64,43 @@ public: /** PropertyType. Integers that represent the type of the property. */ enum PropertyType { - //standard supported QVariant types - Invalid = QVariant::Invalid /**<invalid property type*/, - Map = QVariant::Map /**<QMap<QString, QVariant>*/, - List = QVariant::List /**<QValueList<QVariant>*/, - String = QVariant::String /**<string*/, - StringList = QVariant::StringList /**<string list*/, - Font = QVariant::Font /**<font*/, - Pixmap = QVariant::Pixmap /**<pixmap*/, - //@todo implement QVariant::Brush - Rect = QVariant::Rect /**<rectangle (x,y, width, height)*/, - Size = QVariant::Size /**<size (width, height)*/, - Color = QVariant::Color /**<color*/, - //@todo implement QVariant::Palette - //@todo implement QVariant::ColorGroup - //@todo implement QVariant::IconSet - Point = QVariant::Point /**<point (x,y)*/, - //@todo implement QVariant::Image - Integer = QVariant::Int /**<integer*/, - //@todo implement QVariant::UInt - Boolean = QVariant::Bool /**<boolean*/, - Double = QVariant::Double /**<double*/, - //@todo implement QVariant::CString - //@todo implement QVariant::PointArray - //@todo implement QVariant::Region - //@todo implement QVariant::Bitmap - Cursor = QVariant::Cursor /**<cursor*/, - SizePolicy = QVariant::SizePolicy /**<size policy (horizontal, vertical)*/, - Date = QVariant::Date /**<date*/, - //@todo implement QVariant::Time - DateTime = QVariant::DateTime /**<date and time*/, - //@todo implement QVariant::ByteArray - //@todo implement QVariant::BitArray - //@todo implement QVariant::KeySequence - //@todo implement QVariant::Pen - //@todo implement QVariant::Long - //@todo implement QVariant::LongLong - //@todo implement QVariant::ULongLong + //standard supported TQVariant types + Invalid = TQVariant::Invalid /**<invalid property type*/, + Map = TQVariant::Map /**<TQMap<TQString, TQVariant>*/, + List = TQVariant::List /**<TQValueList<TQVariant>*/, + String = TQVariant::String /**<string*/, + StringList = TQVariant::StringList /**<string list*/, + Font = TQVariant::Font /**<font*/, + Pixmap = TQVariant::Pixmap /**<pixmap*/, + //@todo implement TQVariant::Brush + Rect = TQVariant::Rect /**<rectangle (x,y, width, height)*/, + Size = TQVariant::Size /**<size (width, height)*/, + Color = TQVariant::Color /**<color*/, + //@todo implement TQVariant::Palette + //@todo implement TQVariant::ColorGroup + //@todo implement TQVariant::IconSet + Point = TQVariant::Point /**<point (x,y)*/, + //@todo implement TQVariant::Image + Integer = TQVariant::Int /**<integer*/, + //@todo implement TQVariant::UInt + Boolean = TQVariant::Bool /**<boolean*/, + Double = TQVariant::Double /**<double*/, + //@todo implement TQVariant::CString + //@todo implement TQVariant::PointArray + //@todo implement TQVariant::Region + //@todo implement TQVariant::Bitmap + Cursor = TQVariant::Cursor /**<cursor*/, + SizePolicy = TQVariant::SizePolicy /**<size policy (horizontal, vertical)*/, + Date = TQVariant::Date /**<date*/, + //@todo implement TQVariant::Time + DateTime = TQVariant::DateTime /**<date and time*/, + //@todo implement TQVariant::ByteArray + //@todo implement TQVariant::BitArray + //@todo implement TQVariant::KeySequence + //@todo implement TQVariant::Pen + //@todo implement TQVariant::Long + //@todo implement TQVariant::LongLong + //@todo implement TQVariant::ULongLong //predefined custom types @@ -117,36 +117,36 @@ public: /**Constructs empty property.*/ Property() {} /**Constructs property.*/ - Property(int type, const QString &name, const QString &description, - const QVariant &value = QVariant(), bool save = true, bool readOnly = false); + Property(int type, const TQString &name, const TQString &description, + const TQVariant &value = TQVariant(), bool save = true, bool readOnly = false); /**Constructs property with @ref ValueFromList type.*/ - Property(const QString &name, const QMap<QString, QVariant> &v_valueList, - const QString &description, const QVariant &value = QVariant(), bool save = true, bool readOnly = false); + Property(const TQString &name, const TQMap<TQString, TQVariant> &v_valueList, + const TQString &description, const TQVariant &value = TQVariant(), bool save = true, bool readOnly = false); virtual ~Property(); virtual bool operator<(const Property &prop) const; /**@return the name of the property.*/ - virtual QString name() const; + virtual TQString name() const; /**Sets the name of the property.*/ - virtual void setName(const QString &name); + virtual void setName(const TQString &name); /**@return the type of the property.*/ virtual int type() const; /**Sets the type of the property.*/ virtual void setType(int type); /**@return the value of the property.*/ - virtual QVariant value() const; + virtual TQVariant value() const; /**Sets the value of the property.*/ - virtual void setValue(const QVariant &value, bool rememberOldValue = true); + virtual void setValue(const TQVariant &value, bool rememberOldValue = true); /**@return the description of the property.*/ - virtual QString description() const; + virtual TQString description() const; /**Sets the description of the property.*/ - virtual void setDescription(const QString &description); + virtual void setDescription(const TQString &description); /**Sets the string-to-value correspondence list of the property. This is used to create comboboxes-like property editors.*/ - virtual void setValueList(const QMap<QString, QVariant> &list); + virtual void setValueList(const TQMap<TQString, TQVariant> &list); /**The string-to-value correspondence list of the property.*/ - QMap<QString, QVariant> valueList; + TQMap<TQString, TQVariant> valueList; /**Tells if the property can be saved to a stream, xml, etc. There is a possibility to use "GUI" properties that aren't @@ -160,17 +160,17 @@ public: virtual void setVisible(const bool visible); /**Gets the previous property value.*/ - virtual QVariant oldValue() const; + virtual TQVariant oldValue() const; private: // Property(Property &property) {}; // void operator=(Property &property) {}; int m_type; - QString m_name; - QString m_description; - QVariant m_value; - QVariant m_oldValue; + TQString m_name; + TQString m_description; + TQVariant m_value; + TQVariant m_oldValue; bool m_save; bool m_readOnly; bool m_visible; diff --git a/lib/widgets/propeditor/propertyeditor.cpp b/lib/widgets/propeditor/propertyeditor.cpp index 10f21ac1..c9e6e85d 100644 --- a/lib/widgets/propeditor/propertyeditor.cpp +++ b/lib/widgets/propeditor/propertyeditor.cpp @@ -27,12 +27,12 @@ #include "compat_tools.h" #endif -#include <qtable.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qptrlist.h> -#include <qvaluelist.h> -#include <qpushbutton.h> +#include <tqtable.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqptrlist.h> +#include <tqvaluelist.h> +#include <tqpushbutton.h> #include "property.h" #include "multiproperty.h" @@ -59,7 +59,7 @@ public: return m_property->type(); } - QString name() const + TQString name() const { return m_property->name(); } @@ -69,11 +69,11 @@ public: return m_property; } - virtual void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align) + virtual void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align) { if ((column == 0) && m_changed) { - QFont font; + TQFont font; font.setBold(true); p->setFont(font); p->setBrush(cg.highlight()); @@ -81,18 +81,18 @@ public: } if (column == 1) { - QRect r(0, 0, m_editor->header()->sectionSize(1), height()); + TQRect r(0, 0, m_editor->header()->sectionSize(1), height()); //FIXME: this is ugly, but how else can we deal with ValueFromList properties? - QVariant valueToDraw; + TQVariant valueToDraw; if (m_property->type() == Property::ValueFromList) valueToDraw = m_property->findValueDescription(); else valueToDraw = m_property->value(); - QColorGroup icg(cg); + TQColorGroup icg(cg); #ifndef PURE_QT - icg.setColor(QColorGroup::Background, backgroundColor()); + icg.setColor(TQColorGroup::Background, backgroundColor()); #else - icg.setColor(QColorGroup::Background, white); + icg.setColor(TQColorGroup::Background, white); #endif m_editor->machine(m_property)->propertyEditor->drawViewer(p, icg, r, valueToDraw); return; @@ -120,22 +120,22 @@ private: class PropertyGroupItem: public KListViewItem{ public: - PropertyGroupItem(KListView *parent, const QString &name) + PropertyGroupItem(KListView *parent, const TQString &name) :KListViewItem(parent, name) { init(); } - PropertyGroupItem(KListViewItem *parent, const QString &name) + PropertyGroupItem(KListViewItem *parent, const TQString &name) :KListViewItem(parent, name) { init(); } - virtual void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align) + virtual void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align) { if (column == 0) { - QFont font; + TQFont font; font.setBold(true); p->setFont(font); p->setBrush(cg.highlight()); @@ -164,7 +164,7 @@ public: setSelectable(false); } }; -PropertyEditor::PropertyEditor(QWidget *parent, const char *name) +PropertyEditor::PropertyEditor(TQWidget *parent, const char *name) :KListView(parent, name) { setSorting(-1); @@ -172,15 +172,15 @@ PropertyEditor::PropertyEditor(QWidget *parent, const char *name) addColumn(i18n("Name")); addColumn(i18n("Value")); setAllColumnsShowFocus(true); - setColumnWidthMode(0, QListView::Maximum); - setResizeMode(QListView::LastColumn); + setColumnWidthMode(0, TQListView::Maximum); + setResizeMode(TQListView::LastColumn); header()->setClickEnabled(false); - connect(header(), SIGNAL(sizeChange(int, int, int)), - this, SLOT(updateEditorSize())); - connect(this, SIGNAL(currentChanged(QListViewItem*)), - this, SLOT(slotClicked(QListViewItem*))); + connect(header(), TQT_SIGNAL(sizeChange(int, int, int)), + this, TQT_SLOT(updateEditorSize())); + connect(this, TQT_SIGNAL(currentChanged(TQListViewItem*)), + this, TQT_SLOT(slotClicked(TQListViewItem*))); m_currentEditItem = 0; m_doubleClickForEdit = true; @@ -188,19 +188,19 @@ PropertyEditor::PropertyEditor(QWidget *parent, const char *name) m_currentEditWidget = 0; m_list = 0; - m_currentEditArea = new QWidget(viewport()); + m_currentEditArea = new TQWidget(viewport()); m_currentEditArea->hide(); - m_undoButton = new QPushButton(m_currentEditArea); + m_undoButton = new TQPushButton(m_currentEditArea); #ifndef PURE_QT m_undoButton->setPixmap(SmallIcon("undo")); #else - m_undoButton->setPixmap( QPixmap("undo.xpm") ); + m_undoButton->setPixmap( TQPixmap("undo.xpm") ); #endif - m_undoButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::MinimumExpanding); + m_undoButton->setSizePolicy(TQSizePolicy::Maximum, TQSizePolicy::MinimumExpanding); m_undoButton->resize(m_undoButton->height(), m_undoButton->height()); m_undoButton->hide(); - connect(m_undoButton, SIGNAL(clicked()), this, SLOT(undo())); - m_currentEditLayout = new QGridLayout(m_currentEditArea, 1, 2, 0, 0); + connect(m_undoButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(undo())); + m_currentEditLayout = new TQGridLayout(m_currentEditArea, 1, 2, 0, 0); // m_currentEditLayout->addWidget(m_undoButton, 0, 1); } @@ -214,17 +214,17 @@ void PropertyEditor::populateProperties(PropertyList *list) if (list == 0) return; m_list = list; - connect(m_list, SIGNAL(propertyValueChanged(Property*)), this, SLOT(propertyValueChanged(Property*))); - const QValueList<QPair<QString, QValueList<QString> > >& groups = m_list->propertiesOfGroup(); - for (QValueList<QPair<QString, QValueList<QString> > >::const_iterator it = groups.begin(); + connect(m_list, TQT_SIGNAL(propertyValueChanged(Property*)), this, TQT_SLOT(propertyValueChanged(Property*))); + const TQValueList<QPair<TQString, TQValueList<TQString> > >& groups = m_list->propertiesOfGroup(); + for (TQValueList<QPair<TQString, TQValueList<TQString> > >::const_iterator it = groups.begin(); it != groups.end(); ++it) { // qWarning("PropertyEditor::populateProperties: adding group %s", (*it).first.ascii()); PropertyGroupItem *group = 0; if ( (!(*it).first.isEmpty()) && ((*it).second.count() > 0) ) group = new PropertyGroupItem(this, (*it).first); - const QValueList<QString> &properties = (*it).second; - for (QValueList<QString>::const_iterator it2 = properties.begin(); it2 != properties.end(); ++it2) + const TQValueList<TQString> &properties = (*it).second; + for (TQValueList<TQString>::const_iterator it2 = properties.begin(); it2 != properties.end(); ++it2) { // qWarning("PropertyEditor::populateProperties: adding property %s", (*it2).ascii()); if (group) @@ -241,7 +241,7 @@ void PropertyEditor::populateProperties(PropertyList *list) } } -void PropertyEditor::addProperty(PropertyGroupItem *group, const QString &name) +void PropertyEditor::addProperty(PropertyGroupItem *group, const TQString &name) { if ((*m_list)[name] == 0) return; @@ -250,7 +250,7 @@ void PropertyEditor::addProperty(PropertyGroupItem *group, const QString &name) addChildProperties(pitem); } -void PropertyEditor::addProperty(const QString &name) +void PropertyEditor::addProperty(const TQString &name) { if ((*m_list)[name] == 0) return; @@ -273,7 +273,7 @@ void PropertyEditor::addChildProperties(PropertyItem *parent) // qWarning("seeking children: count: %d", prop->details.count()); parent->setOpen(true); - for (QValueList<ChildProperty>::iterator it = prop->details.begin(); it != prop->details.end(); ++it) + for (TQValueList<ChildProperty>::iterator it = prop->details.begin(); it != prop->details.end(); ++it) { // qWarning("found child %s", (*it).name().ascii()); new PropertyItem(this, parent, new MultiProperty(&m_detailedList, &(*it))); @@ -288,7 +288,7 @@ void PropertyEditor::clearProperties() hideEditor(); - disconnect(m_list, SIGNAL(propertyValueChanged(Property*)), this, SLOT(propertyValueChanged(Property*))); + disconnect(m_list, TQT_SIGNAL(propertyValueChanged(Property*)), this, TQT_SLOT(propertyValueChanged(Property*))); clear(); delete m_list; m_list = 0; @@ -302,7 +302,7 @@ void PropertyEditor::propertyValueChanged(Property *property) else { // repaint all items - QListViewItemIterator it(this); + TQListViewItemIterator it(this); while (it.current()) { repaintItem(it.current()); @@ -311,7 +311,7 @@ void PropertyEditor::propertyValueChanged(Property *property) } } -void PropertyEditor::propertyChanged(MultiProperty *property, const QVariant &value) +void PropertyEditor::propertyChanged(MultiProperty *property, const TQVariant &value) { if (!property) return; @@ -360,7 +360,7 @@ void PropertyEditor::showEditor(PropertyItem *item) void PropertyEditor::placeEditor(PropertyItem *item) { - QRect r = itemRect(item); + TQRect r = itemRect(item); if (!r.size().isValid()) { ensureItemVisible(item); @@ -374,7 +374,7 @@ void PropertyEditor::placeEditor(PropertyItem *item) if (visibleWidth() < r.right()) r.setRight(visibleWidth()); - r = QRect(viewportToContents(r.topLeft()), r.size()); + r = TQRect(viewportToContents(r.topLeft()), r.size()); if (item->pixmap(1)) { @@ -417,7 +417,7 @@ void PropertyEditor::updateEditorSize() placeEditor(m_currentEditItem); } -void PropertyEditor::slotClicked(QListViewItem *item) +void PropertyEditor::slotClicked(TQListViewItem *item) { if (item == 0) { @@ -440,13 +440,13 @@ void PropertyEditor::slotClicked(QListViewItem *item) Machine *PropertyEditor::machine(MultiProperty *property) { // int type = property->type(); - QString name = property->name(); - QMap<QString, QVariant> values = property->valueList(); + TQString name = property->name(); + TQMap<TQString, TQVariant> values = property->valueList(); if (m_registeredForType[name] == 0) { m_registeredForType[name] = PropertyMachineFactory::getInstance()->machineForProperty(property); - connect(m_registeredForType[name]->propertyEditor, SIGNAL(propertyChanged(MultiProperty*, const QVariant&)), - this, SLOT(propertyChanged(MultiProperty*, const QVariant&))); + connect(m_registeredForType[name]->propertyEditor, TQT_SIGNAL(propertyChanged(MultiProperty*, const TQVariant&)), + this, TQT_SLOT(propertyChanged(MultiProperty*, const TQVariant&))); m_registeredForType[name]->propertyEditor->reparent(m_currentEditArea, 0, m_currentEditArea->childrenRect().topLeft()); m_registeredForType[name]->propertyEditor->hide(); } @@ -455,7 +455,7 @@ Machine *PropertyEditor::machine(MultiProperty *property) void PropertyEditor::clearMachineCache() { - for (QMap<QString, Machine* >::iterator it = m_registeredForType.begin(); it != m_registeredForType.end(); ++it) + for (TQMap<TQString, Machine* >::iterator it = m_registeredForType.begin(); it != m_registeredForType.end(); ++it) { delete it.data(); } diff --git a/lib/widgets/propeditor/propertyeditor.h b/lib/widgets/propeditor/propertyeditor.h index 4091d31a..c6c72237 100644 --- a/lib/widgets/propeditor/propertyeditor.h +++ b/lib/widgets/propeditor/propertyeditor.h @@ -23,7 +23,7 @@ #ifndef PURE_QT #include <klistview.h> #else -#include <qlistview.h> +#include <tqlistview.h> #define KListView QListView #define KListViewItem QListViewItem #endif @@ -59,7 +59,7 @@ class PropertyEditor: public KListView{ Q_OBJECT public: /**Constructs the property editor.*/ - PropertyEditor(QWidget *parent = 0, const char *name = 0); + PropertyEditor(TQWidget *parent = 0, const char *name = 0); ~PropertyEditor(); /**@return @ref Machine for given property. @@ -83,25 +83,25 @@ protected slots: /**Updates property widget in the editor.*/ void propertyValueChanged(Property* property); /**Updates property in the list when new value is selected in the editor.*/ - void propertyChanged(MultiProperty *property, const QVariant &value); + void propertyChanged(MultiProperty *property, const TQVariant &value); /**Shows property editor.*/ - void slotClicked(QListViewItem* item); + void slotClicked(TQListViewItem* item); void updateEditorSize(); /**Undoes the last change in property editor.*/ void undo(); protected: - void editItem(QListViewItem*, int); + void editItem(TQListViewItem*, int); void hideEditor(); void showEditor(PropertyItem *item); void placeEditor(PropertyItem *item); PropertyWidget *prepareEditor(PropertyItem *item); - void addGroup(const QString &name); - void addProperty(PropertyGroupItem *group, const QString &name); - void addProperty(const QString &name); + void addGroup(const TQString &name); + void addProperty(PropertyGroupItem *group, const TQString &name); + void addProperty(const TQString &name); void addChildProperties(PropertyItem *parent); private: @@ -109,17 +109,17 @@ private: PropertyList m_detailedList; //machines cache for property types, machines will be deleted - QMap<QString, Machine* > m_registeredForType; + TQMap<TQString, Machine* > m_registeredForType; PropertyItem *m_currentEditItem; PropertyWidget *m_currentEditWidget; - QWidget *m_currentEditArea; - QGridLayout *m_currentEditLayout; + TQWidget *m_currentEditArea; + TQGridLayout *m_currentEditLayout; bool m_doubleClickForEdit; - QListViewItem* m_lastClickedItem; + TQListViewItem* m_lastClickedItem; - QPushButton *m_undoButton; + TQPushButton *m_undoButton; friend class PropertyItem; }; diff --git a/lib/widgets/propeditor/propertylist.cpp b/lib/widgets/propeditor/propertylist.cpp index e92f28b3..491c2ebb 100644 --- a/lib/widgets/propeditor/propertylist.cpp +++ b/lib/widgets/propeditor/propertylist.cpp @@ -25,12 +25,12 @@ namespace PropertyLib{ PropertyList::PropertyList() - :QObject(0, 0), m_propertyOwner(true) + :TQObject(0, 0), m_propertyOwner(true) { } PropertyList::PropertyList(bool propertyOwner) - :QObject(0, 0), m_propertyOwner(propertyOwner) + :TQObject(0, 0), m_propertyOwner(propertyOwner) { } @@ -39,7 +39,7 @@ PropertyList::~PropertyList() clear(); } -MultiProperty *PropertyList::operator[](const QString &name) +MultiProperty *PropertyList::operator[](const TQString &name) { if (m_list.contains(name)) return m_list[name]; @@ -47,7 +47,7 @@ MultiProperty *PropertyList::operator[](const QString &name) return new MultiProperty(this); } -MultiProperty *PropertyList::property( const QString &name ) +MultiProperty *PropertyList::property( const TQString &name ) { if (m_list.contains(name)) return m_list[name]; @@ -73,7 +73,7 @@ void PropertyList::addProperty(Property *property) } } -void PropertyList::addProperty(const QString &group, Property *property) +void PropertyList::addProperty(const TQString &group, Property *property) { if (property == 0) return; @@ -101,9 +101,9 @@ void PropertyList::removeProperty(Property *property) emit aboutToDeleteProperty(property); MultiProperty *mp = m_list[property->name()]; - QString group = m_groupOfProperty[mp]; + TQString group = m_groupOfProperty[mp]; removeFromGroup(mp); - QString pname = property->name(); + TQString pname = property->name(); mp->removeProperty(property); if (m_propertyOwner) delete property; @@ -117,11 +117,11 @@ void PropertyList::removeProperty(Property *property) addToGroup(group, mp); } -void PropertyList::removeProperty(const QString &name) +void PropertyList::removeProperty(const TQString &name) { if (m_list.contains(name)) { - QString group = m_groupOfProperty[m_list[name]]; + TQString group = m_groupOfProperty[m_list[name]]; removeFromGroup(m_list[name]); Property *property; for (property = m_list[name]->list.first(); property; property = m_list[name]->list.next()) @@ -146,17 +146,17 @@ void PropertyList::removeProperty(const QString &name) } } -const QValueList<QPair<QString, QValueList<QString> > >& PropertyList::propertiesOfGroup() const +const TQValueList<QPair<TQString, TQValueList<TQString> > >& PropertyList::propertiesOfGroup() const { return m_propertiesOfGroup; } -const QMap<MultiProperty*, QString>& PropertyList::groupOfProperty() const +const TQMap<MultiProperty*, TQString>& PropertyList::groupOfProperty() const { return m_groupOfProperty; } -void PropertyList::addToGroup(const QString &group, MultiProperty *property) +void PropertyList::addToGroup(const TQString &group, MultiProperty *property) { if (!property) return; @@ -165,8 +165,8 @@ void PropertyList::addToGroup(const QString &group, MultiProperty *property) if (m_groupOfProperty.contains(property) && (m_groupOfProperty[property] == group)) return; - QPair<QString, QValueList<QString> > *groupPair = 0; - for(QValueList<QPair<QString, QValueList<QString> > >::iterator it = m_propertiesOfGroup.begin(); + QPair<TQString, TQValueList<TQString> > *groupPair = 0; + for(TQValueList<QPair<TQString, TQValueList<TQString> > >::iterator it = m_propertiesOfGroup.begin(); it != m_propertiesOfGroup.end(); ++it) { if ((*it).first == group) @@ -177,7 +177,7 @@ void PropertyList::addToGroup(const QString &group, MultiProperty *property) } if (groupPair == 0) { - groupPair = new QPair<QString, QValueList<QString> >(); + groupPair = new QPair<TQString, TQValueList<TQString> >(); groupPair->first = group; groupPair->second.append(property->name()); m_propertiesOfGroup.append(*groupPair); @@ -193,10 +193,10 @@ void PropertyList::addToGroup(const QString &group, MultiProperty *property) void PropertyList::removeFromGroup(MultiProperty *property) { - QString group = m_groupOfProperty[property]; + TQString group = m_groupOfProperty[property]; // qWarning("removeFromGroup group=%s", group.ascii()); - for(QValueList<QPair<QString, QValueList<QString> > >::iterator it = m_propertiesOfGroup.begin(); + for(TQValueList<QPair<TQString, TQValueList<TQString> > >::iterator it = m_propertiesOfGroup.begin(); it != m_propertiesOfGroup.end(); ++it) { // qWarning("removeFromGroup checking %s", (*it).first.ascii()); @@ -213,22 +213,22 @@ void PropertyList::removeFromGroup(MultiProperty *property) void PropertyList::clear( ) { - for (QMap<QString, MultiProperty*>::iterator it = m_list.begin(); it != m_list.end(); ++it) + for (TQMap<TQString, MultiProperty*>::iterator it = m_list.begin(); it != m_list.end(); ++it) removeProperty(it.key()); } -bool PropertyList::contains( const QString & name ) +bool PropertyList::contains( const TQString & name ) { if (m_list.contains(name)) return true; return false; } -QPtrList<Property> PropertyList::properties(const QString &name) +TQPtrList<Property> PropertyList::properties(const TQString &name) { if (m_list.contains(name)) return m_list[name]->list; - return QPtrList<Property>(); + return TQPtrList<Property>(); } PropertyList::Iterator PropertyList::begin() @@ -276,7 +276,7 @@ MultiProperty *PropertyList::Iterator::operator *() return data(); } -QString PropertyList::Iterator::key() +TQString PropertyList::Iterator::key() { return current.key(); } @@ -306,7 +306,7 @@ PropertyBuffer::PropertyBuffer( ) void PropertyBuffer::intersect(const PropertyList *list) { qWarning("PropertyBuffer::intersect"); - for (QMap<QString, MultiProperty*>::iterator it = m_list.begin(); it != m_list.end(); ++it) + for (TQMap<TQString, MultiProperty*>::iterator it = m_list.begin(); it != m_list.end(); ++it) { // qWarning("intersect:: for mp = %s", it.data()->name().ascii()); if (list->m_list.contains(it.key())) @@ -327,13 +327,13 @@ void PropertyBuffer::intersect(const PropertyList *list) // qWarning("intersect:: removing %s from intersection", it.key().ascii()); removeProperty(it.key()); } - connect(list, SIGNAL(propertyValueChanged(Property*)), this, SLOT(intersectedValueChanged(Property*))); + connect(list, TQT_SIGNAL(propertyValueChanged(Property*)), this, TQT_SLOT(intersectedValueChanged(Property*))); } void PropertyBuffer::intersectedValueChanged(Property *property) { // qWarning("PropertyBuffer::intersectedValueChanged"); - QString propertyName = property->name(); + TQString propertyName = property->name(); if (!contains(propertyName)) return; @@ -341,7 +341,7 @@ void PropertyBuffer::intersectedValueChanged(Property *property) if (mp == *m_list[propertyName]) { Property *prop; - QPtrList<Property> props = properties(propertyName); + TQPtrList<Property> props = properties(propertyName); for (prop = props.first(); prop; prop = props.next()) emit propertyValueChanged(prop); } @@ -351,7 +351,7 @@ PropertyBuffer::PropertyBuffer(PropertyList *list) :PropertyList(false) { //deep copy of m_list - for (QMap<QString, MultiProperty*>::const_iterator it = list->m_list.begin(); + for (TQMap<TQString, MultiProperty*>::const_iterator it = list->m_list.begin(); it != list->m_list.end(); ++it) { MultiProperty *mp = new MultiProperty(*it.data()); @@ -359,7 +359,7 @@ PropertyBuffer::PropertyBuffer(PropertyList *list) addToGroup(list->m_groupOfProperty[it.data()], mp); m_list[it.key()] = mp; } - connect(list, SIGNAL(propertyValueChanged(Property*)), this, SLOT(intersectedValueChanged(Property*))); + connect(list, TQT_SIGNAL(propertyValueChanged(Property*)), this, TQT_SLOT(intersectedValueChanged(Property*))); } } diff --git a/lib/widgets/propeditor/propertylist.h b/lib/widgets/propeditor/propertylist.h index 45071606..96e351fc 100644 --- a/lib/widgets/propeditor/propertylist.h +++ b/lib/widgets/propeditor/propertylist.h @@ -20,11 +20,11 @@ #ifndef PROPERTYLIST_H #define PROPERTYLIST_H -#include <qobject.h> -#include <qmap.h> -#include <qptrlist.h> -#include <qvaluelist.h> -#include <qpair.h> +#include <tqobject.h> +#include <tqmap.h> +#include <tqptrlist.h> +#include <tqvaluelist.h> +#include <tqpair.h> namespace PropertyLib{ @@ -66,7 +66,7 @@ public: bool operator != (Iterator it); - QString key(); + TQString key(); MultiProperty *data(); private: @@ -74,7 +74,7 @@ public: Iterator(PropertyList *list, bool end); void next(); - QMap<QString, MultiProperty*>::iterator current; + TQMap<TQString, MultiProperty*>::iterator current; PropertyList *m_list; friend class PropertyList; @@ -93,34 +93,34 @@ public: list["My Property"]->setValue("My Value"); /endcode @return @ref MultiProperty with given name.*/ - virtual MultiProperty *operator[](const QString &name); + virtual MultiProperty *operator[](const TQString &name); /**Accesses a property by it's name. All property modifications are allowed trough this method. For example, to set a value of a property */ - MultiProperty *property( const QString &name ); + MultiProperty *property( const TQString &name ); /**Adds the property to the list to the "common" group.*/ virtual void addProperty(Property *property); /**Adds the property to the list in group.*/ - virtual void addProperty(const QString &group, Property *property); + virtual void addProperty(const TQString &group, Property *property); /**Removes property from the list. Emits aboutToDeleteProperty before removing.*/ virtual void removeProperty(Property *property); /**Removes property with the given name from the list. Emits @ref aboutToDeleteProperty before removing.*/ - virtual void removeProperty(const QString &name); + virtual void removeProperty(const TQString &name); /**@return the list of grouped properties.*/ - virtual const QValueList<QPair<QString, QValueList<QString> > >& propertiesOfGroup() const; + virtual const TQValueList<QPair<TQString, TQValueList<TQString> > >& propertiesOfGroup() const; /**@return the map: property - group name.*/ - virtual const QMap<MultiProperty*, QString>& groupOfProperty() const; + virtual const TQMap<MultiProperty*, TQString>& groupOfProperty() const; /**Clears the list of properties.*/ virtual void clear(); /**Returns true if the list of properties contains property with given name.*/ - virtual bool contains(const QString &name); + virtual bool contains(const TQString &name); /**The list of properties with given name.*/ - QPtrList<Property> properties(const QString &name); + TQPtrList<Property> properties(const TQString &name); Iterator begin(); Iterator end(); @@ -136,19 +136,19 @@ protected: PropertyList(bool propertyOwner); /**Adds property to a group.*/ - void addToGroup(const QString &group, MultiProperty *property); + void addToGroup(const TQString &group, MultiProperty *property); /**Removes property from a group.*/ void removeFromGroup(MultiProperty *property); private: //sorted list of properties in form name: property - QMap<QString, MultiProperty*> m_list; + TQMap<TQString, MultiProperty*> m_list; //groups of properties: // list of group name: (list of property names) - QValueList<QPair<QString, QValueList<QString> > > m_propertiesOfGroup; + TQValueList<QPair<TQString, TQValueList<TQString> > > m_propertiesOfGroup; // map of property: group - QMap<MultiProperty*, QString> m_groupOfProperty; + TQMap<MultiProperty*, TQString> m_groupOfProperty; //indicates that this list will delete properties after removeProperty() //and also in destructor diff --git a/lib/widgets/propeditor/propertymachinefactory.cpp b/lib/widgets/propeditor/propertymachinefactory.cpp index 0ab0945f..613777d6 100644 --- a/lib/widgets/propeditor/propertymachinefactory.cpp +++ b/lib/widgets/propeditor/propertymachinefactory.cpp @@ -22,10 +22,10 @@ #ifndef PURE_QT #include <klocale.h> #else -#define i18n QObject::tr +#define i18n TQObject::tr #endif -#include <qmap.h> +#include <tqmap.h> #include "property.h" #include "childproperty.h" @@ -73,8 +73,8 @@ PropertyMachineFactory::~PropertyMachineFactory() Machine *PropertyMachineFactory::machineForProperty(MultiProperty *property) { int type = property->type(); - QString propertyName = property->name(); - QMap<QString, QVariant> valueList = property->valueList(); + TQString propertyName = property->name(); + TQMap<TQString, TQVariant> valueList = property->valueList(); if (m_registeredForType.contains(propertyName)) return (*m_registeredForType[propertyName])(); @@ -143,14 +143,14 @@ Machine *PropertyMachineFactory::machineForProperty(MultiProperty *property) } case Property::SizePolicy: { - QMap<QString, QVariant> spValues; - spValues[i18n("Fixed")] = QSizePolicy::Fixed; - spValues[i18n("Minimum")] = QSizePolicy::Minimum; - spValues[i18n("Maximum")] = QSizePolicy::Maximum; - spValues[i18n("Preferred")] = QSizePolicy::Preferred; - spValues[i18n("Expanding")] = QSizePolicy::Expanding; - spValues[i18n("Minimum Expanding")] = QSizePolicy::MinimumExpanding; - spValues[i18n("Ignored")] = QSizePolicy::Ignored; + TQMap<TQString, TQVariant> spValues; + spValues[i18n("Fixed")] = TQSizePolicy::Fixed; + spValues[i18n("Minimum")] = TQSizePolicy::Minimum; + spValues[i18n("Maximum")] = TQSizePolicy::Maximum; + spValues[i18n("Preferred")] = TQSizePolicy::Preferred; + spValues[i18n("Expanding")] = TQSizePolicy::Expanding; + spValues[i18n("Minimum Expanding")] = TQSizePolicy::MinimumExpanding; + spValues[i18n("Ignored")] = TQSizePolicy::Ignored; Machine *mach = new Machine(new PSizePolicyEdit(property, spValues)); property->details.append(ChildProperty(property, i18n("hSizeType"), ChildProperty::SizePolicy_HorData, spValues, i18n("Horizontal Size Type"))); @@ -161,7 +161,7 @@ Machine *PropertyMachineFactory::machineForProperty(MultiProperty *property) } case Property::Cursor: { - QMap<QString, QVariant> spValues; + TQMap<TQString, TQVariant> spValues; spValues[i18n("Arrow")] = Qt::ArrowCursor; spValues[i18n("Up Arrow")] = Qt::UpArrowCursor; spValues[i18n("Cross")] = Qt::CrossCursor; diff --git a/lib/widgets/propeditor/propertymachinefactory.h b/lib/widgets/propeditor/propertymachinefactory.h index a8d1e33f..09ea3bbe 100644 --- a/lib/widgets/propeditor/propertymachinefactory.h +++ b/lib/widgets/propeditor/propertymachinefactory.h @@ -20,7 +20,7 @@ #ifndef PROPERTYMACHINEFACTORY_H #define PROPERTYMACHINEFACTORY_H -#include <qmap.h> +#include <tqmap.h> #include "propertywidget.h" @@ -89,7 +89,7 @@ private: virtual ~PropertyMachineFactory(); //registered machines for property types - QMap<QString, createMachine > m_registeredForType; + TQMap<TQString, createMachine > m_registeredForType; }; } diff --git a/lib/widgets/propeditor/propertywidget.cpp b/lib/widgets/propeditor/propertywidget.cpp index 388fd68a..dad296c5 100644 --- a/lib/widgets/propeditor/propertywidget.cpp +++ b/lib/widgets/propeditor/propertywidget.cpp @@ -19,16 +19,16 @@ ***************************************************************************/ #include "propertywidget.h" -#include <qpainter.h> +#include <tqpainter.h> namespace PropertyLib{ -PropertyWidget::PropertyWidget(MultiProperty *property, QWidget *parent, const char *name) - :QWidget(parent, name), m_property(property) +PropertyWidget::PropertyWidget(MultiProperty *property, TQWidget *parent, const char *name) + :TQWidget(parent, name), m_property(property) { } -QString PropertyWidget::propertyName() const +TQString PropertyWidget::propertyName() const { return m_property->name(); } @@ -38,7 +38,7 @@ void PropertyWidget::setProperty(MultiProperty *property) m_property = property; } -void PropertyWidget::drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value) +void PropertyWidget::drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRect &r, const TQVariant &value) { p->setPen(Qt::NoPen); p->setBrush(cg.background()); @@ -46,7 +46,7 @@ void PropertyWidget::drawViewer(QPainter *p, const QColorGroup &cg, const QRect p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, value.toString()); } -void PropertyWidget::setValueList(const QMap<QString, QVariant> &// valueList +void PropertyWidget::setValueList(const TQMap<TQString, TQVariant> &// valueList ) { //this does nothing diff --git a/lib/widgets/propeditor/propertywidget.h b/lib/widgets/propeditor/propertywidget.h index 42ebfa95..edbdf6f3 100644 --- a/lib/widgets/propeditor/propertywidget.h +++ b/lib/widgets/propeditor/propertywidget.h @@ -20,8 +20,8 @@ #ifndef PROPERTYWIDGET_H #define PROPERTYWIDGET_H -#include <qwidget.h> -#include <qvariant.h> +#include <tqwidget.h> +#include <tqvariant.h> /** @file propertywidget.h @short Contains @ref PropertyLib::PropertyWidget class. @@ -39,8 +39,8 @@ Subclass this class to create custom property viewer and editor widget. Descendants should implement value() and setValue() methods. Hint: in case you want to implement your property editor widget using -existing widgets like QLineEdit, QComboBox, etc. you can't use multiple -inheritance from two QObject descendants due to Qt library restriction. +existing widgets like TQLineEdit, TQComboBox, etc. you can't use multiple +inheritance from two TQObject descendants due to Qt library restriction. Therefore use line edits and combo boxes as child widgets. A set of predefined widgets for predefined property types are available @@ -50,24 +50,24 @@ class PropertyWidget: public QWidget{ Q_OBJECT public: /**Constructs widget for property with name "propertyName".*/ - PropertyWidget(MultiProperty *property, QWidget *parent = 0, const char *name = 0); + PropertyWidget(MultiProperty *property, TQWidget *parent = 0, const char *name = 0); virtual ~PropertyWidget() {} /**@return the value currently entered in the editor widget.*/ - virtual QVariant value() const = 0; + virtual TQVariant value() const = 0; /**Sets the value shown in the editor widget. Set emitChange to false if you don't want to emit propertyChanged signal.*/ - virtual void setValue(const QVariant &value, bool emitChange=true) = 0; + virtual void setValue(const TQVariant &value, bool emitChange=true) = 0; /**@return the name of edited property.*/ - virtual QString propertyName() const; + virtual TQString propertyName() const; /**Sets the name of edited property.*/ virtual void setProperty(MultiProperty *property); /**Sets the list of possible values shown in the editor widget. This method does not emit propertyChanged signal.*/ - virtual void setValueList(const QMap<QString, QVariant> &valueList); + virtual void setValueList(const TQMap<TQString, TQVariant> &valueList); /**Function to draw a property viewer when the editor isn't shown.*/ - virtual void drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value); + virtual void drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRect &r, const TQVariant &value); /**Reverts the property value to previous setting.*/ virtual void undo(); @@ -77,7 +77,7 @@ signals: to emit it only from @ref setValue() method. @ref PropertyLib::PropertyEditor widget will connect this to the appropriate slot which will make updates to the @ref PropertyLib::PropertyList that hold propeties.*/ - void propertyChanged(MultiProperty *property, const QVariant &value); + void propertyChanged(MultiProperty *property, const TQVariant &value); protected: MultiProperty *m_property; diff --git a/lib/widgets/propeditor/propertywidgetproxy.cpp b/lib/widgets/propeditor/propertywidgetproxy.cpp index d2c29aae..813708ca 100644 --- a/lib/widgets/propeditor/propertywidgetproxy.cpp +++ b/lib/widgets/propeditor/propertywidgetproxy.cpp @@ -19,18 +19,18 @@ ***************************************************************************/ #include "propertywidgetproxy.h" -#include <qlayout.h> +#include <tqlayout.h> #include "propertywidget.h" #include "propertymachinefactory.h" namespace PropertyLib{ -PropertyWidgetProxy::PropertyWidgetProxy(QWidget *parent, const char *name) - :QWidget(parent, name), mp(0), m_propertyType(Property::Invalid), m_editor(0) +PropertyWidgetProxy::PropertyWidgetProxy(TQWidget *parent, const char *name) + :TQWidget(parent, name), mp(0), m_propertyType(Property::Invalid), m_editor(0) { p = new Property(); - m_layout = new QHBoxLayout(this, 0, 0); + m_layout = new TQHBoxLayout(this, 0, 0); } PropertyWidgetProxy::~PropertyWidgetProxy() @@ -60,26 +60,26 @@ void PropertyWidgetProxy::setWidget() m_editor = PropertyMachineFactory::getInstance()->machineForProperty(mp)->propertyEditor; if (m_editor) { - m_editor->reparent(this, QPoint(0,0), true); + m_editor->reparent(this, TQPoint(0,0), true); m_layout->addWidget(m_editor); } } -QVariant PropertyWidgetProxy::value() const +TQVariant PropertyWidgetProxy::value() const { if (m_editor) return m_editor->value(); else - return QVariant(); + return TQVariant(); } -void PropertyWidgetProxy::setValue(const QVariant &value) +void PropertyWidgetProxy::setValue(const TQVariant &value) { if (m_editor) m_editor->setValue(value, false); } -bool PropertyWidgetProxy::setProperty( const char * name, const QVariant & value ) +bool PropertyWidgetProxy::setProperty( const char * name, const TQVariant & value ) { if( strcmp( name, "value") == 0 ) { @@ -88,15 +88,15 @@ bool PropertyWidgetProxy::setProperty( const char * name, const QVariant & value return true; } else - return QWidget::setProperty(name, value); + return TQWidget::setProperty(name, value); } -QVariant PropertyWidgetProxy::property( const char * name ) const +TQVariant PropertyWidgetProxy::property( const char * name ) const { if( strcmp( name, "value") == 0 ) return value( ); else - return QWidget::property(name); + return TQWidget::property(name); } } diff --git a/lib/widgets/propeditor/propertywidgetproxy.h b/lib/widgets/propeditor/propertywidgetproxy.h index 31c28e76..e1183d91 100644 --- a/lib/widgets/propeditor/propertywidgetproxy.h +++ b/lib/widgets/propeditor/propertywidgetproxy.h @@ -20,8 +20,8 @@ #ifndef PROPERTYWIDGETPROXY_H #define PROPERTYWIDGETPROXY_H -#include <qwidget.h> -#include <qvariant.h> +#include <tqwidget.h> +#include <tqvariant.h> #include "multiproperty.h" @@ -45,7 +45,7 @@ Q_OBJECT Q_PROPERTY( int propertyType READ propertyType WRITE setPropertyType DESIGNABLE true ) Q_PROPERTY( PropertyType propertyType2 READ propertyType2 WRITE setPropertyType2 DESIGNABLE false ) public: - PropertyWidgetProxy(QWidget *parent = 0, const char *name = 0); + PropertyWidgetProxy(TQWidget *parent = 0, const char *name = 0); ~PropertyWidgetProxy(); /**Sets the type of a property editor to appear.*/ @@ -55,13 +55,13 @@ public: void setPropertyType2(PropertyType propertyType); PropertyType propertyType2() const { return m_propertyType; } - QVariant value() const; - void setValue(const QVariant &value); + TQVariant value() const; + void setValue(const TQVariant &value); /**Sets the type of an editor basing on the @p value if the name is "value". - Otherwise works as QWidget::setProperty.*/ - bool setProperty( const char *name, const QVariant &value); - QVariant property( const char *name) const; + Otherwise works as TQWidget::setProperty.*/ + bool setProperty( const char *name, const TQVariant &value); + TQVariant property( const char *name) const; protected: virtual void setWidget(); @@ -73,7 +73,7 @@ private: PropertyType m_propertyType; PropertyWidget *m_editor; - QHBoxLayout *m_layout; + TQHBoxLayout *m_layout; }; } diff --git a/lib/widgets/propeditor/psizeedit.cpp b/lib/widgets/propeditor/psizeedit.cpp index 5cbc1d40..90208304 100644 --- a/lib/widgets/propeditor/psizeedit.cpp +++ b/lib/widgets/propeditor/psizeedit.cpp @@ -20,39 +20,39 @@ #include "psizeedit.h" #include <klineedit.h> -#include <qlayout.h> -#include <qpainter.h> +#include <tqlayout.h> +#include <tqpainter.h> namespace PropertyLib{ -PSizeEdit::PSizeEdit(MultiProperty *property, QWidget *parent, const char *name) +PSizeEdit::PSizeEdit(MultiProperty *property, TQWidget *parent, const char *name) :PropertyWidget(property, parent, name) { - QHBoxLayout *l = new QHBoxLayout(this, 0, 0); + TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0); m_edit = new KLineEdit(this); - m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); l->addWidget(m_edit); m_edit->setReadOnly(true); } -QVariant PSizeEdit::value() const +TQVariant PSizeEdit::value() const { return m_value; } -void PSizeEdit::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value) +void PSizeEdit::drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value) { p->setPen(Qt::NoPen); p->setBrush(cg.background()); p->drawRect(r); - p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, QString("[ %1, %2 ]").arg(value.toSize().width()).arg(value.toSize().height())); + p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, TQString("[ %1, %2 ]").arg(value.toSize().width()).arg(value.toSize().height())); } -void PSizeEdit::setValue(const QVariant& value, bool emitChange) +void PSizeEdit::setValue(const TQVariant& value, bool emitChange) { m_value = value; - m_edit->setText(QString("[ %1, %2 ]").arg(value.toSize().width()).arg(value.toSize().height())); + m_edit->setText(TQString("[ %1, %2 ]").arg(value.toSize().width()).arg(value.toSize().height())); if (emitChange) emit propertyChanged(m_property, value); diff --git a/lib/widgets/propeditor/psizeedit.h b/lib/widgets/propeditor/psizeedit.h index 3053f28f..4613f532 100644 --- a/lib/widgets/propeditor/psizeedit.h +++ b/lib/widgets/propeditor/psizeedit.h @@ -29,21 +29,21 @@ class QPainter; namespace PropertyLib{ /** -@short %Property editor for QSize values. +@short %Property editor for TQSize values. */ class PSizeEdit: public PropertyWidget { Q_OBJECT public: - PSizeEdit(MultiProperty *property, QWidget *parent = 0, const char *name = 0); + PSizeEdit(MultiProperty *property, TQWidget *parent = 0, const char *name = 0); - virtual QVariant value() const; - virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value); - virtual void setValue(const QVariant& value, bool emitChange); + virtual TQVariant value() const; + virtual void drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value); + virtual void setValue(const TQVariant& value, bool emitChange); private: KLineEdit *m_edit; - QVariant m_value; + TQVariant m_value; }; } diff --git a/lib/widgets/propeditor/psizepolicyedit.cpp b/lib/widgets/propeditor/psizepolicyedit.cpp index 8695b9cd..9447a4bc 100644 --- a/lib/widgets/propeditor/psizepolicyedit.cpp +++ b/lib/widgets/propeditor/psizepolicyedit.cpp @@ -20,49 +20,49 @@ #include "psizepolicyedit.h" #include <klineedit.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qsizepolicy.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqsizepolicy.h> namespace PropertyLib{ -PSizePolicyEdit::PSizePolicyEdit(MultiProperty* property, const QMap<QString, QVariant> &spValues, QWidget* parent, const char* name) +PSizePolicyEdit::PSizePolicyEdit(MultiProperty* property, const TQMap<TQString, TQVariant> &spValues, TQWidget* parent, const char* name) :PropertyWidget(property, parent, name), m_spValues(spValues) { - QHBoxLayout *l = new QHBoxLayout(this, 0, 0); + TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0); m_edit = new KLineEdit(this); - m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); l->addWidget(m_edit); m_edit->setReadOnly(true); } -QVariant PSizePolicyEdit::value() const +TQVariant PSizePolicyEdit::value() const { return m_value; } -void PSizePolicyEdit::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value) +void PSizePolicyEdit::drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value) { p->setPen(Qt::NoPen); p->setBrush(cg.background()); p->drawRect(r); - p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, QString("%1/%2/%3/%4").arg(findValueDescription(value.toSizePolicy().horData())).arg(findValueDescription(value.toSizePolicy().verData())).arg(value.toSizePolicy().horStretch()).arg(value.toSizePolicy().verStretch())); + p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, TQString("%1/%2/%3/%4").arg(findValueDescription(value.toSizePolicy().horData())).arg(findValueDescription(value.toSizePolicy().verData())).arg(value.toSizePolicy().horStretch()).arg(value.toSizePolicy().verStretch())); } -void PSizePolicyEdit::setValue(const QVariant& value, bool emitChange) +void PSizePolicyEdit::setValue(const TQVariant& value, bool emitChange) { m_value = value; - m_edit->setText(QString("%1/%2/%3/%4").arg(findValueDescription(value.toSizePolicy().horData())).arg(findValueDescription(value.toSizePolicy().verData())).arg(value.toSizePolicy().horStretch()).arg(value.toSizePolicy().verStretch())); + m_edit->setText(TQString("%1/%2/%3/%4").arg(findValueDescription(value.toSizePolicy().horData())).arg(findValueDescription(value.toSizePolicy().verData())).arg(value.toSizePolicy().horStretch()).arg(value.toSizePolicy().verStretch())); if (emitChange) emit propertyChanged(m_property, value); } -QString PSizePolicyEdit::findValueDescription(QVariant val) const +TQString PSizePolicyEdit::findValueDescription(TQVariant val) const { // qWarning("PSizePolicyEdit::findValueDescription : %d", val.toInt()); - for (QMap<QString, QVariant>::const_iterator it = m_spValues.begin(); it != m_spValues.end(); ++ it) + for (TQMap<TQString, TQVariant>::const_iterator it = m_spValues.begin(); it != m_spValues.end(); ++ it) { if (it.data() == val) return it.key(); diff --git a/lib/widgets/propeditor/psizepolicyedit.h b/lib/widgets/propeditor/psizepolicyedit.h index 668359c2..36c26d1b 100644 --- a/lib/widgets/propeditor/psizepolicyedit.h +++ b/lib/widgets/propeditor/psizepolicyedit.h @@ -22,31 +22,31 @@ #include "propertywidget.h" -#include <qmap.h> +#include <tqmap.h> class KLineEdit; namespace PropertyLib{ /** -@short %Property editor for QSizePolicy values. +@short %Property editor for TQSizePolicy values. */ class PSizePolicyEdit : public PropertyWidget { Q_OBJECT public: - PSizePolicyEdit(MultiProperty* property, const QMap<QString, QVariant> &spValues, QWidget* parent=0, const char* name=0); + PSizePolicyEdit(MultiProperty* property, const TQMap<TQString, TQVariant> &spValues, TQWidget* parent=0, const char* name=0); - virtual QVariant value() const; - virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value); - virtual void setValue(const QVariant& value, bool emitChange); + virtual TQVariant value() const; + virtual void drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value); + virtual void setValue(const TQVariant& value, bool emitChange); - QString findValueDescription(QVariant val) const; + TQString findValueDescription(TQVariant val) const; private: KLineEdit *m_edit; - QVariant m_value; - QMap<QString, QVariant> m_spValues; + TQVariant m_value; + TQMap<TQString, TQVariant> m_spValues; }; } diff --git a/lib/widgets/propeditor/pspinbox.cpp b/lib/widgets/propeditor/pspinbox.cpp index 0171adfb..755041c1 100644 --- a/lib/widgets/propeditor/pspinbox.cpp +++ b/lib/widgets/propeditor/pspinbox.cpp @@ -21,49 +21,49 @@ #include <limits.h> -#include <qspinbox.h> -#include <qlayout.h> +#include <tqspinbox.h> +#include <tqlayout.h> namespace PropertyLib{ -PSpinBox::PSpinBox(MultiProperty *property, QWidget *parent, const char *name) +PSpinBox::PSpinBox(MultiProperty *property, TQWidget *parent, const char *name) :PropertyWidget(property, parent, name) { - QHBoxLayout *l = new QHBoxLayout(this, 0, 0); - m_edit = new QSpinBox(INT_MIN, INT_MAX, 1, this); - m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0); + m_edit = new TQSpinBox(INT_MIN, INT_MAX, 1, this); + m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); l->addWidget(m_edit); - connect(m_edit, SIGNAL(valueChanged(int)), this, SLOT(updateProperty(int))); + connect(m_edit, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(updateProperty(int))); } -PSpinBox::PSpinBox(MultiProperty *property, int minValue, int maxValue, int step, QWidget *parent, const char *name) +PSpinBox::PSpinBox(MultiProperty *property, int minValue, int maxValue, int step, TQWidget *parent, const char *name) :PropertyWidget(property, parent, name) { - QHBoxLayout *l = new QHBoxLayout(this, 0, 0); - m_edit = new QSpinBox(minValue, maxValue, step, this); + TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0); + m_edit = new TQSpinBox(minValue, maxValue, step, this); l->addWidget(m_edit); - connect(m_edit, SIGNAL(valueChanged(int)), this, SLOT(updateProperty(int))); + connect(m_edit, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(updateProperty(int))); } -QVariant PSpinBox::value() const +TQVariant PSpinBox::value() const { - return QVariant(m_edit->cleanText().toInt()); + return TQVariant(m_edit->cleanText().toInt()); } -void PSpinBox::setValue(const QVariant &value, bool emitChange) +void PSpinBox::setValue(const TQVariant &value, bool emitChange) { - disconnect(m_edit, SIGNAL(valueChanged(int)), this, SLOT(updateProperty(int))); + disconnect(m_edit, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(updateProperty(int))); m_edit->setValue(value.toInt()); - connect(m_edit, SIGNAL(valueChanged(int)), this, SLOT(updateProperty(int))); + connect(m_edit, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(updateProperty(int))); if (emitChange) emit propertyChanged(m_property, value); } void PSpinBox::updateProperty(int val) { - emit propertyChanged(m_property, QVariant(val)); + emit propertyChanged(m_property, TQVariant(val)); } } diff --git a/lib/widgets/propeditor/pspinbox.h b/lib/widgets/propeditor/pspinbox.h index 55d723f2..9998ff2f 100644 --- a/lib/widgets/propeditor/pspinbox.h +++ b/lib/widgets/propeditor/pspinbox.h @@ -32,20 +32,20 @@ namespace PropertyLib{ class PSpinBox: public PropertyWidget{ Q_OBJECT public: - PSpinBox(MultiProperty *property, QWidget *parent = 0, const char *name = 0); - PSpinBox(MultiProperty *property, int minValue, int maxValue, int step = 1, QWidget *parent = 0, const char *name = 0); + PSpinBox(MultiProperty *property, TQWidget *parent = 0, const char *name = 0); + PSpinBox(MultiProperty *property, int minValue, int maxValue, int step = 1, TQWidget *parent = 0, const char *name = 0); /**@return the value currently entered in the editor widget.*/ - virtual QVariant value() const; + virtual TQVariant value() const; /**Sets the value shown in the editor widget. Set emitChange to false if you don't want to emit propertyChanged signal.*/ - virtual void setValue(const QVariant &value, bool emitChange=true); + virtual void setValue(const TQVariant &value, bool emitChange=true); private slots: void updateProperty(int val); private: - QSpinBox *m_edit; + TQSpinBox *m_edit; }; } diff --git a/lib/widgets/propeditor/pstringlistedit.cpp b/lib/widgets/propeditor/pstringlistedit.cpp index 18b8756e..f6803304 100644 --- a/lib/widgets/propeditor/pstringlistedit.cpp +++ b/lib/widgets/propeditor/pstringlistedit.cpp @@ -19,9 +19,9 @@ ***************************************************************************/ #include "pstringlistedit.h" -#include <qlayout.h> -#include <qdialog.h> -#include <qpainter.h> +#include <tqlayout.h> +#include <tqdialog.h> +#include <tqpainter.h> #include <klineedit.h> #ifndef PURE_QT @@ -30,34 +30,34 @@ #include <kstdguiitem.h> #else #include "qeditlistbox.h" -#include <qpushbutton.h> +#include <tqpushbutton.h> #include "compat_tools.h" #endif namespace PropertyLib{ -PStringListEdit::PStringListEdit(MultiProperty *property, QWidget *parent, const char *name) +PStringListEdit::PStringListEdit(MultiProperty *property, TQWidget *parent, const char *name) :PropertyWidget(property, parent, name) { - l = new QHBoxLayout(this); + l = new TQHBoxLayout(this); edit = new KLineEdit(this); edit->setReadOnly(true); - edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); l->addWidget(edit); - pbSelect = new QPushButton("...", this); - pbSelect->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::MinimumExpanding); + pbSelect = new TQPushButton("...", this); + pbSelect->setSizePolicy(TQSizePolicy::Maximum, TQSizePolicy::MinimumExpanding); l->addWidget(pbSelect); - connect(pbSelect, SIGNAL(clicked()), this, SLOT(showEditor())); + connect(pbSelect, TQT_SIGNAL(clicked()), this, TQT_SLOT(showEditor())); } -QVariant PStringListEdit::value() const +TQVariant PStringListEdit::value() const { - return QVariant(m_list); + return TQVariant(m_list); } -void PStringListEdit::setValue(const QVariant &value, bool emitChange) +void PStringListEdit::setValue(const TQVariant &value, bool emitChange) { m_list = value.toStringList(); edit->setText(value.toStringList().join(", ")); @@ -67,8 +67,8 @@ void PStringListEdit::setValue(const QVariant &value, bool emitChange) void PStringListEdit::showEditor() { - QDialog* dia = new QDialog(this, "stringlist_dialog", true); - QVBoxLayout *dv = new QVBoxLayout(dia, 2); + TQDialog* dia = new TQDialog(this, "stringlist_dialog", true); + TQVBoxLayout *dv = new TQVBoxLayout(dia, 2); #ifdef PURE_QT QEditListBox *select = new QEditListBox(dia, "select_char"); @@ -77,18 +77,18 @@ void PStringListEdit::showEditor() #endif dv->addWidget(select); - QHBoxLayout *dh = new QHBoxLayout(dv, 6); + TQHBoxLayout *dh = new TQHBoxLayout(dv, 6); #ifndef PURE_QT KPushButton *pbOk = new KPushButton(KStdGuiItem::ok(), dia); KPushButton *pbCancel = new KPushButton(KStdGuiItem::cancel(), dia); #else - QPushButton *pbOk = new QPushButton(i18n("Ok"), dia); - QPushButton *pbCancel = new QPushButton(i18n("Cancel"), dia); + TQPushButton *pbOk = new TQPushButton(i18n("Ok"), dia); + TQPushButton *pbCancel = new TQPushButton(i18n("Cancel"), dia); #endif - QSpacerItem *si = new QSpacerItem(30, 0, QSizePolicy::Expanding, QSizePolicy::Expanding); + TQSpacerItem *si = new TQSpacerItem(30, 0, TQSizePolicy::Expanding, TQSizePolicy::Expanding); - connect(pbOk, SIGNAL(clicked()), dia, SLOT(accept())); - connect(pbCancel, SIGNAL(clicked()), dia, SLOT(reject())); + connect(pbOk, TQT_SIGNAL(clicked()), dia, TQT_SLOT(accept())); + connect(pbCancel, TQT_SIGNAL(clicked()), dia, TQT_SLOT(reject())); dh->addItem(si); dh->addWidget(pbOk); @@ -96,7 +96,7 @@ void PStringListEdit::showEditor() select->insertStringList(m_list); - if (dia->exec() == QDialog::Accepted) + if (dia->exec() == TQDialog::Accepted) { m_list = select->items(); edit->setText(select->items().join(", ")); @@ -106,7 +106,7 @@ void PStringListEdit::showEditor() emit propertyChanged(m_property, m_list); } -void PStringListEdit::drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value) +void PStringListEdit::drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRect &r, const TQVariant &value) { p->setPen(Qt::NoPen); p->setBrush(cg.background()); diff --git a/lib/widgets/propeditor/pstringlistedit.h b/lib/widgets/propeditor/pstringlistedit.h index 086391e8..25bbec74 100644 --- a/lib/widgets/propeditor/pstringlistedit.h +++ b/lib/widgets/propeditor/pstringlistedit.h @@ -36,25 +36,25 @@ class PStringListEdit: public PropertyWidget { Q_OBJECT public: - PStringListEdit(MultiProperty *property, QWidget *parent = 0, const char *name = 0); + PStringListEdit(MultiProperty *property, TQWidget *parent = 0, const char *name = 0); /**@return the value currently entered in the editor widget.*/ - virtual QVariant value() const; + virtual TQVariant value() const; /**Sets the value shown in the editor widget. Set emitChange to false if you don't want to emit propertyChanged signal.*/ - virtual void setValue(const QVariant &value, bool emitChange=true); + virtual void setValue(const TQVariant &value, bool emitChange=true); /**Function to draw a property viewer when the editor isn't shown.*/ - virtual void drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value); + virtual void drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRect &r, const TQVariant &value); private slots: void showEditor(); private: - QPushButton *pbSelect; - QHBoxLayout *l; + TQPushButton *pbSelect; + TQHBoxLayout *l; KLineEdit *edit; - QStringList m_list; + TQStringList m_list; }; } diff --git a/lib/widgets/propeditor/psymbolcombo.cpp b/lib/widgets/propeditor/psymbolcombo.cpp index 05ec4563..24f4259c 100644 --- a/lib/widgets/propeditor/psymbolcombo.cpp +++ b/lib/widgets/propeditor/psymbolcombo.cpp @@ -18,9 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qlayout.h> -#include <qpainter.h> -#include <qpushbutton.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqpushbutton.h> #include <klineedit.h> #ifndef PURE_QT @@ -28,52 +28,52 @@ #include <klocale.h> #include <kpushbutton.h> #include <kstdguiitem.h> -#include <qdialog.h> +#include <tqdialog.h> #endif #include "psymbolcombo.h" namespace PropertyLib{ -PSymbolCombo::PSymbolCombo(MultiProperty *property, QWidget *parent, const char *name) +PSymbolCombo::PSymbolCombo(MultiProperty *property, TQWidget *parent, const char *name) :PropertyWidget(property, parent, name) { - l = new QHBoxLayout(this); + l = new TQHBoxLayout(this); m_edit = new KLineEdit(this); - m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); m_edit->setMaxLength(1); l->addWidget(m_edit); - m_select = new QPushButton("...", this); - m_select->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::MinimumExpanding); + m_select = new TQPushButton("...", this); + m_select->setSizePolicy(TQSizePolicy::Maximum, TQSizePolicy::MinimumExpanding); l->addWidget(m_select); #ifdef PURE_QT m_select->hide(); #endif - connect(m_select, SIGNAL(clicked()), this, SLOT(selectChar())); - connect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&))); + connect(m_select, TQT_SIGNAL(clicked()), this, TQT_SLOT(selectChar())); + connect(m_edit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateProperty(const TQString&))); } -QVariant PSymbolCombo::value() const +TQVariant PSymbolCombo::value() const { if (!(m_edit->text().isNull())) - return QVariant(QString("%1").arg(m_edit->text().at(0).unicode())); + return TQVariant(TQString("%1").arg(m_edit->text().at(0).unicode())); else - return QVariant(0); + return TQVariant(0); } -void PSymbolCombo::setValue(const QVariant &value, bool emitChange) +void PSymbolCombo::setValue(const TQVariant &value, bool emitChange) { #if QT_VERSION >= 0x030100 if (!(value.isNull())) #else - if (value.canCast(QVariant::Int)) + if (value.canCast(TQVariant::Int)) #endif { - disconnect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&))); - m_edit->setText(QChar(value.toInt())); - connect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&))); + disconnect(m_edit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateProperty(const TQString&))); + m_edit->setText(TQChar(value.toInt())); + connect(m_edit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateProperty(const TQString&))); if (emitChange) emit propertyChanged(m_property, value); } @@ -82,19 +82,19 @@ void PSymbolCombo::setValue(const QVariant &value, bool emitChange) void PSymbolCombo::selectChar() { #ifndef PURE_QT - QDialog* dia = new QDialog(this, "select_dialog", true); - QVBoxLayout *dv = new QVBoxLayout(dia, 2); + TQDialog* dia = new TQDialog(this, "select_dialog", true); + TQVBoxLayout *dv = new TQVBoxLayout(dia, 2); KCharSelect *select = new KCharSelect(dia, "select_char"); dv->addWidget(select); - QHBoxLayout *dh = new QHBoxLayout(dv, 6); + TQHBoxLayout *dh = new TQHBoxLayout(dv, 6); KPushButton *pbOk = new KPushButton(KStdGuiItem::ok(), dia); KPushButton *pbCancel = new KPushButton(KStdGuiItem::cancel(), dia); - QSpacerItem *si = new QSpacerItem(30, 0, QSizePolicy::Expanding, QSizePolicy::Expanding); + TQSpacerItem *si = new TQSpacerItem(30, 0, TQSizePolicy::Expanding, TQSizePolicy::Expanding); - connect(pbOk, SIGNAL(clicked()), dia, SLOT(accept())); - connect(pbCancel, SIGNAL(clicked()), dia, SLOT(reject())); + connect(pbOk, TQT_SIGNAL(clicked()), dia, TQT_SLOT(accept())); + connect(pbCancel, TQT_SIGNAL(clicked()), dia, TQT_SLOT(reject())); dh->addItem(si); dh->addWidget(pbOk); @@ -103,7 +103,7 @@ void PSymbolCombo::selectChar() if (!(m_edit->text().isNull())) select->setChar(m_edit->text().at(0)); - if (dia->exec() == QDialog::Accepted) + if (dia->exec() == TQDialog::Accepted) { m_edit->setText(select->chr()); } @@ -111,17 +111,17 @@ void PSymbolCombo::selectChar() #endif } -void PSymbolCombo::updateProperty(const QString& val) +void PSymbolCombo::updateProperty(const TQString& val) { - emit propertyChanged(m_property, QVariant(QString("%1").arg(val.at(0).unicode()))); + emit propertyChanged(m_property, TQVariant(TQString("%1").arg(val.at(0).unicode()))); } -void PSymbolCombo::drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value) +void PSymbolCombo::drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRect &r, const TQVariant &value) { p->setBrush(cg.background()); p->setPen(Qt::NoPen); p->drawRect(r); - p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, QChar(value.toInt())); + p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, TQChar(value.toInt())); } } diff --git a/lib/widgets/propeditor/psymbolcombo.h b/lib/widgets/propeditor/psymbolcombo.h index e3bedfa8..621ce23c 100644 --- a/lib/widgets/propeditor/psymbolcombo.h +++ b/lib/widgets/propeditor/psymbolcombo.h @@ -35,26 +35,26 @@ namespace PropertyLib{ class PSymbolCombo: public PropertyWidget{ Q_OBJECT public: - PSymbolCombo(MultiProperty *property, QWidget *parent = 0, const char *name = 0); + PSymbolCombo(MultiProperty *property, TQWidget *parent = 0, const char *name = 0); /**@return the value currently entered in the editor widget.*/ - virtual QVariant value() const; + virtual TQVariant value() const; /**Sets the value shown in the editor widget. Set emitChange to false if you don't want to emit propertyChanged signal.*/ - virtual void setValue(const QVariant &value, bool emitChange=true); + virtual void setValue(const TQVariant &value, bool emitChange=true); /**Function to draw a property viewer when the editor isn't shown.*/ - virtual void drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value); + virtual void drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRect &r, const TQVariant &value); public slots: void selectChar(); private slots: - void updateProperty(const QString &val); + void updateProperty(const TQString &val); private: KLineEdit *m_edit; - QPushButton *m_select; - QHBoxLayout *l; + TQPushButton *m_select; + TQHBoxLayout *l; }; } diff --git a/lib/widgets/propeditor/purledit.cpp b/lib/widgets/propeditor/purledit.cpp index 3a896cdf..64e4d0c7 100644 --- a/lib/widgets/propeditor/purledit.cpp +++ b/lib/widgets/propeditor/purledit.cpp @@ -22,49 +22,49 @@ #ifndef PURE_QT #include <kurlrequester.h> #else -#include <qpushbutton.h> -#include <qlineedit.h> +#include <tqpushbutton.h> +#include <tqlineedit.h> #endif -#include <qfiledialog.h> -#include <qlayout.h> +#include <tqfiledialog.h> +#include <tqlayout.h> namespace PropertyLib{ -PUrlEdit::PUrlEdit(Mode mode, MultiProperty* property, QWidget* parent, const char* name) +PUrlEdit::PUrlEdit(Mode mode, MultiProperty* property, TQWidget* parent, const char* name) :PropertyWidget(property, parent, name) { - QHBoxLayout *l = new QHBoxLayout(this, 0, 0); + TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0); #ifndef PURE_QT m_edit = new KURLRequester(this); l->addWidget(m_edit); m_edit->setMode((KFile::Mode)mode); - connect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&))); + connect(m_edit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateProperty(const TQString&))); #else m_edit = new KLineEdit(this); - m_select = new QPushButton("...",this); + m_select = new TQPushButton("...",this); l->addWidget(m_edit); l->addWidget(m_select); m_mode = mode; - connect( m_select, SIGNAL(clicked()),this,SLOT(select())); + connect( m_select, TQT_SIGNAL(clicked()),this,TQT_SLOT(select())); #endif - m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); } -QVariant PUrlEdit::value() const +TQVariant PUrlEdit::value() const { #ifndef PURE_QT - return QVariant(m_edit->url()); + return TQVariant(m_edit->url()); #else - return QVariant(m_url); + return TQVariant(m_url); #endif } -void PUrlEdit::setValue(const QVariant& value, bool emitChange) +void PUrlEdit::setValue(const TQVariant& value, bool emitChange) { #ifndef PURE_QT - disconnect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&))); + disconnect(m_edit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateProperty(const TQString&))); m_edit->setURL(value.toString()); - connect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&))); + connect(m_edit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateProperty(const TQString&))); #else m_edit->setText(value.toString()); #endif @@ -72,19 +72,19 @@ void PUrlEdit::setValue(const QVariant& value, bool emitChange) emit propertyChanged(m_property, value); } -void PUrlEdit::updateProperty(const QString &val) +void PUrlEdit::updateProperty(const TQString &val) { - emit propertyChanged(m_property, QVariant(val)); + emit propertyChanged(m_property, TQVariant(val)); } void PUrlEdit::select() { #ifdef PURE_QT - QString path = m_url; + TQString path = m_url; if( m_mode == Directory ) - m_url = QFileDialog::getExistingDirectory( m_url,this); + m_url = TQFileDialog::getExistingDirectory( m_url,this); else - m_url = QFileDialog::getOpenFileName(m_url, QString::null, this); + m_url = TQFileDialog::getOpenFileName(m_url, TQString::null, this); updateProperty(m_url); m_edit->setText(m_url); #endif diff --git a/lib/widgets/propeditor/purledit.h b/lib/widgets/propeditor/purledit.h index 6c9c8a8d..6508ea7d 100644 --- a/lib/widgets/propeditor/purledit.h +++ b/lib/widgets/propeditor/purledit.h @@ -46,21 +46,21 @@ public: enum Mode {File,Directory}; #endif - PUrlEdit(Mode mode, MultiProperty* property, QWidget* parent=0, const char* name=0); + PUrlEdit(Mode mode, MultiProperty* property, TQWidget* parent=0, const char* name=0); - virtual QVariant value() const; - virtual void setValue(const QVariant& value, bool emitChange); + virtual TQVariant value() const; + virtual void setValue(const TQVariant& value, bool emitChange); private slots: - void updateProperty(const QString &val); + void updateProperty(const TQString &val); void select(); private: #ifndef PURE_QT KURLRequester *m_edit; #else KLineEdit *m_edit; - QPushButton *m_select; - QString m_url; + TQPushButton *m_select; + TQString m_url; Mode m_mode; #endif }; diff --git a/lib/widgets/propeditor/pyesnobutton.cpp b/lib/widgets/propeditor/pyesnobutton.cpp index 763ac630..308570be 100644 --- a/lib/widgets/propeditor/pyesnobutton.cpp +++ b/lib/widgets/propeditor/pyesnobutton.cpp @@ -19,9 +19,9 @@ ***************************************************************************/ #include "pyesnobutton.h" -#include <qlayout.h> -#include <qpainter.h> -#include <qpushbutton.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqpushbutton.h> #ifndef PURE_QT #include <klocale.h> @@ -31,34 +31,34 @@ namespace PropertyLib{ -PYesNoButton::PYesNoButton(MultiProperty* property, QWidget* parent, const char* name) +PYesNoButton::PYesNoButton(MultiProperty* property, TQWidget* parent, const char* name) :PropertyWidget(property, parent, name) { - QHBoxLayout *l = new QHBoxLayout(this, 0, 0); - m_edit = new QPushButton(this); + TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0); + m_edit = new TQPushButton(this); m_edit->setToggleButton(true); - m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); l->addWidget(m_edit); - connect(m_edit, SIGNAL(toggled(bool)), this, SLOT(updateProperty(bool))); + connect(m_edit, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(updateProperty(bool))); } -QVariant PYesNoButton::value() const +TQVariant PYesNoButton::value() const { - return QVariant(m_edit->isOn()); + return TQVariant(m_edit->isOn()); } -void PYesNoButton::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value) +void PYesNoButton::drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value) { PropertyWidget::drawViewer(p, cg, r, value.toBool() ? i18n("Yes") : i18n("No")); } -void PYesNoButton::setValue(const QVariant& value, bool emitChange) +void PYesNoButton::setValue(const TQVariant& value, bool emitChange) { - disconnect(m_edit, SIGNAL(toggled(bool)), this, SLOT(updateProperty(bool))); + disconnect(m_edit, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(updateProperty(bool))); m_edit->setDown(value.toBool()); value.toBool() ? m_edit->setText(i18n("Yes")) : m_edit->setText(i18n("No")); - connect(m_edit, SIGNAL(toggled(bool)), this, SLOT(updateProperty(bool))); + connect(m_edit, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(updateProperty(bool))); if (emitChange) emit propertyChanged(m_property, value); } diff --git a/lib/widgets/propeditor/pyesnobutton.h b/lib/widgets/propeditor/pyesnobutton.h index 3f4cabc4..9e5af75b 100644 --- a/lib/widgets/propeditor/pyesnobutton.h +++ b/lib/widgets/propeditor/pyesnobutton.h @@ -33,17 +33,17 @@ class PYesNoButton : public PropertyWidget { Q_OBJECT public: - PYesNoButton(MultiProperty* property, QWidget* parent = 0, const char* name = 0); + PYesNoButton(MultiProperty* property, TQWidget* parent = 0, const char* name = 0); - virtual QVariant value() const; - virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value); - virtual void setValue(const QVariant& value, bool emitChange); + virtual TQVariant value() const; + virtual void drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value); + virtual void setValue(const TQVariant& value, bool emitChange); protected slots: void updateProperty(bool toggled); private: - QPushButton *m_edit; + TQPushButton *m_edit; }; } diff --git a/lib/widgets/propeditor/qeditlistbox.cpp b/lib/widgets/propeditor/qeditlistbox.cpp index 4de4e567..e1b09e4e 100644 --- a/lib/widgets/propeditor/qeditlistbox.cpp +++ b/lib/widgets/propeditor/qeditlistbox.cpp @@ -23,15 +23,15 @@ #include <klineedit.h> -#include <qpushbutton.h> -#include <qlayout.h> -#include <qgroupbox.h> -#include <qlistbox.h> -#include <qwhatsthis.h> -#include <qlabel.h> -#include <qcombobox.h> -#include <qapplication.h> -#include <qstringlist.h> +#include <tqpushbutton.h> +#include <tqlayout.h> +#include <tqgroupbox.h> +#include <tqlistbox.h> +#include <tqwhatsthis.h> +#include <tqlabel.h> +#include <tqcombobox.h> +#include <tqapplication.h> +#include <tqstringlist.h> #include <assert.h> @@ -46,24 +46,24 @@ public: int buttons; }; -QEditListBox::QEditListBox(QWidget *parent, const char *name, +QEditListBox::QEditListBox(TQWidget *parent, const char *name, bool checkAtEntering, int buttons ) - :QGroupBox(parent, name ) + :TQGroupBox(parent, name ) { init( checkAtEntering, buttons ); } -QEditListBox::QEditListBox(const QString& title, QWidget *parent, +QEditListBox::QEditListBox(const TQString& title, TQWidget *parent, const char *name, bool checkAtEntering, int buttons) - :QGroupBox(title, parent, name ) + :TQGroupBox(title, parent, name ) { init( checkAtEntering, buttons ); } -QEditListBox::QEditListBox(const QString& title, const CustomEditor& custom, - QWidget *parent, const char *name, +QEditListBox::QEditListBox(const TQString& title, const CustomEditor& custom, + TQWidget *parent, const char *name, bool checkAtEntering, int buttons) - :QGroupBox(title, parent, name ) + :TQGroupBox(title, parent, name ) { m_lineEdit = custom.lineEdit(); init( checkAtEntering, buttons, custom.representationWidget() ); @@ -76,7 +76,7 @@ QEditListBox::~QEditListBox() } void QEditListBox::init( bool checkAtEntering, int buttons, - QWidget *representationWidget ) + TQWidget *representationWidget ) { d=new QEditListBoxPrivate; d->m_checkAtEntering=checkAtEntering; @@ -92,11 +92,11 @@ void QEditListBox::init( bool checkAtEntering, int buttons, servNewButton = servRemoveButton = servUpButton = servDownButton = 0L; - setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, - QSizePolicy::MinimumExpanding)); + setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, + TQSizePolicy::MinimumExpanding)); - QWidget * gb = this; - QGridLayout * grid = new QGridLayout(gb, 7 - lostButtons, 2, + TQWidget * gb = this; + TQGridLayout * grid = new TQGridLayout(gb, 7 - lostButtons, 2, MarginSize, SpazingSize); grid->addRowSpacing(0, fontMetrics().lineSpacing()); @@ -106,56 +106,56 @@ void QEditListBox::init( bool checkAtEntering, int buttons, grid->setMargin(15); if ( representationWidget ) - representationWidget->reparent( gb, QPoint(0,0) ); + representationWidget->reparent( gb, TQPoint(0,0) ); else m_lineEdit=new KLineEdit(gb); - m_listBox = new QListBox(gb); + m_listBox = new TQListBox(gb); - QWidget *editingWidget = representationWidget ? + TQWidget *editingWidget = representationWidget ? representationWidget : m_lineEdit; grid->addMultiCellWidget(editingWidget,1,1,0,1); grid->addMultiCellWidget(m_listBox, 2, 6 - lostButtons, 0, 0); int row = 2; if ( buttons & Add ) { - servNewButton = new QPushButton(i18n("&Add"), gb); + servNewButton = new TQPushButton(i18n("&Add"), gb); servNewButton->setEnabled(false); - connect(servNewButton, SIGNAL(clicked()), SLOT(addItem())); + connect(servNewButton, TQT_SIGNAL(clicked()), TQT_SLOT(addItem())); grid->addWidget(servNewButton, row++, 1); } if ( buttons & Remove ) { - servRemoveButton = new QPushButton(i18n("&Remove"), gb); + servRemoveButton = new TQPushButton(i18n("&Remove"), gb); servRemoveButton->setEnabled(false); - connect(servRemoveButton, SIGNAL(clicked()), SLOT(removeItem())); + connect(servRemoveButton, TQT_SIGNAL(clicked()), TQT_SLOT(removeItem())); grid->addWidget(servRemoveButton, row++, 1); } if ( buttons & UpDown ) { - servUpButton = new QPushButton(i18n("Move &Up"), gb); + servUpButton = new TQPushButton(i18n("Move &Up"), gb); servUpButton->setEnabled(false); - connect(servUpButton, SIGNAL(clicked()), SLOT(moveItemUp())); + connect(servUpButton, TQT_SIGNAL(clicked()), TQT_SLOT(moveItemUp())); - servDownButton = new QPushButton(i18n("Move &Down"), gb); + servDownButton = new TQPushButton(i18n("Move &Down"), gb); servDownButton->setEnabled(false); - connect(servDownButton, SIGNAL(clicked()), SLOT(moveItemDown())); + connect(servDownButton, TQT_SIGNAL(clicked()), TQT_SLOT(moveItemDown())); grid->addWidget(servUpButton, row++, 1); grid->addWidget(servDownButton, row++, 1); } - 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&))); - connect(m_lineEdit,SIGNAL(returnPressed()),this,SLOT(addItem())); - connect(m_listBox, SIGNAL(highlighted(int)), SLOT(enableMoveButtons(int))); + connect(m_lineEdit,TQT_SIGNAL(returnPressed()),this,TQT_SLOT(addItem())); + connect(m_listBox, TQT_SIGNAL(highlighted(int)), TQT_SLOT(enableMoveButtons(int))); // maybe supplied lineedit has some text already typedSomething( m_lineEdit->text() ); } -void QEditListBox::typedSomething(const QString& text) +void QEditListBox::typedSomething(const TQString& text) { if(currentItem() >= 0) { if(currentText() != m_lineEdit->text()) @@ -206,7 +206,7 @@ void QEditListBox::moveItemUp() return; } - QListBoxItem *selItem = m_listBox->item(selIndex); + TQListBoxItem *selItem = m_listBox->item(selIndex); m_listBox->takeItem(selItem); m_listBox->insertItem(selItem, selIndex-1); m_listBox->setCurrentItem(selIndex - 1); @@ -229,7 +229,7 @@ void QEditListBox::moveItemDown() return; } - QListBoxItem *selItem = m_listBox->item(selIndex); + TQListBoxItem *selItem = m_listBox->item(selIndex); m_listBox->takeItem(selItem); m_listBox->insertItem(selItem, selIndex+1); m_listBox->setCurrentItem(selIndex + 1); @@ -245,7 +245,7 @@ void QEditListBox::addItem() if ( !servNewButton || !servNewButton->isEnabled() ) return; - const QString& currentTextLE=m_lineEdit->text(); + const TQString& currentTextLE=m_lineEdit->text(); bool alreadyInList(false); //if we didn't check for dupes at the inserting we have to do it now if (!d->m_checkAtEntering) @@ -294,7 +294,7 @@ void QEditListBox::removeItem() if ( selected >= 0 ) { - QString removedText = m_listBox->currentText(); + TQString removedText = m_listBox->currentText(); m_listBox->removeItem( selected ); if ( count() > 0 ) @@ -351,17 +351,17 @@ void QEditListBox::clear() emit changed(); } -void QEditListBox::insertStringList(const QStringList& list, int index) +void QEditListBox::insertStringList(const TQStringList& list, int index) { m_listBox->insertStringList(list,index); } -void QEditListBox::insertStrList(const QStrList* list, int index) +void QEditListBox::insertStrList(const TQStrList* list, int index) { m_listBox->insertStrList(list,index); } -void QEditListBox::insertStrList(const QStrList& list, int index) +void QEditListBox::insertStrList(const TQStrList& list, int index) { m_listBox->insertStrList(list,index); } @@ -371,16 +371,16 @@ void QEditListBox::insertStrList(const char ** list, int numStrings, int index) m_listBox->insertStrList(list,numStrings,index); } -QStringList QEditListBox::items() const +TQStringList QEditListBox::items() const { - QStringList list; + TQStringList list; for ( uint i = 0; i < m_listBox->count(); i++ ) list.append( m_listBox->text( i )); return list; } -void QEditListBox::setItems(const QStringList& items) +void QEditListBox::setItems(const TQStringList& items) { m_listBox->clear(); m_listBox->insertStringList(items, 0); @@ -393,7 +393,7 @@ void QEditListBox::virtual_hook( int, void* ) /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// -QEditListBox::CustomEditor::CustomEditor( QComboBox *combo ) +QEditListBox::CustomEditor::CustomEditor( TQComboBox *combo ) { m_representationWidget = combo; m_lineEdit = dynamic_cast<KLineEdit*>( combo->lineEdit() ); diff --git a/lib/widgets/propeditor/qeditlistbox.h b/lib/widgets/propeditor/qeditlistbox.h index 93bf8bf3..245f8b57 100644 --- a/lib/widgets/propeditor/qeditlistbox.h +++ b/lib/widgets/propeditor/qeditlistbox.h @@ -20,8 +20,8 @@ #ifndef QEDITLISTBOX_H #define QEDITLISTBOX_H -#include <qgroupbox.h> -#include <qlistbox.h> +#include <tqgroupbox.h> +#include <tqlistbox.h> class KLineEdit; class QComboBox; @@ -46,7 +46,7 @@ class QEditListBox : public QGroupBox { Q_OBJECT - Q_PROPERTY( QStringList items READ items WRITE setItems ) + Q_PROPERTY( TQStringList items READ items WRITE setItems ) public: // @since 3.1 @@ -56,19 +56,19 @@ public: CustomEditor() : m_representationWidget( 0L ), m_lineEdit( 0L ) {} - CustomEditor( QWidget *repWidget, KLineEdit *edit ) + CustomEditor( TQWidget *repWidget, KLineEdit *edit ) : m_representationWidget( repWidget ), m_lineEdit( edit ) {} - CustomEditor( QComboBox *combo ); + CustomEditor( TQComboBox *combo ); - void setRepresentationWidget( QWidget *repWidget ) { + void setRepresentationWidget( TQWidget *repWidget ) { m_representationWidget = repWidget; } void setLineEdit( KLineEdit *edit ) { m_lineEdit = edit; } - virtual QWidget *representationWidget() const { + virtual TQWidget *representationWidget() const { return m_representationWidget; } virtual KLineEdit *lineEdit() const { @@ -76,7 +76,7 @@ public: } protected: - QWidget *m_representationWidget; + TQWidget *m_representationWidget; KLineEdit *m_lineEdit; }; @@ -100,7 +100,7 @@ public: * it will be checked if you press the Add-button. It is not * possible to enter items twice into the listbox. */ - QEditListBox(QWidget *parent = 0, const char *name = 0, + QEditListBox(TQWidget *parent = 0, const char *name = 0, bool checkAtEntering=false, int buttons = All ); /** * Create an editable listbox. @@ -108,33 +108,33 @@ public: * The same as the other constructor, additionally it takes * @p title, which will be the title of the frame around the listbox. */ - QEditListBox(const QString& title, QWidget *parent = 0, + QEditListBox(const TQString& title, TQWidget *parent = 0, const char *name = 0, bool checkAtEntering=false, int buttons = All ); /** * Another constructor, which allows to use a custom editing widget - * instead of the standard QLineEdit widget. E.g. you can use a - * KURLRequester or a QComboBox as input widget. The custom + * instead of the standard TQLineEdit widget. E.g. you can use a + * KURLRequester or a TQComboBox as input widget. The custom * editor must consist of a lineedit and optionally another widget that - * is used as representation. A QComboBox or a KURLRequester have a - * QLineEdit as child-widget for example, so the QComboBox is used as + * is used as representation. A TQComboBox or a KURLRequester have a + * TQLineEdit as child-widget for example, so the TQComboBox is used as * the representation widget. * * @see KURLRequester::customEditor() * @since 3.1 */ - QEditListBox( const QString& title, + QEditListBox( const TQString& title, const CustomEditor &customEditor, - QWidget *parent = 0, const char *name = 0, + TQWidget *parent = 0, const char *name = 0, bool checkAtEntering = false, int buttons = All ); virtual ~QEditListBox(); /** - * Return a pointer to the embedded QListBox. + * Return a pointer to the embedded TQListBox. */ - QListBox* listBox() const { return m_listBox; } + TQListBox* listBox() const { return m_listBox; } /** * Return a pointer to the embedded KLineEdit. */ @@ -142,72 +142,72 @@ public: /** * Return a pointer to the Add button */ - QPushButton* addButton() const { return servNewButton; } + TQPushButton* addButton() const { return servNewButton; } /** * Return a pointer to the Remove button */ - QPushButton* removeButton() const { return servRemoveButton; } + TQPushButton* removeButton() const { return servRemoveButton; } /** * Return a pointer to the Up button */ - QPushButton* upButton() const { return servUpButton; } + TQPushButton* upButton() const { return servUpButton; } /** * Return a pointer to the Down button */ - QPushButton* downButton() const { return servDownButton; } + TQPushButton* downButton() const { return servDownButton; } /** - * See QListBox::count() + * See TQListBox::count() */ int count() const { return int(m_listBox->count()); } /** - * See QListBox::insertStringList() + * See TQListBox::insertStringList() */ - void insertStringList(const QStringList& list, int index=-1); + void insertStringList(const TQStringList& list, int index=-1); /** - * See QListBox::insertStringList() + * See TQListBox::insertStringList() */ - void insertStrList(const QStrList* list, int index=-1); + void insertStrList(const TQStrList* list, int index=-1); /** - * See QListBox::insertStrList() + * See TQListBox::insertStrList() */ - void insertStrList(const QStrList& list, int index=-1); + void insertStrList(const TQStrList& list, int index=-1); /** - * See QListBox::insertStrList() + * See TQListBox::insertStrList() */ void insertStrList(const char ** list, int numStrings=-1, int index=-1); /** - * See QListBox::insertItem() + * See TQListBox::insertItem() */ - void insertItem(const QString& text, int index=-1) {m_listBox->insertItem(text,index);} + void insertItem(const TQString& text, int index=-1) {m_listBox->insertItem(text,index);} /** * Clears both the listbox and the line edit. */ void clear(); /** - * See QListBox::text() + * See TQListBox::text() */ - QString text(int index) const { return m_listBox->text(index); } + TQString text(int index) const { return m_listBox->text(index); } /** - * See QListBox::currentItem() + * See TQListBox::currentItem() */ int currentItem() const; /** - * See QListBox::currentText() + * See TQListBox::currentText() */ - QString currentText() const { return m_listBox->currentText(); } + TQString currentText() const { return m_listBox->currentText(); } /** * @returns a stringlist of all items in the listbox */ - QStringList items() const; + TQStringList items() const; /** * Clears the listbox and sets the contents to @p items * * @since 3.4 */ - void setItems(const QStringList& items); + void setItems(const TQStringList& items); signals: void changed(); @@ -217,14 +217,14 @@ public: * the parameter is the added string. * @since 3.2 */ - void added( const QString & text ); + void added( const TQString & text ); /** * This signal is emitted when the user removes a string from the list, * the parameter is the removed string. * @since 3.2 */ - void removed( const QString & text ); + void removed( const TQString & text ); protected slots: //the names should be self-explaining @@ -233,17 +233,17 @@ public: void addItem(); void removeItem(); void enableMoveButtons(int index); - void typedSomething(const QString& text); + void typedSomething(const TQString& text); private: - QListBox *m_listBox; - QPushButton *servUpButton, *servDownButton; - QPushButton *servNewButton, *servRemoveButton; + TQListBox *m_listBox; + TQPushButton *servUpButton, *servDownButton; + TQPushButton *servNewButton, *servRemoveButton; KLineEdit *m_lineEdit; //this is called in both ctors, to avoid code duplication void init( bool checkAtEntering, int buttons, - QWidget *representationWidget = 0L ); + TQWidget *representationWidget = 0L ); protected: virtual void virtual_hook( int id, void* data ); diff --git a/lib/widgets/propeditor/qfloatinput.cpp b/lib/widgets/propeditor/qfloatinput.cpp index f1bde4cd..a8522105 100644 --- a/lib/widgets/propeditor/qfloatinput.cpp +++ b/lib/widgets/propeditor/qfloatinput.cpp @@ -23,23 +23,23 @@ #include <math.h> QFloatInput::QFloatInput( int min, int max, float step, int digits, - QWidget *parent, const char *name ) - : QSpinBox( (int) (min*pow(digits,10)), + TQWidget *parent, const char *name ) + : TQSpinBox( (int) (min*pow(digits,10)), (int) (max*pow(digits,10)), (int) (step*pow(digits,10)), parent, name ), m_digits( digits ) { setValue( (int) (min*pow(digits,10)) ); delete validator(); - QDoubleValidator* validator = - new QDoubleValidator( min, max, m_digits, this ); + TQDoubleValidator* validator = + new TQDoubleValidator( min, max, m_digits, this ); setValidator( validator ); } -QString QFloatInput::mapValueToText( int value ) +TQString QFloatInput::mapValueToText( int value ) { - QString format = QString("%.%1f").arg( m_digits ); - return QString().sprintf(format.latin1(), + TQString format = TQString("%.%1f").arg( m_digits ); + return TQString().sprintf(format.latin1(), (value/(float)pow(m_digits,10)) ); } diff --git a/lib/widgets/propeditor/qfloatinput.h b/lib/widgets/propeditor/qfloatinput.h index 5f5adbd4..4bbe63e6 100644 --- a/lib/widgets/propeditor/qfloatinput.h +++ b/lib/widgets/propeditor/qfloatinput.h @@ -21,17 +21,17 @@ #ifndef QFLOATINPUT_H #define QFLOATINPUT_H -#include <qapplication.h> -#include <qspinbox.h> -#include <qvalidator.h> +#include <tqapplication.h> +#include <tqspinbox.h> +#include <tqvalidator.h> class QFloatInput : public QSpinBox { public: QFloatInput( int min, int max, float step, int digits, - QWidget *parent, const char *name = 0 ); + TQWidget *parent, const char *name = 0 ); - virtual QString mapValueToText( int value ); + virtual TQString mapValueToText( int value ); virtual int mapTextToValue( bool* ok ); diff --git a/lib/widgets/propeditor/test.cpp b/lib/widgets/propeditor/test.cpp index 0063e2d6..82665f98 100644 --- a/lib/widgets/propeditor/test.cpp +++ b/lib/widgets/propeditor/test.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qapplication.h> +#include <tqapplication.h> #include "propertyeditor.h" #include "propertylist.h" @@ -27,7 +27,7 @@ using namespace PropertyLib; int main( int argc, char **argv ) { - QApplication app( argc, argv ); + TQApplication app( argc, argv ); PropertyEditor *editor = new PropertyEditor( 0 ); @@ -44,10 +44,10 @@ int main( int argc, char **argv ) "sample pixmap description" ) ); currentList->addProperty( new Property( Property::Rect, "Rectangle", - "sample rectangle", QRect( 10, 11, 30, 40 ) ) ); + "sample rectangle", TQRect( 10, 11, 30, 40 ) ) ); currentList->addProperty( new Property( Property::Point, "Point", - "sample point", QPoint( 20, 30 ) ) ); + "sample point", TQPoint( 20, 30 ) ) ); currentList->addProperty( new Property( Property::Boolean, "Boolean", "sample bool", false ) ); @@ -59,7 +59,7 @@ int main( int argc, char **argv ) new Property( Property::Double, "Double", "sample double", 7.0 ) ); - QStringList things; + TQStringList things; things += "Thing 1"; things += "Thing 2"; diff --git a/lib/widgets/qcomboview.cpp b/lib/widgets/qcomboview.cpp index 2cab4fea..800eec47 100644 --- a/lib/widgets/qcomboview.cpp +++ b/lib/widgets/qcomboview.cpp @@ -16,21 +16,21 @@ #include "qcomboview.h" #include <kdeversion.h> #ifndef QT_NO_COMBOBOX -#include "qpopupmenu.h" -#include "qlistview.h" -#include "qpainter.h" -#include "qdrawutil.h" -#include "qstrlist.h" -#include "qpixmap.h" -#include "qtimer.h" -#include "qapplication.h" -#include "qlineedit.h" -#include "qbitmap.h" +#include "tqpopupmenu.h" +#include "tqlistview.h" +#include "tqpainter.h" +#include "tqdrawutil.h" +#include "tqstrlist.h" +#include "tqpixmap.h" +#include "tqtimer.h" +#include "tqapplication.h" +#include "tqlineedit.h" +#include "tqbitmap.h" #include "private/qeffects_p.h" -#include "qstringlist.h" -#include "qcombobox.h" -#include "qstyle.h" -#include "qheader.h" +#include "tqstringlist.h" +#include "tqcombobox.h" +#include "tqstyle.h" +#include "tqheader.h" #include <limits.h> class QComboViewData @@ -39,16 +39,16 @@ public: QComboViewData( QComboView *cb ): current(0), lView( 0 ), combo( cb ) { duplicatesEnabled = TRUE; - cb->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ) ); + cb->setSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Fixed ) ); } - inline QListView * listView() { return lView; } + inline TQListView * listView() { return lView; } void updateLinedGeometry(); - void setListView( QListView *l ) { lView = l ; + void setListView( TQListView *l ) { lView = l ; l->setMouseTracking( TRUE );} - QListViewItem *current; + TQListViewItem *current; int maxCount; int sizeLimit; QComboView::Policy p; @@ -65,14 +65,14 @@ public: bool duplicatesEnabled; int fullHeight, currHeight; - QLineEdit * ed; // /bin/ed rules! - QTimer *completionTimer; + TQLineEdit * ed; // /bin/ed rules! + TQTimer *completionTimer; - QSize sizeHint; + TQSize sizeHint; private: bool usinglView; - QListView *lView; + TQListView *lView; QComboView *combo; }; @@ -81,11 +81,11 @@ void QComboViewData::updateLinedGeometry() { if ( !ed || !combo ) return; - QRect r = QStyle::visualRect( combo->style().querySubControlMetrics(QStyle::CC_ComboBox, combo, - QStyle::SC_ComboBoxEditField), combo ); + TQRect r = TQStyle::visualRect( combo->style().querySubControlMetrics(TQStyle::CC_ComboBox, combo, + TQStyle::SC_ComboBoxEditField), combo ); // qWarning("updateLinedGeometry(): currentItem is %d", combo->currentItem() == 0 ? 0 : 1); - const QPixmap *pix = combo->currentItem() ? combo->currentItem()->pixmap(0) : 0; + const TQPixmap *pix = combo->currentItem() ? combo->currentItem()->pixmap(0) : 0; if ( pix && pix->width() < r.width() ) r.setLeft( r.left() + pix->width() + 4 ); if ( r != ed->geometry() ) @@ -138,8 +138,8 @@ static inline bool checkIndex( const char *method, const char * name, */ -QComboView::QComboView( bool rw, QWidget *parent, const char *name ) - : QWidget( parent, name, WResizeNoErase ) +QComboView::QComboView( bool rw, TQWidget *parent, const char *name ) + : TQWidget( parent, name, WResizeNoErase ) { d = new QComboViewData( this ); setUpListView(); @@ -156,7 +156,7 @@ QComboView::QComboView( bool rw, QWidget *parent, const char *name ) d->useCompletion = FALSE; d->completeAt = 0; d->completeNow = FALSE; - d->completionTimer = new QTimer( this ); + d->completionTimer = new TQTimer( this ); setFocusPolicy( StrongFocus ); @@ -204,18 +204,18 @@ void QComboView::clear() d->current = 0; if ( d->ed ) { - d->ed->setText( QString::fromLatin1("") ); + d->ed->setText( TQString::fromLatin1("") ); d->updateLinedGeometry(); } currentChanged(); } -QListViewItem *QComboView::currentItem() const +TQListViewItem *QComboView::currentItem() const { return d->current; } -void QComboView::setCurrentItem( QListViewItem *item ) +void QComboView::setCurrentItem( TQListViewItem *item ) { if ( item == d->current && !d->ed ) { return; @@ -272,16 +272,16 @@ void QComboView::setAutoResize( bool enable ) the contents change dynamically. To invalidate the cached value call setFont(). */ -QSize QComboView::sizeHint() const +TQSize QComboView::sizeHint() const { if ( isVisible() && d->sizeHint.isValid() ) return d->sizeHint; constPolish(); // int i, w; - QFontMetrics fm = fontMetrics(); + TQFontMetrics fm = fontMetrics(); - int maxW = childCount() ? 18 : 7 * fm.width(QChar('x')) + 18; + int maxW = childCount() ? 18 : 7 * fm.width(TQChar('x')) + 18; int maxH = QMAX( fm.lineSpacing(), 14 ) + 2; /* for( i = 0; i < count(); i++ ) { @@ -290,8 +290,8 @@ QSize QComboView::sizeHint() const maxW = w; } */ - d->sizeHint = (style().sizeFromContents(QStyle::CT_ComboBox, this, - QSize(maxW, maxH)).expandedTo(QApplication::globalStrut())); + d->sizeHint = (style().sizeFromContents(TQStyle::CT_ComboBox, this, + TQSize(maxW, maxH)).expandedTo(TQApplication::globalStrut())); return d->sizeHint; } @@ -303,7 +303,7 @@ QSize QComboView::sizeHint() const the activated() signal. */ -void QComboView::internalActivate( QListViewItem * item ) +void QComboView::internalActivate( TQListViewItem * item ) { if (!item) { @@ -319,7 +319,7 @@ void QComboView::internalActivate( QListViewItem * item ) d->current = item; - QString t( item->text(0) ); + TQString t( item->text(0) ); if ( d->ed ) { d->ed->setText( t ); // qWarning("internalActivate( %s )", item->text(0).latin1()); @@ -337,7 +337,7 @@ void QComboView::internalActivate( QListViewItem * item ) the highlighted() signal. */ -void QComboView::internalHighlight( QListViewItem * item ) +void QComboView::internalHighlight( TQListViewItem * item ) { if (!item) { @@ -349,7 +349,7 @@ void QComboView::internalHighlight( QListViewItem * item ) return; } emit highlighted( item ); - QString t = item->text(0); + TQString t = item->text(0); if ( !t.isNull() ) emit highlighted( t ); } @@ -369,9 +369,9 @@ void QComboView::internalClickTimeout() popup list to \a palette. */ -void QComboView::setPalette( const QPalette &palette ) +void QComboView::setPalette( const TQPalette &palette ) { - QWidget::setPalette( palette ); + TQWidget::setPalette( palette ); if( d ) { if(d->listView()) d->listView()->setPalette( palette ); @@ -383,10 +383,10 @@ void QComboView::setPalette( const QPalette &palette ) list to \a font. */ -void QComboView::setFont( const QFont &font ) +void QComboView::setFont( const TQFont &font ) { - d->sizeHint = QSize(); // invalidate size hint - QWidget::setFont( font ); + d->sizeHint = TQSize(); // invalidate size hint + TQWidget::setFont( font ); d->listView()->setFont( font ); if (d->ed) d->ed->setFont( font ); @@ -398,49 +398,49 @@ void QComboView::setFont( const QFont &font ) /*!reimp */ -void QComboView::resizeEvent( QResizeEvent * e ) +void QComboView::resizeEvent( TQResizeEvent * e ) { if ( d->ed ) d->updateLinedGeometry(); d->listView()->resize( width(), d->listView()->height() ); - QWidget::resizeEvent( e ); + TQWidget::resizeEvent( e ); } /*!reimp */ -void QComboView::paintEvent( QPaintEvent * ) +void QComboView::paintEvent( TQPaintEvent * ) { - QPainter p( this ); - const QColorGroup & g = colorGroup(); + TQPainter p( this ); + const TQColorGroup & g = colorGroup(); p.setPen(g.text()); - QStyle::SFlags flags = QStyle::Style_Default; + TQStyle::SFlags flags = TQStyle::Style_Default; if (isEnabled()) - flags |= QStyle::Style_Enabled; + flags |= TQStyle::Style_Enabled; if (hasFocus()) - flags |= QStyle::Style_HasFocus; + flags |= TQStyle::Style_HasFocus; if ( width() < 5 || height() < 5 ) { qDrawShadePanel( &p, rect(), g, FALSE, 2, - &g.brush( QColorGroup::Button ) ); + &g.brush( TQColorGroup::Button ) ); return; } -// bool reverse = QApplication::reverseLayout(); - style().drawComplexControl( QStyle::CC_ComboBox, &p, this, rect(), g, - flags, QStyle::SC_All, +// bool reverse = TQApplication::reverseLayout(); + style().drawComplexControl( TQStyle::CC_ComboBox, &p, this, rect(), g, + flags, TQStyle::SC_All, (d->arrowDown ? - QStyle::SC_ComboBoxArrow : - QStyle::SC_None )); + TQStyle::SC_ComboBoxArrow : + TQStyle::SC_None )); - QRect re = style().querySubControlMetrics( QStyle::CC_ComboBox, this, - QStyle::SC_ComboBoxEditField ); - re = QStyle::visualRect(re, this); + TQRect re = style().querySubControlMetrics( TQStyle::CC_ComboBox, this, + TQStyle::SC_ComboBoxEditField ); + re = TQStyle::visualRect(re, this); p.setClipRect( re ); if ( !d->ed ) { - QListViewItem * item = d->current; + TQListViewItem * item = d->current; if ( item ) { // we calculate the QListBoxTexts height (ignoring strut) int itemh = d->listView()->fontMetrics().lineSpacing() + 2; @@ -448,11 +448,11 @@ void QComboView::paintEvent( QPaintEvent * ) item->paintCell( &p, d->listView()->colorGroup(), 0, width(), AlignLeft | AlignVCenter ); } } else if ( d->listView() && d->listView()->currentItem( ) && d->current ) { - QListViewItem * item = d->current ; - const QPixmap *pix = item->pixmap(0); + TQListViewItem * item = d->current ; + const TQPixmap *pix = item->pixmap(0); if ( pix ) { p.fillRect( re.x(), re.y(), pix->width() + 4, re.height(), - colorGroup().brush( QColorGroup::Base ) ); + colorGroup().brush( TQColorGroup::Base ) ); p.drawPixmap( re.x() + 2, re.y() + ( re.height() - pix->height() ) / 2, *pix ); } @@ -464,7 +464,7 @@ void QComboView::paintEvent( QPaintEvent * ) /*!reimp */ -void QComboView::mousePressEvent( QMouseEvent *e ) +void QComboView::mousePressEvent( TQMouseEvent *e ) { if ( e->button() != LeftButton ) return; @@ -472,9 +472,9 @@ void QComboView::mousePressEvent( QMouseEvent *e ) d->discardNextMousePress = FALSE; return; } - QRect arrowRect = style().querySubControlMetrics( QStyle::CC_ComboBox, this, - QStyle::SC_ComboBoxArrow); - arrowRect = QStyle::visualRect(arrowRect, this); + TQRect arrowRect = style().querySubControlMetrics( TQStyle::CC_ComboBox, this, + TQStyle::SC_ComboBoxArrow); + arrowRect = TQStyle::visualRect(arrowRect, this); // Correction for motif style, where arrow is smaller // and thus has a rect that doesn't fit the button. @@ -491,7 +491,7 @@ void QComboView::mousePressEvent( QMouseEvent *e ) d->arrowDown = TRUE; repaint( FALSE ); } - QTimer::singleShot( 200, this, SLOT(internalClickTimeout())); + TQTimer::singleShot( 200, this, TQT_SLOT(internalClickTimeout())); d->shortClick = TRUE; } } @@ -499,21 +499,21 @@ void QComboView::mousePressEvent( QMouseEvent *e ) /*!reimp */ -void QComboView::mouseMoveEvent( QMouseEvent * ) +void QComboView::mouseMoveEvent( TQMouseEvent * ) { } /*!reimp */ -void QComboView::mouseReleaseEvent( QMouseEvent * ) +void QComboView::mouseReleaseEvent( TQMouseEvent * ) { } /*!reimp */ -void QComboView::mouseDoubleClickEvent( QMouseEvent *e ) +void QComboView::mouseDoubleClickEvent( TQMouseEvent *e ) { mousePressEvent( e ); } @@ -522,9 +522,9 @@ void QComboView::mouseDoubleClickEvent( QMouseEvent *e ) /*!reimp */ -void QComboView::keyPressEvent( QKeyEvent *e ) +void QComboView::keyPressEvent( TQKeyEvent *e ) { - QListViewItem *c = currentItem(); + TQListViewItem *c = currentItem(); if ( ( e->key() == Key_F4 && e->state() == 0 ) || ( e->key() == Key_Down && (e->state() & AltButton) ) || ( !d->ed && e->key() == Key_Space ) ) { @@ -571,7 +571,7 @@ void QComboView::keyPressEvent( QKeyEvent *e ) return; } else { d->completionTimer->stop(); - QString ct = currentText().left( d->completeAt ) + e->text(); + TQString ct = currentText().left( d->completeAt ) + e->text(); c = completionIndex( ct, c ); if ( c == 0 && d->completeAt > 0 ) { c = completionIndex( e->text(), listView()->firstChild() ); @@ -597,22 +597,22 @@ void QComboView::keyPressEvent( QKeyEvent *e ) emit activated( c ); } -QString QComboView::currentText() const +TQString QComboView::currentText() const { if ( d->ed ) return d->ed->text(); else if ( d->current ) return currentItem()->text(0); else - return QString::null; + return TQString::null; } /*!reimp */ -void QComboView::focusInEvent( QFocusEvent * e ) +void QComboView::focusInEvent( TQFocusEvent * e ) { - QWidget::focusInEvent( e ); + TQWidget::focusInEvent( e ); d->completeNow = FALSE; d->completeAt = 0; @@ -622,9 +622,9 @@ void QComboView::focusInEvent( QFocusEvent * e ) /*!reimp */ -void QComboView::focusOutEvent( QFocusEvent * e ) +void QComboView::focusOutEvent( TQFocusEvent * e ) { - QWidget::focusOutEvent( e ); + TQWidget::focusOutEvent( e ); d->completeNow = FALSE; d->completeAt = 0; @@ -634,20 +634,20 @@ void QComboView::focusOutEvent( QFocusEvent * e ) /*!reimp */ -void QComboView::wheelEvent( QWheelEvent *e ) +void QComboView::wheelEvent( TQWheelEvent *e ) { if ( d->poppedUp ) { - QApplication::sendEvent( d->listView(), e ); + TQApplication::sendEvent( d->listView(), e ); } else { if ( e->delta() > 0 ) { - QListViewItem *c = currentItem(); + TQListViewItem *c = currentItem(); if ( c && c->itemAbove() ) { setCurrentItem( c->itemAbove() ); emit activated( currentItem() ); emit activated( currentText() ); } } else { - QListViewItem *c = currentItem(); + TQListViewItem *c = currentItem(); if ( c && c->itemBelow() ) { setCurrentItem( c->itemBelow() ); emit activated( currentItem() ); @@ -658,10 +658,10 @@ void QComboView::wheelEvent( QWheelEvent *e ) } } -int childCount(QListViewItem *it) +int childCount(TQListViewItem *it) { int count = 1; - QListViewItem * myChild = it->firstChild(); + TQListViewItem * myChild = it->firstChild(); while( myChild ) { count += childCount(myChild); myChild = myChild->nextSibling(); @@ -669,10 +669,10 @@ int childCount(QListViewItem *it) return count; } -int childCount(QListView *lv) +int childCount(TQListView *lv) { int count = 0; - QListViewItem * myChild = lv->firstChild(); + TQListViewItem * myChild = lv->firstChild(); while( myChild ) { count += childCount(myChild); // count += 1; @@ -686,7 +686,7 @@ int childCount(QListView *lv) Calculates the listbox height needed to contain all items, or as many as the list box is supposed to contain. */ -static int listHeight( QListView *l, int /*sl*/ ) +static int listHeight( TQListView *l, int /*sl*/ ) { /* if ( l->childCount() > 0 ) return QMIN( l->childCount(), (uint)sl) * l->firstChild()->height(); @@ -722,7 +722,7 @@ void QComboView::popup() return; // Send all listbox events to eventFilter(): - QListView* lb = d->listView(); + TQListView* lb = d->listView(); lb->triggerUpdate( ); lb->installEventFilter( this ); lb->viewport()->installEventFilter( this ); @@ -730,13 +730,13 @@ void QComboView::popup() // int w = lb->variableWidth() ? lb->sizeHint().width() : width(); int w = width(); int h = listHeight( lb, d->sizeLimit ); - QRect screen = QApplication::desktop()->availableGeometry( const_cast<QComboView*>(this) ); + TQRect screen = TQApplication::desktop()->availableGeometry( const_cast<QComboView*>(this) ); int sx = screen.x(); // screen pos int sy = screen.y(); int sw = screen.width(); // screen width int sh = screen.height(); // screen height - QPoint pos = mapToGlobal( QPoint(0,height()) ); + TQPoint pos = mapToGlobal( TQPoint(0,height()) ); // ## Similar code is in QPopupMenu int x = pos.x(); int y = pos.y(); @@ -748,10 +748,10 @@ void QComboView::popup() x = sx; if (y + h > sy+sh && y - h - height() >= 0 ) y = y - h - height(); - QRect rect = - style().querySubControlMetrics( QStyle::CC_ComboBox, this, - QStyle::SC_ComboBoxListBoxPopup, - QStyleOption( x, y, w, h ) ); + TQRect rect = + style().querySubControlMetrics( TQStyle::CC_ComboBox, this, + TQStyle::SC_ComboBoxListBoxPopup, + TQStyleOption( x, y, w, h ) ); if ( rect.isNull() ) rect.setRect( x, y, w, h ); lb->setGeometry( rect ); @@ -759,17 +759,17 @@ void QComboView::popup() lb->raise(); bool block = lb->signalsBlocked(); lb->blockSignals( TRUE ); - QListViewItem *currentLBItem = d->current ; + TQListViewItem *currentLBItem = d->current ; lb->setCurrentItem( currentLBItem ); // set the current item to also be the selected item if it isn't already if ( currentLBItem && currentLBItem->isSelectable() && !currentLBItem->isSelected() ) lb->setSelected( currentLBItem, TRUE ); lb->blockSignals( block ); - lb->setVScrollBarMode(QScrollView::Auto); + lb->setVScrollBarMode(TQScrollView::Auto); //#ifndef QT_NO_EFFECTS -/* if ( QApplication::isEffectEnabled( UI_AnimateCombo ) ) { - if ( lb->y() < mapToGlobal(QPoint(0,0)).y() ) +/* if ( TQApplication::isEffectEnabled( UI_AnimateCombo ) ) { + if ( lb->y() < mapToGlobal(TQPoint(0,0)).y() ) qScrollEffect( lb, QEffects::UpScroll ); else qScrollEffect( lb ); @@ -785,12 +785,12 @@ void QComboView::popup() */ void QComboView::updateMask() { - QBitmap bm( size() ); + TQBitmap bm( size() ); bm.fill( color0 ); { - QPainter p( &bm, this ); - style().drawComplexControlMask(QStyle::CC_ComboBox, &p, this, rect()); + TQPainter p( &bm, this ); + style().drawComplexControlMask(TQStyle::CC_ComboBox, &p, this, rect()); } setMask( bm ); @@ -846,42 +846,42 @@ void QComboView::currentChanged() when the mouse button is released. */ -bool QComboView::eventFilter( QObject *object, QEvent *event ) +bool QComboView::eventFilter( TQObject *object, TQEvent *event ) { if ( !event ) return TRUE; else if ( object == d->ed ) { - if ( event->type() == QEvent::KeyPress ) { - bool isAccepted = ( (QKeyEvent*)event )->isAccepted(); - keyPressEvent( (QKeyEvent *)event ); - if ( ((QKeyEvent *)event)->isAccepted() ) { + if ( event->type() == TQEvent::KeyPress ) { + bool isAccepted = ( (TQKeyEvent*)event )->isAccepted(); + keyPressEvent( (TQKeyEvent *)event ); + if ( ((TQKeyEvent *)event)->isAccepted() ) { d->completeNow = FALSE; return TRUE; - } else if ( ((QKeyEvent *)event)->key() != Key_End ) { + } else if ( ((TQKeyEvent *)event)->key() != Key_End ) { d->completeNow = TRUE; d->completeAt = d->ed->cursorPosition(); } if ( isAccepted ) - ( (QKeyEvent*)event )->accept(); + ( (TQKeyEvent*)event )->accept(); else - ( (QKeyEvent*)event )->ignore(); - } else if ( event->type() == QEvent::KeyRelease ) { + ( (TQKeyEvent*)event )->ignore(); + } else if ( event->type() == TQEvent::KeyRelease ) { d->completeNow = FALSE; - keyReleaseEvent( (QKeyEvent *)event ); - return ((QKeyEvent *)event)->isAccepted(); - } else if ( event->type() == QEvent::FocusIn ) { - focusInEvent( (QFocusEvent *)event ); - } else if ( event->type() == QEvent::FocusOut ) { - focusOutEvent( (QFocusEvent *)event ); + keyReleaseEvent( (TQKeyEvent *)event ); + return ((TQKeyEvent *)event)->isAccepted(); + } else if ( event->type() == TQEvent::FocusIn ) { + focusInEvent( (TQFocusEvent *)event ); + } else if ( event->type() == TQEvent::FocusOut ) { + focusOutEvent( (TQFocusEvent *)event ); } else if ( d->useCompletion && d->completeNow ) { if ( !d->ed->text().isNull() && d->ed->cursorPosition() > d->completeAt && d->ed->cursorPosition() == (int)d->ed->text().length() ) { d->completeNow = FALSE; - QString ct( d->ed->text() ); - QListViewItem *i = completionIndex( ct, currentItem() ); + TQString ct( d->ed->text() ); + TQListViewItem *i = completionIndex( ct, currentItem() ); if ( i ) { - QString it = i->text(0); + TQString it = i->text(0); d->ed->validateAndSet( it, ct.length(), ct.length(), it.length() ); } @@ -889,22 +889,22 @@ bool QComboView::eventFilter( QObject *object, QEvent *event ) } } else if ( ( object == d->listView() || object == d->listView()->viewport() )) { - QMouseEvent *e = (QMouseEvent*)event; + TQMouseEvent *e = (TQMouseEvent*)event; switch( event->type() ) { - case QEvent::MouseMove: + case TQEvent::MouseMove: if ( !d->mouseWasInsidePopup ) { // qWarning("!d->mouseWasInsidePopup"); - QPoint pos = e->pos(); + TQPoint pos = e->pos(); if ( d->listView()->rect().contains( pos ) ) d->mouseWasInsidePopup = TRUE; // Check if arrow button should toggle if ( d->arrowPressed ) { - QPoint comboPos; + TQPoint comboPos; comboPos = mapFromGlobal( d->listView()->mapToGlobal(pos) ); - QRect arrowRect = - style().querySubControlMetrics( QStyle::CC_ComboBox, this, - QStyle::SC_ComboBoxArrow); - arrowRect = QStyle::visualRect(arrowRect, this); + TQRect arrowRect = + style().querySubControlMetrics( TQStyle::CC_ComboBox, this, + TQStyle::SC_ComboBoxArrow); + arrowRect = TQStyle::visualRect(arrowRect, this); if ( arrowRect.contains( comboPos ) ) { if ( !d->arrowDown ) { d->arrowDown = TRUE; @@ -918,12 +918,12 @@ bool QComboView::eventFilter( QObject *object, QEvent *event ) } } } else if ((e->state() & ( RightButton | LeftButton | MidButton ) ) == 0 && - style().styleHint(QStyle::SH_ComboBox_ListMouseTracking, this)) { + style().styleHint(TQStyle::SH_ComboBox_ListMouseTracking, this)) { // qWarning("event filter:: emu"); - QWidget *mouseW = QApplication::widgetAt( e->globalPos(), TRUE ); + TQWidget *mouseW = TQApplication::widgetAt( e->globalPos(), TRUE ); // if ( mouseW == d->listView()->viewport() ) { //### if ( mouseW == d->listView()->viewport() ) { - QListViewItem *sel = d->listView()->itemAt(e->pos()); + TQListViewItem *sel = d->listView()->itemAt(e->pos()); if (sel) { d->listView()->setCurrentItem(sel); @@ -934,12 +934,12 @@ bool QComboView::eventFilter( QObject *object, QEvent *event ) } break; - case QEvent::MouseButtonRelease: + case TQEvent::MouseButtonRelease: if ( d->listView()->rect().contains( e->pos() ) ) { - QMouseEvent tmp( QEvent::MouseButtonDblClick, + TQMouseEvent tmp( TQEvent::MouseButtonDblClick, e->pos(), e->button(), e->state() ) ; // will hide popup - QApplication::sendEvent( object, &tmp ); + TQApplication::sendEvent( object, &tmp ); return TRUE; } else { if ( d->mouseWasInsidePopup ) { @@ -953,11 +953,11 @@ bool QComboView::eventFilter( QObject *object, QEvent *event ) } } break; - case QEvent::MouseButtonDblClick: - case QEvent::MouseButtonPress: + case TQEvent::MouseButtonDblClick: + case TQEvent::MouseButtonPress: if ( !d->listView()->rect().contains( e->pos() ) ) { - QPoint globalPos = d->listView()->mapToGlobal(e->pos()); - if ( QApplication::widgetAt( globalPos, TRUE ) == this ) { + TQPoint globalPos = d->listView()->mapToGlobal(e->pos()); + if ( TQApplication::widgetAt( globalPos, TRUE ) == this ) { d->discardNextMousePress = TRUE; // avoid popping up again } @@ -965,11 +965,11 @@ bool QComboView::eventFilter( QObject *object, QEvent *event ) return TRUE; } break; - case QEvent::KeyPress: - switch( ((QKeyEvent *)event)->key() ) { + case TQEvent::KeyPress: + switch( ((TQKeyEvent *)event)->key() ) { case Key_Up: case Key_Down: - if ( !(((QKeyEvent *)event)->state() & AltButton) ) + if ( !(((TQKeyEvent *)event)->state() & AltButton) ) break; case Key_F4: case Key_Escape: @@ -986,14 +986,14 @@ bool QComboView::eventFilter( QObject *object, QEvent *event ) break; } break; - case QEvent::Hide: + case TQEvent::Hide: popDownListView(); break; default: break; } } - return QWidget::eventFilter( object, event ); + return TQWidget::eventFilter( object, event ); } @@ -1003,10 +1003,10 @@ bool QComboView::eventFilter( QObject *object, QEvent *event ) items start with \a prefix. */ -QListViewItem *QComboView::completionIndex( const QString & prefix, - QListViewItem *startingAt ) const +TQListViewItem *QComboView::completionIndex( const TQString & prefix, + TQListViewItem *startingAt ) const { - QListViewItem *start = startingAt; + TQListViewItem *start = startingAt; /* if ( start < 0 || start >= count() ) start = 0; if ( start >= count() ) @@ -1017,12 +1017,12 @@ QListViewItem *QComboView::completionIndex( const QString & prefix, return 0; /* if (!start->itemBelow()) return 0;*/ - QString match = prefix.lower(); + TQString match = prefix.lower(); if ( match.length() < 1 ) return start; - QString current; - QListViewItem *i = start; + TQString current; + TQListViewItem *i = start; do { current = i->text(0).lower(); if ( current.startsWith( match ) ) @@ -1077,12 +1077,12 @@ void QComboView::setInsertionPolicy( Policy policy ) void QComboView::returnPressed() { - QString s( d->ed->text() ); + TQString s( d->ed->text() ); if ( s.isEmpty() ) return; - QListViewItem *c = 0; + TQListViewItem *c = 0; bool doInsert = TRUE; if ( !d->duplicatesEnabled ) { c = listView()->findItem(s, 0); @@ -1113,11 +1113,11 @@ void QComboView::returnPressed() return; // break; case AtBottom: - c = new QListViewItem(listView(), listView()->lastItem(), s); + c = new TQListViewItem(listView(), listView()->lastItem(), s); break; case BeforeCurrent: if (currentItem() && currentItem()->itemAbove()) - c = new QListViewItem(listView(), currentItem()->itemAbove(), s); + c = new TQListViewItem(listView(), currentItem()->itemAbove(), s); else { c = 0; @@ -1126,7 +1126,7 @@ void QComboView::returnPressed() break; case AfterCurrent: if (currentItem() && currentItem()->itemBelow()) - c = new QListViewItem(listView(), currentItem()->itemBelow(), s); + c = new TQListViewItem(listView(), currentItem()->itemBelow(), s); else { c = 0; @@ -1150,7 +1150,7 @@ void QComboView::returnPressed() void QComboView::setEnabled( bool enable ) { - QWidget::setEnabled( enable ); + TQWidget::setEnabled( enable ); } @@ -1164,7 +1164,7 @@ void QComboView::setEnabled( bool enable ) \sa validator() clearValidator() QValidator */ -void QComboView::setValidator( const QValidator * v ) +void QComboView::setValidator( const TQValidator * v ) { if ( d && d->ed ) d->ed->setValidator( v ); @@ -1178,7 +1178,7 @@ void QComboView::setValidator( const QValidator * v ) \sa setValidator() clearValidator() QValidator */ -const QValidator * QComboView::validator() const +const TQValidator * QComboView::validator() const { return d && d->ed ? d->ed->validator() : 0; } @@ -1205,19 +1205,19 @@ void QComboView::clearValidator() necessary because of the line edit in QComboView. */ -void QComboView::setListView( QListView * newListView ) +void QComboView::setListView( TQListView * newListView ) { clear(); delete d->listView(); - newListView->reparent( this, WType_Popup, QPoint(0,0), FALSE ); + newListView->reparent( this, WType_Popup, TQPoint(0,0), FALSE ); d->setListView( newListView ); d->listView()->setFont( font() ); d->listView()->setPalette( palette() ); -/* d->listView()->setVScrollBarMode(QScrollView::AlwaysOff); - d->listView()->setHScrollBarMode(QScrollView::AlwaysOff);*/ - d->listView()->setFrameStyle( QFrame::Box | QFrame::Plain ); +/* d->listView()->setVScrollBarMode(TQScrollView::AlwaysOff); + d->listView()->setHScrollBarMode(TQScrollView::AlwaysOff);*/ + d->listView()->setFrameStyle( TQFrame::Box | TQFrame::Plain ); d->listView()->setLineWidth( 1 ); /* d->listView()->setRootIsDecorated( true ); d->listView()->setAllColumnsShowFocus(true);*/ @@ -1231,9 +1231,9 @@ void QComboView::setListView( QListView * newListView ) /* d->listView()->setFont( font() ); d->listView()->setPalette( palette() ); - d->listView()->setVScrollBarMode( QScrollView::AlwaysOff ); - d->listView()->setHScrollBarMode( QScrollView::AlwaysOff ); - d->listView()->setFrameStyle( QFrame::Box | QFrame::Plain ); + d->listView()->setVScrollBarMode( TQScrollView::AlwaysOff ); + d->listView()->setHScrollBarMode( TQScrollView::AlwaysOff ); + d->listView()->setFrameStyle( TQFrame::Box | TQFrame::Plain ); d->listView()->setLineWidth( 1 ); d->listView()->setRootIsDecorated( true ); d->listView()->setAllColumnsShowFocus(true); @@ -1241,28 +1241,28 @@ void QComboView::setListView( QListView * newListView ) d->listView()->resize( 100, 10 ); */ - connect( d->listView(), SIGNAL(returnPressed(QListViewItem*)), - SLOT(internalActivate(QListViewItem*))); - connect( d->listView(), SIGNAL(doubleClicked(QListViewItem*)), - SLOT(internalActivate(QListViewItem*))); - connect( d->listView(), SIGNAL(doubleClicked(QListViewItem*)), - SLOT(checkState(QListViewItem*))); - connect( d->listView(), SIGNAL(currentChanged(QListViewItem*)), - SLOT(internalHighlight(QListViewItem*))); - connect( d->listView(), SIGNAL(selectionChanged(QListViewItem*)), - SLOT(internalHighlight(QListViewItem*))); + connect( d->listView(), TQT_SIGNAL(returnPressed(TQListViewItem*)), + TQT_SLOT(internalActivate(TQListViewItem*))); + connect( d->listView(), TQT_SIGNAL(doubleClicked(TQListViewItem*)), + TQT_SLOT(internalActivate(TQListViewItem*))); + connect( d->listView(), TQT_SIGNAL(doubleClicked(TQListViewItem*)), + TQT_SLOT(checkState(TQListViewItem*))); + connect( d->listView(), TQT_SIGNAL(currentChanged(TQListViewItem*)), + TQT_SLOT(internalHighlight(TQListViewItem*))); + connect( d->listView(), TQT_SIGNAL(selectionChanged(TQListViewItem*)), + TQT_SLOT(internalHighlight(TQListViewItem*))); } /*! Returns the current list box, or 0 if there is no list box. - (QComboView can use QPopupMenu instead of QListBox.) Provided to + (QComboView can use TQPopupMenu instead of TQListBox.) Provided to match setlistView(). \sa setlistView() */ -QListView * QComboView::listView() const +TQListView * QComboView::listView() const { return d ? d->listView() : 0; } @@ -1272,7 +1272,7 @@ QListView * QComboView::listView() const Only editable listboxes have a line editor. */ -QLineEdit* QComboView::lineEdit() const +TQLineEdit* QComboView::lineEdit() const { return d->ed; } @@ -1309,7 +1309,7 @@ void QComboView::clearEdit() \sa clearEdit() insertItem() */ -void QComboView::setEditText( const QString &newText ) +void QComboView::setEditText( const TQString &newText ) { if ( d && d->ed ) { d->updateLinedGeometry(); @@ -1331,12 +1331,12 @@ bool QComboView::autoCompletion() const /*!reimp */ -void QComboView::styleChange( QStyle& s ) +void QComboView::styleChange( TQStyle& s ) { - d->sizeHint = QSize(); // invalidate size hint... + d->sizeHint = TQSize(); // invalidate size hint... if ( d->ed ) d->updateLinedGeometry(); - QWidget::styleChange( s ); + TQWidget::styleChange( s ); } bool QComboView::editable() const @@ -1367,49 +1367,49 @@ void QComboView::setEditable( bool y ) void QComboView::setUpListView() { - d->setListView( new QListView( this, "in-combo", WType_Popup ) ); + d->setListView( new TQListView( this, "in-combo", WType_Popup ) ); d->listView()->setFont( font() ); d->listView()->setPalette( palette() ); -/* d->listView()->setVScrollBarMode( QScrollView::AlwaysOff ); - d->listView()->setHScrollBarMode( QScrollView::AlwaysOff );*/ - d->listView()->setFrameStyle( QFrame::Box | QFrame::Plain ); +/* d->listView()->setVScrollBarMode( TQScrollView::AlwaysOff ); + d->listView()->setHScrollBarMode( TQScrollView::AlwaysOff );*/ + d->listView()->setFrameStyle( TQFrame::Box | TQFrame::Plain ); d->listView()->setLineWidth( 1 ); d->listView()->setRootIsDecorated( false ); d->listView()->setAllColumnsShowFocus(true); d->listView()->addColumn(""); d->listView()->resize( 100, 10 ); - d->listView()->setResizeMode(QListView::LastColumn); + d->listView()->setResizeMode(TQListView::LastColumn); if (d->listView()->firstChild()) d->current = d->listView()->firstChild(); d->listView()->header()->hide(); - connect( d->listView(), SIGNAL(returnPressed(QListViewItem*)), - SLOT(internalActivate(QListViewItem*))); - connect( d->listView(), SIGNAL(doubleClicked(QListViewItem*)), - SLOT(internalActivate(QListViewItem*))); - connect( d->listView(), SIGNAL(doubleClicked(QListViewItem*)), - SLOT(checkState(QListViewItem*))); - connect( d->listView(), SIGNAL(currentChanged(QListViewItem*)), - SLOT(internalHighlight(QListViewItem*))); - connect( d->listView(), SIGNAL(selectionChanged(QListViewItem*)), - SLOT(internalHighlight(QListViewItem*))); + connect( d->listView(), TQT_SIGNAL(returnPressed(TQListViewItem*)), + TQT_SLOT(internalActivate(TQListViewItem*))); + connect( d->listView(), TQT_SIGNAL(doubleClicked(TQListViewItem*)), + TQT_SLOT(internalActivate(TQListViewItem*))); + connect( d->listView(), TQT_SIGNAL(doubleClicked(TQListViewItem*)), + TQT_SLOT(checkState(TQListViewItem*))); + connect( d->listView(), TQT_SIGNAL(currentChanged(TQListViewItem*)), + TQT_SLOT(internalHighlight(TQListViewItem*))); + connect( d->listView(), TQT_SIGNAL(selectionChanged(TQListViewItem*)), + TQT_SLOT(internalHighlight(TQListViewItem*))); } void QComboView::setUpLineEdit() { if ( !d->ed ) - setLineEdit( new QLineEdit( this, "combo edit" ) ); + setLineEdit( new TQLineEdit( this, "combo edit" ) ); } /*! Sets the line edit to use \a edit instead of the current line edit. */ -void QComboView::setLineEdit( QLineEdit *edit ) +void QComboView::setLineEdit( TQLineEdit *edit ) { if ( !edit ) { #if defined(QT_CHECK_NULL) @@ -1431,13 +1431,13 @@ void QComboView::setLineEdit( QLineEdit *edit ) d->ed = edit; if ( edit->parent() != this ) { - edit->reparent( this, QPoint(0,0), FALSE ); + edit->reparent( this, TQPoint(0,0), FALSE ); edit->setFont( font() ); } - connect (edit, SIGNAL( textChanged( const QString& ) ), - this, SIGNAL( textChanged( const QString& ) ) ); - connect( edit, SIGNAL(returnPressed()), SLOT(returnPressed()) ); + connect (edit, TQT_SIGNAL( textChanged( const TQString& ) ), + this, TQT_SIGNAL( textChanged( const TQString& ) ) ); + connect( edit, TQT_SIGNAL(returnPressed()), TQT_SLOT(returnPressed()) ); edit->setFrame( FALSE ); d->updateLinedGeometry(); @@ -1454,9 +1454,9 @@ void QComboView::setLineEdit( QLineEdit *edit ) update(); } -void QComboView::setCurrentText( const QString& txt ) +void QComboView::setCurrentText( const TQString& txt ) { - QListViewItem *i; + TQListViewItem *i; i = listView()->findItem(txt, 0); if ( i ) setCurrentItem( i ); @@ -1466,12 +1466,12 @@ void QComboView::setCurrentText( const QString& txt ) currentItem()->setText(0, txt); } -void QComboView::checkState( QListViewItem * item) +void QComboView::checkState( TQListViewItem * item) { item->setOpen(!item->isOpen()); } -void QComboView::setCurrentActiveItem( QListViewItem * item ) +void QComboView::setCurrentActiveItem( TQListViewItem * item ) { if ( item == d->current && !d->ed ) { return; diff --git a/lib/widgets/qcomboview.h b/lib/widgets/qcomboview.h index 8f618f50..b918df1f 100644 --- a/lib/widgets/qcomboview.h +++ b/lib/widgets/qcomboview.h @@ -17,7 +17,7 @@ #define QCOMBOVIEW_H #ifndef QT_H -#include "qwidget.h" +#include "tqwidget.h" #endif // QT_H #ifndef QT_NO_COMBOBOX @@ -36,9 +36,9 @@ class QListViewItem; class QComboViewData; /** -QComboView - a combo with a QListView as a popup widget. +QComboView - a combo with a TQListView as a popup widget. This means that you can have a treeview inside of a combo. Otherwise it works -in the same way as QComboBox and have similar API. +in the same way as TQComboBox and have similar API. */ class Q_EXPORT QComboView : public QWidget { @@ -46,8 +46,8 @@ class Q_EXPORT QComboView : public QWidget Q_ENUMS( Policy ) Q_PROPERTY( bool editable READ editable WRITE setEditable ) // Q_PROPERTY( int count READ count ) - Q_PROPERTY( QString currentText READ currentText WRITE setCurrentText DESIGNABLE false ) -// Q_PROPERTY( QListView *currentItem READ currentItem WRITE setCurrentItem ) + Q_PROPERTY( TQString currentText READ currentText WRITE setCurrentText DESIGNABLE false ) +// Q_PROPERTY( TQListView *currentItem READ currentItem WRITE setCurrentItem ) Q_PROPERTY( bool autoResize READ autoResize WRITE setAutoResize DESIGNABLE false ) Q_PROPERTY( int sizeLimit READ sizeLimit WRITE setSizeLimit ) // Q_PROPERTY( int maxCount READ maxCount WRITE setMaxCount ) @@ -57,22 +57,22 @@ class Q_EXPORT QComboView : public QWidget Q_OVERRIDE( bool autoMask DESIGNABLE true SCRIPTABLE true ) public: -// QComboView( QWidget* parent=0, const char* name=0 ); - QComboView( bool rw, QWidget* parent=0, const char* name=0 ); +// QComboView( TQWidget* parent=0, const char* name=0 ); + QComboView( bool rw, TQWidget* parent=0, const char* name=0 ); ~QComboView(); int childCount() const; - QListViewItem *currentItem() const; - virtual void setCurrentItem( QListViewItem * ); - virtual void setCurrentActiveItem( QListViewItem * ); + TQListViewItem *currentItem() const; + virtual void setCurrentItem( TQListViewItem * ); + virtual void setCurrentActiveItem( TQListViewItem * ); bool autoResize() const; virtual void setAutoResize( bool ); QSize sizeHint() const; - void setPalette( const QPalette & ); - void setFont( const QFont & ); + void setPalette( const TQPalette & ); + void setFont( const TQFont & ); void setEnabled( bool ); virtual void setSizeLimit( int ); @@ -87,19 +87,19 @@ public: virtual void setInsertionPolicy( Policy policy ); Policy insertionPolicy() const; - virtual void setValidator( const QValidator * ); - const QValidator * validator() const; + virtual void setValidator( const TQValidator * ); + const TQValidator * validator() const; - virtual void setListView( QListView * ); - QListView * listView() const; + virtual void setListView( TQListView * ); + TQListView * listView() const; - virtual void setLineEdit( QLineEdit *edit ); - QLineEdit* lineEdit() const; + virtual void setLineEdit( TQLineEdit *edit ); + TQLineEdit* lineEdit() const; virtual void setAutoCompletion( bool ); bool autoCompletion() const; - bool eventFilter( QObject *object, QEvent *event ); + bool eventFilter( TQObject *object, TQEvent *event ); void setDuplicatesEnabled( bool enable ); bool duplicatesEnabled() const; @@ -109,43 +109,43 @@ public: virtual void popup(); - QString currentText() const; - void setCurrentText( const QString& ); + TQString currentText() const; + void setCurrentText( const TQString& ); public slots: virtual void clear(); void clearValidator(); void clearEdit(); - virtual void setEditText( const QString &); + virtual void setEditText( const TQString &); signals: - void activated( QListViewItem * item ); - void highlighted( QListViewItem * item ); - void activated( const QString &); - void highlighted( const QString &); - void textChanged( const QString &); + void activated( TQListViewItem * item ); + void highlighted( TQListViewItem * item ); + void activated( const TQString &); + void highlighted( const TQString &); + void textChanged( const TQString &); void focusGranted(); void focusLost(); private slots: - void internalActivate( QListViewItem * ); - void internalHighlight( QListViewItem * ); + void internalActivate( TQListViewItem * ); + void internalHighlight( TQListViewItem * ); void internalClickTimeout(); void returnPressed(); - void checkState(QListViewItem*); + void checkState(TQListViewItem*); protected: - void paintEvent( QPaintEvent * ); - void resizeEvent( QResizeEvent * ); - void mousePressEvent( QMouseEvent * ); - void mouseMoveEvent( QMouseEvent * ); - void mouseReleaseEvent( QMouseEvent * ); - void mouseDoubleClickEvent( QMouseEvent * ); - void keyPressEvent( QKeyEvent *e ); - void focusInEvent( QFocusEvent *e ); - void focusOutEvent( QFocusEvent *e ); - void wheelEvent( QWheelEvent *e ); - void styleChange( QStyle& ); + void paintEvent( TQPaintEvent * ); + void resizeEvent( TQResizeEvent * ); + void mousePressEvent( TQMouseEvent * ); + void mouseMoveEvent( TQMouseEvent * ); + void mouseReleaseEvent( TQMouseEvent * ); + void mouseDoubleClickEvent( TQMouseEvent * ); + void keyPressEvent( TQKeyEvent *e ); + void focusInEvent( TQFocusEvent *e ); + void focusOutEvent( TQFocusEvent *e ); + void wheelEvent( TQWheelEvent *e ); + void styleChange( TQStyle& ); void updateMask(); @@ -155,7 +155,7 @@ private: void popDownListView(); void reIndex(); void currentChanged(); - QListViewItem *completionIndex( const QString &, QListViewItem * ) const; + TQListViewItem *completionIndex( const TQString &, TQListViewItem * ) const; QComboViewData *d; diff --git a/lib/widgets/resizablecombo.cpp b/lib/widgets/resizablecombo.cpp index 7d7ecb39..6ca7e239 100644 --- a/lib/widgets/resizablecombo.cpp +++ b/lib/widgets/resizablecombo.cpp @@ -20,11 +20,11 @@ #include "kcomboview.h" -#include <qevent.h> -#include <qlayout.h> -#include <qpixmap.h> -#include <qapplication.h> -#include <qwhatsthis.h> +#include <tqevent.h> +#include <tqlayout.h> +#include <tqpixmap.h> +#include <tqapplication.h> +#include <tqwhatsthis.h> #include <klocale.h> @@ -51,43 +51,43 @@ static const char * resize_xpm[] = { " . ", " "}; -ResizableCombo::ResizableCombo(KComboView *view, QWidget *parent, const char *name): - QWidget(parent, name), m_sizer(0), m_combo(view) +ResizableCombo::ResizableCombo(KComboView *view, TQWidget *parent, const char *name): + TQWidget(parent, name), m_sizer(0), m_combo(view) { - QHBoxLayout *l = new QHBoxLayout(this); - view->reparent(this, QPoint(0,0)); + TQHBoxLayout *l = new TQHBoxLayout(this); + view->reparent(this, TQPoint(0,0)); l->addWidget(view); m_sizer = new MyPushButton(this); - m_sizer->setPixmap(QPixmap(resize_xpm)); - QWhatsThis::add(m_sizer, i18n("Drag this to resize the combobox.")); + m_sizer->setPixmap(TQPixmap(resize_xpm)); + TQWhatsThis::add(m_sizer, i18n("Drag this to resize the combobox.")); l->addWidget(m_sizer); } -void MyPushButton::mousePressEvent( QMouseEvent * e ) +void MyPushButton::mousePressEvent( TQMouseEvent * e ) { m_resizing = true; m_pressedPos = e->globalPos(); m_width = m_combo->m_combo->width(); - QPushButton::mousePressEvent(e); + TQPushButton::mousePressEvent(e); } -void MyPushButton::mouseReleaseEvent( QMouseEvent * e ) +void MyPushButton::mouseReleaseEvent( TQMouseEvent * e ) { m_resizing = false; - QPushButton::mouseReleaseEvent(e); + TQPushButton::mouseReleaseEvent(e); } -void MyPushButton::mouseMoveEvent( QMouseEvent * e ) +void MyPushButton::mouseMoveEvent( TQMouseEvent * e ) { if (m_resizing) m_combo->m_combo->setMinimumWidth(m_width + e->globalPos().x() - pressedPos().x()); - QPushButton::mouseMoveEvent(e); + TQPushButton::mouseMoveEvent(e); } MyPushButton::MyPushButton( ResizableCombo * parent, const char * name ) - :QPushButton(parent, name), m_resizing(false), m_combo(parent) + :TQPushButton(parent, name), m_resizing(false), m_combo(parent) { setFocusPolicy(NoFocus); setFlat(true); diff --git a/lib/widgets/resizablecombo.h b/lib/widgets/resizablecombo.h index 5c417378..b76b4f7e 100644 --- a/lib/widgets/resizablecombo.h +++ b/lib/widgets/resizablecombo.h @@ -19,8 +19,8 @@ #ifndef RESIZABLECOMBO_H #define RESIZABLECOMBO_H -#include <qpushbutton.h> -#include <qpoint.h> +#include <tqpushbutton.h> +#include <tqpoint.h> class KComboView; class QMouseEvent; @@ -38,7 +38,7 @@ Used to place resizable KComboBox onto toolbars. class ResizableCombo: public QWidget{ Q_OBJECT public: - ResizableCombo(KComboView *view, QWidget *parent = 0, const char *name = 0); + ResizableCombo(KComboView *view, TQWidget *parent = 0, const char *name = 0); private: MyPushButton *m_sizer; @@ -52,19 +52,19 @@ class MyPushButton: public QPushButton public: MyPushButton(ResizableCombo *parent = 0, const char *name = 0 ); - QPoint pressedPos() + TQPoint pressedPos() { return m_pressedPos; } protected: - virtual void mouseReleaseEvent ( QMouseEvent * e ); - virtual void mousePressEvent ( QMouseEvent * e ); - virtual void mouseMoveEvent ( QMouseEvent * e ); + virtual void mouseReleaseEvent ( TQMouseEvent * e ); + virtual void mousePressEvent ( TQMouseEvent * e ); + virtual void mouseMoveEvent ( TQMouseEvent * e ); private: bool m_resizing; - QPoint m_pressedPos; + TQPoint m_pressedPos; int m_width; ResizableCombo *m_combo; }; |