diff options
Diffstat (limited to 'lib/kotext/KoCustomVariablesDia.cpp')
-rw-r--r-- | lib/kotext/KoCustomVariablesDia.cpp | 158 |
1 files changed, 79 insertions, 79 deletions
diff --git a/lib/kotext/KoCustomVariablesDia.cpp b/lib/kotext/KoCustomVariablesDia.cpp index 32a99743..af709678 100644 --- a/lib/kotext/KoCustomVariablesDia.cpp +++ b/lib/kotext/KoCustomVariablesDia.cpp @@ -23,11 +23,11 @@ #include <klocale.h> #include <kbuttonbox.h> -#include <qcombobox.h> -#include <qvbox.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qheader.h> +#include <tqcombobox.h> +#include <tqvbox.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqheader.h> #include <klineedit.h> #include <kdebug.h> @@ -37,20 +37,20 @@ * ******************************************************************/ -KoVariableNameDia::KoVariableNameDia( QWidget *parent ) - : KDialogBase( parent, "", TRUE,i18n( "Entry Name" ),Ok|Cancel ) +KoVariableNameDia::KoVariableNameDia( TQWidget *tqparent ) + : KDialogBase( tqparent, "", TRUE,i18n( "Entry Name" ),Ok|Cancel ) { init(); } -KoVariableNameDia::KoVariableNameDia( QWidget *parent, const QPtrList<KoVariable>& vars ) - : KDialogBase( parent, "", TRUE, i18n( "Variable Name" ), Ok|Cancel ) +KoVariableNameDia::KoVariableNameDia( TQWidget *tqparent, const TQPtrList<KoVariable>& vars ) + : KDialogBase( tqparent, "", TRUE, i18n( "Variable Name" ), Ok|Cancel ) { init(); enableButtonOK(false); - QPtrListIterator<KoVariable> it( vars ); + TQPtrListIterator<KoVariable> it( vars ); for ( ; it.current() ; ++it ) { KoVariable *var = it.current(); if ( var->type() == VT_CUSTOM ) @@ -63,30 +63,30 @@ void KoVariableNameDia::init() { back = makeVBoxMainWidget(); - QHBox *row1 = new QHBox( back ); + TQHBox *row1 = new TQHBox( back ); row1->setSpacing( KDialog::spacingHint() ); - QLabel *l = new QLabel( i18n( "Name:" ), row1 ); - l->setFixedSize( l->sizeHint() ); - names = new QComboBox( TRUE, row1 ); + TQLabel *l = new TQLabel( i18n( "Name:" ), row1 ); + l->setFixedSize( l->tqsizeHint() ); + names = new TQComboBox( TRUE, row1 ); names->setFocus(); - connect( names, SIGNAL( textChanged ( const QString & )), - this, SLOT( textChanged ( const QString & ))); - connect( this, SIGNAL( okClicked() ), - this, SLOT( accept() ) ); - connect( this, SIGNAL( cancelClicked() ), - this, SLOT( reject() ) ); + connect( names, TQT_SIGNAL( textChanged ( const TQString & )), + this, TQT_SLOT( textChanged ( const TQString & ))); + connect( this, TQT_SIGNAL( okClicked() ), + this, TQT_SLOT( accept() ) ); + connect( this, TQT_SIGNAL( cancelClicked() ), + this, TQT_SLOT( reject() ) ); enableButtonOK( !names->currentText().isEmpty() ); resize( 350, 100 ); } -QString KoVariableNameDia::getName() const +TQString KoVariableNameDia::getName() const { return names->currentText(); } -void KoVariableNameDia::textChanged ( const QString &_text ) +void KoVariableNameDia::textChanged ( const TQString &_text ) { enableButtonOK(!_text.isEmpty()); } @@ -97,8 +97,8 @@ void KoVariableNameDia::textChanged ( const QString &_text ) * ******************************************************************/ -KoCustomVariablesListItem::KoCustomVariablesListItem( QListView *parent ) - : QListViewItem( parent ) +KoCustomVariablesListItem::KoCustomVariablesListItem( TQListView *tqparent ) + : TQListViewItem( tqparent ) { editWidget = new KLineEdit( listView()->viewport() ); listView()->addChild( editWidget ); @@ -106,11 +106,11 @@ KoCustomVariablesListItem::KoCustomVariablesListItem( QListView *parent ) void KoCustomVariablesListItem::setup() { - QListViewItem::setup(); - setHeight( QMAX( listView()->fontMetrics().height(), - editWidget->sizeHint().height() ) ); - //if ( listView()->columnWidth( 1 ) < editWidget->sizeHint().width() ) - // listView()->setColumnWidth( 1, editWidget->sizeHint().width() ); + TQListViewItem::setup(); + setHeight( TQMAX( listView()->fontMetrics().height(), + editWidget->tqsizeHint().height() ) ); + //if ( listView()->columnWidth( 1 ) < editWidget->tqsizeHint().width() ) + // listView()->setColumnWidth( 1, editWidget->tqsizeHint().width() ); } void KoCustomVariablesListItem::update() @@ -135,21 +135,21 @@ KoCustomVariable *KoCustomVariablesListItem::getVariable() const void KoCustomVariablesListItem::applyValue() { - QString newVal=editWidget->text(); + TQString newVal=editWidget->text(); if(var->value()!=newVal) var->setValue( newVal ); } -int KoCustomVariablesListItem::width( const QFontMetrics & fm, const QListView *lv, int c ) const +int KoCustomVariablesListItem::width( const TQFontMetrics & fm, const TQListView *lv, int c ) const { - // The text of the 2nd column isn't known to QListViewItem, only we know it + // The text of the 2nd column isn't known to TQListViewItem, only we know it // (it's in our lineedit) if ( c == 1 ) { - QString val = editWidget->text(); + TQString val = editWidget->text(); int w = fm.width( val ); return w; } else - return QListViewItem::width( fm, lv, c ); + return TQListViewItem::width( fm, lv, c ); } /****************************************************************** @@ -158,24 +158,24 @@ int KoCustomVariablesListItem::width( const QFontMetrics & fm, const QListView * * ******************************************************************/ -KoCustomVariablesList::KoCustomVariablesList( QWidget *parent ) - : KListView( parent ) +KoCustomVariablesList::KoCustomVariablesList( TQWidget *tqparent ) + : KListView( tqparent ) { header()->setMovingEnabled( FALSE ); addColumn( i18n( "Variable" ) ); addColumn( i18n( "Value" ) ); - connect( header(), SIGNAL( sizeChange( int, int, int ) ), - this, SLOT( columnSizeChange( int, int, int ) ) ); - connect( header(), SIGNAL( sectionClicked( int ) ), - this, SLOT( sectionClicked( int ) ) ); + connect( header(), TQT_SIGNAL( sizeChange( int, int, int ) ), + this, TQT_SLOT( columnSizeChange( int, int, int ) ) ); + connect( header(), TQT_SIGNAL( sectionClicked( int ) ), + this, TQT_SLOT( sectionClicked( int ) ) ); - setResizeMode(QListView::LastColumn); + setResizeMode(TQListView::LastColumn); setSorting( -1 ); } void KoCustomVariablesList::setValues() { - QListViewItemIterator it( this ); + TQListViewItemIterator it( this ); for ( ; it.current(); ++it ) ( (KoCustomVariablesListItem *)it.current() )->applyValue(); } @@ -193,7 +193,7 @@ void KoCustomVariablesList::sectionClicked( int ) void KoCustomVariablesList::updateItems() { - QListViewItemIterator it( this ); + TQListViewItemIterator it( this ); for ( ; it.current(); ++it ) ( (KoCustomVariablesListItem*)it.current() )->update(); } @@ -204,21 +204,21 @@ void KoCustomVariablesList::updateItems() * ******************************************************************/ -KoCustomVariablesDia::KoCustomVariablesDia( QWidget *parent, const QPtrList<KoVariable> &variables ) - : KDialogBase( parent, "", TRUE,i18n( "Variable Value Editor" ), Ok|Cancel ) +KoCustomVariablesDia::KoCustomVariablesDia( TQWidget *tqparent, const TQPtrList<KoVariable> &variables ) + : KDialogBase( tqparent, "", TRUE,i18n( "Variable Value Editor" ), Ok|Cancel ) { back = makeVBoxMainWidget(); list = new KoCustomVariablesList( back ); - QStringList lst; - QPtrListIterator<KoVariable> it( variables ); + TQStringList lst; + TQPtrListIterator<KoVariable> it( variables ); for ( ; it.current() ; ++it ) { KoVariable *var = it.current(); if ( var->type() == VT_CUSTOM ) { KoCustomVariable *v = (KoCustomVariable*)var; - if ( !lst.contains( v->name() ) ) { + if ( !lst.tqcontains( v->name() ) ) { lst.append( v->name() ); KoCustomVariablesListItem *item = new KoCustomVariablesListItem( list ); item->setVariable( v ); @@ -227,10 +227,10 @@ KoCustomVariablesDia::KoCustomVariablesDia( QWidget *parent, const QPtrList<KoVa } - connect( this, SIGNAL( okClicked() ), - this, SLOT( slotOk() ) ); - connect( this, SIGNAL( cancelClicked() ), - this, SLOT( reject() ) ); + connect( this, TQT_SIGNAL( okClicked() ), + this, TQT_SLOT( slotOk() ) ); + connect( this, TQT_SIGNAL( cancelClicked() ), + this, TQT_SLOT( reject() ) ); showButtonOK(lst.count()>0); resize( 600, 400 ); @@ -248,28 +248,28 @@ void KoCustomVariablesDia::slotOk() * ******************************************************************/ -KoCustomVarDialog::KoCustomVarDialog( QWidget *parent ) - : KDialogBase( parent, "", TRUE,i18n( "Add Variable" ), Ok|Cancel ) +KoCustomVarDialog::KoCustomVarDialog( TQWidget *tqparent ) + : KDialogBase( tqparent, "", TRUE,i18n( "Add Variable" ), Ok|Cancel ) { init(); m_name->setFocus(); - connect( this, SIGNAL( okClicked() ), - this, SLOT( slotAddOk() ) ); - connect( this, SIGNAL( cancelClicked() ), - this, SLOT( reject() ) ); + connect( this, TQT_SIGNAL( okClicked() ), + this, TQT_SLOT( slotAddOk() ) ); + connect( this, TQT_SIGNAL( cancelClicked() ), + this, TQT_SLOT( reject() ) ); - connect( m_name, SIGNAL( textChanged(const QString&) ), - this, SLOT( slotTextChanged(const QString&) ) ); + connect( m_name, TQT_SIGNAL( textChanged(const TQString&) ), + this, TQT_SLOT( slotTextChanged(const TQString&) ) ); enableButtonOK( false ); resize( 350, 100 ); } // edit existing variable -KoCustomVarDialog::KoCustomVarDialog( QWidget *parent, KoCustomVariable *var ) - : KDialogBase( parent, "", TRUE,i18n( "Edit Variable" ), Ok|Cancel ) +KoCustomVarDialog::KoCustomVarDialog( TQWidget *tqparent, KoCustomVariable *var ) + : KDialogBase( tqparent, "", TRUE,i18n( "Edit Variable" ), Ok|Cancel ) { m_var = var; init(); @@ -279,13 +279,13 @@ KoCustomVarDialog::KoCustomVarDialog( QWidget *parent, KoCustomVariable *var ) m_value->setFocus(); - connect( this, SIGNAL( okClicked() ), - this, SLOT( slotEditOk() ) ); - connect( this, SIGNAL( cancelClicked() ), - this, SLOT( reject() ) ); + connect( this, TQT_SIGNAL( okClicked() ), + this, TQT_SLOT( slotEditOk() ) ); + connect( this, TQT_SIGNAL( cancelClicked() ), + this, TQT_SLOT( reject() ) ); - connect( m_value, SIGNAL( textChanged(const QString&) ), - this, SLOT( slotTextChanged(const QString&) ) ); + connect( m_value, TQT_SIGNAL( textChanged(const TQString&) ), + this, TQT_SLOT( slotTextChanged(const TQString&) ) ); enableButtonOK( true ); resize( 350, 100 ); @@ -294,16 +294,16 @@ KoCustomVarDialog::KoCustomVarDialog( QWidget *parent, KoCustomVariable *var ) void KoCustomVarDialog::init() { back = makeVBoxMainWidget(); - QHBox *row1 = new QHBox( back ); + TQHBox *row1 = new TQHBox( back ); row1->setSpacing( KDialog::spacingHint() ); - QLabel *ln = new QLabel( i18n( "Name:" ), row1 ); - ln->setFixedSize( ln->sizeHint() ); + TQLabel *ln = new TQLabel( i18n( "Name:" ), row1 ); + ln->setFixedSize( ln->tqsizeHint() ); m_name = new KLineEdit( row1 ); - QHBox *row2 = new QHBox( back ); + TQHBox *row2 = new TQHBox( back ); row2->setSpacing( KDialog::spacingHint() ); - QLabel *lv = new QLabel( i18n( "Value:" ), row2 ); - lv->setFixedSize( lv->sizeHint() ); + TQLabel *lv = new TQLabel( i18n( "Value:" ), row2 ); + lv->setFixedSize( lv->tqsizeHint() ); m_value = new KLineEdit( row2 ); } @@ -317,20 +317,20 @@ void KoCustomVarDialog::slotEditOk() accept(); } -void KoCustomVarDialog::slotTextChanged(const QString&text) +void KoCustomVarDialog::slotTextChanged(const TQString&text) { enableButtonOK( !text.isEmpty() ); } -QString KoCustomVarDialog::name() +TQString KoCustomVarDialog::name() { if ( m_name->text().isEmpty() ) - return QString( "No name" ); + return TQString( "No name" ); return m_name->text(); } -QString KoCustomVarDialog::value() +TQString KoCustomVarDialog::value() { if ( m_value->text().isEmpty() ) - return QString( "No value" ); + return TQString( "No value" ); return m_value->text(); } |