diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /libkdepim/designerfields.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdepim/designerfields.cpp')
-rw-r--r-- | libkdepim/designerfields.cpp | 190 |
1 files changed, 95 insertions, 95 deletions
diff --git a/libkdepim/designerfields.cpp b/libkdepim/designerfields.cpp index 8073bf885..ba78df0ea 100644 --- a/libkdepim/designerfields.cpp +++ b/libkdepim/designerfields.cpp @@ -20,15 +20,15 @@ Boston, MA 02110-1301, USA. */ -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qdatetimeedit.h> -#include <qlayout.h> -#include <qobjectlist.h> -#include <qspinbox.h> -#include <qregexp.h> -#include <qtextedit.h> -#include <qwidgetfactory.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqdatetimeedit.h> +#include <tqlayout.h> +#include <tqobjectlist.h> +#include <tqspinbox.h> +#include <tqregexp.h> +#include <tqtextedit.h> +#include <tqwidgetfactory.h> #include <kdatepicker.h> #include <kdatetimewidget.h> @@ -41,18 +41,18 @@ using namespace KPIM; -DesignerFields::DesignerFields( const QString &uiFile, QWidget *parent, +DesignerFields::DesignerFields( const TQString &uiFile, TQWidget *parent, const char *name ) - : QWidget( parent, name ) + : TQWidget( parent, name ) { initGUI( uiFile ); } -void DesignerFields::initGUI( const QString &uiFile ) +void DesignerFields::initGUI( const TQString &uiFile ) { - QVBoxLayout *layout = new QVBoxLayout( this ); + TQVBoxLayout *layout = new TQVBoxLayout( this ); - QWidget *wdg = QWidgetFactory::create( uiFile, 0, this ); + TQWidget *wdg = TQWidgetFactory::create( uiFile, 0, this ); if ( !wdg ) { kdError() << "No ui file found" << endl; return; @@ -63,15 +63,15 @@ void DesignerFields::initGUI( const QString &uiFile ) layout->addWidget( wdg ); - QObjectList *list = wdg->queryList( "QWidget" ); - QObjectListIt it( *list ); + TQObjectList *list = wdg->queryList( "TQWidget" ); + TQObjectListIt it( *list ); - QStringList allowedTypes; - allowedTypes << "QLineEdit" - << "QTextEdit" - << "QSpinBox" - << "QCheckBox" - << "QComboBox" + TQStringList allowedTypes; + allowedTypes << "TQLineEdit" + << "TQTextEdit" + << "TQSpinBox" + << "TQCheckBox" + << "TQComboBox" << "QDateTimeEdit" << "KLineEdit" << "KDateTimeWidget" @@ -79,38 +79,38 @@ void DesignerFields::initGUI( const QString &uiFile ) while ( it.current() ) { if ( allowedTypes.contains( it.current()->className() ) ) { - QString name = it.current()->name(); + TQString name = it.current()->name(); if ( name.startsWith( "X_" ) ) { name = name.mid( 2 ); - QWidget *widget = static_cast<QWidget*>( it.current() ); + TQWidget *widget = static_cast<TQWidget*>( it.current() ); if ( !name.isEmpty() ) mWidgets.insert( name, widget ); - if ( it.current()->inherits( "QLineEdit" ) ) - connect( it.current(), SIGNAL( textChanged( const QString& ) ), - SIGNAL( modified() ) ); - else if ( it.current()->inherits( "QSpinBox" ) ) - connect( it.current(), SIGNAL( valueChanged( int ) ), - SIGNAL( modified() ) ); - else if ( it.current()->inherits( "QCheckBox" ) ) - connect( it.current(), SIGNAL( toggled( bool ) ), - SIGNAL( modified() ) ); - else if ( it.current()->inherits( "QComboBox" ) ) - connect( it.current(), SIGNAL( activated( const QString& ) ), - SIGNAL( modified() ) ); + if ( it.current()->inherits( "TQLineEdit" ) ) + connect( it.current(), TQT_SIGNAL( textChanged( const TQString& ) ), + TQT_SIGNAL( modified() ) ); + else if ( it.current()->inherits( "TQSpinBox" ) ) + connect( it.current(), TQT_SIGNAL( valueChanged( int ) ), + TQT_SIGNAL( modified() ) ); + else if ( it.current()->inherits( "TQCheckBox" ) ) + connect( it.current(), TQT_SIGNAL( toggled( bool ) ), + TQT_SIGNAL( modified() ) ); + else if ( it.current()->inherits( "TQComboBox" ) ) + connect( it.current(), TQT_SIGNAL( activated( const TQString& ) ), + TQT_SIGNAL( modified() ) ); else if ( it.current()->inherits( "QDateTimeEdit" ) ) - connect( it.current(), SIGNAL( valueChanged( const QDateTime& ) ), - SIGNAL( modified() ) ); + connect( it.current(), TQT_SIGNAL( valueChanged( const TQDateTime& ) ), + TQT_SIGNAL( modified() ) ); else if ( it.current()->inherits( "KDateTimeWidget" ) ) - connect( it.current(), SIGNAL( valueChanged( const QDateTime& ) ), - SIGNAL( modified() ) ); + connect( it.current(), TQT_SIGNAL( valueChanged( const TQDateTime& ) ), + TQT_SIGNAL( modified() ) ); else if ( it.current()->inherits( "KDatePicker" ) ) - connect( it.current(), SIGNAL( dateChanged( QDate ) ), - SIGNAL( modified() ) ); - else if ( it.current()->inherits( "QTextEdit" ) ) - connect( it.current(), SIGNAL( textChanged() ), - SIGNAL( modified() ) ); + connect( it.current(), TQT_SIGNAL( dateChanged( TQDate ) ), + TQT_SIGNAL( modified() ) ); + else if ( it.current()->inherits( "TQTextEdit" ) ) + connect( it.current(), TQT_SIGNAL( textChanged() ), + TQT_SIGNAL( modified() ) ); if ( !widget->isEnabled() ) mDisabledWidgets.append( widget ); @@ -123,82 +123,82 @@ void DesignerFields::initGUI( const QString &uiFile ) delete list; } -QString DesignerFields::identifier() const +TQString DesignerFields::identifier() const { return mIdentifier; } -QString DesignerFields::title() const +TQString DesignerFields::title() const { return mTitle; } void DesignerFields::load( DesignerFields::Storage *storage ) { - QStringList keys = storage->keys(); + TQStringList keys = storage->keys(); // clear all custom page widgets // we can't do this in the following loop, as it works on the // custom fields of the vcard, which may not be set. - QMap<QString, QWidget *>::ConstIterator widIt; + TQMap<TQString, TQWidget *>::ConstIterator widIt; for ( widIt = mWidgets.begin(); widIt != mWidgets.end(); ++widIt ) { - QString value; - if ( widIt.data()->inherits( "QLineEdit" ) ) { - QLineEdit *wdg = static_cast<QLineEdit*>( widIt.data() ); - wdg->setText( QString::null ); - } else if ( widIt.data()->inherits( "QSpinBox" ) ) { - QSpinBox *wdg = static_cast<QSpinBox*>( widIt.data() ); + TQString value; + if ( widIt.data()->inherits( "TQLineEdit" ) ) { + TQLineEdit *wdg = static_cast<TQLineEdit*>( widIt.data() ); + wdg->setText( TQString::null ); + } else if ( widIt.data()->inherits( "TQSpinBox" ) ) { + TQSpinBox *wdg = static_cast<TQSpinBox*>( widIt.data() ); wdg->setValue( wdg->minValue() ); - } else if ( widIt.data()->inherits( "QCheckBox" ) ) { - QCheckBox *wdg = static_cast<QCheckBox*>( widIt.data() ); + } else if ( widIt.data()->inherits( "TQCheckBox" ) ) { + TQCheckBox *wdg = static_cast<TQCheckBox*>( widIt.data() ); wdg->setChecked( false ); } else if ( widIt.data()->inherits( "QDateTimeEdit" ) ) { QDateTimeEdit *wdg = static_cast<QDateTimeEdit*>( widIt.data() ); - wdg->setDateTime( QDateTime::currentDateTime() ); + wdg->setDateTime( TQDateTime::currentDateTime() ); } else if ( widIt.data()->inherits( "KDateTimeWidget" ) ) { KDateTimeWidget *wdg = static_cast<KDateTimeWidget*>( widIt.data() ); - wdg->setDateTime( QDateTime::currentDateTime() ); + wdg->setDateTime( TQDateTime::currentDateTime() ); } else if ( widIt.data()->inherits( "KDatePicker" ) ) { KDatePicker *wdg = static_cast<KDatePicker*>( widIt.data() ); - wdg->setDate( QDate::currentDate() ); - } else if ( widIt.data()->inherits( "QComboBox" ) ) { - QComboBox *wdg = static_cast<QComboBox*>( widIt.data() ); + wdg->setDate( TQDate::currentDate() ); + } else if ( widIt.data()->inherits( "TQComboBox" ) ) { + TQComboBox *wdg = static_cast<TQComboBox*>( widIt.data() ); wdg->setCurrentItem( 0 ); - } else if ( widIt.data()->inherits( "QTextEdit" ) ) { - QTextEdit *wdg = static_cast<QTextEdit*>( widIt.data() ); - wdg->setText( QString::null ); + } else if ( widIt.data()->inherits( "TQTextEdit" ) ) { + TQTextEdit *wdg = static_cast<TQTextEdit*>( widIt.data() ); + wdg->setText( TQString::null ); } } - QStringList::ConstIterator it2; + TQStringList::ConstIterator it2; for ( it2 = keys.begin(); it2 != keys.end(); ++it2 ) { - QString value = storage->read( *it2 ); + TQString value = storage->read( *it2 ); - QMap<QString, QWidget *>::ConstIterator it = mWidgets.find( *it2 ); + TQMap<TQString, TQWidget *>::ConstIterator it = mWidgets.find( *it2 ); if ( it != mWidgets.end() ) { - if ( it.data()->inherits( "QLineEdit" ) ) { - QLineEdit *wdg = static_cast<QLineEdit*>( it.data() ); + if ( it.data()->inherits( "TQLineEdit" ) ) { + TQLineEdit *wdg = static_cast<TQLineEdit*>( it.data() ); wdg->setText( value ); - } else if ( it.data()->inherits( "QSpinBox" ) ) { - QSpinBox *wdg = static_cast<QSpinBox*>( it.data() ); + } else if ( it.data()->inherits( "TQSpinBox" ) ) { + TQSpinBox *wdg = static_cast<TQSpinBox*>( it.data() ); wdg->setValue( value.toInt() ); - } else if ( it.data()->inherits( "QCheckBox" ) ) { - QCheckBox *wdg = static_cast<QCheckBox*>( it.data() ); + } else if ( it.data()->inherits( "TQCheckBox" ) ) { + TQCheckBox *wdg = static_cast<TQCheckBox*>( it.data() ); wdg->setChecked( value == "true" || value == "1" ); } else if ( it.data()->inherits( "QDateTimeEdit" ) ) { QDateTimeEdit *wdg = static_cast<QDateTimeEdit*>( it.data() ); - wdg->setDateTime( QDateTime::fromString( value, Qt::ISODate ) ); + wdg->setDateTime( TQDateTime::fromString( value, Qt::ISODate ) ); } else if ( it.data()->inherits( "KDateTimeWidget" ) ) { KDateTimeWidget *wdg = static_cast<KDateTimeWidget*>( it.data() ); - wdg->setDateTime( QDateTime::fromString( value, Qt::ISODate ) ); + wdg->setDateTime( TQDateTime::fromString( value, Qt::ISODate ) ); } else if ( it.data()->inherits( "KDatePicker" ) ) { KDatePicker *wdg = static_cast<KDatePicker*>( it.data() ); - wdg->setDate( QDate::fromString( value, Qt::ISODate ) ); - } else if ( it.data()->inherits( "QComboBox" ) ) { - QComboBox *wdg = static_cast<QComboBox*>( it.data() ); + wdg->setDate( TQDate::fromString( value, Qt::ISODate ) ); + } else if ( it.data()->inherits( "TQComboBox" ) ) { + TQComboBox *wdg = static_cast<TQComboBox*>( it.data() ); wdg->setCurrentText( value ); - } else if ( it.data()->inherits( "QTextEdit" ) ) { - QTextEdit *wdg = static_cast<QTextEdit*>( it.data() ); + } else if ( it.data()->inherits( "TQTextEdit" ) ) { + TQTextEdit *wdg = static_cast<TQTextEdit*>( it.data() ); wdg->setText( value ); } } @@ -207,17 +207,17 @@ void DesignerFields::load( DesignerFields::Storage *storage ) void DesignerFields::save( DesignerFields::Storage *storage ) { - QMap<QString, QWidget*>::Iterator it; + TQMap<TQString, TQWidget*>::Iterator it; for ( it = mWidgets.begin(); it != mWidgets.end(); ++it ) { - QString value; - if ( it.data()->inherits( "QLineEdit" ) ) { - QLineEdit *wdg = static_cast<QLineEdit*>( it.data() ); + TQString value; + if ( it.data()->inherits( "TQLineEdit" ) ) { + TQLineEdit *wdg = static_cast<TQLineEdit*>( it.data() ); value = wdg->text(); - } else if ( it.data()->inherits( "QSpinBox" ) ) { - QSpinBox *wdg = static_cast<QSpinBox*>( it.data() ); - value = QString::number( wdg->value() ); - } else if ( it.data()->inherits( "QCheckBox" ) ) { - QCheckBox *wdg = static_cast<QCheckBox*>( it.data() ); + } else if ( it.data()->inherits( "TQSpinBox" ) ) { + TQSpinBox *wdg = static_cast<TQSpinBox*>( it.data() ); + value = TQString::number( wdg->value() ); + } else if ( it.data()->inherits( "TQCheckBox" ) ) { + TQCheckBox *wdg = static_cast<TQCheckBox*>( it.data() ); value = ( wdg->isChecked() ? "true" : "false" ); } else if ( it.data()->inherits( "QDateTimeEdit" ) ) { QDateTimeEdit *wdg = static_cast<QDateTimeEdit*>( it.data() ); @@ -228,11 +228,11 @@ void DesignerFields::save( DesignerFields::Storage *storage ) } else if ( it.data()->inherits( "KDatePicker" ) ) { KDatePicker *wdg = static_cast<KDatePicker*>( it.data() ); value = wdg->date().toString( Qt::ISODate ); - } else if ( it.data()->inherits( "QComboBox" ) ) { - QComboBox *wdg = static_cast<QComboBox*>( it.data() ); + } else if ( it.data()->inherits( "TQComboBox" ) ) { + TQComboBox *wdg = static_cast<TQComboBox*>( it.data() ); value = wdg->currentText(); - } else if ( it.data()->inherits( "QTextEdit" ) ) { - QTextEdit *wdg = static_cast<QTextEdit*>( it.data() ); + } else if ( it.data()->inherits( "TQTextEdit" ) ) { + TQTextEdit *wdg = static_cast<TQTextEdit*>( it.data() ); value = wdg->text(); } @@ -242,7 +242,7 @@ void DesignerFields::save( DesignerFields::Storage *storage ) void DesignerFields::setReadOnly( bool readOnly ) { - QMap<QString, QWidget*>::Iterator it; + TQMap<TQString, TQWidget*>::Iterator it; for ( it = mWidgets.begin(); it != mWidgets.end(); ++it ) if ( mDisabledWidgets.find( it.data() ) == mDisabledWidgets.end() ) it.data()->setEnabled( !readOnly ); |