summaryrefslogtreecommitdiffstats
path: root/kbarcode/previewdialog.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-29 00:55:34 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-29 00:55:34 +0000
commitc4189d200e71c7ef82e9a6e34935ad225154d658 (patch)
treef7f29a1159e0402472ff2ab22617a8113f66263c /kbarcode/previewdialog.cpp
parent2f888b1578e65ec1bc514996eb509fcaf34462d6 (diff)
downloadkbarcode-c4189d200e71c7ef82e9a6e34935ad225154d658.tar.gz
kbarcode-c4189d200e71c7ef82e9a6e34935ad225154d658.zip
TQt4 port kbarcode
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kbarcode@1233956 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbarcode/previewdialog.cpp')
-rw-r--r--kbarcode/previewdialog.cpp82
1 files changed, 41 insertions, 41 deletions
diff --git a/kbarcode/previewdialog.cpp b/kbarcode/previewdialog.cpp
index 2af08f6..1524973 100644
--- a/kbarcode/previewdialog.cpp
+++ b/kbarcode/previewdialog.cpp
@@ -21,13 +21,13 @@
#include "labeleditor.h"
#include "measurements.h"
-// Qt includes
-#include <qiodevice.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpainter.h>
-#include <qscrollview.h>
-#include <qsqlcursor.h>
+// TQt includes
+#include <tqiodevice.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqpainter.h>
+#include <tqscrollview.h>
+#include <tqsqlcursor.h>
// KDE includes
#include <kabc/addresseedialog.h>
@@ -42,22 +42,22 @@
int PreviewDialog::customer_index = 0;
int PreviewDialog::m_index = 1;
-QString PreviewDialog::group = "";
-QString PreviewDialog::article = "";
+TQString PreviewDialog::group = "";
+TQString PreviewDialog::article = "";
-PreviewDialog::PreviewDialog( QIODevice* device, Definition* d, QString filename, QWidget *parent, const char *name )
- : QDialog( parent, name, true, WDestructiveClose )
+PreviewDialog::PreviewDialog( TQIODevice* device, Definition* d, TQString filename, TQWidget *tqparent, const char *name )
+ : TQDialog( tqparent, name, true, WDestructiveClose )
{
file = device;
def = d;
m_filename = filename;
- QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
- QHBoxLayout* Layout = new QHBoxLayout( this, 6, 6 );
- QVBoxLayout* vbox = new QVBoxLayout( 0, 6, 6 );
- QVBoxLayout* buttons = new QVBoxLayout( 0, 6, 6 );
- QGridLayout* grid = new QGridLayout( 0 );
+ TQHBoxLayout* Layout = new TQHBoxLayout( this, 6, 6 );
+ TQVBoxLayout* vbox = new TQVBoxLayout( 0, 6, 6 );
+ TQVBoxLayout* buttons = new TQVBoxLayout( 0, 6, 6 );
+ TQGridLayout* grid = new TQGridLayout( 0 );
customerName = new KComboBox( false, this );
customerId = new KComboBox( false, this );
@@ -66,8 +66,8 @@ PreviewDialog::PreviewDialog( QIODevice* device, Definition* d, QString filename
articleId = new KLineEdit( article, this );
if( SqlTables::isConnected() ) {
KCompletion* comp = articleId->completionObject();
- QSqlQuery query( "select article_no from barcode_basic" );
- QStringList slist;
+ TQSqlQuery query( "select article_no from barcode_basic" );
+ TQStringList slist;
while ( query.next() )
slist.append( query.value(0).toString() );
slist.sort();
@@ -92,29 +92,29 @@ PreviewDialog::PreviewDialog( QIODevice* device, Definition* d, QString filename
buttonClose = new KPushButton( i18n("&Close"), this );
buttonClose->setIconSet( SmallIconSet("fileclose") );
- grid->addWidget( new QLabel( i18n("Customer Name and No.:"), this ), 0, 0 );
+ grid->addWidget( new TQLabel( i18n("Customer Name and No.:"), this ), 0, 0 );
grid->addWidget( customerName, 0, 1 );
grid->addWidget( customerId, 0, 2 );
- grid->addWidget( new QLabel( i18n("Article Number:"), this ), 1, 0 );
+ grid->addWidget( new TQLabel( i18n("Article Number:"), this ), 1, 0 );
grid->addMultiCellWidget( articleId, 1, 1, 1, 2 );
- grid->addWidget( new QLabel( i18n("Group:"), this ), 2, 0 );
+ grid->addWidget( new TQLabel( i18n("Group:"), this ), 2, 0 );
grid->addMultiCellWidget( groupName, 2, 2, 1, 2 );
- grid->addWidget( new QLabel( i18n("Index:"), this ), 3, 0 );
+ grid->addWidget( new TQLabel( i18n("Index:"), this ), 3, 0 );
grid->addMultiCellWidget( spinIndex, 3, 3, 1, 2 );
- grid->addWidget( new QLabel( i18n("Serial start:"), this ), 4, 0 );
+ grid->addWidget( new TQLabel( i18n("Serial start:"), this ), 4, 0 );
grid->addMultiCellWidget( serialStart, 4, 4, 1, 2 );
- grid->addWidget( new QLabel( i18n( "Serial increment:" ), this ), 5, 0 );
+ grid->addWidget( new TQLabel( i18n( "Serial increment:" ), this ), 5, 0 );
grid->addMultiCellWidget( serialInc, 5, 5, 1, 2 );
- grid->addWidget( new QLabel( i18n( "Addressbook entry:" ), this ), 6, 0 );
+ grid->addWidget( new TQLabel( i18n( "Addressbook entry:" ), this ), 6, 0 );
grid->addWidget( lineAddr, 6, 1 );
grid->addWidget( buttonAddr, 6, 2 );
- QScrollView* sv = new QScrollView( this );
+ TQScrollView* sv = new TQScrollView( this );
- preview = new QLabel( sv->viewport() );
+ preview = new TQLabel( sv->viewport() );
sv->addChild( preview );
- QPixmap pix( (int)d->getMeasurements().width( this ), (int)d->getMeasurements().height( this ) );
- pix.fill( Qt::white );
+ TQPixmap pix( (int)d->getMeasurements().width( TQT_TQPAINTDEVICE(this) ), (int)d->getMeasurements().height( TQT_TQPAINTDEVICE(this) ) );
+ pix.fill( TQt::white );
preview->setPixmap( pix );
vbox->addLayout( grid );
@@ -127,17 +127,17 @@ PreviewDialog::PreviewDialog( QIODevice* device, Definition* d, QString filename
Layout->addLayout( vbox );
Layout->addLayout( buttons );
- connect( buttonClose, SIGNAL( clicked() ), this, SLOT( reject() ) );
- connect( buttonAddr, SIGNAL( clicked() ), this, SLOT( selectAddress() ) );
+ connect( buttonClose, TQT_SIGNAL( clicked() ), this, TQT_SLOT( reject() ) );
+ connect( buttonAddr, TQT_SIGNAL( clicked() ), this, TQT_SLOT( selectAddress() ) );
// TODO:
// remove this ugly hack! The finished label is only shown when I call
// updateChanges() twice. I have no idea why!
- connect( buttonUpdate, SIGNAL( clicked() ), this, SLOT( updatechanges() ) );
- connect( buttonUpdate, SIGNAL( clicked() ), this, SLOT( updatechanges() ) );
+ connect( buttonUpdate, TQT_SIGNAL( clicked() ), this, TQT_SLOT( updatechanges() ) );
+ connect( buttonUpdate, TQT_SIGNAL( clicked() ), this, TQT_SLOT( updatechanges() ) );
// end ugly hack
- connect( customerName, SIGNAL( activated(int) ), this, SLOT( customerNameChanged(int) ) );
- connect( customerId, SIGNAL( activated(int) ), this, SLOT( customerIdChanged(int) ) );
+ connect( customerName, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( customerNameChanged(int) ) );
+ connect( customerId, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( customerIdChanged(int) ) );
KConfig* config = kapp->config();
config->setGroup( "PreviewDialog" );
@@ -158,7 +158,7 @@ PreviewDialog::~PreviewDialog()
void PreviewDialog::setupSql()
{
- QSqlCursor cur( "customer" );
+ TQSqlCursor cur( "customer" );
cur.select();
customerId->clear();
customerName->clear();
@@ -177,17 +177,17 @@ void PreviewDialog::selectAddress()
if( !m_address.isEmpty() )
lineAddr->setText( m_address.realName() );
else
- lineAddr->setText( QString::null );
+ lineAddr->setText( TQString() );
}
void PreviewDialog::updatechanges()
{
- QPixmap pix( (int)def->getMeasurements().width( this ), (int)def->getMeasurements().height( this ) );
- pix.fill( Qt::white );
+ TQPixmap pix( (int)def->getMeasurements().width( TQT_TQPAINTDEVICE(this) ), (int)def->getMeasurements().height( TQT_TQPAINTDEVICE(this) ) );
+ pix.fill( TQt::white );
- QPainter painter( &pix );
+ TQPainter painter( &pix );
- Label* l = new Label( def, file, m_filename, KApplication::desktop(),
+ Label* l = new Label( def, file, m_filename, TQT_TQPAINTDEVICE(KApplication::desktop()),
customerId->currentText(), articleId->text(), groupName->text() );
l->setIndex( spinIndex->value() - 1 );
l->setSerial( serialStart->text(), serialInc->value() );