summaryrefslogtreecommitdiffstats
path: root/src/fieldlineedit.cpp
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2013-06-29 12:56:53 +0200
committerSlávek Banko <[email protected]>2013-07-04 03:11:35 +0200
commit5f5e7c5455d52826b0bd50f64fcffb7695ce970d (patch)
treec8ee8792d3fb139365abbf70c2255f1e69d2aa34 /src/fieldlineedit.cpp
parent251c9a439759c830d34c70683d0fc9454d703010 (diff)
downloadkbibtex-5f5e7c5455d52826b0bd50f64fcffb7695ce970d.tar.gz
kbibtex-5f5e7c5455d52826b0bd50f64fcffb7695ce970d.zip
Initial TQt conversion
Diffstat (limited to 'src/fieldlineedit.cpp')
-rw-r--r--src/fieldlineedit.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/src/fieldlineedit.cpp b/src/fieldlineedit.cpp
index ba36fe7..03296ca 100644
--- a/src/fieldlineedit.cpp
+++ b/src/fieldlineedit.cpp
@@ -17,11 +17,11 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#include <qpushbutton.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
-#include <qtextedit.h>
+#include <ntqpushbutton.h>
+#include <ntqlayout.h>
+#include <ntqtooltip.h>
+#include <ntqwhatsthis.h>
+#include <ntqtextedit.h>
#include <kdialog.h>
#include <klocale.h>
@@ -37,8 +37,8 @@
namespace KBibTeX
{
- FieldLineEdit::FieldLineEdit( const QString& caption, InputType inputType, bool isReadOnly, QWidget *parent, const char *name )
- : QWidget( parent, name ), m_value( new BibTeX::Value() ), m_caption( caption ), m_lineEdit( NULL ), m_textEdit( NULL ), m_isReadOnly( isReadOnly ), m_enabled( TRUE ), m_inputType( inputType ), m_isModified( FALSE ), m_fieldType( BibTeX::EntryField::ftUnknown ), m_completion( NULL )
+ FieldLineEdit::FieldLineEdit( const TQString& caption, InputType inputType, bool isReadOnly, TQWidget *parent, const char *name )
+ : TQWidget( parent, name ), m_value( new BibTeX::Value() ), m_caption( caption ), m_lineEdit( NULL ), m_textEdit( NULL ), m_isReadOnly( isReadOnly ), m_enabled( TRUE ), m_inputType( inputType ), m_isModified( FALSE ), m_fieldType( BibTeX::EntryField::ftUnknown ), m_completion( NULL )
{
setupGUI( name );
}
@@ -88,18 +88,18 @@ namespace KBibTeX
m_lineEdit->setCompletionObject( m_completion );
else
m_lineEdit->setCompletionObject( settings->completionMacro );
- QToolTip::add( m_lineEdit, QString( i18n( "BibTeX field '%1'" ) ).arg( BibTeX::EntryField::fieldTypeToString( fieldType ) ) );
- QWhatsThis::add( m_lineEdit, QString( i18n( "BibTeX field '%1'" ) ).arg( BibTeX::EntryField::fieldTypeToString( fieldType ) ) );
+ TQToolTip::add( m_lineEdit, TQString( i18n( "BibTeX field '%1'" ) ).arg( BibTeX::EntryField::fieldTypeToString( fieldType ) ) );
+ TQWhatsThis::add( m_lineEdit, TQString( i18n( "BibTeX field '%1'" ) ).arg( BibTeX::EntryField::fieldTypeToString( fieldType ) ) );
}
else if ( m_textEdit != NULL )
{
- QToolTip::add( m_textEdit, QString( i18n( "BibTeX field '%1'" ) ).arg( BibTeX::EntryField::fieldTypeToString( fieldType ) ) );
- QWhatsThis::add( m_textEdit, QString( i18n( "BibTeX field '%1'" ) ).arg( BibTeX::EntryField::fieldTypeToString( fieldType ) ) );
+ TQToolTip::add( m_textEdit, TQString( i18n( "BibTeX field '%1'" ) ).arg( BibTeX::EntryField::fieldTypeToString( fieldType ) ) );
+ TQWhatsThis::add( m_textEdit, TQString( i18n( "BibTeX field '%1'" ) ).arg( BibTeX::EntryField::fieldTypeToString( fieldType ) ) );
}
}
- QString FieldLineEdit::caption()
+ TQString FieldLineEdit::caption()
{
return m_caption;
}
@@ -117,7 +117,7 @@ namespace KBibTeX
FieldLineEdit::ErrorType FieldLineEdit::error()
{
ErrorType result = etNoError;
- for ( QValueList<BibTeX::ValueItem*>::ConstIterator it = m_value->items.begin(); result == etNoError && it != m_value->items.end(); ++it )
+ for ( TQValueList<BibTeX::ValueItem*>::ConstIterator it = m_value->items.begin(); result == etNoError && it != m_value->items.end(); ++it )
{
BibTeX::MacroKey *macroKey = dynamic_cast<BibTeX::MacroKey*>( *it );
result = ( macroKey != NULL && !macroKey->isValid() ) ? etInvalidStringKey : etNoError;
@@ -128,7 +128,7 @@ namespace KBibTeX
void FieldLineEdit::slotTextChanged( )
{
- QString text;
+ TQString text;
switch ( m_inputType )
{
case itSingleLine:
@@ -161,7 +161,7 @@ namespace KBibTeX
{
if ( m_value->items.count() == 1 )
{
- QString text = m_value->items.first()->text();
+ TQString text = m_value->items.first()->text();
if ( m_pushButtonString->isOn() )
{
BibTeX::PlainText *plainText = dynamic_cast<BibTeX::PlainText*>( m_value->items.first() );
@@ -200,7 +200,7 @@ namespace KBibTeX
void FieldLineEdit::slotComplexClicked()
{
- if ( ValueWidget::execute( m_caption, m_fieldType, m_value, m_isReadOnly, this ) == QDialog::Accepted )
+ if ( ValueWidget::execute( m_caption, m_fieldType, m_value, m_isReadOnly, this ) == TQDialog::Accepted )
{
updateGUI();
emit textChanged();
@@ -221,11 +221,11 @@ namespace KBibTeX
strcpy( subname, name );
strcat( subname, "_pbstring" );
}
- m_pushButtonString = new QPushButton( this, subname );
- m_pushButtonString->setIconSet( QIconSet( SmallIcon( "flag" ) ) );
- m_pushButtonString->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
+ m_pushButtonString = new TQPushButton( this, subname );
+ m_pushButtonString->setIconSet( TQIconSet( SmallIcon( "flag" ) ) );
+ m_pushButtonString->setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum );
m_pushButtonString->setToggleButton( TRUE );
- QToolTip::add( m_pushButtonString, QString( i18n( "Set '%1' to be a string key" ) ).arg( m_caption ) );
+ TQToolTip::add( m_pushButtonString, TQString( i18n( "Set '%1' to be a string key" ) ).arg( m_caption ) );
m_pushButtonString->setEnabled( !m_isReadOnly );
connect( m_pushButtonString, SIGNAL( clicked() ), this, SLOT( slotStringToggled() ) );
@@ -234,18 +234,18 @@ namespace KBibTeX
strcpy( subname, name );
strcat( subname, "_pbcomplex" );
}
- m_pushButtonComplex = new QPushButton( this, subname );
- m_pushButtonComplex->setIconSet( QIconSet( SmallIcon( "leftjust" ) ) );
- m_pushButtonComplex->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
- QToolTip::add( m_pushButtonComplex, QString( i18n( "Edit '%1' as a concatenated value" ) ).arg( m_caption ) );
+ m_pushButtonComplex = new TQPushButton( this, subname );
+ m_pushButtonComplex->setIconSet( TQIconSet( SmallIcon( "leftjust" ) ) );
+ m_pushButtonComplex->setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum );
+ TQToolTip::add( m_pushButtonComplex, TQString( i18n( "Edit '%1' as a concatenated value" ) ).arg( m_caption ) );
connect( m_pushButtonComplex, SIGNAL( clicked() ), this, SLOT( slotComplexClicked() ) );
- QGridLayout * layout = NULL;
+ TQGridLayout * layout = NULL;
switch ( m_inputType )
{
case itSingleLine:
{
- layout = new QGridLayout( this, 2, 3, 0, KDialog::spacingHint() );
+ layout = new TQGridLayout( this, 2, 3, 0, KDialog::spacingHint() );
if ( subname != NULL )
{
strcpy( subname, name );
@@ -259,19 +259,19 @@ namespace KBibTeX
setFocusProxy( m_lineEdit );
layout->addWidget( m_pushButtonString, 0, 1 );
layout->addWidget( m_pushButtonComplex, 0, 2 );
- QWidget::setTabOrder( m_lineEdit, m_pushButtonString );
+ TQWidget::setTabOrder( m_lineEdit, m_pushButtonString );
}
break;
case itMultiLine:
{
- layout = new QGridLayout( this, 3, 2, 0, KDialog::spacingHint() );
+ layout = new TQGridLayout( this, 3, 2, 0, KDialog::spacingHint() );
layout->setRowStretch( 2, 1 );
if ( subname != NULL )
{
strcpy( subname, name );
strcat( subname, "_textedit" );
}
- m_textEdit = new QTextEdit( this, subname );
+ m_textEdit = new TQTextEdit( this, subname );
m_textEdit->setReadOnly( m_isReadOnly );
if ( settings->editing_UseSpecialFont )
m_textEdit->setFont( settings->editing_SpecialFont );
@@ -279,12 +279,12 @@ namespace KBibTeX
setFocusProxy( m_textEdit );
layout->addWidget( m_pushButtonString, 0, 1 );
layout->addWidget( m_pushButtonComplex, 1, 1 );
- QWidget::setTabOrder( m_textEdit, m_pushButtonString );
+ TQWidget::setTabOrder( m_textEdit, m_pushButtonString );
}
break;
}
- QWidget::setTabOrder( m_pushButtonString, m_pushButtonComplex );
+ TQWidget::setTabOrder( m_pushButtonString, m_pushButtonComplex );
layout->setRowStretch( layout->numRows() - 1, 1 );
if ( subname != NULL )
@@ -308,11 +308,11 @@ namespace KBibTeX
switch ( m_inputType )
{
case itSingleLine:
- if ( QString::compare( m_lineEdit->text(), item->text() ) != 0 )
+ if ( TQString::compare( m_lineEdit->text(), item->text() ) != 0 )
m_lineEdit->setText( item->text() );
break;
case itMultiLine:
- if ( QString::compare( m_textEdit->text(), item->text() ) != 0 )
+ if ( TQString::compare( m_textEdit->text(), item->text() ) != 0 )
m_textEdit->setText( item->text() );
break;
}
@@ -353,9 +353,9 @@ namespace KBibTeX
{
case itSingleLine:
if ( enabled )
- connect( m_lineEdit, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotTextChanged( ) ) );
+ connect( m_lineEdit, SIGNAL( textChanged( const TQString& ) ), this, SLOT( slotTextChanged( ) ) );
else
- disconnect( m_lineEdit, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotTextChanged( ) ) );
+ disconnect( m_lineEdit, SIGNAL( textChanged( const TQString& ) ), this, SLOT( slotTextChanged( ) ) );
break;
case itMultiLine:
if ( enabled )