summaryrefslogtreecommitdiffstats
path: root/kaddressbook/customfieldswidget.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
commit67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch)
tree5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /kaddressbook/customfieldswidget.cpp
parent2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff)
downloadtdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.tar.gz
tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.zip
Initial conversion of kdepim to TQt
This will probably require some tweaking before it will build under Qt4, however Qt3 builds are OK. Any alterations this commit makes to kdepim behaviour under Qt3 are unintentional and should be fixed. git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kaddressbook/customfieldswidget.cpp')
-rw-r--r--kaddressbook/customfieldswidget.cpp94
1 files changed, 47 insertions, 47 deletions
diff --git a/kaddressbook/customfieldswidget.cpp b/kaddressbook/customfieldswidget.cpp
index 44b0294ac..5ceac5dbe 100644
--- a/kaddressbook/customfieldswidget.cpp
+++ b/kaddressbook/customfieldswidget.cpp
@@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, permission is given to link this program
- with any edition of Qt, and distribute the resulting executable,
- without including the source code for Qt in the source distribution.
+ with any edition of TQt, and distribute the resulting executable,
+ without including the source code for TQt in the source distribution.
*/
#include <tqcheckbox.h>
@@ -42,9 +42,9 @@
#include "customfieldswidget.h"
-AddFieldDialog::AddFieldDialog( TQWidget *parent, const char *name )
+AddFieldDialog::AddFieldDialog( TQWidget *tqparent, const char *name )
: KDialogBase( Plain, i18n( "Add Field" ), Ok | Cancel,
- Ok, parent, name, true, true )
+ Ok, tqparent, name, true, true )
{
TQWidget *page = plainPage();
@@ -121,14 +121,14 @@ void AddFieldDialog::nameChanged( const TQString &name )
enableButton( Ok, !name.isEmpty() );
}
-FieldWidget::FieldWidget( TQWidget *parent, const char *name )
- : TQWidget( parent, name )
+FieldWidget::FieldWidget( TQWidget *tqparent, const char *name )
+ : TQWidget( tqparent, name )
{
TQVBoxLayout *tqlayout = new TQVBoxLayout( this, KDialog::marginHint(),
KDialog::spacingHint() );
mGlobalLayout = new TQVBoxLayout( tqlayout, KDialog::spacingHint() );
- mGlobalLayout->tqsetAlignment( Qt::AlignTop );
+ mGlobalLayout->tqsetAlignment( TQt::AlignTop );
mSeparator = new TQFrame( this );
mSeparator->setFrameStyle( TQFrame::HLine | TQFrame::Sunken );
@@ -136,7 +136,7 @@ FieldWidget::FieldWidget( TQWidget *parent, const char *name )
tqlayout->addWidget( mSeparator );
mLocalLayout = new TQVBoxLayout( tqlayout, KDialog::spacingHint() );
- mLocalLayout->tqsetAlignment( Qt::AlignTop );
+ mLocalLayout->tqsetAlignment( TQt::AlignTop );
}
void FieldWidget::addField( const TQString &identifier, const TQString &title,
@@ -159,17 +159,17 @@ void FieldWidget::addField( const TQString &identifier, const TQString &title,
connect( wdg, TQT_SIGNAL( toggled( bool ) ),
this, TQT_SIGNAL( changed() ) );
} else if ( type == "date" ) {
- QDateEdit *wdg = new QDateEdit( this );
+ TQDateEdit *wdg = new TQDateEdit( this );
record.mWidget = wdg;
connect( wdg, TQT_SIGNAL( valueChanged( const TQDate& ) ),
this, TQT_SIGNAL( changed() ) );
} else if ( type == "time" ) {
- QTimeEdit *wdg = new QTimeEdit( this );
+ TQTimeEdit *wdg = new TQTimeEdit( this );
record.mWidget = wdg;
connect( wdg, TQT_SIGNAL( valueChanged( const TQTime& ) ),
this, TQT_SIGNAL( changed() ) );
} else if ( type == "datetime" ) {
- QDateTimeEdit *wdg = new QDateTimeEdit( this );
+ TQDateTimeEdit *wdg = new TQDateTimeEdit( this );
record.mWidget = wdg;
connect( wdg, TQT_SIGNAL( valueChanged( const TQDateTime& ) ),
this, TQT_SIGNAL( changed() ) );
@@ -186,11 +186,11 @@ void FieldWidget::addField( const TQString &identifier, const TQString &title,
if ( isGlobal ) {
record.mLayout = new TQHBoxLayout( mGlobalLayout );
record.mLayout->addWidget( record.mLabel );
- record.mLayout->addWidget( record.mWidget, Qt::AlignLeft );
+ record.mLayout->addWidget( record.mWidget, TQt::AlignLeft );
} else {
record.mLayout = new TQHBoxLayout( mLocalLayout );
record.mLayout->addWidget( record.mLabel );
- record.mLayout->addWidget( record.mWidget, Qt::AlignLeft );
+ record.mLayout->addWidget( record.mWidget, TQt::AlignLeft );
mSeparator->show();
}
@@ -236,14 +236,14 @@ void FieldWidget::clearFields()
} else if ( (*fieldIt).mWidget->isA( TQCHECKBOX_OBJECT_NAME_STRING ) ) {
TQCheckBox *wdg = static_cast<TQCheckBox*>( (*fieldIt).mWidget );
wdg->setChecked( true );
- } else if ( (*fieldIt).mWidget->isA( "QDateEdit" ) ) {
- QDateEdit *wdg = static_cast<QDateEdit*>( (*fieldIt).mWidget );
+ } else if ( (*fieldIt).mWidget->isA( TQDATEEDIT_OBJECT_NAME_STRING ) ) {
+ TQDateEdit *wdg = static_cast<TQDateEdit*>( (*fieldIt).mWidget );
wdg->setDate( TQDate::tqcurrentDate() );
- } else if ( (*fieldIt).mWidget->isA( "QTimeEdit" ) ) {
- QTimeEdit *wdg = static_cast<QTimeEdit*>( (*fieldIt).mWidget );
+ } else if ( (*fieldIt).mWidget->isA( TQTIMEEDIT_OBJECT_NAME_STRING ) ) {
+ TQTimeEdit *wdg = static_cast<TQTimeEdit*>( (*fieldIt).mWidget );
wdg->setTime( TQTime::currentTime() );
- } else if ( (*fieldIt).mWidget->isA( "QDateTimeEdit" ) ) {
- QDateTimeEdit *wdg = static_cast<QDateTimeEdit*>( (*fieldIt).mWidget );
+ } else if ( (*fieldIt).mWidget->isA( TQDATETIMEEDIT_OBJECT_NAME_STRING ) ) {
+ TQDateTimeEdit *wdg = static_cast<TQDateTimeEdit*>( (*fieldIt).mWidget );
wdg->setDateTime( TQDateTime::tqcurrentDateTime() );
}
}
@@ -274,15 +274,15 @@ void FieldWidget::loadContact( KABC::Addressee *addr )
} else if ( (*fieldIt).mWidget->isA( TQCHECKBOX_OBJECT_NAME_STRING ) ) {
TQCheckBox *wdg = static_cast<TQCheckBox*>( (*fieldIt).mWidget );
wdg->setChecked( value == "true" || value == "1" );
- } else if ( (*fieldIt).mWidget->isA( "QDateEdit" ) ) {
- QDateEdit *wdg = static_cast<QDateEdit*>( (*fieldIt).mWidget );
- wdg->setDate( TQDate::fromString( value, Qt::ISODate ) );
- } else if ( (*fieldIt).mWidget->isA( "QTimeEdit" ) ) {
- QTimeEdit *wdg = static_cast<QTimeEdit*>( (*fieldIt).mWidget );
- wdg->setTime( TQTime::fromString( value, Qt::ISODate ) );
- } else if ( (*fieldIt).mWidget->isA( "QDateTimeEdit" ) ) {
- QDateTimeEdit *wdg = static_cast<QDateTimeEdit*>( (*fieldIt).mWidget );
- wdg->setDateTime( TQDateTime::fromString( value, Qt::ISODate ) );
+ } else if ( (*fieldIt).mWidget->isA( TQDATEEDIT_OBJECT_NAME_STRING ) ) {
+ TQDateEdit *wdg = static_cast<TQDateEdit*>( (*fieldIt).mWidget );
+ wdg->setDate( TQDate::fromString( value, TQt::ISODate ) );
+ } else if ( (*fieldIt).mWidget->isA( TQTIMEEDIT_OBJECT_NAME_STRING ) ) {
+ TQTimeEdit *wdg = static_cast<TQTimeEdit*>( (*fieldIt).mWidget );
+ wdg->setTime( TQTime::fromString( value, TQt::ISODate ) );
+ } else if ( (*fieldIt).mWidget->isA( TQDATETIMEEDIT_OBJECT_NAME_STRING ) ) {
+ TQDateTimeEdit *wdg = static_cast<TQDateTimeEdit*>( (*fieldIt).mWidget );
+ wdg->setDateTime( TQDateTime::fromString( value, TQt::ISODate ) );
}
}
}
@@ -330,15 +330,15 @@ void FieldWidget::storeContact( KABC::Addressee *addr )
} else if ( (*it).mWidget->isA( TQCHECKBOX_OBJECT_NAME_STRING ) ) {
TQCheckBox *wdg = static_cast<TQCheckBox*>( (*it).mWidget );
value = ( wdg->isChecked() ? "true" : "false" );
- } else if ( (*it).mWidget->isA( "QDateEdit" ) ) {
- QDateEdit *wdg = static_cast<QDateEdit*>( (*it).mWidget );
- value = wdg->date().toString( Qt::ISODate );
- } else if ( (*it).mWidget->isA( "QTimeEdit" ) ) {
- QTimeEdit *wdg = static_cast<QTimeEdit*>( (*it).mWidget );
- value = wdg->time().toString( Qt::ISODate );
- } else if ( (*it).mWidget->isA( "QDateTimeEdit" ) ) {
- QDateTimeEdit *wdg = static_cast<QDateTimeEdit*>( (*it).mWidget );
- value = wdg->dateTime().toString( Qt::ISODate );
+ } else if ( (*it).mWidget->isA( TQDATEEDIT_OBJECT_NAME_STRING ) ) {
+ TQDateEdit *wdg = static_cast<TQDateEdit*>( (*it).mWidget );
+ value = wdg->date().toString( TQt::ISODate );
+ } else if ( (*it).mWidget->isA( TQTIMEEDIT_OBJECT_NAME_STRING ) ) {
+ TQTimeEdit *wdg = static_cast<TQTimeEdit*>( (*it).mWidget );
+ value = wdg->time().toString( TQt::ISODate );
+ } else if ( (*it).mWidget->isA( TQDATETIMEEDIT_OBJECT_NAME_STRING ) ) {
+ TQDateTimeEdit *wdg = static_cast<TQDateTimeEdit*>( (*it).mWidget );
+ value = wdg->dateTime().toString( TQt::ISODate );
}
if ( value.isEmpty() )
@@ -370,15 +370,15 @@ void FieldWidget::recalculateLayout()
FieldRecordList::ConstIterator it;
for ( it = mFieldList.begin(); it != mFieldList.end(); ++it )
- maxWidth = QMAX( maxWidth, (*it).mLabel->tqminimumSizeHint().width() );
+ maxWidth = TQMAX( maxWidth, (*it).mLabel->tqminimumSizeHint().width() );
for ( it = mFieldList.begin(); it != mFieldList.end(); ++it )
(*it).mLabel->setMinimumWidth( maxWidth );
}
CustomFieldsWidget::CustomFieldsWidget( KABC::AddressBook *ab,
- TQWidget *parent, const char *name )
- : KAB::ContactEditorWidget( ab, parent, name )
+ TQWidget *tqparent, const char *name )
+ : KAB::ContactEditorWidget( ab, tqparent, name )
{
initGUI();
@@ -492,11 +492,11 @@ void CustomFieldsWidget::initGUI()
tqlayout->addMultiCellWidget( mFieldWidget, 0, 0, 0, 2 );
mAddButton = new TQPushButton( i18n( "Add Field..." ), this );
- tqlayout->addWidget( mAddButton, 1, 1, Qt::AlignRight );
+ tqlayout->addWidget( mAddButton, 1, 1, TQt::AlignRight );
mRemoveButton = new TQPushButton( i18n( "Remove Field..." ), this );
mRemoveButton->setEnabled( false );
- tqlayout->addWidget( mRemoveButton, 1, 2, Qt::AlignRight );
+ tqlayout->addWidget( mRemoveButton, 1, 2, TQt::AlignRight );
// load global fields
TQStringList globalFields = KABPrefs::instance()->globalCustomFields();
@@ -527,11 +527,11 @@ TQStringList CustomFieldsWidget::marshallFields( bool global ) const
type = "integer";
} else if ( (*it).mWidget->isA( TQCHECKBOX_OBJECT_NAME_STRING ) ) {
type = "boolean";
- } else if ( (*it).mWidget->isA( "QDateEdit" ) ) {
+ } else if ( (*it).mWidget->isA( TQDATEEDIT_OBJECT_NAME_STRING ) ) {
type = "date";
- } else if ( (*it).mWidget->isA( "QTimeEdit" ) ) {
+ } else if ( (*it).mWidget->isA( TQTIMEEDIT_OBJECT_NAME_STRING ) ) {
type = "time";
- } else if ( (*it).mWidget->isA( "QDateTimeEdit" ) ) {
+ } else if ( (*it).mWidget->isA( TQDATETIMEEDIT_OBJECT_NAME_STRING ) ) {
type = "datetime";
} else if ( (*it).mWidget->isA( TQLINEEDIT_OBJECT_NAME_STRING ) ) {
type = "text";
@@ -547,12 +547,12 @@ TQStringList CustomFieldsWidget::marshallFields( bool global ) const
void splitField( const TQString &str, TQString &app, TQString &name, TQString &value )
{
- int colon = str.find( ':' );
+ int colon = str.tqfind( ':' );
if ( colon != -1 ) {
TQString tmp = str.left( colon );
value = str.mid( colon + 1 );
- int dash = tmp.find( '-' );
+ int dash = tmp.tqfind( '-' );
if ( dash != -1 ) {
app = tmp.left( dash );
name = tmp.mid( dash + 1 );