summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--fileplugin/kfile_kbarcode.cpp34
-rw-r--r--fileplugin/kfile_kbarcode.h5
-rw-r--r--kbarcode/barcodecombo.cpp99
-rw-r--r--kbarcode/barcodecombo.h52
-rw-r--r--kbarcode/barcodedialog.cpp72
-rw-r--r--kbarcode/barcodedialog.h27
-rw-r--r--kbarcode/barcodedialogs.cpp162
-rw-r--r--kbarcode/barcodedialogs.h65
-rw-r--r--kbarcode/barcodeitem.cpp66
-rw-r--r--kbarcode/barcodeitem.h20
-rw-r--r--kbarcode/barcodeprinterdlg.cpp44
-rw-r--r--kbarcode/barcodeprinterdlg.h17
-rw-r--r--kbarcode/barkode.cpp142
-rw-r--r--kbarcode/barkode.h96
-rw-r--r--kbarcode/barkodeengine.cpp8
-rw-r--r--kbarcode/barkodeengine.h24
-rw-r--r--kbarcode/batchiface.h18
-rw-r--r--kbarcode/batchprinter.cpp92
-rw-r--r--kbarcode/batchprinter.h78
-rw-r--r--kbarcode/batchwizard.cpp428
-rw-r--r--kbarcode/batchwizard.h129
-rw-r--r--kbarcode/commands.cpp40
-rw-r--r--kbarcode/commands.h112
-rw-r--r--kbarcode/configdialog.cpp122
-rw-r--r--kbarcode/configdialog.h19
-rw-r--r--kbarcode/confwizard.cpp86
-rw-r--r--kbarcode/confwizard.h71
-rw-r--r--kbarcode/csvfile.cpp50
-rw-r--r--kbarcode/csvfile.h54
-rw-r--r--kbarcode/csvimportdlg.cpp204
-rw-r--r--kbarcode/csvimportdlg.h33
-rw-r--r--kbarcode/databasebrowser.cpp56
-rw-r--r--kbarcode/databasebrowser.h9
-rw-r--r--kbarcode/definition.cpp156
-rw-r--r--kbarcode/definition.h66
-rw-r--r--kbarcode/definitiondialog.cpp184
-rw-r--r--kbarcode/definitiondialog.h70
-rw-r--r--kbarcode/documentitem.cpp60
-rw-r--r--kbarcode/documentitem.h82
-rw-r--r--kbarcode/documentitemdlg.cpp24
-rw-r--r--kbarcode/documentitemdlg.h3
-rw-r--r--kbarcode/dsmainwindow.cpp68
-rw-r--r--kbarcode/dsmainwindow.h7
-rw-r--r--kbarcode/dsrichtext.cpp144
-rw-r--r--kbarcode/dsrichtext.h106
-rw-r--r--kbarcode/dstextedit.cpp42
-rw-r--r--kbarcode/dstextedit.h19
-rw-r--r--kbarcode/editoriface.h6
-rw-r--r--kbarcode/encodingcombo.cpp12
-rw-r--r--kbarcode/encodingcombo.h3
-rw-r--r--kbarcode/gnubarcode.cpp38
-rw-r--r--kbarcode/gnubarcode.h12
-rw-r--r--kbarcode/imageitem.cpp88
-rw-r--r--kbarcode/imageitem.h28
-rw-r--r--kbarcode/kactionmap.cpp84
-rw-r--r--kbarcode/kactionmap.h17
-rw-r--r--kbarcode/kbarcode.cpp58
-rw-r--r--kbarcode/kbarcode.h7
-rw-r--r--kbarcode/kbarcodeiface.h2
-rw-r--r--kbarcode/kbarcodesettings.cpp12
-rw-r--r--kbarcode/kbarcodesettings.h13
-rw-r--r--kbarcode/label.cpp64
-rw-r--r--kbarcode/label.h36
-rw-r--r--kbarcode/labeleditor.cpp337
-rw-r--r--kbarcode/labeleditor.h63
-rw-r--r--kbarcode/labelutils.cpp90
-rw-r--r--kbarcode/labelutils.h44
-rw-r--r--kbarcode/lineitem.cpp18
-rw-r--r--kbarcode/lineitem.h16
-rw-r--r--kbarcode/main.cpp10
-rw-r--r--kbarcode/measurements.cpp22
-rw-r--r--kbarcode/measurements.h20
-rw-r--r--kbarcode/mimesources.cpp38
-rw-r--r--kbarcode/mimesources.h13
-rw-r--r--kbarcode/multilineeditdlg.cpp112
-rw-r--r--kbarcode/multilineeditdlg.h13
-rw-r--r--kbarcode/mybarcode.cpp128
-rw-r--r--kbarcode/mybarcode.h74
-rw-r--r--kbarcode/mycanvasitem.cpp12
-rw-r--r--kbarcode/mycanvasitem.h14
-rw-r--r--kbarcode/mycanvasview.cpp158
-rw-r--r--kbarcode/mycanvasview.h76
-rw-r--r--kbarcode/mydatatable.cpp4
-rw-r--r--kbarcode/mydatatable.h9
-rw-r--r--kbarcode/newlabel.cpp104
-rw-r--r--kbarcode/newlabel.h45
-rw-r--r--kbarcode/pixmapbarcode.cpp120
-rw-r--r--kbarcode/pixmapbarcode.h36
-rw-r--r--kbarcode/previewdialog.cpp82
-rw-r--r--kbarcode/previewdialog.h23
-rw-r--r--kbarcode/printersettings.cpp10
-rw-r--r--kbarcode/printersettings.h17
-rw-r--r--kbarcode/printlabeldlg.cpp16
-rw-r--r--kbarcode/printlabeldlg.h9
-rw-r--r--kbarcode/propertywidget.cpp152
-rw-r--r--kbarcode/propertywidget.h64
-rw-r--r--kbarcode/purepostscript.cpp70
-rw-r--r--kbarcode/purepostscript.h16
-rw-r--r--kbarcode/rectitem.cpp50
-rw-r--r--kbarcode/rectitem.h22
-rw-r--r--kbarcode/rectsettingsdlg.cpp72
-rw-r--r--kbarcode/rectsettingsdlg.h24
-rw-r--r--kbarcode/smalldialogs.cpp56
-rw-r--r--kbarcode/smalldialogs.h18
-rw-r--r--kbarcode/sqltables.cpp208
-rw-r--r--kbarcode/sqltables.h79
-rw-r--r--kbarcode/tbarcode2.cpp20
-rw-r--r--kbarcode/tbarcode2.h8
-rw-r--r--kbarcode/tcanvasitem.cpp36
-rw-r--r--kbarcode/tcanvasitem.h10
-rw-r--r--kbarcode/tec.cpp580
-rw-r--r--kbarcode/tec.h48
-rw-r--r--kbarcode/textitem.cpp104
-rw-r--r--kbarcode/textitem.h24
-rw-r--r--kbarcode/textlineedit.cpp70
-rw-r--r--kbarcode/textlineedit.h23
-rw-r--r--kbarcode/textlineitem.cpp86
-rw-r--r--kbarcode/textlineitem.h24
-rw-r--r--kbarcode/tokendialog.cpp186
-rw-r--r--kbarcode/tokendialog.h79
-rw-r--r--kbarcode/tokenprovider.cpp164
-rw-r--r--kbarcode/tokenprovider.h102
-rw-r--r--kbarcode/xmlutils.cpp104
-rw-r--r--kbarcode/xmlutils.h48
-rw-r--r--kbarcode/zplutils.cpp104
-rw-r--r--kbarcode/zplutils.h72
126 files changed, 4249 insertions, 4252 deletions
diff --git a/fileplugin/kfile_kbarcode.cpp b/fileplugin/kfile_kbarcode.cpp
index bd2c1c8..465cae7 100644
--- a/fileplugin/kfile_kbarcode.cpp
+++ b/fileplugin/kfile_kbarcode.cpp
@@ -7,15 +7,15 @@
#include <kgenericfactory.h>
#include <klocale.h>
-#include <qfile.h>
-#include <qdom.h>
+#include <tqfile.h>
+#include <tqdom.h>
K_EXPORT_COMPONENT_FACTORY(kfile_kbarcode, KGenericFactory<KBarcodePlugin>( "kfile_kbarcode" ));
-KBarcodePlugin::KBarcodePlugin(QObject *parent, const char *name,
- const QStringList &args)
+KBarcodePlugin::KBarcodePlugin(TQObject *tqparent, const char *name,
+ const TQStringList &args)
- : KFilePlugin(parent, name, args)
+ : KFilePlugin(tqparent, name, args)
{
KFileMimeTypeInfo* info = addMimeTypeInfo( "application/kbarcode-label" );
@@ -25,11 +25,11 @@ KBarcodePlugin::KBarcodePlugin(QObject *parent, const char *name,
KFileMimeTypeInfo::ItemInfo* item;
- item = addItemInfo(group, "Manufacturer", i18n("Manufacturer"), QVariant::String );
- item = addItemInfo(group, "Type", i18n("Type"), QVariant::String);
- item = addItemInfo(group, "Description", i18n("Description"), QVariant::String );
- item = addItemInfo(group, "Id", i18n("Label Id"), QVariant::String );
- item = addItemInfo(group, "Dimensions", i18n("Dimensions"), QVariant::Size);
+ item = addItemInfo(group, "Manufacturer", i18n("Manufacturer"), TQVariant::String );
+ item = addItemInfo(group, "Type", i18n("Type"), TQVariant::String);
+ item = addItemInfo(group, "Description", i18n("Description"), TQVariant::String );
+ item = addItemInfo(group, "Id", i18n("Label Id"), TQVariant::String );
+ item = addItemInfo(group, "Dimensions", i18n("Dimensions"), TQVariant::Size);
setHint( item, KFileMimeTypeInfo::Size );
setUnit(item, KFileMimeTypeInfo::Centimeters );
}
@@ -37,11 +37,11 @@ KBarcodePlugin::KBarcodePlugin(QObject *parent, const char *name,
bool KBarcodePlugin::readInfo( KFileMetaInfo& info, uint )
{
- QFile f( info.path() );
+ TQFile f( info.path() );
if ( !f.open( IO_ReadOnly ) )
return false;
- QDomDocument doc( "KBarcodeLabel" );
+ TQDomDocument doc( "KBarcodeLabel" );
if ( !doc.setContent( &f ) ) {
f.close();
return false;
@@ -49,14 +49,14 @@ bool KBarcodePlugin::readInfo( KFileMetaInfo& info, uint )
KFileMetaInfoGroup group = appendGroup(info, "Label");
- QDomNode n = doc.documentElement().firstChild();
+ TQDomNode n = doc.documentElement().firstChild();
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if( !e.isNull() )
if( e.tagName() == "label" ) {
- QDomNode node = e.firstChild();
+ TQDomNode node = e.firstChild();
while( !node.isNull() ) {
- QDomElement e = node.toElement(); // try to convert the node to an element.
+ TQDomElement e = node.toElement(); // try to convert the node to an element.
if( !e.isNull() )
if( e.tagName() == "description" )
appendItem(group, "Description", e.text() );
@@ -65,7 +65,7 @@ bool KBarcodePlugin::readInfo( KFileMetaInfo& info, uint )
appendItem(group, "Type", e.attribute("type", "") );
appendItem(group, "Id", e.text() );
appendItem(group, "Dimensions",
- QSize( int(e.attribute("width", "0").toDouble()/10), int(e.attribute("height", "0").toDouble()/10) ) );
+ TQSize( int(e.attribute("width", "0").toDouble()/10), int(e.attribute("height", "0").toDouble()/10) ) );
}
node = node.nextSibling();
diff --git a/fileplugin/kfile_kbarcode.h b/fileplugin/kfile_kbarcode.h
index fd71ada..419af16 100644
--- a/fileplugin/kfile_kbarcode.h
+++ b/fileplugin/kfile_kbarcode.h
@@ -7,14 +7,15 @@
#include <kfilemetainfo.h>
-class QStringList;
+class TQStringList;
class KBarcodePlugin: public KFilePlugin
{
Q_OBJECT
+ TQ_OBJECT
public:
- KBarcodePlugin( QObject *parent, const char *name, const QStringList& args );
+ KBarcodePlugin( TQObject *tqparent, const char *name, const TQStringList& args );
virtual bool readInfo( KFileMetaInfo& info, uint );
};
diff --git a/kbarcode/barcodecombo.cpp b/kbarcode/barcodecombo.cpp
index 1aadc7d..2f3dbdd 100644
--- a/kbarcode/barcodecombo.cpp
+++ b/kbarcode/barcodecombo.cpp
@@ -22,17 +22,13 @@
#include <pcre.h>
-// Qt includes
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qregexp.h>
-#include <qstring.h>
-#if QT_VERSION >= 0x030100
- #include <ktextedit.h>
-#else
- #include <qtextedit.h>
-#endif
+// TQt includes
+#include <tqcheckbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqregexp.h>
+#include <tqstring.h>
+#include <ktextedit.h>
// KDE includes
#include <kiconloader.h>
@@ -41,14 +37,14 @@
#include <klocale.h>
#include <kpushbutton.h>
-BarcodeValidator::BarcodeValidator( QObject* parent, const char* name )
- : QValidator( parent, name )
+BarcodeValidator::BarcodeValidator( TQObject* tqparent, const char* name )
+ : TQValidator( tqparent, name )
{
m_valid = NULL;
m_notValid = NULL;
}
-bool BarcodeValidator::pcreValidate( QString* pattern, const QString & input ) const
+bool BarcodeValidator::pcreValidate( TQString* pattern, const TQString & input ) const
{
const char* error;
const int ovector_size = 12;
@@ -72,7 +68,7 @@ bool BarcodeValidator::pcreValidate( QString* pattern, const QString & input ) c
return (result >= 1);
}
-QValidator::State BarcodeValidator::validate( QString & input, int & pos ) const
+TQValidator::State BarcodeValidator::validate( TQString & input, int & pos ) const
{
if( (!m_valid && !m_notValid) || input.isEmpty() )
return Acceptable;
@@ -88,8 +84,8 @@ QValidator::State BarcodeValidator::validate( QString & input, int & pos ) const
return Acceptable;
}
-BarcodeCombo::BarcodeCombo(QWidget *parent, const char *name )
- : KComboBox( false, parent, name )
+BarcodeCombo::BarcodeCombo(TQWidget *tqparent, const char *name )
+ : KComboBox( false, tqparent, name )
{
this->insertStringList( *Barkode::encodingTypes() );
@@ -104,9 +100,9 @@ const char* BarcodeCombo::getEncodingType()
return Barkode::typeFromName( currentText() );
}
-void BarcodeCombo::setEncodingType( const QString & type )
+void BarcodeCombo::setEncodingType( const TQString & type )
{
- const QString name = Barkode::nameFromType( type );
+ const TQString name = Barkode::nameFromType( type );
for( unsigned int z = 0; z < (unsigned int)count(); z++ )
if( text( z ) == name )
{
@@ -115,50 +111,47 @@ void BarcodeCombo::setEncodingType( const QString & type )
}
}
-BarcodeWidget::BarcodeWidget(QWidget *parent, const char *name )
- : QWidget( parent, name ), m_validator( this )
+BarcodeWidget::BarcodeWidget(TQWidget *tqparent, const char *name )
+ : TQWidget( tqparent, name ), m_validator( TQT_TQOBJECT(this) )
{
m_token = NULL;
- QGridLayout* grid = new QGridLayout( this, 6, 6 );
+ TQGridLayout* grid = new TQGridLayout( this, 6, 6 );
- labelStandard = new QLabel( i18n( "&Encoding Type:" ), this );
+ labelStandard = new TQLabel( i18n( "&Encoding Type:" ), this );
grid->addWidget( labelStandard, 1, 0 );
comboStandard = new BarcodeCombo( this, "comboStandard" );
- connect( comboStandard, SIGNAL( activated(int) ), this, SLOT( encodingChanged() ) );
- connect( comboStandard, SIGNAL( activated(int) ), this, SLOT( changed() ) );
+ connect( comboStandard, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( encodingChanged() ) );
+ connect( comboStandard, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( changed() ) );
grid->addMultiCellWidget( comboStandard, 1, 1, 1, 3 );
labelStandard->setBuddy( comboStandard );
- labelData = new QLabel( i18n( "&Value:" ), this );
+ labelData = new TQLabel( i18n( "&Value:" ), this );
grid->addWidget( labelData, 2, 0 );
data = new KLineEdit( this, "data" );
labelData->setBuddy( data );
- connect( data, SIGNAL( textChanged( const QString & ) ), this, SLOT( changed() ) );
- connect( data, SIGNAL( textChanged( const QString & ) ), this, SLOT( slotValidateValue() ) );
+ connect( data, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( changed() ) );
+ connect( data, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( slotValidateValue() ) );
grid->addMultiCellWidget( data, 2, 2, 1, 3 );
-#if QT_VERSION >= 0x030100
- multi = new KTextEdit( this );
-#else
- multi = new QTextEdit( this );
-#endif
- multi->setTextFormat( QTextEdit::PlainText );
- multi->setWordWrap( QTextEdit::NoWrap );
+ multi = new KTextEdit( this );
+
+ multi->setTextFormat( TQTextEdit::PlainText );
+ multi->setWordWrap( TQTextEdit::NoWrap );
multi->setEnabled( false );
- multi->setVScrollBarMode( QScrollView::AlwaysOn );
- multi->setHScrollBarMode( QScrollView::AlwaysOn );
+ multi->setVScrollBarMode( TQScrollView::AlwaysOn );
+ multi->setHScrollBarMode( TQScrollView::AlwaysOn );
multi->hide();
- connect( multi, SIGNAL( textChanged() ), this, SLOT( changed() ) );
+ connect( multi, TQT_SIGNAL( textChanged() ), this, TQT_SLOT( changed() ) );
grid->addMultiCellWidget( multi, 3, 3, 1, 3 );
- checkText = new QCheckBox( this, "checkText" );
+ checkText = new TQCheckBox( this, "checkText" );
checkText->setText( i18n( "&Display text" ) );
checkText->setChecked( true );
- connect( checkText, SIGNAL( clicked() ), this, SLOT( changed() ) );
+ connect( checkText, TQT_SIGNAL( clicked() ), this, TQT_SLOT( changed() ) );
grid->addWidget( checkText, 4, 1 );
buttonAdvanced = new KPushButton( i18n("&Advanced..."), this );
@@ -166,38 +159,38 @@ BarcodeWidget::BarcodeWidget(QWidget *parent, const char *name )
grid->addWidget( buttonAdvanced, 4, 2 );
buttonToken = new KPushButton( i18n("&Insert Data Field..."), this );
- buttonToken->setIconSet( QIconSet( SmallIcon("contents") ) );
+ buttonToken->setIconSet( TQIconSet( SmallIcon("contents") ) );
grid->addWidget( buttonToken, 4, 3 );
spinMargin = new KIntNumInput( this, "spinMargin" );
spinMargin->setLabel( i18n( "&Margin:" ), KNumInput::AlignLeft | KNumInput::AlignVCenter );
spinMargin->setRange( 0, 10000, 1, false );
spinMargin->setValue( 10 );
- connect( spinMargin, SIGNAL( valueChanged(int) ), this, SLOT( changed() ) );
+ connect( spinMargin, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT( changed() ) );
grid->addMultiCellWidget( spinMargin, 5, 5, 0, 1 );
spinRotation = new KIntNumInput( this );
spinRotation->setLabel( i18n( "&Rotation:" ), KNumInput::AlignLeft | KNumInput::AlignVCenter );
spinRotation->setRange( 0, 360, 90, false );
spinRotation->setValue( 0 );
- connect( spinRotation, SIGNAL( valueChanged(int) ), this, SLOT( changed() ) );
+ connect( spinRotation, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT( changed() ) );
grid->addMultiCellWidget( spinRotation, 5, 5, 2, 3 );
spinScale = new KIntNumInput( spinMargin, 1000, this );
spinScale->setLabel( i18n("&Scale (in permille):"), KNumInput::AlignLeft | KNumInput::AlignVCenter );
spinScale->setRange( 100, 10000, 100, false );
spinScale->setValue( 1000 );
- connect( spinScale, SIGNAL( valueChanged(int) ), this, SLOT( changed() ) );
+ connect( spinScale, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT( changed() ) );
grid->addMultiCellWidget( spinScale, 6, 6, 0, 1 );
spinCut = new KIntNumInput( spinRotation, 100, this );
spinCut->setLabel( i18n("&Crop:"), KNumInput::AlignLeft | KNumInput::AlignVCenter );
spinCut->setRange( 1, 100, 1, false );
- connect( spinCut, SIGNAL( valueChanged(int) ), this, SLOT( changed() ) );
+ connect( spinCut, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT( changed() ) );
grid->addMultiCellWidget( spinCut, 6, 6, 2, 3 );
- connect( buttonAdvanced, SIGNAL( clicked() ), this, SLOT( advanced() ) );
- connect( buttonToken, SIGNAL( clicked() ), this, SLOT( tokens() ) );
+ connect( buttonAdvanced, TQT_SIGNAL( clicked() ), this, TQT_SLOT( advanced() ) );
+ connect( buttonToken, TQT_SIGNAL( clicked() ), this, TQT_SLOT( tokens() ) );
m_enabledata = true;
m_multi = false;
@@ -207,7 +200,7 @@ BarcodeWidget::BarcodeWidget(QWidget *parent, const char *name )
void BarcodeWidget::getData( Barkode & barcode )
{
// make sure all changes are applied to the barcode
- // even if not all widgets have emitted their changed SIGNAL yet
+ // even if not all widgets have emitted their changed TQT_SIGNAL yet
this->changed();
barcode = m_barcode;
@@ -253,8 +246,8 @@ void BarcodeWidget::defaults()
void BarcodeWidget::encodingChanged()
{
- QString* validator;
- QString* validatorNot;
+ TQString* validator;
+ TQString* validatorNot;
spinCut->setEnabled( Barkode::hasFeature( comboStandard->getEncodingType(), NOCUT ) ? false : true );
if( !spinCut->isEnabled() )
@@ -299,14 +292,14 @@ void BarcodeWidget::advanced()
{
AdvancedBarcodeDialog abd( comboStandard->getEncodingType(), this, "abd" );
abd.setData( &m_barcode );
- if( abd.exec() == QDialog::Accepted )
+ if( abd.exec() == TQDialog::Accepted )
abd.getData( &m_barcode );
}
void BarcodeWidget::tokens()
{
TokenDialog tokendlg( m_token, this, "tokendlg" );
- if( tokendlg.exec() == QDialog::Accepted )
+ if( tokendlg.exec() == TQDialog::Accepted )
{
if( data->isEnabled() )
data->insert( tokendlg.token() );
@@ -317,7 +310,7 @@ void BarcodeWidget::tokens()
void BarcodeWidget::slotValidateValue()
{
- QColor c = data->hasAcceptableInput() ? this->foregroundColor() : Qt::red;
+ TQColor c = data->hasAcceptableInput() ? this->foregroundColor() : TQt::red;
data->setPaletteForegroundColor( c );
}
diff --git a/kbarcode/barcodecombo.h b/kbarcode/barcodecombo.h
index 48e1cde..32ba567 100644
--- a/kbarcode/barcodecombo.h
+++ b/kbarcode/barcodecombo.h
@@ -18,36 +18,36 @@
#ifndef BARCODECOMBO_H
#define BARCODECOMBO_H
-#include <qvalidator.h>
-#include <qwidget.h>
+#include <tqvalidator.h>
+#include <tqwidget.h>
#include <kcombobox.h>
#include "barkode.h"
-/** A validator that takes to QRegExp's to check
+/** A validator that takes to TQRegExp's to check
* wether a barcode is valid or not.
*/
-class BarcodeValidator : public QValidator {
+class BarcodeValidator : public TQValidator {
public:
- BarcodeValidator( QObject* parent = 0, const char* name = 0 );
+ BarcodeValidator( TQObject* tqparent = 0, const char* name = 0 );
- QValidator::State validate( QString & input, int & pos ) const;
+ TQValidator::State validate( TQString & input, int & pos ) const;
/** validate a given input string agains a pattern using
* Perl Compatible Regular Expressions
* \param pattern may be NULL
* \returns true if the pattern matches
*/
- bool pcreValidate( QString* pattern, const QString & input ) const;
+ bool pcreValidate( TQString* pattern, const TQString & input ) const;
- inline void setRegExp( QString* valid, QString* notValid ) {
+ inline void setRegExp( TQString* valid, TQString* notValid ) {
m_valid = valid;
m_notValid = notValid;
}
private:
- QString* m_valid;
- QString* m_notValid;
+ TQString* m_valid;
+ TQString* m_notValid;
};
/** A combobox that lists all barcode encodign types
@@ -55,24 +55,21 @@ class BarcodeValidator : public QValidator {
*/
class BarcodeCombo : public KComboBox {
Q_OBJECT
+ TQ_OBJECT
public:
- BarcodeCombo(QWidget *parent=0, const char *name=0);
+ BarcodeCombo(TQWidget *tqparent=0, const char *name=0);
~BarcodeCombo();
const char* getEncodingType();
- void setEncodingType( const QString & type );
+ void setEncodingType( const TQString & type );
};
class KIntNumInput;
class KLineEdit;
class KPushButton;
-#if QT_VERSION >= 0x030100
- class KTextEdit;
-#else
- class QTextEdit;
-#endif
-class QCheckBox;
-class QLabel;
+class KTextEdit;
+class TQCheckBox;
+class TQLabel;
/** This widget is used in BarCodeDialog and BarcodeSettingsDlg and
* allows the user to change the data of a barcodeData struct. This powerful
@@ -82,10 +79,11 @@ class QLabel;
* @see BarCodeDialog, @see BarcodeSettingsDlg
* @author Dominik Seichter
*/
-class BarcodeWidget : public QWidget {
+class BarcodeWidget : public TQWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- BarcodeWidget(QWidget *parent=0, const char *name=0);
+ BarcodeWidget(TQWidget *tqparent=0, const char *name=0);
~BarcodeWidget() { }
void getData( Barkode & barkode );
@@ -112,23 +110,19 @@ class BarcodeWidget : public QWidget {
KLineEdit* data;
BarcodeValidator m_validator;
-#if QT_VERSION >= 0x030100
KTextEdit* multi;
-#else
- QTextEdit* multi;
-#endif
-
+
KIntNumInput* spinMargin;
KIntNumInput* spinScale;
KIntNumInput* spinRotation;
KIntNumInput* spinCut;
- QCheckBox* checkText;
+ TQCheckBox* checkText;
KPushButton* buttonAdvanced;
KPushButton* buttonToken;
- QLabel* labelStandard;
- QLabel* labelData;
+ TQLabel* labelStandard;
+ TQLabel* labelData;
bool m_enabledata;
bool m_multi;
diff --git a/kbarcode/barcodedialog.cpp b/kbarcode/barcodedialog.cpp
index ce6f64d..506b05a 100644
--- a/kbarcode/barcodedialog.cpp
+++ b/kbarcode/barcodedialog.cpp
@@ -32,25 +32,25 @@
#include <kprinter.h>
#include <kpushbutton.h>
-// Qt includes
-#include <qclipboard.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpainter.h>
-#include <qpaintdevicemetrics.h>
-#include <qpicture.h>
-
-BarCodeDialog::BarCodeDialog( QWidget* parent, const char* name )
- : QDialog( parent, name, false)
+// TQt includes
+#include <tqclipboard.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqpainter.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqpicture.h>
+
+BarCodeDialog::BarCodeDialog( TQWidget* tqparent, const char* name )
+ : TQDialog( tqparent, name, false)
{
setCaption( i18n( "Barcode Generator" ) );
- BarCodeDialogLayout = new QHBoxLayout( this, 11, 6, "BarCodeDialogLayout");
- Layout5 = new QVBoxLayout( 0, 0, 6, "Layout5");
- Layout6 = new QVBoxLayout( 0, 0, 6, "Layout2");
+ BarCodeDialogLayout = new TQHBoxLayout( this, 11, 6, "BarCodeDialogLayout");
+ Layout5 = new TQVBoxLayout( 0, 0, 6, "Layout5");
+ Layout6 = new TQVBoxLayout( 0, 0, 6, "Layout2");
widget = new BarcodeWidget( this, "widget" );
- m_token = new TokenProvider( KApplication::desktop() );
+ m_token = new TokenProvider( TQT_TQPAINTDEVICE(KApplication::desktop()) );
widget->setTokenProvider( m_token );
buttonGenerate = new KPushButton( this, "buttonGenerate" );
@@ -78,16 +78,16 @@ BarCodeDialog::BarCodeDialog( QWidget* parent, const char* name )
buttonClose->setIconSet( SmallIconSet("fileclose") );
- QScrollView* sv = new QScrollView( this );
+ TQScrollView* sv = new TQScrollView( this );
- barcode = new QLabel( sv->viewport(), "barcode" );
+ barcode = new TQLabel( sv->viewport(), "barcode" );
sv->addChild( barcode );
- connect( buttonGenerate, SIGNAL( clicked() ), this, SLOT( generate() ) );
- connect( buttonSave, SIGNAL( clicked() ), this, SLOT( save() ) );
- connect( buttonPrint, SIGNAL( clicked() ), this, SLOT( print() ) );
- connect( buttonCopy, SIGNAL( clicked() ), this, SLOT( copy() ) );
+ connect( buttonGenerate, TQT_SIGNAL( clicked() ), this, TQT_SLOT( generate() ) );
+ connect( buttonSave, TQT_SIGNAL( clicked() ), this, TQT_SLOT( save() ) );
+ connect( buttonPrint, TQT_SIGNAL( clicked() ), this, TQT_SLOT( print() ) );
+ connect( buttonCopy, TQT_SIGNAL( clicked() ), this, TQT_SLOT( copy() ) );
- QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding );
+ TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Expanding );
Layout5->addWidget( buttonGenerate );
Layout5->addWidget( buttonSave );
@@ -103,7 +103,7 @@ BarCodeDialog::BarCodeDialog( QWidget* parent, const char* name )
BarCodeDialogLayout->addLayout( Layout5 );
BarCodeDialogLayout->setStretchFactor( Layout6, 2 );
- connect( buttonClose, SIGNAL( clicked() ), this, SLOT( close() ) );
+ connect( buttonClose, TQT_SIGNAL( clicked() ), this, TQT_SLOT( close() ) );
buttonGenerate->setDefault( true );
@@ -120,7 +120,7 @@ void BarCodeDialog::generate()
Barkode d;
widget->getData( d );
d.setTokenProvider( m_token );
- d.update( KApplication::desktop() );
+ d.update( TQT_TQPAINTDEVICE(KApplication::desktop()) );
barcode->setPixmap( d.pixmap() );
@@ -139,17 +139,17 @@ void BarCodeDialog::save()
KFileDialog fd( ":save_image", KImageIO::pattern( KImageIO::Writing ), this, "fd", true );
fd.setMode( KFile::File );
fd.setOperationMode( KFileDialog::Saving );
- if( fd.exec() == QDialog::Accepted )
+ if( fd.exec() == TQDialog::Accepted )
{
- QString path = fd.selectedURL().path();
- QString extension = KImageIO::type( path );
+ TQString path = fd.selectedURL().path();
+ TQString extension = KImageIO::type( path );
if( extension.isNull() )
extension = KImageIO::type( fd.currentFilter() );
bc.setTokenProvider( m_token );
- bc.update( KApplication::desktop() );
+ bc.update( TQT_TQPAINTDEVICE(KApplication::desktop()) );
if(!bc.pixmap().save( path, extension, 0 ))
KMessageBox::error( this, i18n("An error occurred during saving the image") );
@@ -172,13 +172,13 @@ void BarCodeDialog::print()
// unless we can center the barcode
printer->setFullPage( false );
- QPaintDeviceMetrics metrics( printer );
+ TQPaintDeviceMetrics metrics( printer );
- double scalex = (double)metrics.logicalDpiX() / (double)QPaintDevice::x11AppDpiX();
- double scaley = (double)metrics.logicalDpiY() / (double)QPaintDevice::x11AppDpiY();
+ double scalex = (double)metrics.logicalDpiX() / (double)TQPaintDevice::x11AppDpiX();
+ double scaley = (double)metrics.logicalDpiY() / (double)TQPaintDevice::x11AppDpiY();
- QPicture picture;
- QPainter p( printer );
+ TQPicture picture;
+ TQPainter p( printer );
p.scale( scalex, scaley );
// TODO: center barcode
@@ -188,7 +188,7 @@ void BarCodeDialog::print()
d.update( printer );
picture = d.picture();
- p.drawPicture( QPoint( 0, 0 ), picture );
+ p.drawPicture( TQPoint( 0, 0 ), picture );
p.end();
delete printer;
@@ -208,11 +208,7 @@ void BarCodeDialog::copy()
DocumentItemDrag* drag = new DocumentItemDrag();
drag->setDocumentItem( &list );
-#if QT_VERSION >= 0x030100
- kapp->clipboard()->setData( drag, QClipboard::Clipboard );
-#else
- kapp->clipboard()->setData( drag );
-#endif
+ kapp->tqclipboard()->setData( drag, TQClipboard::Clipboard );
}
#include "barcodedialog.moc"
diff --git a/kbarcode/barcodedialog.h b/kbarcode/barcodedialog.h
index 9490467..6e861be 100644
--- a/kbarcode/barcodedialog.h
+++ b/kbarcode/barcodedialog.h
@@ -18,7 +18,7 @@
#ifndef BARCODEDIALOG_H
#define BARCODEDIALOG_H
-#include <qdialog.h>
+#include <tqdialog.h>
class BarcodeCombo;
class BarcodeWidget;
@@ -30,12 +30,12 @@ class KIntNumInput;
class KLineEdit;
class KPushButton;
class KPopupMenu;
-class QCheckBox;
-class QLabel;
-class QPixmap;
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
+class TQCheckBox;
+class TQLabel;
+class TQPixmap;
+class TQVBoxLayout;
+class TQHBoxLayout;
+class TQGridLayout;
class TokenProvider;
/** This class provides a dialog, where the user can create a single barcode
@@ -45,12 +45,13 @@ class TokenProvider;
* All barcoding features are available for the user. This dialog allows also
* to just experiment a little bit with barcodes.
*/
-class BarCodeDialog : public QDialog
+class BarCodeDialog : public TQDialog
{
Q_OBJECT
+ TQ_OBJECT
public:
- BarCodeDialog( QWidget* parent = 0, const char* name = 0 );
+ BarCodeDialog( TQWidget* tqparent = 0, const char* name = 0 );
~BarCodeDialog();
private:
@@ -62,7 +63,7 @@ class BarCodeDialog : public QDialog
KPushButton* buttonSave;
KPushButton* buttonCopy;
KPushButton* buttonClose;
- QLabel* barcode;
+ TQLabel* barcode;
private slots:
void generate();
@@ -71,9 +72,9 @@ class BarCodeDialog : public QDialog
void copy();
protected:
- QHBoxLayout* BarCodeDialogLayout;
- QVBoxLayout* Layout6;
- QVBoxLayout* Layout5;
+ TQHBoxLayout* BarCodeDialogLayout;
+ TQVBoxLayout* Layout6;
+ TQVBoxLayout* Layout5;
};
#endif // BARCODEDIALOG_H
diff --git a/kbarcode/barcodedialogs.cpp b/kbarcode/barcodedialogs.cpp
index 28639a4..676265c 100644
--- a/kbarcode/barcodedialogs.cpp
+++ b/kbarcode/barcodedialogs.cpp
@@ -20,17 +20,17 @@
#include "purepostscript.h"
#include "tbarcode2.h"
-// Qt includes
-#include <qbuttongroup.h>
-#include <qcheckbox.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qmap.h>
-#include <qradiobutton.h>
-#include <qtooltip.h>
-#include <qvbox.h>
-#include <qvgroupbox.h>
+// TQt includes
+#include <tqbuttongroup.h>
+#include <tqcheckbox.h>
+#include <tqgroupbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqmap.h>
+#include <tqradiobutton.h>
+#include <tqtooltip.h>
+#include <tqvbox.h>
+#include <tqvgroupbox.h>
// KDE includes
#include <kcombobox.h>
@@ -39,43 +39,43 @@
#include <kcolorbutton.h>
-AdvancedBarcodeDialog::AdvancedBarcodeDialog( QString type, QWidget* parent, const char* name )
+AdvancedBarcodeDialog::AdvancedBarcodeDialog( TQString type, TQWidget* tqparent, const char* name )
: KDialogBase( KDialogBase::Tabbed, i18n("Barcode Settings"),
- KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, parent,name)
+ KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, tqparent,name)
{
list.setAutoDelete( false );
if( Barkode::hasFeature( type, PDF417BARCODE ) ) {
- QVBox* box = addVBoxPage( i18n("PDF417") );
+ TQVBox* box = addVBoxPage( i18n("PDF417") );
PDF417BarcodeDlg* dlg = new PDF417BarcodeDlg( box );
list.append( (BarcodeDlgBase*)dlg );
}
if( Barkode::hasFeature( type, DATAMATRIX ) ) {
- QVBox* box = addVBoxPage( i18n("DataMatrix") );
+ TQVBox* box = addVBoxPage( i18n("DataMatrix") );
DataMatrixDlg* dlg = new DataMatrixDlg( box );
list.append( (BarcodeDlgBase*)dlg );
}
if( Barkode::hasFeature( type, TBARCODEADV ) ) {
- QVBox* box = addVBoxPage( i18n("TBarcode") );
+ TQVBox* box = addVBoxPage( i18n("TBarcode") );
TBarcodeDlg* dlg = new TBarcodeDlg( box );
list.append( (BarcodeDlgBase*)dlg );
}
if( Barkode::hasFeature( type, PUREADV ) ) {
- QVBox* box = addVBoxPage( i18n("Barcode Writer in Pure Postscript") );
+ TQVBox* box = addVBoxPage( i18n("Barcode Writer in Pure Postscript") );
PurePostscriptDlg* dlg = new PurePostscriptDlg( box );
list.append( (BarcodeDlgBase*)dlg );
}
if( Barkode::hasFeature( type, COLORED ) ) {
- QVBox* box = addVBoxPage( i18n("Colors") );
+ TQVBox* box = addVBoxPage( i18n("Colors") );
ColorDlg* dlg = new ColorDlg( box );
list.append( (BarcodeDlgBase*)dlg );
}
- QVBox* box = addVBoxPage( i18n("Sequence") );
+ TQVBox* box = addVBoxPage( i18n("Sequence") );
SequenceDlg* dlg = new SequenceDlg( box );
list.append( (BarcodeDlgBase*)dlg );
}
@@ -100,17 +100,17 @@ void AdvancedBarcodeDialog::getData( Barkode* b )
}
}
-TBarcodeDlg::TBarcodeDlg(QWidget *parent, const char *name )
- : QWidget( parent, name )
+TBarcodeDlg::TBarcodeDlg(TQWidget *tqparent, const char *name )
+ : TQWidget( tqparent, name )
{
- QVBoxLayout* layout = new QVBoxLayout( this, 6, 6 );
+ TQVBoxLayout* tqlayout = new TQVBoxLayout( this, 6, 6 );
- QGroupBox* gb = new QGroupBox( i18n("TBarcode"), this );
+ TQGroupBox* gb = new TQGroupBox( i18n("TBarcode"), this );
gb->setColumnLayout(0, Qt::Vertical );
- gb->layout()->setSpacing( 6 );
- gb->layout()->setMargin( 11 );
+ gb->tqlayout()->setSpacing( 6 );
+ gb->tqlayout()->setMargin( 11 );
gb->setEnabled( Barkode::haveTBarcode() || Barkode::haveTBarcode2() );
- QVBoxLayout* gbLayout = new QVBoxLayout( gb->layout() );
+ TQVBoxLayout* gbLayout = new TQVBoxLayout( gb->tqlayout() );
spinModule = new KDoubleNumInput( gb );
spinModule->setLabel( i18n("Module width (mm):"), AlignLeft | AlignVCenter );
@@ -120,16 +120,16 @@ TBarcodeDlg::TBarcodeDlg(QWidget *parent, const char *name )
spinHeight->setLabel( i18n("Barcode Height (mm):"), AlignLeft | AlignVCenter );
spinHeight->setRange( 1, 1000, 10, false );
- checkEscape = new QCheckBox( i18n("&Translate escape sequences"), gb );
- checkAbove = new QCheckBox( i18n("&Text above barcode"), gb );
- checkAutoCorrect = new QCheckBox( i18n("&Auto correction"), gb );
+ checkEscape = new TQCheckBox( i18n("&Translate escape sequences"), gb );
+ checkAbove = new TQCheckBox( i18n("&Text above barcode"), gb );
+ checkAutoCorrect = new TQCheckBox( i18n("&Auto correction"), gb );
comboCheckSum = new KComboBox( false, gb );
- QLabel* label = new QLabel( i18n("&Checksum calculation method:"), gb );
+ TQLabel* label = new TQLabel( i18n("&Checksum calculation method:"), gb );
label->setBuddy( comboCheckSum );
- QHBoxLayout * hbox = new QHBoxLayout( 0, 6, 6 );
+ TQHBoxLayout * hbox = new TQHBoxLayout( 0, 6, 6 );
hbox->addWidget( label );
hbox->addWidget( comboCheckSum );
@@ -140,11 +140,11 @@ TBarcodeDlg::TBarcodeDlg(QWidget *parent, const char *name )
gbLayout->addWidget( checkAutoCorrect );
gbLayout->addLayout( hbox );
- QToolTip::add( spinModule, i18n("<qt>Change the module with used by tbarcode. Take a look into the "
+ TQToolTip::add( spinModule, i18n("<qt>Change the module with used by tbarcode. Take a look into the "
"tbarcode documentation for details. Normaly you do not want to change "
"this value.</qt>") );
- layout->addWidget( gb );
+ tqlayout->addWidget( gb );
}
void TBarcodeDlg::setData( Barkode* b )
@@ -221,7 +221,7 @@ void TBarcodeDlg::setData( Barkode* b )
comboCheckSum->insertStringList( map.keys() );
- QMap<QString,int>::Iterator it;
+ TQMap<TQString,int>::Iterator it;
for ( it = map.begin(); it != map.end(); ++it ) {
if( it.data() == options->checksum() ) {
for( int i = 0; i < comboCheckSum->count(); i++ )
@@ -250,17 +250,17 @@ void TBarcodeDlg::getData( Barkode* b ) const
}
}
-PDF417BarcodeDlg::PDF417BarcodeDlg(QWidget *parent, const char *name )
- : QWidget( parent, name )
+PDF417BarcodeDlg::PDF417BarcodeDlg(TQWidget *tqparent, const char *name )
+ : TQWidget( tqparent, name )
{
- QVBoxLayout* layout = new QVBoxLayout( this, 6, 6 );
+ TQVBoxLayout* tqlayout = new TQVBoxLayout( this, 6, 6 );
- QGroupBox* gpdf = new QGroupBox( i18n("PDF417"), this );
+ TQGroupBox* gpdf = new TQGroupBox( i18n("PDF417"), this );
gpdf->setColumnLayout(0, Qt::Vertical );
- gpdf->layout()->setSpacing( 6 );
- gpdf->layout()->setMargin( 11 );
+ gpdf->tqlayout()->setSpacing( 6 );
+ gpdf->tqlayout()->setMargin( 11 );
gpdf->setEnabled( Barkode::haveTBarcode() || Barkode::havePDFBarcode() );
- QVBoxLayout* gpdfLayout = new QVBoxLayout( gpdf->layout() );
+ TQVBoxLayout* gpdfLayout = new TQVBoxLayout( gpdf->tqlayout() );
spinRow = new KIntNumInput( gpdf );
spinRow->setLabel( i18n("Rows:"), AlignLeft | AlignVCenter );
@@ -277,7 +277,7 @@ PDF417BarcodeDlg::PDF417BarcodeDlg(QWidget *parent, const char *name )
gpdfLayout->addWidget( spinRow );
gpdfLayout->addWidget( spinCol );
gpdfLayout->addWidget( spinErr );
- layout->addWidget( gpdf );
+ tqlayout->addWidget( gpdf );
}
void PDF417BarcodeDlg::setData( Barkode* b )
@@ -304,16 +304,16 @@ void PDF417BarcodeDlg::getData( Barkode* b ) const
}
}
-DataMatrixDlg::DataMatrixDlg(QWidget *parent, const char *name )
- : QWidget( parent, name )
+DataMatrixDlg::DataMatrixDlg(TQWidget *tqparent, const char *name )
+ : TQWidget( tqparent, name )
{
- QHBoxLayout* datamLayout = new QHBoxLayout( this, 6, 6 );
+ TQHBoxLayout* datamLayout = new TQHBoxLayout( this, 6, 6 );
comboDataMatrix = new KComboBox( false, this );
- datamLayout->addWidget( new QLabel( i18n("Data Matrix symbol sizes (rows x cols):"), this ) );
+ datamLayout->addWidget( new TQLabel( i18n("Data Matrix symbol sizes (rows x cols):"), this ) );
datamLayout->addWidget( comboDataMatrix );
- datamLayout->addItem( new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Minimum ) );
+ datamLayout->addItem( new TQSpacerItem( 0, 0, TQSizePolicy::Minimum, TQSizePolicy::Minimum ) );
comboDataMatrix->insertItem( i18n("Automatic calculation" ) );
comboDataMatrix->insertItem( "10 x 10" );
@@ -358,22 +358,22 @@ void DataMatrixDlg::getData( Barkode* b ) const
b->setDatamatrixSize( comboDataMatrix->currentItem() );
}
-SequenceDlg::SequenceDlg( QWidget *parent, const char *name )
- : QWidget( parent, name )
+SequenceDlg::SequenceDlg( TQWidget *tqparent, const char *name )
+ : TQWidget( tqparent, name )
{
- QVBoxLayout* main = new QVBoxLayout( this, 6, 6 );
+ TQVBoxLayout* main = new TQVBoxLayout( this, 6, 6 );
- QButtonGroup* group = new QButtonGroup( i18n("Sequence"), this );
+ TQButtonGroup* group = new TQButtonGroup( i18n("Sequence"), this );
group->setColumnLayout(0, Qt::Vertical );
- group->layout()->setSpacing( 6 );
- group->layout()->setMargin( 11 );
- QVBoxLayout* layout = new QVBoxLayout( group->layout() );
+ group->tqlayout()->setSpacing( 6 );
+ group->tqlayout()->setMargin( 11 );
+ TQVBoxLayout* tqlayout = new TQVBoxLayout( group->tqlayout() );
- checkSequence = new QCheckBox( i18n("&Enable sequence"), group );
+ checkSequence = new TQCheckBox( i18n("&Enable sequence"), group );
- radioNumbers = new QRadioButton( i18n("Iterate over numbers 0-9"), group );
- radioAlpha = new QRadioButton( i18n("Iterate over characters A-Z"), group );
- radioAlphaNum = new QRadioButton( i18n("Iterate over A-Z, 0-9"), group );
+ radioNumbers = new TQRadioButton( i18n("Iterate over numbers 0-9"), group );
+ radioAlpha = new TQRadioButton( i18n("Iterate over characters A-Z"), group );
+ radioAlphaNum = new TQRadioButton( i18n("Iterate over A-Z, 0-9"), group );
spinStep = new KIntNumInput( group );
spinStep->setLabel( i18n("Step:"), AlignLeft | AlignVCenter );
@@ -383,19 +383,19 @@ SequenceDlg::SequenceDlg( QWidget *parent, const char *name )
spinStart->setLabel( i18n("Start:"), AlignLeft | AlignVCenter );
spinStart->setRange( -100000, 100000, 1, false );
- layout->addWidget( checkSequence );
- layout->addWidget( radioNumbers );
- layout->addWidget( radioAlpha );
- layout->addWidget( radioAlphaNum );
- layout->addWidget( spinStep );
- layout->addWidget( spinStart );
+ tqlayout->addWidget( checkSequence );
+ tqlayout->addWidget( radioNumbers );
+ tqlayout->addWidget( radioAlpha );
+ tqlayout->addWidget( radioAlphaNum );
+ tqlayout->addWidget( spinStep );
+ tqlayout->addWidget( spinStart );
main->addWidget( group );
- connect( checkSequence, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioNumbers, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioAlpha, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioAlphaNum, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
+ connect( checkSequence, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioNumbers, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioAlpha, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioAlphaNum, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
}
void SequenceDlg::setData( Barkode* b )
@@ -438,23 +438,23 @@ void SequenceDlg::enableControls()
spinStart->setEnabled( checkSequence->isChecked() && radioNumbers->isChecked() );
}
-ColorDlg::ColorDlg(QWidget *parent, const char *name)
- : QVBox( parent, name )
+ColorDlg::ColorDlg(TQWidget *tqparent, const char *name)
+ : TQVBox( tqparent, name )
{
- QGroupBox* gb = new QGroupBox( i18n("Colors"), this );
+ TQGroupBox* gb = new TQGroupBox( i18n("Colors"), this );
gb->setColumnLayout(0, Qt::Vertical );
- gb->layout()->setSpacing( 6 );
- gb->layout()->setMargin( 11 );
+ gb->tqlayout()->setSpacing( 6 );
+ gb->tqlayout()->setMargin( 11 );
gb->setEnabled( Barkode::havePurePostscriptBarcode() );
- QGridLayout* gbLayout = new QGridLayout( gb->layout() );
+ TQGridLayout* gbLayout = new TQGridLayout( gb->tqlayout() );
buttonBarColor = new KColorButton( gb );
buttonBackColor = new KColorButton( gb );
buttonTextColor = new KColorButton( gb );
- gbLayout->addWidget( new QLabel( i18n("Bar Color:"), gb ), 0, 0 );
- gbLayout->addWidget( new QLabel( i18n("Background Color:"), gb ), 1, 0 );
- gbLayout->addWidget( new QLabel( i18n("Text Color:"), gb ), 2, 0 );
+ gbLayout->addWidget( new TQLabel( i18n("Bar Color:"), gb ), 0, 0 );
+ gbLayout->addWidget( new TQLabel( i18n("Background Color:"), gb ), 1, 0 );
+ gbLayout->addWidget( new TQLabel( i18n("Text Color:"), gb ), 2, 0 );
gbLayout->addWidget( buttonBarColor, 0, 1 );
gbLayout->addWidget( buttonBackColor, 1, 1 );
gbLayout->addWidget( buttonTextColor, 2, 1 );
@@ -474,13 +474,13 @@ void ColorDlg::getData( Barkode* b ) const
b->setTextColor( buttonTextColor->color() );
}
-PurePostscriptDlg::PurePostscriptDlg(QWidget *parent, const char *name)
- : QVBox( parent, name )
+PurePostscriptDlg::PurePostscriptDlg(TQWidget *tqparent, const char *name)
+ : TQVBox( tqparent, name )
{
- QVGroupBox* gb = new QVGroupBox( i18n("Barcode Writer in Pure Postscript"), this );
+ TQVGroupBox* gb = new TQVGroupBox( i18n("Barcode Writer in Pure Postscript"), this );
gb->setEnabled( Barkode::havePurePostscriptBarcode() );
- checkChecksum = new QCheckBox( i18n("Enable &Checksum"), gb );
+ checkChecksum = new TQCheckBox( i18n("Enable &Checksum"), gb );
}
void PurePostscriptDlg::setData( Barkode* b )
diff --git a/kbarcode/barcodedialogs.h b/kbarcode/barcodedialogs.h
index 56e3a58..abaee68 100644
--- a/kbarcode/barcodedialogs.h
+++ b/kbarcode/barcodedialogs.h
@@ -18,10 +18,10 @@
#ifndef BARCODEDIALOGS_H
#define BARCODEDIALOGS_H
-#include <qmap.h>
-#include <qptrlist.h>
-#include <qwidget.h>
-#include <qvbox.h>
+#include <tqmap.h>
+#include <tqptrlist.h>
+#include <tqwidget.h>
+#include <tqvbox.h>
#include <kdialogbase.h>
class Barkode;
@@ -29,8 +29,8 @@ class KColorButton;
class KComboBox;
class KDoubleNumInput;
class KIntNumInput;
-class QCheckBox;
-class QRadioButton;
+class TQCheckBox;
+class TQRadioButton;
/** A base class for all widgets, that will be used in AdvancedBarcodeDialog
* to modify the settings of a barcode. The API is simple. You can only set the
@@ -56,24 +56,26 @@ class BarcodeDlgBase {
*/
class AdvancedBarcodeDialog : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
- AdvancedBarcodeDialog( QString type, QWidget* parent = 0, const char* name = 0 );
+ AdvancedBarcodeDialog( TQString type, TQWidget* tqparent = 0, const char* name = 0 );
~AdvancedBarcodeDialog();
void setData( Barkode* b );
void getData( Barkode* b );
private:
- QPtrList<BarcodeDlgBase> list;
+ TQPtrList<BarcodeDlgBase> list;
};
/** A configuration widget for TBarcode settings.
* @author Dominik Seichter
*/
-class TBarcodeDlg : public QWidget, public BarcodeDlgBase {
+class TBarcodeDlg : public TQWidget, public BarcodeDlgBase {
Q_OBJECT
+ TQ_OBJECT
public:
- TBarcodeDlg(QWidget *parent=0, const char *name=0);
+ TBarcodeDlg(TQWidget *tqparent=0, const char *name=0);
void setData( Barkode* b );
void getData( Barkode* b ) const;
@@ -81,21 +83,22 @@ class TBarcodeDlg : public QWidget, public BarcodeDlgBase {
private:
KDoubleNumInput* spinModule;
KIntNumInput* spinHeight;
- QCheckBox* checkEscape;
- QCheckBox* checkAbove;
- QCheckBox* checkAutoCorrect;
+ TQCheckBox* checkEscape;
+ TQCheckBox* checkAbove;
+ TQCheckBox* checkAutoCorrect;
KComboBox* comboCheckSum;
- QMap<QString,int> map;
+ TQMap<TQString,int> map;
};
/** A configuration Dialog for PDF417 settings.
* @author Dominik Seichter
*/
-class PDF417BarcodeDlg : public QWidget, public BarcodeDlgBase {
+class PDF417BarcodeDlg : public TQWidget, public BarcodeDlgBase {
Q_OBJECT
+ TQ_OBJECT
public:
- PDF417BarcodeDlg(QWidget *parent=0, const char *name=0);
+ PDF417BarcodeDlg(TQWidget *tqparent=0, const char *name=0);
void setData( Barkode* b );
void getData( Barkode* b ) const;
@@ -109,10 +112,11 @@ class PDF417BarcodeDlg : public QWidget, public BarcodeDlgBase {
/** A configuration widget for DataMatrix settings.
* @author Dominik Seichter
*/
-class DataMatrixDlg : public QWidget, public BarcodeDlgBase {
+class DataMatrixDlg : public TQWidget, public BarcodeDlgBase {
Q_OBJECT
+ TQ_OBJECT
public:
- DataMatrixDlg(QWidget *parent=0, const char *name=0);
+ DataMatrixDlg(TQWidget *tqparent=0, const char *name=0);
void setData( Barkode* b );
void getData( Barkode* b ) const;
@@ -124,10 +128,11 @@ class DataMatrixDlg : public QWidget, public BarcodeDlgBase {
/** A configuration widget for barcode sequences.
* @author Dominik Seichter
*/
-class SequenceDlg : public QWidget, public BarcodeDlgBase {
+class SequenceDlg : public TQWidget, public BarcodeDlgBase {
Q_OBJECT
+ TQ_OBJECT
public:
- SequenceDlg(QWidget *parent=0, const char *name=0);
+ SequenceDlg(TQWidget *tqparent=0, const char *name=0);
void setData( Barkode* b );
void getData( Barkode* b ) const;
@@ -136,10 +141,10 @@ class SequenceDlg : public QWidget, public BarcodeDlgBase {
void enableControls();
private:
- QCheckBox* checkSequence;
- QRadioButton* radioNumbers;
- QRadioButton* radioAlpha;
- QRadioButton* radioAlphaNum;
+ TQCheckBox* checkSequence;
+ TQRadioButton* radioNumbers;
+ TQRadioButton* radioAlpha;
+ TQRadioButton* radioAlphaNum;
KIntNumInput* spinStep;
KIntNumInput* spinStart;
@@ -148,10 +153,11 @@ class SequenceDlg : public QWidget, public BarcodeDlgBase {
/** A configuration widget for colors in pure postscript barcodes
* @author Dominik Seichter
*/
-class ColorDlg : public QVBox, public BarcodeDlgBase {
+class ColorDlg : public TQVBox, public BarcodeDlgBase {
Q_OBJECT
+ TQ_OBJECT
public:
- ColorDlg(QWidget *parent=0, const char *name=0);
+ ColorDlg(TQWidget *tqparent=0, const char *name=0);
void setData( Barkode* b );
void getData( Barkode* b ) const;
@@ -165,16 +171,17 @@ class ColorDlg : public QVBox, public BarcodeDlgBase {
/** A configuration widget for colors in pure postscript barcodes
* @author Dominik Seichter
*/
-class PurePostscriptDlg : public QVBox, public BarcodeDlgBase {
+class PurePostscriptDlg : public TQVBox, public BarcodeDlgBase {
Q_OBJECT
+ TQ_OBJECT
public:
- PurePostscriptDlg(QWidget *parent=0, const char *name=0);
+ PurePostscriptDlg(TQWidget *tqparent=0, const char *name=0);
void setData( Barkode* b );
void getData( Barkode* b ) const;
private:
- QCheckBox* checkChecksum;
+ TQCheckBox* checkChecksum;
};
#endif
diff --git a/kbarcode/barcodeitem.cpp b/kbarcode/barcodeitem.cpp
index f2fbe4c..e5d58cf 100644
--- a/kbarcode/barcodeitem.cpp
+++ b/kbarcode/barcodeitem.cpp
@@ -18,9 +18,9 @@
#include "barcodeitem.h"
#include "tcanvasitem.h"
-#include <qdom.h>
-#include <qpainter.h>
-#include <qpaintdevicemetrics.h>
+#include <tqdom.h>
+#include <tqpainter.h>
+#include <tqpaintdevicemetrics.h>
BarcodeItem::BarcodeItem()
: Barkode(), DocumentItem()
@@ -34,7 +34,7 @@ BarcodeItem::BarcodeItem( const Barkode & bcode )
init();
}
-QMap<QString,QString> BarcodeItem::legacy;
+TQMap<TQString,TQString> BarcodeItem::legacy;
void BarcodeItem::init()
{
@@ -64,16 +64,16 @@ void BarcodeItem::init()
}
*/
setBorder( false );
- setRect( QRect( 0, 0, 100, 100 ) );
+ setRect( TQRect( 0, 0, 100, 100 ) );
updateBarcode();
}
-void BarcodeItem::loadXML (QDomElement* element)
+void BarcodeItem::loadXML (TQDomElement* element)
{
// TODO: default() should be called first and the current values should be used
// instead of the now hardcoded values
- // i.e: setQuietZone( element->attribute("margin", QString::number( quietZone() ) ).toInt() );
+ // i.e: setQuietZone( element->attribute("margin", TQString::number( quietZone() ) ).toInt() );
setQuietZone( element->attribute("margin", "10" ).toInt() );
setRotation( element->attribute("rotation", "0" ).toInt() );
@@ -84,7 +84,7 @@ void BarcodeItem::loadXML (QDomElement* element)
/*
* check for encoding types saved by kbarcode <= 1.2.0
*/
- if( legacy.contains( type() ) )
+ if( legacy.tqcontains( type() ) )
setType( legacy[type()] );
setTextVisible( element->attribute("text", "0" ).toInt() );
@@ -103,9 +103,9 @@ void BarcodeItem::loadXML (QDomElement* element)
setSequenceStart( element->attribute( "sequencestart", "0" ).toInt() );
}
- QDomNode n = element->firstChild();
+ TQDomNode n = element->firstChild();
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if( !e.isNull() )
if( e.tagName() == "value" )
setValue( e.text() );
@@ -118,7 +118,7 @@ void BarcodeItem::loadXML (QDomElement* element)
updateBarcode();
}
-void BarcodeItem::saveXML (QDomElement* element)
+void BarcodeItem::saveXML (TQDomElement* element)
{
element->setAttribute( "margin", quietZone() );
element->setAttribute( "rotation", rotation() );
@@ -145,7 +145,7 @@ void BarcodeItem::saveXML (QDomElement* element)
element->setAttribute( "datamatrix.size", datamatrixSize() );
- QDomElement texttag = element->ownerDocument().createElement( "value" );
+ TQDomElement texttag = element->ownerDocument().createElement( "value" );
texttag.appendChild( element->ownerDocument().createTextNode( value() ) );
element->appendChild( texttag );
@@ -153,16 +153,16 @@ void BarcodeItem::saveXML (QDomElement* element)
DocumentItem::saveXML( element );
}
-void BarcodeItem::draw (QPainter* painter)
+void BarcodeItem::draw (TQPainter* painter)
{
if( DocumentItem::paintDevice() && DocumentItem::paintDevice()->isExtDev() )
{
painter->save();
/*
- QPaintDeviceMetrics metrics( DocumentItem::paintDevice() );
- double scalex = (double)metrics.logicalDpiX() / (double)QPaintDevice::x11AppDpiX();
- double scaley = (double)metrics.logicalDpiY() / (double)QPaintDevice::x11AppDpiY();
+ TQPaintDeviceMetrics metrics( DocumentItem::paintDevice() );
+ double scalex = (double)metrics.logicalDpiX() / (double)TQPaintDevice::x11AppDpiX();
+ double scaley = (double)metrics.logicalDpiY() / (double)TQPaintDevice::x11AppDpiY();
painter->scale( 1.0 / scalex, 1.0 / scaley );
*/
@@ -183,14 +183,14 @@ void BarcodeItem::draw (QPainter* painter)
}
// TODO: do a bitBlt when device is screen
//painter->drawPixmap( rect().x(), rect().y(), m_pixmap );
- //bitBlt( painter->device(), rect().x(), rect().y(), &m_pixmap, 0, 0, rect().width(), rect().height(), Qt::CopyROP );
+ //bitBlt( painter->device(), rect().x(), rect().y(), &m_pixmap, 0, 0, rect().width(), rect().height(), TQt::CopyROP );
}
DocumentItem::drawBorder( painter );
}
-void BarcodeItem::drawZpl( QTextStream* stream )
+void BarcodeItem::drawZpl( TQTextStream* stream )
{
- QString encoding = ZPLUtils::encoding( type() );
+ TQString encoding = ZPLUtils::encoding( type() );
if( encoding.isNull() )
{
qDebug( "ERROR: No ZPL barcode found");
@@ -202,9 +202,9 @@ void BarcodeItem::drawZpl( QTextStream* stream )
*stream << ZPLUtils::fieldData( value() );
}
-void BarcodeItem::drawIpl( QTextStream* stream, IPLUtils* utils )
+void BarcodeItem::drawIpl( TQTextStream* stream, IPLUtils* utils )
{
- QString encoding = utils->encoding( type() );
+ TQString encoding = utils->encoding( type() );
if( encoding.isEmpty() )
{
@@ -213,21 +213,21 @@ void BarcodeItem::drawIpl( QTextStream* stream, IPLUtils* utils )
}
int counter = utils->counter();
- QString s = QString("B%1;").arg( counter ); // field number
+ TQString s = TQString("B%1;").tqarg( counter ); // field number
s += utils->fieldOrigin( rect().x(), rect().y() );
- s += QString("c%1;").arg( encoding ); // encoding type
- s += QString("h%1;").arg( rect().height() ); // height of barcode
- s += QString("w%1;").arg( 3 ); // width of barcode (per line)
- s += QString("d0,%1;").arg( value().length() ); // max length of data
+ s += TQString("c%1;").tqarg( encoding ); // encoding type
+ s += TQString("h%1;").tqarg( rect().height() ); // height of barcode
+ s += TQString("w%1;").tqarg( 3 ); // width of barcode (per line)
+ s += TQString("d0,%1;").tqarg( value().length() ); // max length of data
*stream << utils->field( s );
utils->addValue( value() );
}
-void BarcodeItem::drawEPcl( QTextStream* stream )
+void BarcodeItem::drawEPcl( TQTextStream* stream )
{
- QString encoding = EPCLUtils::encoding( type() );
+ TQString encoding = EPCLUtils::encoding( type() );
if( encoding.isEmpty() )
{
qDebug( "ERROR: No EPCL barcode found");
@@ -235,11 +235,11 @@ void BarcodeItem::drawEPcl( QTextStream* stream )
}
// Coordinates cannot start at zero
- QString s = QString("B %1").arg( rect().x()+1 );
- s += QString(" %1 0").arg( rect().y() + rect().height() );
- s += QString(" %1 1 4").arg( encoding );
- s += QString(" %1 1").arg( rect().height() );
- s += QString(" %1").arg( value() );
+ TQString s = TQString("B %1").tqarg( rect().x()+1 );
+ s += TQString(" %1 0").tqarg( rect().y() + rect().height() );
+ s += TQString(" %1 1 4").tqarg( encoding );
+ s += TQString(" %1 1").tqarg( rect().height() );
+ s += TQString(" %1").tqarg( value() );
*stream << EPCLUtils::field( s );
}
diff --git a/kbarcode/barcodeitem.h b/kbarcode/barcodeitem.h
index 0faafc2..0ca0815 100644
--- a/kbarcode/barcodeitem.h
+++ b/kbarcode/barcodeitem.h
@@ -18,8 +18,8 @@
#ifndef BARCODEITEM_H
#define BARCODEITEM_H
-#include <qmap.h>
-#include <qpixmap.h>
+#include <tqmap.h>
+#include <tqpixmap.h>
#include "barkode.h"
#include "gnubarcode.h"
@@ -38,20 +38,20 @@ public:
int rtti() const { return eRtti_Barcode;}
- void loadXML (QDomElement* element);
- void saveXML (QDomElement* element);
- void draw (QPainter* painter);
- void drawZpl( QTextStream* stream );
- void drawIpl( QTextStream* stream, IPLUtils* utils );
- void drawEPcl( QTextStream* stream );
+ void loadXML (TQDomElement* element);
+ void saveXML (TQDomElement* element);
+ void draw (TQPainter* painter);
+ void drawZpl( TQTextStream* stream );
+ void drawIpl( TQTextStream* stream, IPLUtils* utils );
+ void drawEPcl( TQTextStream* stream );
private:
void init();
private:
- static QMap<QString,QString> legacy;
+ static TQMap<TQString,TQString> legacy;
- QPixmap m_pixmap;
+ TQPixmap m_pixmap;
};
#endif //BARCODEITEM_H
diff --git a/kbarcode/barcodeprinterdlg.cpp b/kbarcode/barcodeprinterdlg.cpp
index 3488a97..e565bd2 100644
--- a/kbarcode/barcodeprinterdlg.cpp
+++ b/kbarcode/barcodeprinterdlg.cpp
@@ -22,38 +22,38 @@
#include <klocale.h>
#include <kurlrequester.h>
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qvbuttongroup.h>
+#include <tqcheckbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqvbuttongroup.h>
-BarcodePrinterDlg::BarcodePrinterDlg(QWidget *parent, const char *name)
+BarcodePrinterDlg::BarcodePrinterDlg(TQWidget *tqparent, const char *name)
: KDialogBase( KDialogBase::Plain, i18n("Barcode Printer"),
- KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, parent,name)
+ KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, tqparent,name)
{
- QGridLayout* layout = new QGridLayout( plainPage(), 6, 6 );
+ TQGridLayout* tqlayout = new TQGridLayout( plainPage(), 6, 6 );
- QLabel* label = new QLabel( i18n("&Output Format:"), plainPage() );
+ TQLabel* label = new TQLabel( i18n("&Output Format:"), plainPage() );
comboFormat = new KComboBox( false, plainPage() );
label->setBuddy( comboFormat );
- checkFile = new QCheckBox( i18n("&Print to File"), plainPage() );
+ checkFile = new TQCheckBox( i18n("&Print to File"), plainPage() );
- label2 = new QLabel( i18n("&Filename:"), plainPage() );
+ label2 = new TQLabel( i18n("&Filename:"), plainPage() );
requester = new KURLRequester( plainPage() );
label2->setBuddy( requester );
- label3 = new QLabel( i18n("&Device:"), plainPage() );
+ label3 = new TQLabel( i18n("&Device:"), plainPage() );
comboDevice = new KComboBox( true, plainPage() );
label3->setBuddy( comboDevice );
- layout->addWidget( label, 0, 0 );
- layout->addMultiCellWidget( comboFormat, 0, 0, 1, 2 );
- layout->addMultiCellWidget( checkFile, 1, 1, 1, 2 );
- layout->addWidget( label2, 2, 0 );
- layout->addWidget( requester, 2, 1 );
- layout->addWidget( label3, 3, 0 );
- layout->addMultiCellWidget( comboDevice, 3, 3, 1, 2 );
+ tqlayout->addWidget( label, 0, 0 );
+ tqlayout->addMultiCellWidget( comboFormat, 0, 0, 1, 2 );
+ tqlayout->addMultiCellWidget( checkFile, 1, 1, 1, 2 );
+ tqlayout->addWidget( label2, 2, 0 );
+ tqlayout->addWidget( requester, 2, 1 );
+ tqlayout->addWidget( label3, 3, 0 );
+ tqlayout->addMultiCellWidget( comboDevice, 3, 3, 1, 2 );
comboFormat->insertItem( i18n("TEC Printer (TEC)") );
comboFormat->insertItem( i18n("Zebra Printer (ZPL)") );
@@ -68,9 +68,9 @@ BarcodePrinterDlg::BarcodePrinterDlg(QWidget *parent, const char *name)
comboDevice->insertItem( "/dev/usb/lp1" );
comboDevice->insertItem( "/dev/usb/lp2" );
- connect( checkFile, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
+ connect( checkFile, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
-// KFileDialog fd( QString::null, "*.zpl|Zebra Printer Language (*.zpl)\n*.ipl|Intermec Printer Language (*.ipl)", this, "fd", true );
+// KFileDialog fd( TQString(), "*.zpl|Zebra Printer Language (*.zpl)\n*.ipl|Intermec Printer Language (*.ipl)", this, "fd", true );
enableControls();
}
@@ -112,12 +112,12 @@ bool BarcodePrinterDlg::printToFile() const
return checkFile->isChecked();
}
-const QString BarcodePrinterDlg::deviceName() const
+const TQString BarcodePrinterDlg::deviceName() const
{
return comboDevice->currentText();
}
-const QString BarcodePrinterDlg::fileName() const
+const TQString BarcodePrinterDlg::fileName() const
{
return requester->url();
}
diff --git a/kbarcode/barcodeprinterdlg.h b/kbarcode/barcodeprinterdlg.h
index fe0e6e3..1d7a54b 100644
--- a/kbarcode/barcodeprinterdlg.h
+++ b/kbarcode/barcodeprinterdlg.h
@@ -21,8 +21,8 @@
class KComboBox;
class KURLRequester;
-class QCheckBox;
-class QLabel;
+class TQCheckBox;
+class TQLabel;
/**
@author Dominik Seichter
@@ -30,14 +30,15 @@ class QLabel;
class BarcodePrinterDlg : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- BarcodePrinterDlg(QWidget *parent = 0, const char *name = 0);
+ BarcodePrinterDlg(TQWidget *tqparent = 0, const char *name = 0);
~BarcodePrinterDlg();
int outputFormat() const;
bool printToFile() const;
- const QString deviceName() const;
- const QString fileName() const;
+ const TQString deviceName() const;
+ const TQString fileName() const;
private slots:
void enableControls();
@@ -47,9 +48,9 @@ class BarcodePrinterDlg : public KDialogBase
KComboBox* comboDevice;
KURLRequester* requester;
- QCheckBox* checkFile;
- QLabel* label2;
- QLabel* label3;
+ TQCheckBox* checkFile;
+ TQLabel* label2;
+ TQLabel* label3;
};
#endif
diff --git a/kbarcode/barkode.cpp b/kbarcode/barkode.cpp
index 7ec5c84..f9c6510 100644
--- a/kbarcode/barkode.cpp
+++ b/kbarcode/barkode.cpp
@@ -60,18 +60,18 @@ enum {
};
#endif // _ENABLE_NATIVE_GNU_BARCODE
-#include <qdom.h>
-#include <qfile.h>
-#include <qpainter.h>
-#include <qpicture.h>
-#include <qpixmap.h>
-#include <qsize.h>
+#include <tqdom.h>
+#include <tqfile.h>
+#include <tqpainter.h>
+#include <tqpicture.h>
+#include <tqpixmap.h>
+#include <tqsize.h>
#include <klocale.h>
#include <kstandarddirs.h>
-QValueList<tBarcodeInfo> Barkode::s_info;
-QStringList* Barkode::s_encoding = NULL;
+TQValueList<tBarcodeInfo> Barkode::s_info;
+TQStringList* Barkode::s_encoding = NULL;
bool Barkode::s_haveGnuBarcode = false;
bool Barkode::s_havePdfEncode = false;
bool Barkode::s_haveTBarcode = false;
@@ -112,9 +112,9 @@ void Barkode::defaults()
m_valid = false;
m_text_visible = true;
- m_background = Qt::white;
- m_foreground = Qt::black;
- m_textcolor = Qt::black;
+ m_background = TQt::white;
+ m_foreground = TQt::black;
+ m_textcolor = TQt::black;
m_quietzone = 0;
m_bar_height = 80;
@@ -197,10 +197,10 @@ bool Barkode::operator==( const Barkode & barkode ) const
return b;
}
-const QPicture Barkode::picture()
+const TQPicture Barkode::picture()
{
- QPicture pic;
- QPainter painter( &pic );
+ TQPicture pic;
+ TQPainter painter( &pic );
painter.fillRect( 0, 0, size().width(), size().height(), m_background );
@@ -210,29 +210,29 @@ const QPicture Barkode::picture()
return pic;
}
-void Barkode::drawInvalid( QPainter & painter, int x, int y )
+void Barkode::drawInvalid( TQPainter & painter, int x, int y )
{
- QRect rect( x, y, size().width(), size().height() );
+ TQRect rect( x, y, size().width(), size().height() );
painter.save();
- painter.fillRect( rect, Qt::white );
- painter.setPen( QPen( Qt::red, 2 ) );
+ painter.fillRect( rect, TQt::white );
+ painter.setPen( TQPen( TQt::red, 2 ) );
painter.drawRect( rect );
painter.drawLine( x, y, x + size().width(), y + size().height() );
painter.drawLine( x, y + size().height(), x + size().width(), y );
painter.restore();
}
-const QSize Barkode::size() const
+const TQSize Barkode::size() const
{
- return m_engine ? m_engine->size() : QSize( 0, 0 );
+ return m_engine ? m_engine->size() : TQSize( 0, 0 );
}
-const QPixmap Barkode::pixmap( double scalex, double scaley )
+const TQPixmap Barkode::pixmap( double scalex, double scaley )
{
- QPixmap pixmap( (int)(size().width() * scalex), (int)(size().height() * scaley) );
+ TQPixmap pixmap( (int)(size().width() * scalex), (int)(size().height() * scaley) );
if( !pixmap.isNull() )
{
- QPainter painter( &pixmap );
+ TQPainter painter( &pixmap );
painter.scale( scalex, scaley );
painter.fillRect( 0, 0, size().width(), size().height(), m_background );
drawBarcode( painter );
@@ -241,27 +241,27 @@ const QPixmap Barkode::pixmap( double scalex, double scaley )
return pixmap;
}
-const QString Barkode::parsedValue()
+const TQString Barkode::parsedValue()
{
- QString text = m_token ? m_token->parse( m_value ) : m_value;
+ TQString text = m_token ? m_token->parse( m_value ) : m_value;
if( !sequenceEnabled() )
return text;
- if( m_value.contains( '#' ) <= 0 )
+ if( m_value.tqcontains( '#' ) <= 0 )
return text;
int pos = 0, counter = 1;
- pos = text.find("#", pos);
+ pos = text.tqfind("#", pos);
pos++;
while( text[pos] == '#' ) {
text.remove(pos, 1);
counter++;
}
- pos = text.find("#", 0);
- QString temp;
+ pos = text.tqfind("#", 0);
+ TQString temp;
if( sequenceMode() == NUM ) {
int v = sequenceStart() + m_index*sequenceStep();
@@ -277,11 +277,11 @@ const QString Barkode::parsedValue()
v -= z*('Z'-'A');
if( v <= 'Z' ) {
- temp[p] = QChar(v);
+ temp[p] = TQChar(v);
break;
} else if( v > 'Z' )
v = 'Z';
- temp[p] = QChar(v);
+ temp[p] = TQChar(v);
} else if( sequenceMode() == ALPHANUM ) {
qDebug("NOT IMPLEMENTED");
/* char array[36];
@@ -298,11 +298,11 @@ const QString Barkode::parsedValue()
}
}
- text.replace( pos, 1, temp);
+ text.tqreplace( pos, 1, temp);
return text;
}
-EEngine Barkode::engineForType( const QString & type )
+EEngine Barkode::engineForType( const TQString & type )
{
EEngine engine = NONE;
@@ -350,13 +350,13 @@ void Barkode::updateEngine()
}
}
-void Barkode::drawBarcode( QPainter & painter, int x, int y )
+void Barkode::drawBarcode( TQPainter & painter, int x, int y )
{
if( m_engine )
m_engine->drawBarcode( painter, x, y );
}
-void Barkode::update( const QPaintDevice* device )
+void Barkode::update( const TQPaintDevice* device )
{
if( m_engine )
m_engine->update( device );
@@ -371,17 +371,17 @@ bool Barkode::isValid() const
return m_valid;
}
-const QColor & Barkode::background() const
+const TQColor & Barkode::background() const
{
return m_background;
}
-const QColor & Barkode::foreground() const
+const TQColor & Barkode::foreground() const
{
return m_foreground;
}
-const QColor & Barkode::textColor() const
+const TQColor & Barkode::textColor() const
{
return m_textcolor;
}
@@ -401,12 +401,12 @@ const unsigned int Barkode::barHeight() const
return m_bar_height;
}
-const QString & Barkode::type() const
+const TQString & Barkode::type() const
{
return m_type;
}
-const QString & Barkode::value() const
+const TQString & Barkode::value() const
{
return m_value;
}
@@ -436,7 +436,7 @@ const int Barkode::sequenceStep() const
return m_sequence_step;
}
-const QString & Barkode::databaseMode() const
+const TQString & Barkode::databaseMode() const
{
return m_database_mode;
}
@@ -470,17 +470,17 @@ const int Barkode::datamatrixSize() const
// Set attributes //
////////////////////////////////////////////////////////////
-void Barkode::setBackground( const QColor & c )
+void Barkode::setBackground( const TQColor & c )
{
m_background = c;
}
-void Barkode::setForeground( const QColor & c )
+void Barkode::setForeground( const TQColor & c )
{
m_foreground = c;
}
-void Barkode::setTextColor( const QColor & c )
+void Barkode::setTextColor( const TQColor & c )
{
m_textcolor = c;
}
@@ -500,13 +500,13 @@ void Barkode::setBarHeight( unsigned int h )
m_bar_height = h;
}
-void Barkode::setType( const QString & type )
+void Barkode::setType( const TQString & type )
{
m_type = type.lower();
updateEngine();
}
-void Barkode::setValue( const QString & value )
+void Barkode::setValue( const TQString & value )
{
m_value = value;
}
@@ -536,7 +536,7 @@ void Barkode::setSequenceStep( int s )
m_sequence_step = s;
}
-void Barkode::setDatabaseMode( const QString & mode )
+void Barkode::setDatabaseMode( const TQString & mode )
{
m_database_mode = mode;
}
@@ -570,7 +570,7 @@ void Barkode::setDatamatrixSize( int s )
// Fill the s_info structure
////////////////////////////////////////////////////////////
-bool Barkode::hasFeature( const QString & type, unsigned int feature )
+bool Barkode::hasFeature( const TQString & type, unsigned int feature )
{
for( unsigned int i = 0; i < s_info.count(); i++ )
if( s_info[i].xml == type )
@@ -579,7 +579,7 @@ bool Barkode::hasFeature( const QString & type, unsigned int feature )
return false;
}
-int Barkode::internalType( const QString & type )
+int Barkode::internalType( const TQString & type )
{
for( unsigned int i = 0; i < s_info.count(); i++ )
if( s_info[i].xml == type )
@@ -588,11 +588,11 @@ int Barkode::internalType( const QString & type )
return false;
}
-const QStringList* Barkode::encodingTypes()
+const TQStringList* Barkode::encodingTypes()
{
if( !s_encoding )
{
- s_encoding = new QStringList;
+ s_encoding = new TQStringList;
for( unsigned int i = 0; i < s_info.count(); i++ )
s_encoding->append( s_info[i].name );
//s_encoding->sort();
@@ -601,7 +601,7 @@ const QStringList* Barkode::encodingTypes()
return s_encoding;
}
-const char* Barkode::typeFromName( const QString & name )
+const char* Barkode::typeFromName( const TQString & name )
{
for( unsigned int i = 0; i < s_info.count(); i++ )
if( s_info[i].name == name )
@@ -610,7 +610,7 @@ const char* Barkode::typeFromName( const QString & name )
return NULL;
}
-const char* Barkode::nameFromType( const QString & type )
+const char* Barkode::nameFromType( const TQString & type )
{
for( unsigned int i = 0; i < s_info.count(); i++ )
if( s_info[i].xml == type )
@@ -619,7 +619,7 @@ const char* Barkode::nameFromType( const QString & type )
return NULL;
}
-QString* Barkode::validatorFromType( const QString & type )
+TQString* Barkode::validatorFromType( const TQString & type )
{
for( unsigned int i = 0; i < s_info.count(); i++ )
if( s_info[i].xml == type )
@@ -628,7 +628,7 @@ QString* Barkode::validatorFromType( const QString & type )
return NULL;
}
-QString* Barkode::validatorNotFromType( const QString & type )
+TQString* Barkode::validatorNotFromType( const TQString & type )
{
for( unsigned int i = 0; i < s_info.count(); i++ )
if( s_info[i].xml == type )
@@ -637,11 +637,11 @@ QString* Barkode::validatorNotFromType( const QString & type )
return NULL;
}
-tBarcodeInfo Barkode::createInfo( const char* xml, const QString & name, const EEngine engine,
+tBarcodeInfo Barkode::createInfo( const char* xml, const TQString & name, const EEngine engine,
const unsigned int features, const int internal )
{
tBarcodeInfo info;
- QString strengine;
+ TQString strengine;
switch( engine )
{
@@ -900,20 +900,20 @@ void Barkode::initInfo()
void Barkode::initValidators()
{
- QString path;
+ TQString path;
const char* rules = "/usr/share/libpostscriptbarcode/rules.xml";
- if( QFile::exists( rules ) )
+ if( TQFile::exists( rules ) )
path = rules;
else
path = locate( "data", "kbarcode/rules.xml" );
- QFile xml( path );
- QDomDocument doc;
- QDomElement root;
- QDomNode n;
- QString id;
- QString* regular;
- QString* regularNot;
+ TQFile xml( path );
+ TQDomDocument doc;
+ TQDomElement root;
+ TQDomNode n;
+ TQString id;
+ TQString* regular;
+ TQString* regularNot;
if( !xml.open( IO_ReadOnly ) )
{
@@ -927,7 +927,7 @@ void Barkode::initValidators()
while( !n.isNull() )
{
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
if( !e.isNull() && e.tagName() == "encoder" )
{
id = e.attribute( "id" );
@@ -935,11 +935,11 @@ void Barkode::initValidators()
regular = Barkode::validatorFromType( id );
regularNot = Barkode::validatorNotFromType( id );
- QDomNode child = e.firstChild();
+ TQDomNode child = e.firstChild();
while( !child.isNull() )
{
- QDomElement e = child.toElement();
- QString pattern = QString::null;
+ TQDomElement e = child.toElement();
+ TQString pattern = TQString();
if( child.firstChild().isCDATASection() )
{
@@ -949,7 +949,7 @@ void Barkode::initValidators()
if( !e.isNull() && e.tagName() == "pattern" )
{
- QString sense = e.attribute( "sense", "true" );
+ TQString sense = e.attribute( "sense", "true" );
if( sense == "true" )
*regular = pattern;
else
diff --git a/kbarcode/barkode.h b/kbarcode/barkode.h
index 4d7004b..57d21d5 100644
--- a/kbarcode/barkode.h
+++ b/kbarcode/barkode.h
@@ -21,8 +21,8 @@
#define BARKODE_H
-#include <qcolor.h>
-#include <qstring.h>
+#include <tqcolor.h>
+#include <tqstring.h>
#include "barkodeengine.h"
@@ -59,10 +59,10 @@ typedef struct tBarcodeInfo
/** the name which is stored for identification in the xml file
* and used as commandline parameter for external tools
*/
- QString xml;
+ TQString xml;
/** the user visible name of this typedef
*/
- QString name;
+ TQString name;
/** the barcode engine to use
*/
EEngine engine;
@@ -77,17 +77,17 @@ typedef struct tBarcodeInfo
/** A regular expression that validates
* a value for this barcode.
*/
- QString validator;
- QString validatorNot;
+ TQString validator;
+ TQString validatorNot;
};
-typedef QValueList<tBarcodeInfo> TBarcodeInfoList;
+typedef TQValueList<tBarcodeInfo> TBarcodeInfoList;
class BarkodeEngine;
-class QPainter;
-class QPicture;
-class QSize;
-class QPaintDevice;
+class TQPainter;
+class TQPicture;
+class TQSize;
+class TQPaintDevice;
class TokenProvider;
class Barkode {
@@ -107,31 +107,31 @@ class Barkode {
/** call this method after you changed a property
* to update the internal structures
*/
- void update( const QPaintDevice* device );
+ void update( const TQPaintDevice* device );
/** get the barcode value after all sequences and datafields have
* been parsed
*/
- const QString parsedValue();
+ const TQString parsedValue();
- const QPixmap pixmap( double scalex = 1.0, double scaley = 1.0 );
- const QPicture picture();
- const QSize size() const;
+ const TQPixmap pixmap( double scalex = 1.0, double scaley = 1.0 );
+ const TQPicture picture();
+ const TQSize size() const;
bool isValid() const;
- const QColor & background() const;
- const QColor & foreground() const;
- const QColor & textColor() const;
+ const TQColor & background() const;
+ const TQColor & foreground() const;
+ const TQColor & textColor() const;
const unsigned int fontsize() const;
const unsigned int quietZone() const;
const unsigned int barHeight() const;
- const QString & type() const;
- const QString & value() const;
+ const TQString & type() const;
+ const TQString & value() const;
const bool sequenceEnabled() const;
const ESequence sequenceMode() const;
const int sequenceStart() const;
const int sequenceStep() const;
- const QString & databaseMode() const;
+ const TQString & databaseMode() const;
const bool textVisible() const;
const int rotation() const;
const double scaling() const;
@@ -139,14 +139,14 @@ class Barkode {
const double cut() const;
const int datamatrixSize() const;
- void setBackground( const QColor & c );
- void setForeground( const QColor & c );
- void setTextColor( const QColor & c );
+ void setBackground( const TQColor & c );
+ void setForeground( const TQColor & c );
+ void setTextColor( const TQColor & c );
void setFontsize ( unsigned int f );
void setQuietZone( unsigned int q );
void setBarHeight( unsigned int h );
- void setType( const QString & type );
- void setValue( const QString & value );
+ void setType( const TQString & type );
+ void setValue( const TQString & value );
void setTextVisible( const bool b );
/** Set the index of the barcodes for barcode sequences.
*/
@@ -155,7 +155,7 @@ class Barkode {
void setSequenceMode( ESequence e );
void setSequenceStart( int s );
void setSequenceStep( int s );
- void setDatabaseMode( const QString & mode );
+ void setDatabaseMode( const TQString & mode );
void setRotation( const int r );
void setScaling( const double d );
void setCut( const double c );
@@ -172,35 +172,35 @@ class Barkode {
inline const BarkodeEngine* engine() const;
/** Test if the encodingType @p type has a certain
- * @p feature, as defined in the codes QValueList.
+ * @p feature, as defined in the codes TQValueList.
*/
- static bool hasFeature( const QString & type, unsigned int feature );
+ static bool hasFeature( const TQString & type, unsigned int feature );
/** Returns the internal value for the encoding type @p typedef
*/
- static int internalType( const QString & type );
+ static int internalType( const TQString & type );
/** Returns all supported encoding types
* ready for displaying them to the user
*/
- static const QStringList* encodingTypes();
+ static const TQStringList* encodingTypes();
/** Convert the uservisible encoding type @p name
* to the internal identifier
*/
- static const char* typeFromName( const QString & name );
+ static const char* typeFromName( const TQString & name );
/** Convert the internal identifier @p type
* to the user visible encoding name
*/
- static const char* nameFromType( const QString & type );
+ static const char* nameFromType( const TQString & type );
- static QString* validatorFromType( const QString & type );
- static QString* validatorNotFromType( const QString & type );
+ static TQString* validatorFromType( const TQString & type );
+ static TQString* validatorNotFromType( const TQString & type );
/** return the barcode generation engine for type @p typedef
*/
- static EEngine engineForType( const QString & type );
- /** Draw an invalid barcode sign to QPainter @p painter
+ static EEngine engineForType( const TQString & type );
+ /** Draw an invalid barcode sign to TQPainter @p painter
*/
- void drawInvalid( QPainter & painter, int x = 0, int y = 0 );
+ void drawInvalid( TQPainter & painter, int x = 0, int y = 0 );
/** returns wether barcode functionallity
* is available
@@ -230,11 +230,11 @@ class Barkode {
return s_havePurePostscript;
}
- static tBarcodeInfo createInfo( const char* xml, const QString & name, const EEngine engine,
+ static tBarcodeInfo createInfo( const char* xml, const TQString & name, const EEngine engine,
const unsigned int features = 0, const int internal = 0 );
protected:
- void drawBarcode( QPainter & painter, int x = 0, int y = 0 );
+ void drawBarcode( TQPainter & painter, int x = 0, int y = 0 );
private:
static void initInfo();
@@ -253,9 +253,9 @@ class Barkode {
int m_sequence_step;
bool m_text_visible;
- QColor m_background;
- QColor m_foreground;
- QColor m_textcolor;
+ TQColor m_background;
+ TQColor m_foreground;
+ TQColor m_textcolor;
unsigned int m_quietzone;
unsigned int m_bar_height;
@@ -268,12 +268,12 @@ class Barkode {
double m_cut; // temporarly used for the pixmap engines
// won't be needed for the Barkode engine
- QString m_type;
- QString m_value;
- QString m_database_mode;
+ TQString m_type;
+ TQString m_value;
+ TQString m_database_mode;
static TBarcodeInfoList s_info;
- static QStringList* s_encoding;
+ static TQStringList* s_encoding;
static bool s_haveGnuBarcode;
static bool s_haveTBarcode;
diff --git a/kbarcode/barkodeengine.cpp b/kbarcode/barkodeengine.cpp
index f05440e..986cdc3 100644
--- a/kbarcode/barkodeengine.cpp
+++ b/kbarcode/barkodeengine.cpp
@@ -38,17 +38,17 @@ EmptyEngine::EmptyEngine()
{
}
-void EmptyEngine::update( const QPaintDevice* )
+void EmptyEngine::update( const TQPaintDevice* )
{
// Do nothing
}
-const QSize EmptyEngine::size() const
+const TQSize EmptyEngine::size() const
{
- return QSize( 150, 80 );
+ return TQSize( 150, 80 );
}
-void EmptyEngine::drawBarcode( QPainter & painter, int x, int y )
+void EmptyEngine::drawBarcode( TQPainter & painter, int x, int y )
{
barkode->drawInvalid( painter, x, y );
}
diff --git a/kbarcode/barkodeengine.h b/kbarcode/barkodeengine.h
index 037667c..0975baf 100644
--- a/kbarcode/barkodeengine.h
+++ b/kbarcode/barkodeengine.h
@@ -24,8 +24,8 @@
typedef enum { GNU_BARCODE, PDF417, TBARCODE, TBARCODE2, PIXMAP, PURE_POSTSCRIPT, NONE } EEngine;
class Barkode;
-class QDomElement;
-class QPainter;
+class TQDomElement;
+class TQPainter;
/** An interface for additional special options
* supported by a BarkodeEngine
@@ -37,11 +37,11 @@ class BarkodeEngineOptions {
virtual void defaults() = 0;
- virtual void load( const QDomElement* tag ) = 0;
- virtual void save( QDomElement* tag ) = 0;
+ virtual void load( const TQDomElement* tag ) = 0;
+ virtual void save( TQDomElement* tag ) = 0;
};
-#include <qsize.h>
+#include <tqsize.h>
/**
* Inherit from this class if you want to create a
@@ -56,11 +56,11 @@ class BarkodeEngine{
virtual const BarkodeEngine & operator=( const BarkodeEngine & rhs ) = 0;
virtual EEngine engine() const = 0;
- virtual void update( const QPaintDevice* device ) = 0;
- virtual const QSize size() const = 0;
+ virtual void update( const TQPaintDevice* device ) = 0;
+ virtual const TQSize size() const = 0;
void setBarkode( Barkode* b ) { barkode = b; }
- virtual void drawBarcode( QPainter & painter, int x, int y ) = 0;
+ virtual void drawBarcode( TQPainter & painter, int x, int y ) = 0;
/** @returns a pointer to a BarkodeEngineOptions object
* if this BarkodeEngine has one. Otherwise null is returned.
@@ -71,7 +71,7 @@ class BarkodeEngine{
protected:
Barkode* barkode;
- QSize m_size;
+ TQSize m_size;
bool m_valid;
};
@@ -85,9 +85,9 @@ class EmptyEngine : public BarkodeEngine {
virtual inline const BarkodeEngine & operator=( const BarkodeEngine & rhs );
virtual inline EEngine engine() const;
- virtual void update( const QPaintDevice* device );
- virtual const QSize size() const;
- virtual void drawBarcode( QPainter & painter, int x, int y );
+ virtual void update( const TQPaintDevice* device );
+ virtual const TQSize size() const;
+ virtual void drawBarcode( TQPainter & painter, int x, int y );
};
const BarkodeEngine & EmptyEngine::operator=( const BarkodeEngine & )
diff --git a/kbarcode/batchiface.h b/kbarcode/batchiface.h
index 6eb6586..2f6f201 100644
--- a/kbarcode/batchiface.h
+++ b/kbarcode/batchiface.h
@@ -19,7 +19,7 @@
#define BATCHIFACE_H
#include <dcopobject.h>
-#include <qstringlist.h>
+#include <tqstringlist.h>
#include "batchprinter.h"
class BatchIface : virtual public DCOPObject
@@ -28,18 +28,18 @@ class BatchIface : virtual public DCOPObject
public:
k_dcop:
- virtual void setFilename( const QString & url ) = 0;
- virtual void setImportCsvFile( const QString & filename ) = 0;
- virtual void setImportSqlQuery( const QString & query ) = 0;
+ virtual void setFilename( const TQString & url ) = 0;
+ virtual void setImportCsvFile( const TQString & filename ) = 0;
+ virtual void setImportSqlQuery( const TQString & query ) = 0;
virtual void setNumLabels( const int n ) = 0;
virtual void setOutputFormat( const int e ) = 0;
- virtual void setSerialNumber( const QString & val, int inc ) = 0;
+ virtual void setSerialNumber( const TQString & val, int inc ) = 0;
- virtual bool addItem( const QString & article, const QString & group, int count = 1, bool msg = true ) = 0;
- virtual bool existsArticle( const QString & article ) = 0;
- virtual void loadFromFile( const QString & url ) = 0;
+ virtual bool addItem( const TQString & article, const TQString & group, int count = 1, bool msg = true ) = 0;
+ virtual bool existsArticle( const TQString & article ) = 0;
+ virtual void loadFromFile( const TQString & url ) = 0;
virtual void loadFromClipboard() = 0;
- virtual void printNow( const QString & printer, bool bUserInteraction = true ) = 0;
+ virtual void printNow( const TQString & printer, bool bUserInteraction = true ) = 0;
};
#endif /* BATCHIFACE_H */
diff --git a/kbarcode/batchprinter.cpp b/kbarcode/batchprinter.cpp
index 9ca66c3..8ef28cb 100644
--- a/kbarcode/batchprinter.cpp
+++ b/kbarcode/batchprinter.cpp
@@ -23,11 +23,11 @@
#include "zplutils.h"
#include "tec.h"
-// Qt includes
-#include <qfile.h>
-#include <qpainter.h>
-#include <qpaintdevicemetrics.h>
-#include <qprogressdialog.h>
+// TQt includes
+#include <tqfile.h>
+#include <tqpainter.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqprogressdialog.h>
// KDE includes
#include <kabc/addressee.h>
@@ -46,8 +46,8 @@
#include <krun.h>
#define MAXDATASIZE 32550
-BatchPrinter::BatchPrinter( KPrinter* p, QWidget* _parent )
- : printer( p ), parent( _parent )
+BatchPrinter::BatchPrinter( KPrinter* p, TQWidget* _parent )
+ : printer( p ), tqparent( _parent )
{
m_events = true;
m_data = NULL;
@@ -59,8 +59,8 @@ BatchPrinter::BatchPrinter( KPrinter* p, QWidget* _parent )
m_paintDevice = p;
}
-BatchPrinter::BatchPrinter( const QString & path, QWidget* p )
- : m_path( path ), parent( p )
+BatchPrinter::BatchPrinter( const TQString & path, TQWidget* p )
+ : m_path( path ), tqparent( p )
{
m_data = NULL;
m_vardata = NULL;
@@ -70,11 +70,11 @@ BatchPrinter::BatchPrinter( const QString & path, QWidget* p )
m_cur_data_count = 0;
- m_paintDevice = p;
+ m_paintDevice = TQT_TQPAINTDEVICE(p);
}
-BatchPrinter::BatchPrinter( const QString & path, int format, QWidget* _parent )
- : m_path( path ), m_bcp_format( format ), parent( _parent )
+BatchPrinter::BatchPrinter( const TQString & path, int format, TQWidget* _parent )
+ : m_path( path ), m_bcp_format( format ), tqparent( _parent )
{
m_data = NULL;
m_vardata = NULL;
@@ -84,7 +84,7 @@ BatchPrinter::BatchPrinter( const QString & path, int format, QWidget* _parent )
m_cur_data_count = 0;
- m_paintDevice = _parent;
+ m_paintDevice = TQT_TQPAINTDEVICE(_parent);
}
BatchPrinter::~BatchPrinter()
@@ -96,10 +96,10 @@ BatchPrinter::~BatchPrinter()
void BatchPrinter::start()
{
- painter = new QPainter( printer );
+ painter = new TQPainter( printer );
m_cur_data_count = 0;
- QPaintDeviceMetrics pdm( painter->device() );
+ TQPaintDeviceMetrics pdm( painter->device() );
pageh = pdm.height(); // in pixel
@@ -108,7 +108,7 @@ void BatchPrinter::start()
c_h = 0;
c_w = 0;
- QProgressDialog* progress = createProgressDialog( i18n("Printing...") );
+ TQProgressDialog* progress = createProgressDialog( i18n("Printing...") );
m_measure = def->getMeasurements();
@@ -123,7 +123,7 @@ void BatchPrinter::start()
delete painter;
}
-void BatchPrinter::startPrintData( QProgressDialog* progress )
+void BatchPrinter::startPrintData( TQProgressDialog* progress )
{
labelprinterdata* lpdata = PrinterSettings::getInstance()->getData();
@@ -133,7 +133,7 @@ void BatchPrinter::startPrintData( QProgressDialog* progress )
for( unsigned int i = 0; i < m_data->count(); i++ )
{
- Label l( def, buffer, m_name, printer, m_customer,
+ Label l( def, TQT_TQIODEVICE(buffer), m_name, printer, m_customer,
(*m_data)[i].article_no, (*m_data)[i].group );
l.setSerial( m_serial, m_increment );
@@ -194,7 +194,7 @@ void BatchPrinter::startPrintData( QProgressDialog* progress )
}
}
-void BatchPrinter::startPrintVarData( QProgressDialog* progress )
+void BatchPrinter::startPrintVarData( TQProgressDialog* progress )
{
Label* l;
while( ( l = initLabel() ) != NULL )
@@ -245,19 +245,19 @@ Label* BatchPrinter::initLabel( int* number )
if( m_vardata )
{
- l = new Label( def, buffer, m_name, m_paintDevice );
+ l = new Label( def, TQT_TQIODEVICE(buffer), m_name, m_paintDevice );
l->setUserVars( (*m_vardata)[m_cur_data_count] );
}
else if( m_data )
{
- l = new Label( def, buffer, m_name, m_paintDevice, m_customer,
+ l = new Label( def, TQT_TQIODEVICE(buffer), m_name, m_paintDevice, m_customer,
(*m_data)[m_cur_data_count].article_no, (*m_data)[m_cur_data_count].group );
if( number )
*number = (*m_data)[m_cur_data_count].number;
}
else if( m_addrdata )
{
- l = new Label( def, buffer, m_name, m_paintDevice );
+ l = new Label( def, TQT_TQIODEVICE(buffer), m_name, m_paintDevice );
l->setAddressee( &((*m_addrdata)[m_cur_data_count]) );
}
@@ -270,20 +270,20 @@ Label* BatchPrinter::initLabel( int* number )
void BatchPrinter::startImages()
{
- QProgressDialog* progress = createProgressDialog( i18n("Creating Images...") );
+ TQProgressDialog* progress = createProgressDialog( i18n("Creating Images...") );
int number = 0;
m_cur_data_count = 0;
Measurements measure = def->getMeasurements();
Label* l = NULL;
- painter = new QPainter();
- QPixmap pixmap( (int)measure.width( parent ), (int)measure.height( parent ) );
+ painter = new TQPainter();
+ TQPixmap pixmap( (int)measure.width( TQT_TQPAINTDEVICE(tqparent) ), (int)measure.height( TQT_TQPAINTDEVICE(tqparent) ) );
while( (l = initLabel( &number ) ) != NULL )
{
for( int i = 0; i < number; i++ )
{
- pixmap.fill( Qt::white );
+ pixmap.fill( TQt::white );
painter->begin( &pixmap );
l->setIndex( i );
l->setRow( 0 );
@@ -292,19 +292,19 @@ void BatchPrinter::startImages()
painter->end();
- QString name = m_path + "/";
+ TQString name = m_path + "/";
if( m_image_filename == E_ARTICLE )
- name += m_data ? (*m_data)[m_cur_data_count].article_no : QString::number( m_cur_data_count );
+ name += m_data ? (*m_data)[m_cur_data_count].article_no : TQString::number( m_cur_data_count );
else if( m_image_filename == E_BARCODE )
name += l->barcodeNo();
else
name += m_image_custom_filename;
- QString filename = name + QString("_%1.").arg( i ) + KImageIO::suffix( m_image_format );
+ TQString filename = name + TQString("_%1.").tqarg( i ) + KImageIO::suffix( m_image_format );
unsigned int c = 0;
- while( QFile::exists( filename ) ) {
- filename += "." + QString::number( c );
+ while( TQFile::exists( filename ) ) {
+ filename += "." + TQString::number( c );
c++;
}
@@ -331,14 +331,14 @@ void BatchPrinter::startImages()
void BatchPrinter::startBCP()
{
int number = 0;
- QFile file( m_path );
+ TQFile file( m_path );
if( !file.open( IO_WriteOnly ) ) // | IO_Raw ) )
{
- KMessageBox::error( parent, QString( i18n("<qt>Can't open the file or device <b>%1</b></qt>.") ).arg( m_path ) );
+ KMessageBox::error( tqparent, TQString( i18n("<qt>Can't open the file or device <b>%1</b></qt>.") ).tqarg( m_path ) );
return;
}
- QProgressDialog* progress = createProgressDialog( i18n("Printing...") );
+ TQProgressDialog* progress = createProgressDialog( i18n("Printing...") );
if( m_bcp_format == PrinterSettings::ZEBRA )
// Zebra printers are printed at 304dpi, this should
@@ -349,13 +349,13 @@ void BatchPrinter::startBCP()
else if( m_bcp_format == PrinterSettings::TEC )
// don't know which resolution is used for tec printers
// so we use a factor to convert everything to mm
- // this is not accurate as QPaintDevice supports only integers
+ // this is not accurate as TQPaintDevice supports only integers
m_paintDevice = new BarcodePrinterDevice( 25.4000508001016, 25.4000508001016 );
else if( m_bcp_format == PrinterSettings::EPCL )
m_paintDevice = new BarcodePrinterDevice( 304.0, 304.0 );
- QTextStream stream( &file );
+ TQTextStream stream( &file );
Label* l;
while( ( l = initLabel( &number ) ) != NULL )
{
@@ -422,10 +422,10 @@ void BatchPrinter::checkForNewPage( Label* label )
void BatchPrinter::drawBorders()
{
if( PrinterSettings::getInstance()->getData()->border ) {
- painter->setPen( QPen( Qt::black, 1 ) );
+ painter->setPen( TQPen( TQt::black, 1 ) );
painter->drawRect( (int)curw, (int)curh,
- (int)m_measure.width( painter->device() ),
- (int)m_measure.height( painter->device() ) );
+ (int)m_measure.width( TQT_TQPAINTDEVICE(painter->device()) ),
+ (int)m_measure.height( TQT_TQPAINTDEVICE(painter->device()) ) );
}
}
@@ -439,7 +439,7 @@ void BatchPrinter::changeLine()
}
}
-void BatchPrinter::proccessEvents( int lb, QString value, Label* label )
+void BatchPrinter::proccessEvents( int lb, TQString value, Label* label )
{
if( lb == NEW_PAGE ) {
if( curh > m_measure.gapTop( printer ) || curw > m_measure.gapLeft( printer ) ) {
@@ -460,10 +460,10 @@ void BatchPrinter::proccessEvents( int lb, QString value, Label* label )
if( lb == LABEL_X )
- printXLabel( lb, label, QString::null );
+ printXLabel( lb, label, TQString() );
}
-void BatchPrinter::printXLabel( int lb, Label* label, const QString & value )
+void BatchPrinter::printXLabel( int lb, Label* label, const TQString & value )
{
changeLine();
checkForNewPage( label );
@@ -500,15 +500,15 @@ void BatchPrinter::moveLabels()
}
}
-QProgressDialog* BatchPrinter::createProgressDialog( const QString & caption )
+TQProgressDialog* BatchPrinter::createProgressDialog( const TQString & caption )
{
- QProgressDialog* progress = new QProgressDialog( caption, i18n("&Cancel"), m_labels+1, parent );
+ TQProgressDialog* progress = new TQProgressDialog( caption, i18n("&Cancel"), m_labels+1, tqparent );
progress->setProgress( 0 );
progress->show();
return progress;
}
-bool BatchPrinter::checkProgressDialog( QProgressDialog* progress )
+bool BatchPrinter::checkProgressDialog( TQProgressDialog* progress )
{
kapp->processEvents( 0 );
progress->setProgress( progress->progress() + 1 );
@@ -519,7 +519,7 @@ bool BatchPrinter::checkProgressDialog( QProgressDialog* progress )
return true;
}
-void BatchPrinter::setData( QValueList<data>* list )
+void BatchPrinter::setData( TQValueList<data>* list )
{
if( m_data )
delete m_data;
diff --git a/kbarcode/batchprinter.h b/kbarcode/batchprinter.h
index c189183..ed06a9e 100644
--- a/kbarcode/batchprinter.h
+++ b/kbarcode/batchprinter.h
@@ -20,8 +20,8 @@
#include "measurements.h"
-#include <qmap.h>
-#include <qvaluelist.h>
+#include <tqmap.h>
+#include <tqvaluelist.h>
namespace KABC {
class AddresseeList;
@@ -31,13 +31,13 @@ class Definition;
class Label;
class KPrinter;
class Measurements;
-class QBuffer;
-class QPainter;
-class QProgressDialog;
-class QWidget;
-class QPaintDevice;
+class TQBuffer;
+class TQPainter;
+class TQProgressDialog;
+class TQWidget;
+class TQPaintDevice;
-typedef QValueList< QMap<QString,QString> > TVariableList;
+typedef TQValueList< TQMap<TQString,TQString> > TVariableList;
/**
This class is responsible for batch printing of articles.
It is also responsible for creating images of all articles.
@@ -51,29 +51,29 @@ class BatchPrinter
struct data {
int number;
- QString article_no;
- QString group;
+ TQString article_no;
+ TQString group;
};
/** Use this constructor if you want to print to
* a printer.
*/
- BatchPrinter( KPrinter* p, QWidget* _parent );
+ BatchPrinter( KPrinter* p, TQWidget* _parent );
/** This constructor is used in image gernaration mode.
* @p path is the path to an existing directory where
* the images are saved.
*/
- BatchPrinter( const QString & path, QWidget* p );
+ BatchPrinter( const TQString & path, TQWidget* p );
/** Use this constructor to print to a barcode printer @p path
* with format @p format
*/
- BatchPrinter( const QString & path, int format, QWidget* _parent );
+ BatchPrinter( const TQString & path, int format, TQWidget* _parent );
~BatchPrinter();
- inline void setBuffer( QBuffer* b ) { buffer = b; }
- void setCustomer( const QString & s ) { m_customer = s; }
+ inline void setBuffer( TQBuffer* b ) { buffer = b; }
+ void setCustomer( const TQString & s ) { m_customer = s; }
/** Specify the label on which is printed first on the page.
* The first label on the page (top/left) has the index 1,
@@ -86,7 +86,7 @@ class BatchPrinter
/** set the sql data for the batchprinter
* @p list will be deleted by the batchprinter
*/
- void setData( QValueList<data>* list );
+ void setData( TQValueList<data>* list );
/** set the variable data for the batchprinter
* @p list will be deleted by the batchprinter
@@ -99,10 +99,10 @@ class BatchPrinter
void setData( KABC::AddresseeList* list );
inline void setImageFilename( const EImageFileName e ) { m_image_filename = e; }
- inline void setImageCustomFilename( const QString & name ) { m_image_custom_filename = name; };
- inline void setImageFormat( const QString & f ) { m_image_format = f; }
- inline void setSerial( const QString & s, unsigned int inc ) { m_serial = s; m_increment = inc; }
- inline void setName( const QString & s ) { m_name = s; }
+ inline void setImageCustomFilename( const TQString & name ) { m_image_custom_filename = name; };
+ inline void setImageFormat( const TQString & f ) { m_image_format = f; }
+ inline void setSerial( const TQString & s, unsigned int inc ) { m_serial = s; m_increment = inc; }
+ inline void setName( const TQString & s ) { m_name = s; }
inline void setDefinition( Definition* d ) { def = d; }
inline void setLabels( int l ) { m_labels = l; }
inline void setEvents( bool b ) { m_events = b; }
@@ -126,7 +126,7 @@ class BatchPrinter
* current label does not fit anymore on the current pageh
*/
void checkForNewPage( Label* label );
- /** draw a border around the current label using QPainter @p painter
+ /** draw a border around the current label using TQPainter @p painter
*/
void drawBorders();
/** start a "new line" on the printer,
@@ -134,38 +134,38 @@ class BatchPrinter
* on the page.
*/
void changeLine();
- void proccessEvents( int lb, QString value = QString::null, Label* label = 0 );
- void printXLabel( int lb, Label* label, const QString & value );
+ void proccessEvents( int lb, TQString value = TQString(), Label* label = 0 );
+ void printXLabel( int lb, Label* label, const TQString & value );
void moveLabels();
/** print the labels using data from the m_data structure
*/
- void startPrintData( QProgressDialog* progress );
+ void startPrintData( TQProgressDialog* progress );
/** print the labels using data from the m_vardata or m_addrdata structure
*/
- void startPrintVarData( QProgressDialog* progress );
+ void startPrintVarData( TQProgressDialog* progress );
/** Create and return a progressdialog
*/
- QProgressDialog* createProgressDialog( const QString & caption );
- bool checkProgressDialog( QProgressDialog* progress );
+ TQProgressDialog* createProgressDialog( const TQString & caption );
+ bool checkProgressDialog( TQProgressDialog* progress );
Definition* def;
Measurements m_measure;
- QValueList<data>* m_data;
+ TQValueList<data>* m_data;
TVariableList* m_vardata;
KABC::AddresseeList* m_addrdata;
- QString m_serial;
- QString m_name;
- QString m_customer;
+ TQString m_serial;
+ TQString m_name;
+ TQString m_customer;
/** Path for image output
* or device for bcp output
*/
- QString m_path;
+ TQString m_path;
/** defines the image format to be used
*/
- QString m_image_format;
+ TQString m_image_format;
unsigned int m_cur_data_count;
@@ -179,7 +179,7 @@ class BatchPrinter
/** prefix for custom filenames if m_image_filename = E_CUSTOM
*/
- QString m_image_custom_filename;
+ TQString m_image_custom_filename;
/** enable/disable events
*/
@@ -199,14 +199,14 @@ class BatchPrinter
int c_h;
int c_w;
- QPaintDevice* m_paintDevice;
+ TQPaintDevice* m_paintDevice;
- QBuffer* buffer;
+ TQBuffer* buffer;
KPrinter* printer;
- QPainter* painter;
- /** parent for dialogs
+ TQPainter* painter;
+ /** tqparent for dialogs
*/
- QWidget* parent;
+ TQWidget* tqparent;
};
#endif
diff --git a/kbarcode/batchwizard.cpp b/kbarcode/batchwizard.cpp
index defcca8..7ae3b04 100644
--- a/kbarcode/batchwizard.cpp
+++ b/kbarcode/batchwizard.cpp
@@ -29,19 +29,19 @@
#include "tokenprovider.h"
#include "xmlutils.h"
-#include <qbuffer.h>
-#include <qcheckbox.h>
-#include <qclipboard.h>
-#include <qcursor.h>
-#include <qdom.h>
-#include <qheader.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qradiobutton.h>
-#include <qsqlselectcursor.h>
-#include <qtooltip.h>
-#include <qvbuttongroup.h>
-#include <qwidgetstack.h>
+#include <tqbuffer.h>
+#include <tqcheckbox.h>
+#include <tqclipboard.h>
+#include <tqcursor.h>
+#include <tqdom.h>
+#include <tqheader.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqradiobutton.h>
+#include <tqsqlselectcursor.h>
+#include <tqtooltip.h>
+#include <tqvbuttongroup.h>
+#include <tqwidgetstack.h>
#include <kabc/addressee.h>
#include <kabc/addresseelist.h>
@@ -61,15 +61,15 @@
#include <kpopupmenu.h>
#include <kpushbutton.h>
#include <kurlrequester.h>
-#include <qtable.h>
-#include <qvbox.h>
+#include <tqtable.h>
+#include <tqvbox.h>
#define PNG_FORMAT "PNG"
class AddressListViewItem : public KListViewItem {
public:
- AddressListViewItem(QListView *parent, KABC::Addressee & addr )
- : KListViewItem( parent ), m_address( addr )
+ AddressListViewItem(TQListView *tqparent, KABC::Addressee & addr )
+ : KListViewItem( tqparent ), m_address( addr )
{
this->setText( 0, m_address.givenName() );
this->setText( 1, m_address.familyName() );
@@ -85,9 +85,9 @@ private:
};
-BatchWizard::BatchWizard( QWidget* parent, const char* name )
+BatchWizard::BatchWizard( TQWidget* tqparent, const char* name )
: DCOPObject("BatchPrinting"),
- KWizard( parent, name )
+ KWizard( tqparent, name )
{
setupPage1();
setupPage2();
@@ -111,10 +111,10 @@ BatchWizard::~BatchWizard()
void BatchWizard::setupPage1()
{
- page1 = new QWidget( this, "page1" );
- QVBoxLayout* pageLayout = new QVBoxLayout( page1, 11, 6, "pageLayout");
+ page1 = new TQWidget( this, "page1" );
+ TQVBoxLayout* pageLayout = new TQVBoxLayout( page1, 11, 6, "pageLayout");
- QLabel* label = new QLabel( i18n("<qt>This wizard will guide you through the process "
+ TQLabel* label = new TQLabel( i18n("<qt>This wizard will guide you through the process "
"of printing many labels with KBarcode.<br>The first step "
"is to select the KBarcode label file you want to print.</qt>"), page1 );
pageLayout->addWidget( label );
@@ -123,10 +123,10 @@ void BatchWizard::setupPage1()
m_url->setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly );
m_url->setFilter( "*.kbarcode" );
- label = new QLabel( i18n("&Filename:"), page1 );
+ label = new TQLabel( i18n("&Filename:"), page1 );
label->setBuddy( m_url );
- QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding );
+ TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Expanding );
pageLayout->addWidget( label );
pageLayout->addWidget( m_url );
@@ -134,37 +134,37 @@ void BatchWizard::setupPage1()
addPage( page1, i18n("File Selection") );
- connect( m_url, SIGNAL( textChanged( const QString & ) ), this, SLOT( enableControls() ) );
+ connect( m_url, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( enableControls() ) );
}
void BatchWizard::setupPage2()
{
- page2 = new QWidget( this, "page2" );
- QVBoxLayout* pageLayout = new QVBoxLayout( page2, 11, 6, "pageLayout");
+ page2 = new TQWidget( this, "page2" );
+ TQVBoxLayout* pageLayout = new TQVBoxLayout( page2, 11, 6, "pageLayout");
- QVButtonGroup* group = new QVButtonGroup( page2 );
+ TQVButtonGroup* group = new TQVButtonGroup( page2 );
- radioSimple = new QRadioButton( i18n("Print &labels without data"), group );
- radioSqlArticles = new QRadioButton( i18n("Print &articles from KBarcodes SQL database"), group );
- radioVarImport = new QRadioButton( i18n("Import &variables and print"), group );
- radioAddressBook = new QRadioButton( i18n("Print &contacts from your addressbook"), group );
+ radioSimple = new TQRadioButton( i18n("Print &labels without data"), group );
+ radioSqlArticles = new TQRadioButton( i18n("Print &articles from KBarcodes SQL database"), group );
+ radioVarImport = new TQRadioButton( i18n("Import &variables and print"), group );
+ radioAddressBook = new TQRadioButton( i18n("Print &contacts from your addressbook"), group );
radioSimple->setChecked( true );
- QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding );
+ TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Expanding );
pageLayout->addWidget( group );
pageLayout->addItem( spacer );
- connect( radioSimple, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioSqlArticles, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioVarImport, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioAddressBook, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
+ connect( radioSimple, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioSqlArticles, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioVarImport, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioAddressBook, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
addPage( page2, i18n("Data Source") );
}
void BatchWizard::setupPage3()
{
- page3 = new QWidgetStack( this, "page3" );
+ page3 = new TQWidgetStack( this, "page3" );
setupStackPage1();
setupStackPage2();
@@ -176,10 +176,10 @@ void BatchWizard::setupPage3()
void BatchWizard::setupPage4()
{
- page4 = new QVBox( this, "page4" );
+ page4 = new TQVBox( this, "page4" );
page4->setSpacing( 5 );
- QHBox* hbox = new QHBox( page4 );
+ TQHBox* hbox = new TQHBox( page4 );
hbox->setSpacing( 5 );
buttonTableInsert = new KPushButton( i18n("Insert Row"), hbox );
@@ -187,33 +187,33 @@ void BatchWizard::setupPage4()
buttonTableRemove = new KPushButton( i18n("Delete Row"), hbox );
buttonTableRemove->setIconSet( BarIconSet( "editdelete") );
- m_varTable = new QTable( page4 );
+ m_varTable = new TQTable( page4 );
m_varTable->setReadOnly( false );
- m_varTable->setSelectionMode( QTable::SingleRow );
+ m_varTable->setSelectionMode( TQTable::SingleRow );
addPage( page4, i18n("Import Variables") );
- connect( buttonTableInsert, SIGNAL( clicked() ), this, SLOT( slotTableInsert() ) );
- connect( buttonTableRemove, SIGNAL( clicked() ), this, SLOT( slotTableRemove() ) );
+ connect( buttonTableInsert, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotTableInsert() ) );
+ connect( buttonTableRemove, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotTableRemove() ) );
}
void BatchWizard::setupPage5()
{
- TokenProvider serial( this );
+ TokenProvider serial( TQT_TQPAINTDEVICE(this) );
- page5 = new QVBox( this, "page5" );
+ page5 = new TQVBox( this, "page5" );
- new QLabel( i18n( "<qt>KBarcode has support for placing serial numbers on labels. "
+ new TQLabel( i18n( "<qt>KBarcode has support for placing serial numbers on labels. "
"If you did not use the [serial] token on your label in "
"a text field or a barcode, you can skip this page.<br>"
"Serial start is a free form start value containing at least one "
"number. This number is increased for every printed label on the "
"print out.</qt>"), page5 );
- QHBox* hbox = new QHBox( page5 );
+ TQHBox* hbox = new TQHBox( page5 );
hbox->setSpacing( 5 );
- new QLabel( i18n( "Serial start:" ), hbox );
+ new TQLabel( i18n( "Serial start:" ), hbox );
serialStart = new KLineEdit( serial.serial(), hbox );
serialInc = new KIntNumInput( 1, hbox );
@@ -225,81 +225,81 @@ void BatchWizard::setupPage5()
void BatchWizard::setupPage10()
{
- page10 = new QWidget( this, "page10" );
- QVBoxLayout* pageLayout = new QVBoxLayout( page10, 11, 6, "pageLayout");
+ page10 = new TQWidget( this, "page10" );
+ TQVBoxLayout* pageLayout = new TQVBoxLayout( page10, 11, 6, "pageLayout");
- QVButtonGroup* group = new QVButtonGroup( page10 );
+ TQVButtonGroup* group = new TQVButtonGroup( page10 );
- radioPrinter = new QRadioButton( i18n("&Print to a system printer or to a file"), group );
- radioImage = new QRadioButton( i18n("&Create images"), group );
+ radioPrinter = new TQRadioButton( i18n("&Print to a system printer or to a file"), group );
+ radioImage = new TQRadioButton( i18n("&Create images"), group );
- imageBox = new QVBox( group );
+ imageBox = new TQVBox( group );
imageBox->setMargin( 10 );
- radioBarcode = new QRadioButton( i18n("Print to a special &barcode printer"), group );
+ radioBarcode = new TQRadioButton( i18n("Print to a special &barcode printer"), group );
- QHBox* directoryBox = new QHBox( imageBox );
+ TQHBox* directoryBox = new TQHBox( imageBox );
directoryBox->setSpacing( 5 );
- QLabel* label = new QLabel( i18n("Output &Directory:"), directoryBox );
+ TQLabel* label = new TQLabel( i18n("Output &Directory:"), directoryBox );
imageDirPath = new KURLRequester( directoryBox );
imageDirPath->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
label->setBuddy( directoryBox );
- QHBox* formatBox = new QHBox( imageBox );
- label = new QLabel( i18n("Output File &Format:"), formatBox );
+ TQHBox* formatBox = new TQHBox( imageBox );
+ label = new TQLabel( i18n("Output File &Format:"), formatBox );
- QStringList formats = KImageIO::types( KImageIO::Writing );
+ TQStringList formats = KImageIO::types( KImageIO::Writing );
comboFormat = new KComboBox( false, formatBox );
comboFormat->insertStringList( formats );
- if( formats.contains( PNG_FORMAT ) )
- comboFormat->setCurrentItem( formats.findIndex( PNG_FORMAT ) );
+ if( formats.tqcontains( PNG_FORMAT ) )
+ comboFormat->setCurrentItem( formats.tqfindIndex( PNG_FORMAT ) );
label->setBuddy( comboFormat );
- QVButtonGroup* imageNameGroup = new QVButtonGroup( i18n("&Filename:"), imageBox );
- radioImageFilenameArticle = new QRadioButton( i18n("Use &article number for filename"), imageNameGroup );
- radioImageFilenameBarcode = new QRadioButton( i18n("Use &barcode number for filename"), imageNameGroup );
- radioImageFilenameCustom = new QRadioButton( i18n("Use &custom filename:"), imageNameGroup );
+ TQVButtonGroup* imageNameGroup = new TQVButtonGroup( i18n("&Filename:"), imageBox );
+ radioImageFilenameArticle = new TQRadioButton( i18n("Use &article number for filename"), imageNameGroup );
+ radioImageFilenameBarcode = new TQRadioButton( i18n("Use &barcode number for filename"), imageNameGroup );
+ radioImageFilenameCustom = new TQRadioButton( i18n("Use &custom filename:"), imageNameGroup );
editImageFilename = new KLineEdit( imageNameGroup );
radioImageFilenameBarcode->setChecked( true );
- labelInfo = new QLabel( page10 );
+ labelInfo = new TQLabel( page10 );
radioPrinter->setChecked( true );
- checkKeepOpen = new QCheckBox( i18n("&Keep window open after printing."), page10 );
+ checkKeepOpen = new TQCheckBox( i18n("&Keep window open after printing."), page10 );
- QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding );
+ TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Expanding );
pageLayout->addWidget( group );
pageLayout->addItem( spacer );
pageLayout->addWidget( labelInfo );
pageLayout->addWidget( checkKeepOpen );
- connect( radioPrinter, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioImage, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioBarcode, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
+ connect( radioPrinter, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioImage, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioBarcode, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
- connect( radioImageFilenameArticle, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioImageFilenameBarcode, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioImageFilenameCustom, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
+ connect( radioImageFilenameArticle, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioImageFilenameBarcode, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioImageFilenameCustom, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
- connect( imageDirPath, SIGNAL( textChanged( const QString & ) ), this, SLOT( enableControls() ) );
+ connect( imageDirPath, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( enableControls() ) );
addPage( page10, i18n("Output Device") );
}
void BatchWizard::setupStackPage1()
{
- stack1 = new QVBox( page3, "stack1" );
+ stack1 = new TQVBox( page3, "stack1" );
stack1->setSpacing( 5 );
- QHBox* hbox = new QHBox( stack1 );
+ TQHBox* hbox = new TQHBox( stack1 );
hbox->setSpacing( 5 );
- new QLabel( i18n( "Customer name and no.:" ), hbox );
+ new TQLabel( i18n( "Customer name and no.:" ), hbox );
customerName = new KComboBox( false, hbox );
customerId = new KComboBox( false, hbox );
- QHBox* hButtonBox = new QHBox( stack1 );
+ TQHBox* hButtonBox = new TQHBox( stack1 );
hButtonBox->setSpacing( 5 );
buttonAdd = new KPushButton( i18n( "&Add..." ), hButtonBox );
@@ -309,9 +309,9 @@ void BatchWizard::setupStackPage1()
buttonRemoveAll = new KPushButton( i18n("R&emove All"), hButtonBox );
KPopupMenu* mnuImport = new KPopupMenu( this );
- mnuImport->insertItem( i18n("Import from File ..."), this, SLOT( loadFromFile() ) );
- mnuImport->insertItem( i18n("Import from Clipboard ..."), this, SLOT( loadFromClipboard() ) );
- mnuImport->insertItem( i18n("Import barcode_basic"), this, SLOT( addAllItems() ) );
+ mnuImport->insertItem( i18n("Import from File ..."), this, TQT_SLOT( loadFromFile() ) );
+ mnuImport->insertItem( i18n("Import from Clipboard ..."), this, TQT_SLOT( loadFromClipboard() ) );
+ mnuImport->insertItem( i18n("Import barcode_basic"), this, TQT_SLOT( addAllItems() ) );
buttonImport->setPopup( mnuImport );
sqlList = new KListView( stack1 );
@@ -320,60 +320,60 @@ void BatchWizard::setupStackPage1()
sqlList->addColumn( i18n("Article Number") );
sqlList->addColumn( i18n("Group") );
sqlList->setAllColumnsShowFocus( true );
- connect( sqlList, SIGNAL(doubleClicked(QListViewItem*,const QPoint &,int)),
- this, SLOT(changeItem(QListViewItem*,const QPoint &,int)));
+ connect( sqlList, TQT_SIGNAL(doubleClicked(TQListViewItem*,const TQPoint &,int)),
+ this, TQT_SLOT(changeItem(TQListViewItem*,const TQPoint &,int)));
- connect( customerName, SIGNAL( activated(int) ), this, SLOT( customerNameChanged(int) ) );
- connect( customerId, SIGNAL( activated(int) ), this, SLOT( customerIdChanged(int) ) );
- connect( buttonAdd, SIGNAL( clicked() ), this, SLOT( addItem() ) );
- connect( buttonEdit, SIGNAL( clicked() ), this, SLOT( editItem() ) );
- connect( buttonRemove, SIGNAL( clicked() ), this, SLOT( removeItem() ) );
- connect( buttonRemoveAll, SIGNAL( clicked() ), sqlList, SLOT( clear() ) );
- connect( buttonRemoveAll, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
+ connect( customerName, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( customerNameChanged(int) ) );
+ connect( customerId, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( customerIdChanged(int) ) );
+ connect( buttonAdd, TQT_SIGNAL( clicked() ), this, TQT_SLOT( addItem() ) );
+ connect( buttonEdit, TQT_SIGNAL( clicked() ), this, TQT_SLOT( editItem() ) );
+ connect( buttonRemove, TQT_SIGNAL( clicked() ), this, TQT_SLOT( removeItem() ) );
+ connect( buttonRemoveAll, TQT_SIGNAL( clicked() ), sqlList, TQT_SLOT( clear() ) );
+ connect( buttonRemoveAll, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
page3->addWidget( stack1 );
}
void BatchWizard::setupStackPage2()
{
- stack2 = new QHBox( page3, "stack2" );
+ stack2 = new TQHBox( page3, "stack2" );
stack2->setSpacing( 5 );
- QVButtonGroup* group = new QVButtonGroup( stack2 );
- radioImportManual = new QRadioButton( i18n("Enter &data manually"), group );
- radioImportSql = new QRadioButton( i18n("Import variables from a &SQL table"), group );
- labelSqlQuery = new QLabel( i18n("Please enter a sql &query:"), group );
+ TQVButtonGroup* group = new TQVButtonGroup( stack2 );
+ radioImportManual = new TQRadioButton( i18n("Enter &data manually"), group );
+ radioImportSql = new TQRadioButton( i18n("Import variables from a &SQL table"), group );
+ labelSqlQuery = new TQLabel( i18n("Please enter a sql &query:"), group );
importSqlQuery = new KLineEdit( group );
labelSqlQuery->setBuddy( importSqlQuery );
- radioImportCSV = new QRadioButton( i18n("Import from a &CSV file"), group );
- labelCsvFile= new QLabel( i18n("Please select a csv &file:"), group );
+ radioImportCSV = new TQRadioButton( i18n("Import from a &CSV file"), group );
+ labelCsvFile= new TQLabel( i18n("Please select a csv &file:"), group );
importCsvFile = new KURLRequester( group );
labelCsvFile->setBuddy( importCsvFile );
- labelEncoding = new QLabel( i18n("&Encoding:"), group );
+ labelEncoding = new TQLabel( i18n("&Encoding:"), group );
comboEncoding = new EncodingCombo( group );
labelEncoding->setBuddy( comboEncoding );
radioImportManual->setChecked( true );
- QVBox* box = new QVBox( stack2 );
+ TQVBox* box = new TQVBox( stack2 );
box->setSpacing( 5 );
- new QLabel( i18n("Available Variables:"), box );
+ new TQLabel( i18n("Available Variables:"), box );
m_varList = new KListBox( box );
- connect( radioImportManual, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioImportSql, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioImportCSV, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( importSqlQuery, SIGNAL( textChanged( const QString & ) ), this, SLOT( enableControls() ) );
- connect( importCsvFile, SIGNAL( textChanged( const QString & ) ), this, SLOT( enableControls() ) );
+ connect( radioImportManual, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioImportSql, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioImportCSV, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( importSqlQuery, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( enableControls() ) );
+ connect( importCsvFile, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( enableControls() ) );
page3->addWidget( stack2 );
}
void BatchWizard::setupStackPage3()
{
- stack3 = new QVBox( page3, "stack3" );
+ stack3 = new TQVBox( page3, "stack3" );
numLabels = new KIntNumInput( 1, stack3 );
numLabels->setRange( 1, 100000, 1, true );
@@ -384,19 +384,19 @@ void BatchWizard::setupStackPage3()
void BatchWizard::setupStackPage4()
{
- stack4 = new QWidget( page3, "stack4" );
+ stack4 = new TQWidget( page3, "stack4" );
- QHBoxLayout* mainLayout = new QHBoxLayout( stack4 );
+ TQHBoxLayout* mainLayout = new TQHBoxLayout( stack4 );
- QVBox* list1 = new QVBox( stack4 );
- QVBox* list2 = new QVBox( stack4 );
+ TQVBox* list1 = new TQVBox( stack4 );
+ TQVBox* list2 = new TQVBox( stack4 );
- QFrame* buttons = new QFrame( stack4 );
+ TQFrame* buttons = new TQFrame( stack4 );
buttons->setMargin( 10 );
- QVBoxLayout* layout = new QVBoxLayout( buttons );
- QSpacerItem* spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding );
- QSpacerItem* spacer2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding );
+ TQVBoxLayout* tqlayout = new TQVBoxLayout( buttons );
+ TQSpacerItem* spacer1 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Expanding );
+ TQSpacerItem* spacer2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Expanding );
buttonAddAllAddress = new KPushButton( buttons );
buttonAddAddress = new KPushButton( buttons );
@@ -408,17 +408,17 @@ void BatchWizard::setupStackPage4()
buttonRemoveAddress->setIconSet( BarIconSet( "1leftarrow" ) );
buttonRemoveAllAddress->setIconSet( BarIconSet( "2leftarrow" ) );
- QToolTip::add( buttonAddAllAddress, i18n("Add all contacts to the list of contacts which will be printed.") );
- QToolTip::add( buttonAddAddress, i18n("Add selected contacts to the list of contacts which will be printed.") );
- QToolTip::add( buttonRemoveAddress, i18n("Remove selected contacts from the list of contacts which will be printed.") );
- QToolTip::add( buttonRemoveAllAddress, i18n("Remove all contacts from the list of contacts which will be printed.") );
+ TQToolTip::add( buttonAddAllAddress, i18n("Add all contacts to the list of contacts which will be printed.") );
+ TQToolTip::add( buttonAddAddress, i18n("Add selected contacts to the list of contacts which will be printed.") );
+ TQToolTip::add( buttonRemoveAddress, i18n("Remove selected contacts from the list of contacts which will be printed.") );
+ TQToolTip::add( buttonRemoveAllAddress, i18n("Remove all contacts from the list of contacts which will be printed.") );
- layout->addItem( spacer1 );
- layout->addWidget( buttonAddAllAddress );
- layout->addWidget( buttonAddAddress );
- layout->addWidget( buttonRemoveAddress );
- layout->addWidget( buttonRemoveAllAddress );
- layout->addItem( spacer2 );
+ tqlayout->addItem( spacer1 );
+ tqlayout->addWidget( buttonAddAllAddress );
+ tqlayout->addWidget( buttonAddAddress );
+ tqlayout->addWidget( buttonRemoveAddress );
+ tqlayout->addWidget( buttonRemoveAllAddress );
+ tqlayout->addItem( spacer2 );
mainLayout->addWidget( list1 );
mainLayout->addWidget( buttons );
@@ -427,8 +427,8 @@ void BatchWizard::setupStackPage4()
mainLayout->setStretchFactor( list1, 2 );
mainLayout->setStretchFactor( list2, 2 );
- new QLabel( i18n("All Addresses"), list1 );
- new QLabel( i18n("Selected Addresses"), list2 );
+ new TQLabel( i18n("All Addresses"), list1 );
+ new TQLabel( i18n("Selected Addresses"), list2 );
listAddress = new KListView( list1 );
listAddress->addColumn( i18n("Given Name"), 0 );
@@ -437,9 +437,9 @@ void BatchWizard::setupStackPage4()
listAddress->setMultiSelection( true );
listAddress->setAllColumnsShowFocus( true );
- listAddress->setColumnWidthMode( 0, QListView::Maximum );
- listAddress->setColumnWidthMode( 1, QListView::Maximum );
- listAddress->setColumnWidthMode( 2, QListView::Maximum );
+ listAddress->setColumnWidthMode( 0, TQListView::Maximum );
+ listAddress->setColumnWidthMode( 1, TQListView::Maximum );
+ listAddress->setColumnWidthMode( 2, TQListView::Maximum );
listSelectedAddress = new KListView( list2 );
listSelectedAddress->addColumn( i18n("Given Name"), 0 );
@@ -448,14 +448,14 @@ void BatchWizard::setupStackPage4()
listSelectedAddress->setMultiSelection( true );
listSelectedAddress->setAllColumnsShowFocus( true );
- listSelectedAddress->setColumnWidthMode( 0, QListView::Maximum );
- listSelectedAddress->setColumnWidthMode( 1, QListView::Maximum );
- listSelectedAddress->setColumnWidthMode( 2, QListView::Maximum );
+ listSelectedAddress->setColumnWidthMode( 0, TQListView::Maximum );
+ listSelectedAddress->setColumnWidthMode( 1, TQListView::Maximum );
+ listSelectedAddress->setColumnWidthMode( 2, TQListView::Maximum );
- connect( buttonAddAddress, SIGNAL( clicked() ), this, SLOT( slotAddAddress() ) );
- connect( buttonRemoveAddress, SIGNAL( clicked() ), this, SLOT( slotRemoveAddress() ) );
- connect( buttonAddAllAddress, SIGNAL( clicked() ), this, SLOT( slotAddAllAddress() ) );
- connect( buttonRemoveAllAddress, SIGNAL( clicked() ), this, SLOT( slotRemoveAllAddress() ) );
+ connect( buttonAddAddress, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAddAddress() ) );
+ connect( buttonRemoveAddress, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotRemoveAddress() ) );
+ connect( buttonAddAllAddress, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAddAllAddress() ) );
+ connect( buttonRemoveAllAddress, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotRemoveAllAddress() ) );
page3->addWidget( stack4 );
}
@@ -466,7 +466,7 @@ void BatchWizard::setupSql()
if( !tables->isConnected() )
return;
- QSqlCursor cur( TABLE_CUSTOMER );
+ TQSqlCursor cur( TABLE_CUSTOMER );
cur.select();
customerId->clear();
customerName->clear();
@@ -517,7 +517,7 @@ void BatchWizard::enableControls()
setFinishEnabled( page10, true );
}
-void BatchWizard::showPage( QWidget* p )
+void BatchWizard::showPage( TQWidget* p )
{
if( p == page3 )
{
@@ -546,19 +546,19 @@ void BatchWizard::showPage( QWidget* p )
void BatchWizard::accept()
{
- printNow( QString::null );
+ printNow( TQString() );
}
-void BatchWizard::printNow( const QString & printer, bool bUserInteraction )
+void BatchWizard::printNow( const TQString & printer, bool bUserInteraction )
{
BatchPrinter* batch = NULL;
KPrinter* prn = NULL;
int batchType = 0;
// let's check if the label file does even exist!
- if( !QFile::exists( m_url->url() ) )
+ if( !TQFile::exists( m_url->url() ) )
{
- KMessageBox::error( this, QString( i18n("The label file %1 was not found") ).arg( m_url->url()) );
+ KMessageBox::error( this, TQString( i18n("The label file %1 was not found") ).tqarg( m_url->url()) );
return;
}
@@ -569,7 +569,7 @@ void BatchWizard::printNow( const QString & printer, bool bUserInteraction )
{
PrintLabelDlg pld( this, "pld" );
pld.setLabelsEnabled( false );
- if( pld.exec() != QDialog::Accepted )
+ if( pld.exec() != TQDialog::Accepted )
return;
move = pld.position();
@@ -588,7 +588,7 @@ void BatchWizard::printNow( const QString & printer, bool bUserInteraction )
else if( radioBarcode->isChecked() )
{
BarcodePrinterDlg dlg(this);
- if( dlg.exec() != QDialog::Accepted )
+ if( dlg.exec() != TQDialog::Accepted )
return;
batch = new BatchPrinter( dlg.printToFile() ? dlg.fileName() : dlg.deviceName(),
@@ -614,7 +614,7 @@ void BatchWizard::printNow( const QString & printer, bool bUserInteraction )
if( !checkKeepOpen->isChecked() )
KWizard::accept();
- KApplication::setOverrideCursor( QCursor( Qt::ArrowCursor ), true );
+ KApplication::setOverrideCursor( TQCursor( TQt::ArrowCursor ), true );
setupBatchPrinter( batch, batchType );
KApplication::restoreOverrideCursor();
@@ -625,18 +625,18 @@ void BatchWizard::printNow( const QString & printer, bool bUserInteraction )
void BatchWizard::setupBatchPrinter( BatchPrinter* batch, int m )
{
Definition* def = NULL;
- QString description;
+ TQString description;
bool kbarcode18;
fillByteArray();
- QDomDocument doc( "KBarcodeLabel" );
+ TQDomDocument doc( "KBarcodeLabel" );
if ( !doc.setContent( m_bytearray ) )
return;
XMLUtils util;
util.readXMLHeader( &doc, description, kbarcode18, &def );
- QBuffer buffer( m_bytearray );
+ TQBuffer buffer( m_bytearray );
if( !buffer.open( IO_ReadOnly ) )
return;
@@ -655,8 +655,8 @@ void BatchWizard::setupBatchPrinter( BatchPrinter* batch, int m )
sqlList->setSorting( 3, true );
sqlList->sort();
- QValueList<BatchPrinter::data>* dlist = new QValueList<BatchPrinter::data>;
- QListViewItem* item = sqlList->firstChild();
+ TQValueList<BatchPrinter::data>* dlist = new TQValueList<BatchPrinter::data>;
+ TQListViewItem* item = sqlList->firstChild();
while( item )
{
BatchPrinter::data m_data;
@@ -677,7 +677,7 @@ void BatchWizard::setupBatchPrinter( BatchPrinter* batch, int m )
batch->setLabels( numLabels->value() );
// do a dirty drick, TODO: refactor BatchPrinter in the future
- QValueList<BatchPrinter::data>* dlist = new QValueList<BatchPrinter::data>;
+ TQValueList<BatchPrinter::data>* dlist = new TQValueList<BatchPrinter::data>;
BatchPrinter::data m_data;
m_data.number = numLabels->value();
dlist->append( m_data );
@@ -689,7 +689,7 @@ void BatchWizard::setupBatchPrinter( BatchPrinter* batch, int m )
TVariableList* tVariableList = new TVariableList;
for( int i=0; i<m_varTable->numRows(); i++ )
{
- QMap<QString, QString> map;
+ TQMap<TQString, TQString> map;
for( int z=0; z<m_varTable->numCols(); z++ )
map[ m_varTable->horizontalHeader()->label( z ) ] = m_varTable->text( i, z );
tVariableList->append( map );
@@ -700,7 +700,7 @@ void BatchWizard::setupBatchPrinter( BatchPrinter* batch, int m )
else if( radioAddressBook->isChecked() )
{
KABC::AddresseeList* list = new KABC::AddresseeList;
- QListViewItem* item = listSelectedAddress->firstChild();
+ TQListViewItem* item = listSelectedAddress->firstChild();
while( item )
{
list->append( static_cast<AddressListViewItem*>(item)->address() );
@@ -725,18 +725,18 @@ void BatchWizard::addItem()
{
DSSmallDialogs::AddItemsDialog aid( this, "aid" );
aid.setGroupCompletion( compGroup );
- connect( &aid, SIGNAL( add( const QString &, const QString &, int) ),
- this, SLOT( slotAddItem( const QString &, const QString &, int) ) );
+ connect( &aid, TQT_SIGNAL( add( const TQString &, const TQString &, int) ),
+ this, TQT_SLOT( slotAddItem( const TQString &, const TQString &, int) ) );
aid.exec();
}
-bool BatchWizard::slotAddItem( const QString & article, const QString & group, int count )
+bool BatchWizard::slotAddItem( const TQString & article, const TQString & group, int count )
{
return this->addItem( article, group, count, true );
}
-bool BatchWizard::addItem( const QString & article, const QString & group, int count, bool msg )
+bool BatchWizard::addItem( const TQString & article, const TQString & group, int count, bool msg )
{
if( !article.isEmpty() && !existsArticle( article ) ) {
if( msg )
@@ -744,10 +744,10 @@ bool BatchWizard::addItem( const QString & article, const QString & group, int c
return false;
}
- QString temp;
+ TQString temp;
temp.sprintf("%0*i", 5, sqlList->childCount() + 1 );
- KListViewItem* item = new KListViewItem( sqlList, temp, QString( "%1" ).arg( count ),
+ KListViewItem* item = new KListViewItem( sqlList, temp, TQString( "%1" ).tqarg( count ),
article, group );
sqlList->insertItem( item );
@@ -757,22 +757,22 @@ bool BatchWizard::addItem( const QString & article, const QString & group, int c
return true;
}
-void BatchWizard::addGroupCompletion( const QString & group )
+void BatchWizard::addGroupCompletion( const TQString & group )
{
if( !group.isEmpty() )
{
- QStringList slist = compGroup->items();
- if(!slist.contains( group ) )
+ TQStringList slist = compGroup->items();
+ if(!slist.tqcontains( group ) )
compGroup->addItem( group );
}
}
-bool BatchWizard::existsArticle( const QString & article )
+bool BatchWizard::existsArticle( const TQString & article )
{
if( article.isEmpty() )
return false;
- QSqlQuery query( "select uid from barcode_basic where article_no='" + article + "'" );
+ TQSqlQuery query( "select uid from barcode_basic where article_no='" + article + "'" );
while ( query.next() )
return true;
@@ -781,12 +781,12 @@ bool BatchWizard::existsArticle( const QString & article )
void BatchWizard::editItem()
{
- QListViewItem* item = sqlList->selectedItem();
+ TQListViewItem* item = sqlList->selectedItem();
if( item )
- changeItem( item, QPoint(0,0), 0 );
+ changeItem( item, TQPoint(0,0), 0 );
}
-void BatchWizard::changeItem( QListViewItem* item, const QPoint &, int )
+void BatchWizard::changeItem( TQListViewItem* item, const TQPoint &, int )
{
if(!item)
return;
@@ -795,9 +795,9 @@ void BatchWizard::changeItem( QListViewItem* item, const QPoint &, int )
item->text( 1 ).toInt(), this, "aid" );
aid.setGroupCompletion( compGroup );
- if( aid.exec() == QDialog::Accepted )
+ if( aid.exec() == TQDialog::Accepted )
{
- item->setText( 1, QString::number( aid.count() ) );
+ item->setText( 1, TQString::number( aid.count() ) );
item->setText( 2, aid.articleNo() );
item->setText( 3, aid.groupName() );
addGroupCompletion( aid.groupName() );
@@ -807,18 +807,18 @@ void BatchWizard::changeItem( QListViewItem* item, const QPoint &, int )
void BatchWizard::removeItem()
{
- QListViewItem* item = sqlList->firstChild();
+ TQListViewItem* item = sqlList->firstChild();
while( item )
{
if( item->isSelected() )
{
- QListViewItem* it = item->nextSibling();
+ TQListViewItem* it = item->nextSibling();
delete item;
while( it )
{
int a = it->text( 0 ).toInt();
- QString temp;
+ TQString temp;
temp.sprintf("%0*i", 5, a - 1 );
it->setText( 0, temp );
it = it->nextSibling();
@@ -847,13 +847,13 @@ void BatchWizard::customerNameChanged( int index )
void BatchWizard::addAllItems()
{
DSSmallDialogs::AddAllDialog* dlg = new DSSmallDialogs::AddAllDialog( this, "dlg" );
- if( dlg->exec() == QDialog::Accepted )
+ if( dlg->exec() == TQDialog::Accepted )
{
- QString temp;
- QString group = dlg->groupName();
- const QString num = QString::number( dlg->numberLabels() );
+ TQString temp;
+ TQString group = dlg->groupName();
+ const TQString num = TQString::number( dlg->numberLabels() );
- QSqlQuery query("SELECT article_no FROM " TABLE_BASIC );
+ TQSqlQuery query("SELECT article_no FROM " TABLE_BASIC );
while( query.next() )
{
temp.sprintf("%0*i", 5, sqlList->childCount() + 1 );
@@ -866,21 +866,21 @@ void BatchWizard::addAllItems()
void BatchWizard::loadFromFile()
{
- QString f = KFileDialog::getOpenFileName( 0, 0, this );
+ TQString f = KFileDialog::getOpenFileName( 0, 0, this );
if( !f.isEmpty() )
loadFromFile( f );
}
void BatchWizard::loadFromClipboard()
{
- QClipboard *cb = KApplication::clipboard();
+ TQClipboard *cb = KApplication::tqclipboard();
loadData( cb->text() );
}
-void BatchWizard::loadFromFile( const QString & url )
+void BatchWizard::loadFromFile( const TQString & url )
{
- QByteArray data;
- QFile file( url );
+ TQByteArray data;
+ TQFile file( url );
if( !file.open( IO_ReadOnly ) )
{
@@ -890,10 +890,10 @@ void BatchWizard::loadFromFile( const QString & url )
data = file.readAll();
- loadData( QString( data ) );
+ loadData( TQString( data ) );
}
-void BatchWizard::loadData( const QString & data )
+void BatchWizard::loadData( const TQString & data )
{
labelprinterdata* lpdata = PrinterSettings::getInstance()->getData();
if( lpdata->separator.isEmpty() )
@@ -910,17 +910,17 @@ void BatchWizard::loadData( const QString & data )
config->readNumEntry("Data2", 2 ) };
bool custom_article_no = lpdata->useCustomNo;
- QBuffer buf( data.utf8() );
+ TQBuffer buf( data.utf8() );
CSVFile file( buf );
- QStringList list, dropped;
- QString article, quantity, group;
+ TQStringList list, dropped;
+ TQString article, quantity, group;
while( file.isValid() && !file.isEof() )
{
list = file.readNextLine();
while( list.count() < 3 )
- list.append( QString::null );
+ list.append( TQString() );
if( pos[0] == 0 )
quantity = list[0];
@@ -952,7 +952,7 @@ void BatchWizard::loadData( const QString & data )
if( qint && custom_article_no ) {
qint = false;
- QSqlQuery query("SELECT article_no FROM customer_text WHERE article_no_customer='" + article + "'" );
+ TQSqlQuery query("SELECT article_no FROM customer_text WHERE article_no_customer='" + article + "'" );
while( query.next() ) {
article = query.value( 0 ).toString();
qint = true;
@@ -962,17 +962,13 @@ void BatchWizard::loadData( const QString & data )
if( qint ) // && existsArticle( article )
{
- if( !addItem( QString( article ), QString( group ), quantity.toInt(), false ) )
+ if( !addItem( TQString( article ), TQString( group ), quantity.toInt(), false ) )
dropped.append( quantity + lpdata->separator + article + lpdata->separator + group );
}
}
if( !dropped.isEmpty() )
-#if QT_VERSION >= 0x030100
KMessageBox::informationList( this, i18n("<qt>The following items can not be added:" )+ "</qt>", dropped );
-#else
- KMessageBox::questionYesNoList( this, i18n("<qt>The following items can not be added:" )+ "</qt>", dropped );
-#endif
enableControls();
}
@@ -981,10 +977,10 @@ void BatchWizard::fillByteArray()
{
if( m_bytearray_filename != m_url->url() )
{
- QFile f( m_url->url() );
+ TQFile f( m_url->url() );
if ( !f.open( IO_ReadOnly ) )
{
- m_bytearray_filename = QString::null;
+ m_bytearray_filename = TQString();
m_bytearray.resize( 0 );
return ;
}
@@ -997,7 +993,7 @@ void BatchWizard::fillByteArray()
void BatchWizard::fillVarList()
{
fillByteArray();
- QDomDocument doc( "KBarcodeLabel" );
+ TQDomDocument doc( "KBarcodeLabel" );
if ( !doc.setContent( m_bytearray ) )
return;
@@ -1005,17 +1001,17 @@ void BatchWizard::fillVarList()
DocumentItemList list;
list.setAutoDelete( true );
- TokenProvider token( this );
+ TokenProvider token( TQT_TQPAINTDEVICE(this) );
Definition* def = NULL;
- QString description;
+ TQString description;
bool kbarcode18;
util.readXMLHeader( &doc, description, kbarcode18, &def );
util.readDocumentItems( &list, &doc, &token, kbarcode18 );
token.setCurrentDocumentItems( list );
- QStringList vars = token.listUserVars();
+ TQStringList vars = token.listUserVars();
m_varList->clear();
m_varList->insertStringList( vars );
m_varTable->setNumCols( vars.count() );
@@ -1049,9 +1045,9 @@ bool BatchWizard::fillVarTable()
{
int y = 0;
int x;
- QSqlSelectCursor query( importSqlQuery->text(), SqlTables::getInstance()->database() );
+ TQSqlSelectCursor query( importSqlQuery->text(), SqlTables::getInstance()->database() );
query.select();
- if( query.lastError().type() != QSqlError::None )
+ if( query.lastError().type() != TQSqlError::None )
{
KMessageBox::error( this, i18n("<qt>Can't execute SQL query:<br>") + query.lastError().text() + "</qt>" );
return false;
@@ -1073,14 +1069,14 @@ bool BatchWizard::fillVarTable()
CSVFile file( importCsvFile->url() );
file.setEncoding( comboEncoding->currentText() );
- QStringList heading;
- QStringList data;
+ TQStringList heading;
+ TQStringList data;
int i = 0;
file.setCSVFile(true);
if( !file.isValid() )
{
- KMessageBox::error( this, QString( i18n("Can't open file: %1") ).arg( importCsvFile->url() ) );
+ KMessageBox::error( this, TQString( i18n("Can't open file: %1") ).tqarg( importCsvFile->url() ) );
return false;
}
@@ -1131,17 +1127,17 @@ void BatchWizard::slotTableInsert()
void BatchWizard::slotTableRemove()
{
- QTableSelection sel = m_varTable->selection( m_varTable->currentSelection() );
+ TQTableSelection sel = m_varTable->selection( m_varTable->currentSelection() );
m_varTable->removeRow( sel.topRow() );
}
-void BatchWizard::setFilename( const QString & url )
+void BatchWizard::setFilename( const TQString & url )
{
m_url->setURL( url );
enableControls();
}
-void BatchWizard::setImportSqlQuery( const QString & query )
+void BatchWizard::setImportSqlQuery( const TQString & query )
{
radioImportCSV->setChecked( false );
radioImportManual->setChecked( false );
@@ -1159,7 +1155,7 @@ void BatchWizard::setImportSqlQuery( const QString & query )
showPage( page4 );
}
-void BatchWizard::setImportCsvFile( const QString & filename )
+void BatchWizard::setImportCsvFile( const TQString & filename )
{
radioImportCSV->setChecked( true );
radioImportManual->setChecked( false );
@@ -1209,7 +1205,7 @@ void BatchWizard::setOutputFormat( const int e )
enableControls();
}
-void BatchWizard::setSerialNumber( const QString & val, int inc )
+void BatchWizard::setSerialNumber( const TQString & val, int inc )
{
serialInc->setValue( inc );
serialStart->setText( val );
@@ -1241,10 +1237,10 @@ void BatchWizard::slotRemoveAllAddress()
enableControls();
}
-void BatchWizard::moveAddress( QListView* src, QListView* dst, bool bAll )
+void BatchWizard::moveAddress( TQListView* src, TQListView* dst, bool bAll )
{
- QListViewItem* item = src->firstChild();
- QListViewItem* cur;
+ TQListViewItem* item = src->firstChild();
+ TQListViewItem* cur;
while( item )
{
diff --git a/kbarcode/batchwizard.h b/kbarcode/batchwizard.h
index e736a6f..9bdb2a5 100644
--- a/kbarcode/batchwizard.h
+++ b/kbarcode/batchwizard.h
@@ -31,20 +31,21 @@ class KListBox;
class KListView;
class KPushButton;
class KURLRequester;
-class QCheckBox;
-class QHBox;
-class QLabel;
-class QListView;
-class QListViewItem;
-class QRadioButton;
-class QTable;
-class QVBox;
-class QWidgetStack;
+class TQCheckBox;
+class TQHBox;
+class TQLabel;
+class TQListView;
+class TQListViewItem;
+class TQRadioButton;
+class TQTable;
+class TQVBox;
+class TQWidgetStack;
class BatchWizard : public KWizard, public BatchIface {
Q_OBJECT
+ TQ_OBJECT
public:
- BatchWizard( QWidget* parent = NULL, const char* name = NULL );
+ BatchWizard( TQWidget* tqparent = NULL, const char* name = NULL );
~BatchWizard();
/** reimplemented DCOP method from BatchIface
@@ -54,45 +55,45 @@ class BatchWizard : public KWizard, public BatchIface {
* @p count number of labels to print for this article
* @p msgbox show a messagebox if adding the item fails
*/
- bool addItem( const QString & article, const QString & group, int count, bool msgbox = true );
+ bool addItem( const TQString & article, const TQString & group, int count, bool msgbox = true );
/** reimplemented DCOP method from BatchIface
* tests wether the arctile is existing in KBarcodes database
* @p article article number to test for
*/
- virtual bool existsArticle( const QString & article );
+ virtual bool existsArticle( const TQString & article );
/** reimplemented DCOP method from BatchIface
* import articles from a file. The user is asked for the filename
*/
- virtual void loadFromFile( const QString & url );
+ virtual void loadFromFile( const TQString & url );
/** reimplemented DCOP method from BatchIface
* print immediately with current settings
* @p printer print to this printer (must be known to the system)
* @p bUserInteraction if false no dialog will pop up besides the printer dialog
*/
- virtual void printNow( const QString & printer, bool bUserInteraction = true );
+ virtual void printNow( const TQString & printer, bool bUserInteraction = true );
/** reimplemented DCOP method from BatchIface
* to allow the user to set the label to be used
* @p url path of the label which shall get printed
*/
- virtual void setFilename( const QString & url );
+ virtual void setFilename( const TQString & url );
/** reimplemented DCOP method from BatchIface
* Set the batchwizards mode to print from imported data
* and import the data from the csv file @p filname
* @p filename csv file to import
*/
- virtual void setImportCsvFile( const QString & filename );
+ virtual void setImportCsvFile( const TQString & filename );
/** reimplemented DCOP method from BatchIface
* Set the batchwizards mode to print from imported data
* and import the data from the sql query @p query
* @p query sql query to execute to get on user defined variables
*/
- virtual void setImportSqlQuery( const QString & query );
+ virtual void setImportSqlQuery( const TQString & query );
/** reimplemented DCOP method from BatchIface
* set the numbers of labels to print.
@@ -115,7 +116,7 @@ class BatchWizard : public KWizard, public BatchIface {
* @p val value of the serial number (e.g. TEST0002)
* @p inc the serial number is increased that much for every label
*/
- virtual void setSerialNumber( const QString & val, int inc );
+ virtual void setSerialNumber( const TQString & val, int inc );
public slots:
/** reimplemented DCOP method from BatchIface
@@ -130,8 +131,8 @@ class BatchWizard : public KWizard, public BatchIface {
void customerIdChanged( int index );
void customerNameChanged( int index );
void addItem();
- bool slotAddItem( const QString & article, const QString & group, int count );
- void changeItem( QListViewItem* item, const QPoint &, int );
+ bool slotAddItem( const TQString & article, const TQString & group, int count );
+ void changeItem( TQListViewItem* item, const TQPoint &, int );
void editItem();
void removeItem();
@@ -145,7 +146,7 @@ class BatchWizard : public KWizard, public BatchIface {
void slotRemoveAllAddress();
private:
- void moveAddress( QListView* src, QListView* dst, bool bAll = false );
+ void moveAddress( TQListView* src, TQListView* dst, bool bAll = false );
void fillByteArray();
void fillVarList();
@@ -167,12 +168,12 @@ class BatchWizard : public KWizard, public BatchIface {
void setupSql();
void setupBatchPrinter( BatchPrinter* batch, int m );
- void addGroupCompletion( const QString & group );
- void loadData( const QString & data );
+ void addGroupCompletion( const TQString & group );
+ void loadData( const TQString & data );
protected:
void accept();
- void showPage( QWidget* w );
+ void showPage( TQWidget* w );
private:
/** m_bytearray_filename is set whenever
@@ -181,44 +182,44 @@ class BatchWizard : public KWizard, public BatchIface {
* to re-read the bytearray when the filename was
* changed by the user.
*/
- QString m_bytearray_filename;
- QByteArray m_bytearray;
-
- QWidget* page1;
- QWidget* page2;
- QWidgetStack* page3;
- QVBox* page4;
- QVBox* page5;
- QWidget* page10;
-
- QVBox* stack1;
- QHBox* stack2;
- QVBox* stack3;
- QWidget* stack4;
-
- QVBox* imageBox;
-
- QLabel* labelInfo;
- QLabel* labelSqlQuery;
- QLabel* labelCsvFile;
- QLabel* labelEncoding;
-
- QRadioButton* radioSqlArticles;
- QRadioButton* radioVarImport;
- QRadioButton* radioSimple;
- QRadioButton* radioAddressBook;
-
- QRadioButton* radioPrinter;
- QRadioButton* radioImage;
- QRadioButton* radioBarcode;
-
- QRadioButton* radioImportSql;
- QRadioButton* radioImportCSV;
- QRadioButton* radioImportManual;
-
- QRadioButton* radioImageFilenameArticle;
- QRadioButton* radioImageFilenameBarcode;
- QRadioButton* radioImageFilenameCustom;
+ TQString m_bytearray_filename;
+ TQByteArray m_bytearray;
+
+ TQWidget* page1;
+ TQWidget* page2;
+ TQWidgetStack* page3;
+ TQVBox* page4;
+ TQVBox* page5;
+ TQWidget* page10;
+
+ TQVBox* stack1;
+ TQHBox* stack2;
+ TQVBox* stack3;
+ TQWidget* stack4;
+
+ TQVBox* imageBox;
+
+ TQLabel* labelInfo;
+ TQLabel* labelSqlQuery;
+ TQLabel* labelCsvFile;
+ TQLabel* labelEncoding;
+
+ TQRadioButton* radioSqlArticles;
+ TQRadioButton* radioVarImport;
+ TQRadioButton* radioSimple;
+ TQRadioButton* radioAddressBook;
+
+ TQRadioButton* radioPrinter;
+ TQRadioButton* radioImage;
+ TQRadioButton* radioBarcode;
+
+ TQRadioButton* radioImportSql;
+ TQRadioButton* radioImportCSV;
+ TQRadioButton* radioImportManual;
+
+ TQRadioButton* radioImageFilenameArticle;
+ TQRadioButton* radioImageFilenameBarcode;
+ TQRadioButton* radioImageFilenameCustom;
KLineEdit* editImageFilename;
KURLRequester* imageDirPath;
@@ -235,7 +236,7 @@ class BatchWizard : public KWizard, public BatchIface {
KIntNumInput* serialInc;
KIntNumInput* numLabels;
- QTable* m_varTable;
+ TQTable* m_varTable;
KListBox* m_varList;
KListView* listAddress;
@@ -244,7 +245,7 @@ class BatchWizard : public KWizard, public BatchIface {
KListView* sqlList;
KLineEdit* serialStart;
- QCheckBox* checkKeepOpen;
+ TQCheckBox* checkKeepOpen;
KPushButton* buttonAddAddress;
KPushButton* buttonRemoveAddress;
diff --git a/kbarcode/commands.cpp b/kbarcode/commands.cpp
index a11c01b..ae62911 100644
--- a/kbarcode/commands.cpp
+++ b/kbarcode/commands.cpp
@@ -33,25 +33,25 @@
// KDE includes
#include <kapplication.h>
-QPoint getFreePos( QCanvas* c )
+TQPoint getFreePos( TQCanvas* c )
{
MyCanvas* canvas = (MyCanvas*)c;
if( !c->width() && !c->height() )
- return QPoint( canvas->rect().x(), canvas->rect().y() );
+ return TQPoint( canvas->rect().x(), canvas->rect().y() );
// TODO: fix for positions on label
int x = KApplication::random() % canvas->rect().width() - 20;
int y = KApplication::random() % canvas->rect().height() - 20;
if( x > 0 && y > 0 )
- return QPoint( canvas->rect().x() + x, canvas->rect().y() + y );
+ return TQPoint( canvas->rect().x() + x, canvas->rect().y() + y );
else
- return QPoint( canvas->rect().x(), canvas->rect().y() );
+ return TQPoint( canvas->rect().x(), canvas->rect().y() );
}
CommandUtils::CommandUtils(TCanvasItem* item)
- : QObject()
+ : TQObject()
{
m_canvas_item = item;
m_canvas_item->addRef();
@@ -59,7 +59,7 @@ CommandUtils::CommandUtils(TCanvasItem* item)
c = m_canvas_item->canvas();
/* NOT NEEDED:
if( m_canvas_item && m_canvas_item->item() )
- connect( m_canvas_item->item(), SIGNAL( destroyed() ), this, SLOT( documentItemDeleted() ) );
+ connect( m_canvas_item->item(), TQT_SIGNAL( destroyed() ), this, TQT_SLOT( documentItemDeleted() ) );
*/
}
@@ -72,7 +72,7 @@ bool CommandUtils::canvasHasItem()
{
if( m_canvas_item && c )
{
- QCanvasItemList list = c->allItems();
+ TQCanvasItemList list = c->allItems();
for( unsigned int i=0;i<list.count();i++)
if( m_canvas_item == list[i] )
return true;
@@ -96,8 +96,8 @@ void CommandUtils::documentItemDeleted()
*/
}
-NewItemCommand::NewItemCommand( MyCanvasView* view, const QString & name )
- : QObject(), KCommand()
+NewItemCommand::NewItemCommand( MyCanvasView* view, const TQString & name )
+ : TQObject(), KCommand()
{
cv = view;
m_name = name;
@@ -125,7 +125,7 @@ void NewItemCommand::execute()
m_item->addRef();
/* NOT NEEDED:
- connect( m_object, SIGNAL( destroyed() ), this, SLOT( documentItemDeleted() ) );
+ connect( m_object, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( documentItemDeleted() ) );
*/
}
}
@@ -173,7 +173,7 @@ void ResizeCommand::setRect( int cx, int cy, int cw, int ch )
if( ch <= 0 )
ch = orect.height();
- rect = QRect( cx, cy, cw, ch );
+ rect = TQRect( cx, cy, cw, ch );
}
void ResizeCommand::execute()
@@ -295,12 +295,12 @@ PictureCommand::PictureCommand( double r, bool mh, bool mv, EImageScaling s, Ima
m_item = it;
}
-void PictureCommand::setExpression( const QString & expr )
+void PictureCommand::setExpression( const TQString & expr )
{
expression = expr;
}
-void PictureCommand::setPixmap( const QPixmap & pix )
+void PictureCommand::setPixmap( const TQPixmap & pix )
{
pixmap = pix;
pixserial = pixmap.serialNumber();
@@ -334,7 +334,7 @@ void PictureCommand::unexecute()
}
}
-TextChangeCommand::TextChangeCommand( TextItem* it, QString t )
+TextChangeCommand::TextChangeCommand( TextItem* it, TQString t )
: CommandUtils( it->canvasItem() )
{
m_item = it;
@@ -372,7 +372,7 @@ void TextRotationCommand::unexecute()
}
//NY24
-TextLineChangeCommand::TextLineChangeCommand( TextLineItem* it, QString t, int font , int magvert, int maghor)
+TextLineChangeCommand::TextLineChangeCommand( TextLineItem* it, TQString t, int font , int magvert, int maghor)
: CommandUtils( it->canvasItem() )
{
m_item = it;
@@ -454,7 +454,7 @@ void NewLineCommand::create()
m_object = new LineItem();
}
-NewTextCommand::NewTextCommand( QString t, MyCanvasView* v, TokenProvider* token )
+NewTextCommand::NewTextCommand( TQString t, MyCanvasView* v, TokenProvider* token )
: NewItemCommand( v, i18n("New Text") ),
m_token( token )
{
@@ -471,7 +471,7 @@ void NewTextCommand::create()
}
//NY25
-NewTextLineCommand::NewTextLineCommand( QString t, MyCanvasView* v, TokenProvider* token )
+NewTextLineCommand::NewTextLineCommand( TQString t, MyCanvasView* v, TokenProvider* token )
: NewItemCommand( v, i18n("New TextLine") ),
m_token( token )
{
@@ -506,7 +506,7 @@ DeleteCommand::~DeleteCommand()
{
DocumentItem* item = m_canvas_item->item();
if( item )
- item->disconnect( item, SIGNAL( destroyed() ), this, 0 );
+ item->disconnect( item, TQT_SIGNAL( destroyed() ), this, 0 );
delete m_canvas_item;
}
}
@@ -528,7 +528,7 @@ void DeleteCommand::unexecute()
}
}
-BorderCommand::BorderCommand( bool border, const QPen & pen, DocumentItem* item )
+BorderCommand::BorderCommand( bool border, const TQPen & pen, DocumentItem* item )
: CommandUtils( item->canvasItem() )
{
m_new_border = border;
@@ -560,7 +560,7 @@ void BorderCommand::unexecute()
}
}
-FillCommand::FillCommand( QColor c, RectItem* r )
+FillCommand::FillCommand( TQColor c, RectItem* r )
: CommandUtils( r->canvasItem() )
{
fill = c;
diff --git a/kbarcode/commands.h b/kbarcode/commands.h
index e9eb001..bee18c9 100644
--- a/kbarcode/commands.h
+++ b/kbarcode/commands.h
@@ -20,7 +20,7 @@
#include "mycanvasitem.h"
-#include <qobject.h>
+#include <tqobject.h>
#include <kcommand.h>
#include <klocale.h>
@@ -36,14 +36,14 @@ class MyCanvasRectangle;
class MyCanvasView;
class CanvasBarcode;
class PictureRectangle;
-class QCanvasItem;
-class QColor;
-class QFont;
-class QImage;
-class QPen;
-class QPixmap;
-class QPoint;
-class QString;
+class TQCanvasItem;
+class TQColor;
+class TQFont;
+class TQImage;
+class TQPen;
+class TQPixmap;
+class TQPoint;
+class TQString;
class TextItem;
//NY29
class TextLineItem;
@@ -52,8 +52,9 @@ class TokenProvider;
// Stuff for undo redo
-class CommandUtils : public QObject {
+class CommandUtils : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
CommandUtils(TCanvasItem* item);
~CommandUtils();
@@ -64,7 +65,7 @@ class CommandUtils : public QObject {
void documentItemDeleted();
protected:
- QCanvas* c;
+ TQCanvas* c;
TCanvasItem* m_canvas_item;
};
@@ -73,21 +74,22 @@ class CommandUtils : public QObject {
* that create a new item in the label editor (e.g. a
* barcode or a text element).
* You have to implement void create() which creates
- * a QCanvasItem in item.
+ * a TQCanvasItem in item.
* NewItemCommand takes care about possitioning and
* undo/redo (because of KCommand).
*
* @author Dominik Seichter
*/
-class NewItemCommand : public QObject, public KCommand {
+class NewItemCommand : public TQObject, public KCommand {
Q_OBJECT
+ TQ_OBJECT
public:
- NewItemCommand( MyCanvasView* view, const QString & name );
+ NewItemCommand( MyCanvasView* view, const TQString & name );
virtual ~NewItemCommand();
void execute();
void unexecute();
- QString name() const {
+ TQString name() const {
return m_name;
};
@@ -100,14 +102,14 @@ class NewItemCommand : public QObject, public KCommand {
protected:
/** This function has to be reimplemented in all subclasses
- * and has to create a QCanvasItem and store a pointer to it
+ * and has to create a TQCanvasItem and store a pointer to it
* in item. Otherwise KBarcode is going to crash.
*
* Example:
*
* <pre>
* void create() {
- * DrawingRect* r = new DrawingRect( 0 ); // Drawing rect is a subclass of QCanvasItem
+ * DrawingRect* r = new DrawingRect( 0 ); // Drawing rect is a subclass of TQCanvasItem
* r->setCircle( m_circle ); // Do something with r
* item = r; // save r into item, so that NewItemCommand knows about it
* }
@@ -118,8 +120,8 @@ class NewItemCommand : public QObject, public KCommand {
MyCanvasView* cv;
TCanvasItem* m_item;
DocumentItem* m_object;
- QPoint m_point;
- QString m_name;
+ TQPoint m_point;
+ TQString m_name;
};
class ResizeCommand : public KCommand, CommandUtils {
@@ -136,13 +138,13 @@ class ResizeCommand : public KCommand, CommandUtils {
void execute();
void unexecute();
- QString name() const {
+ TQString name() const {
return i18n("Resized Item");
}
protected:
- QRect orect;
- QRect rect;
+ TQRect orect;
+ TQRect rect;
bool m_shift;
};
@@ -164,7 +166,7 @@ class MoveCommand : public KCommand, CommandUtils {
void execute();
void unexecute();
- QString name() const {
+ TQString name() const {
return i18n("Moved Item");
}
@@ -179,7 +181,7 @@ class ChangeZCommand : public KCommand, CommandUtils {
void execute();
void unexecute();
- QString name() const {
+ TQString name() const {
return i18n("Raised or lowered an item");
}
@@ -197,7 +199,7 @@ class LockCommand : public KCommand, CommandUtils {
void execute();
void unexecute();
- QString name() const {
+ TQString name() const {
return i18n("Protected Item");
}
@@ -210,22 +212,22 @@ class PictureCommand : public KCommand, CommandUtils {
PictureCommand( double r, bool mirrorh, bool mirrorv, EImageScaling s, ImageItem* it );
~PictureCommand() {}
- void setExpression( const QString & expr );
- void setPixmap( const QPixmap & pix );
+ void setExpression( const TQString & expr );
+ void setPixmap( const TQPixmap & pix );
void execute();
void unexecute();
- QString name() const {
+ TQString name() const {
return i18n("Changed Settings");
}
protected:
double rotate, orotate;
bool mirrorv, omirrorv;
bool mirrorh, omirrorh;
- QString expression, oexpression;
+ TQString expression, oexpression;
EImageScaling scaling, oscaling;
- QPixmap pixmap, opixmap;
- QSize oldsize;
+ TQPixmap pixmap, opixmap;
+ TQSize oldsize;
int pixserial, opixserial;
ImageItem* m_item;
@@ -233,16 +235,16 @@ class PictureCommand : public KCommand, CommandUtils {
class TextChangeCommand : public KCommand, CommandUtils {
public:
- TextChangeCommand( TextItem* it, QString t );
+ TextChangeCommand( TextItem* it, TQString t );
~TextChangeCommand() { }
void execute();
void unexecute();
- QString name() const {
+ TQString name() const {
return i18n("Changed Text");
}
protected:
- QString oldtext, text;
+ TQString oldtext, text;
TextItem* m_item;
};
@@ -252,7 +254,7 @@ class TextRotationCommand : public KCommand, protected CommandUtils {
void execute();
void unexecute();
- QString name() const {
+ TQString name() const {
return i18n("Rotated Text");
}
@@ -265,16 +267,16 @@ class TextRotationCommand : public KCommand, protected CommandUtils {
//NY28
class TextLineChangeCommand : public KCommand, CommandUtils {
public:
- TextLineChangeCommand( TextLineItem* it, QString t, int font, int magvert, int maghor );
+ TextLineChangeCommand( TextLineItem* it, TQString t, int font, int magvert, int maghor );
~TextLineChangeCommand() { }
void execute();
void unexecute();
- QString name() const {
+ TQString name() const {
return i18n("Changed Text");
}
protected:
- QString oldtext, text;
+ TQString oldtext, text;
TextLineItem* m_item;
int m_font;
int m_mag_vert;
@@ -291,7 +293,7 @@ class BarcodeCommand : public KCommand, CommandUtils {
void execute();
void unexecute();
- QString name() const {
+ TQString name() const {
return i18n("Changed Barcode");
}
protected:
@@ -313,22 +315,22 @@ class NewPictureCommand : public NewItemCommand {
class NewTextCommand : public NewItemCommand {
public:
- NewTextCommand( QString t, MyCanvasView* v, TokenProvider* token );
+ NewTextCommand( TQString t, MyCanvasView* v, TokenProvider* token );
protected:
void create();
- QString text;
+ TQString text;
TokenProvider* m_token;
};
//NY27
class NewTextLineCommand : public NewItemCommand {
public:
- NewTextLineCommand( QString t, MyCanvasView* v, TokenProvider* token );
+ NewTextLineCommand( TQString t, MyCanvasView* v, TokenProvider* token );
protected:
void create();
- QString text;
+ TQString text;
TokenProvider* m_token;
};
//NY27
@@ -371,48 +373,48 @@ class DeleteCommand : public KCommand, CommandUtils {
void execute();
void unexecute();
- QString name() const {
+ TQString name() const {
return i18n("Delete Item");
}
};
class BorderCommand : public KCommand, protected CommandUtils {
public:
- BorderCommand( bool border, const QPen & pen, DocumentItem* item );
+ BorderCommand( bool border, const TQPen & pen, DocumentItem* item );
void execute();
void unexecute();
- QString name() const {
+ TQString name() const {
return i18n("Modified Border");
}
protected:
bool m_new_border;
bool m_old_border;
- QPen m_new_pen;
- QPen m_old_pen;
+ TQPen m_new_pen;
+ TQPen m_old_pen;
DocumentItem* m_item;
};
class FillCommand : public KCommand, protected CommandUtils {
public:
- FillCommand( QColor c, RectItem* r );
+ FillCommand( TQColor c, RectItem* r );
void execute();
void unexecute();
- QString name() const {
+ TQString name() const {
return i18n("Modified Rectangle or Ellipse");
}
protected:
- QColor fill, fill2;
+ TQColor fill, fill2;
RectItem* m_item;
};
class ScriptCommand : public KCommand, CommandUtils {
public:
- ScriptCommand( const QString & script, TCanvasItem* it )
+ ScriptCommand( const TQString & script, TCanvasItem* it )
: CommandUtils( it )
{
m_script = script;
@@ -421,13 +423,13 @@ class ScriptCommand : public KCommand, CommandUtils {
void execute();
void unexecute();
- QString name() const {
+ TQString name() const {
return i18n("Changed visibility JavaScript");
}
protected:
- QString m_script;
- QString m_old_script;
+ TQString m_script;
+ TQString m_old_script;
};
#endif
diff --git a/kbarcode/configdialog.cpp b/kbarcode/configdialog.cpp
index 787a560..3a9b320 100644
--- a/kbarcode/configdialog.cpp
+++ b/kbarcode/configdialog.cpp
@@ -19,15 +19,15 @@
#include "printersettings.h"
#include "sqltables.h"
-// Qt includes
-#include <qbuttongroup.h>
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpaintdevicemetrics.h>
-#include <qradiobutton.h>
-#include <qsqldatabase.h>
-#include <qtooltip.h>
+// TQt includes
+#include <tqbuttongroup.h>
+#include <tqcheckbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqradiobutton.h>
+#include <tqsqldatabase.h>
+#include <tqtooltip.h>
// KDE includes
#include <kabc/addressee.h>
@@ -43,12 +43,12 @@
#include <kmessagebox.h>
#include <kpushbutton.h>
-const QString cached = I18N_NOOP("There are currently %1 cached barcodes.");
+const TQString cached = I18N_NOOP("There are currently %1 cached barcodes.");
using namespace KABC;
-ConfigDialog::ConfigDialog( QWidget* parent )
+ConfigDialog::ConfigDialog( TQWidget* tqparent )
: KDialogBase( IconList, i18n("Configure KBarcode"), KDialogBase::Ok|KDialogBase::Cancel,
- KDialogBase::Ok, parent, "", true, true )
+ KDialogBase::Ok, tqparent, "", true, true )
{
setupTab2(); // Printer
setupTab1(); // SQL
@@ -63,26 +63,26 @@ ConfigDialog::~ConfigDialog()
void ConfigDialog::setupTab1( )
{
- QFrame* box = addPage( i18n("SQL Settings"), "", BarIcon("connect_no") );
- QVBoxLayout* layout = new QVBoxLayout( box, 6, 6 );
- QSpacerItem* spacer = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding );
+ TQFrame* box = addPage( i18n("SQL Settings"), "", BarIcon("connect_no") );
+ TQVBoxLayout* tqlayout = new TQVBoxLayout( box, 6, 6 );
+ TQSpacerItem* spacer = new TQSpacerItem( 0, 0, TQSizePolicy::Expanding, TQSizePolicy::Expanding );
sqlwidget = new SqlWidget( false, box, "sqlwidget" );
- layout->addWidget( sqlwidget );
- layout->addItem( spacer );
+ tqlayout->addWidget( sqlwidget );
+ tqlayout->addItem( spacer );
}
void ConfigDialog::setupTab2()
{
labelprinterdata* lb = PrinterSettings::getInstance()->getData();
- QFrame* box = addPage( i18n("Print Settings"), "", BarIcon("fileprint") );
+ TQFrame* box = addPage( i18n("Print Settings"), "", BarIcon("fileprint") );
- QVBoxLayout* tabLayout = new QVBoxLayout( box, 11, 6 );
- QHBoxLayout* Layout0 = new QHBoxLayout( 0, 6, 6 );
- QHBoxLayout* Layout1 = new QHBoxLayout( 0, 6, 6 );
- QSpacerItem* spacer = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding );
+ TQVBoxLayout* tabLayout = new TQVBoxLayout( box, 11, 6 );
+ TQHBoxLayout* Layout0 = new TQHBoxLayout( 0, 6, 6 );
+ TQHBoxLayout* Layout1 = new TQHBoxLayout( 0, 6, 6 );
+ TQSpacerItem* spacer = new TQSpacerItem( 0, 0, TQSizePolicy::Expanding, TQSizePolicy::Expanding );
printerQuality = new KComboBox( false, box );
printerQuality->insertItem( i18n("Medium Resolution (300dpi)") );
@@ -107,9 +107,9 @@ void ConfigDialog::setupTab2()
PrinterSettings::getInstance()->insertPageFormat( pageFormat );
pageFormat->setCurrentItem( lb->format );
- Layout0->addWidget( new QLabel( i18n("Printer Resolution:"), box ) );
+ Layout0->addWidget( new TQLabel( i18n("Printer Resolution:"), box ) );
Layout0->addWidget( printerQuality );
- Layout1->addWidget( new QLabel( i18n("Preview Page Format:"), box ) );
+ Layout1->addWidget( new TQLabel( i18n("Preview Page Format:"), box ) );
Layout1->addWidget( pageFormat );
tabLayout->addLayout( Layout0 );
tabLayout->addLayout( Layout1 );
@@ -120,37 +120,37 @@ void ConfigDialog::setupTab3()
{
labelprinterdata* lb = PrinterSettings::getInstance()->getData();
- QFrame* box = addPage( i18n("Import"), "", BarIcon("fileimport") );
- QGridLayout* grid = new QGridLayout( box, 2, 2 );
+ TQFrame* box = addPage( i18n("Import"), "", BarIcon("fileimport") );
+ TQGridLayout* grid = new TQGridLayout( box, 2, 2 );
- QLabel* label = new QLabel( box );
+ TQLabel* label = new TQLabel( box );
label->setText( i18n("Comment:") );
grid->addWidget( label, 0, 0 );
comment = new KLineEdit( lb->comment, box );
grid->addWidget( comment, 0, 1 );
- label = new QLabel( box );
+ label = new TQLabel( box );
label->setText( i18n( "Separator:" ) );
grid->addWidget( label, 1, 0 );
separator = new KLineEdit( lb->separator, box );
grid->addWidget( separator, 1, 1 );
- label = new QLabel( box );
+ label = new TQLabel( box );
label->setText( i18n("Quote Character:") );
grid->addWidget( label, 2, 0 );
quote = new KLineEdit( lb->quote, box );
grid->addWidget( quote, 2, 1 );
- checkUseCustomNo = new QCheckBox( i18n("&Use customer article no. for import"), box );
+ checkUseCustomNo = new TQCheckBox( i18n("&Use customer article no. for import"), box );
checkUseCustomNo->setChecked( lb->useCustomNo );
grid->addMultiCellWidget( checkUseCustomNo, 3, 3, 0, 2 );
- QHBoxLayout* Layout1 = new QHBoxLayout( 0, 6, 6 );
- Layout1->addWidget( new QLabel( i18n("File Format:"), box ) );
+ TQHBoxLayout* Layout1 = new TQHBoxLayout( 0, 6, 6 );
+ Layout1->addWidget( new TQLabel( i18n("File Format:"), box ) );
combo1 = new KComboBox( box );
combo1->insertItem( i18n("Quantity") );
@@ -171,7 +171,7 @@ void ConfigDialog::setupTab3()
Layout1->addWidget( combo3 );
grid->addMultiCellLayout( Layout1, 4, 4, 0, 2 );
- QSpacerItem* spacer = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ TQSpacerItem* spacer = new TQSpacerItem( 0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
grid->addItem( spacer, 5, 0 );
KConfig* config = kapp->config();
@@ -183,16 +183,16 @@ void ConfigDialog::setupTab3()
void ConfigDialog::setupTab4()
{
- QFrame* box = addPage( i18n("Label Editor"), "", BarIcon("kbarcode") );
- QGridLayout* tabLayout = new QGridLayout( box, 11, 6 );
+ TQFrame* box = addPage( i18n("Label Editor"), "", BarIcon("kbarcode") );
+ TQGridLayout* tabLayout = new TQGridLayout( box, 11, 6 );
- checkNewDlg = new QCheckBox( box );
+ checkNewDlg = new TQCheckBox( box );
checkNewDlg->setText( i18n("&Create a new label on startup") );
date = new KLineEdit( box );
- labelDate = new QLabel( box );
+ labelDate = new TQLabel( box );
- connect( date, SIGNAL( textChanged( const QString & ) ), this, SLOT( updateDatePreview() ) );
+ connect( date, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( updateDatePreview() ) );
spinGrid = new KIntNumInput( 0, box );
spinGrid->setLabel( i18n("Grid:" ), AlignLeft | AlignVCenter );
@@ -202,9 +202,9 @@ void ConfigDialog::setupTab4()
tabLayout->addWidget( checkNewDlg, 0, 0 );
tabLayout->addMultiCellWidget( spinGrid, 1, 1, 0, 2 );
- tabLayout->addWidget( new QLabel( i18n("Grid Color:"), box ), 2, 0 );
+ tabLayout->addWidget( new TQLabel( i18n("Grid Color:"), box ), 2, 0 );
tabLayout->addWidget( colorGrid, 2, 1 );
- tabLayout->addWidget( new QLabel( i18n("Date Format:"), box ), 3, 0 );
+ tabLayout->addWidget( new TQLabel( i18n("Date Format:"), box ), 3, 0 );
tabLayout->addWidget( date, 3, 1 );
tabLayout->addWidget( labelDate, 3, 2 );
}
@@ -212,17 +212,17 @@ void ConfigDialog::setupTab4()
void ConfigDialog::setupTab5()
{
labelprinterdata* lb = PrinterSettings::getInstance()->getData();
- QFrame* box = addPage( i18n("On New"), "", BarIcon("filenew") );
+ TQFrame* box = addPage( i18n("On New"), "", BarIcon("filenew") );
- QVBoxLayout* tabLayout = new QVBoxLayout( box, 11, 6 );
+ TQVBoxLayout* tabLayout = new TQVBoxLayout( box, 11, 6 );
- QButtonGroup* bg = new QButtonGroup( i18n("On New Article"), box );
+ TQButtonGroup* bg = new TQButtonGroup( i18n("On New Article"), box );
bg->setColumnLayout(0, Qt::Vertical );
- bg->layout()->setSpacing( 6 );
- bg->layout()->setMargin( 11 );
- QGridLayout* bgLayout = new QGridLayout( bg->layout() );
+ bg->tqlayout()->setSpacing( 6 );
+ bg->tqlayout()->setMargin( 11 );
+ TQGridLayout* bgLayout = new TQGridLayout( bg->tqlayout() );
- QStringList alist, glist;
+ TQStringList alist, glist;
alist.append( i18n("No Line Break") );
alist.append( i18n("Line Break") );
alist.append( i18n("Insert Label X") );
@@ -247,21 +247,21 @@ void ConfigDialog::setupTab5()
bgLayout->setColStretch( 1, 3 );
- bgLayout->addWidget( new QLabel( "1.", bg ), 0, 0 );
- bgLayout->addWidget( new QLabel( "2.", bg ), 1, 0 );
- bgLayout->addWidget( new QLabel( "3.", bg ), 2, 0 );
- bgLayout->addWidget( new QLabel( "4.", bg ), 3, 0 );
+ bgLayout->addWidget( new TQLabel( "1.", bg ), 0, 0 );
+ bgLayout->addWidget( new TQLabel( "2.", bg ), 1, 0 );
+ bgLayout->addWidget( new TQLabel( "3.", bg ), 2, 0 );
+ bgLayout->addWidget( new TQLabel( "4.", bg ), 3, 0 );
bgLayout->addWidget( onNewArticle1, 0, 1 );
bgLayout->addWidget( onNewArticle2, 1, 1 );
bgLayout->addWidget( onNewArticle3, 2, 1 );
bgLayout->addWidget( onNewArticle4, 3, 1 );
- QButtonGroup* bg2 = new QButtonGroup( i18n("On New Group"), box );
+ TQButtonGroup* bg2 = new TQButtonGroup( i18n("On New Group"), box );
bg2->setColumnLayout(0, Qt::Vertical );
- bg2->layout()->setSpacing( 6 );
- bg2->layout()->setMargin( 11 );
- QGridLayout* bg2Layout = new QGridLayout( bg2->layout() );
+ bg2->tqlayout()->setSpacing( 6 );
+ bg2->tqlayout()->setMargin( 11 );
+ TQGridLayout* bg2Layout = new TQGridLayout( bg2->tqlayout() );
onNewGroup1 = new KComboBox( false, bg2 );
onNewGroup2 = new KComboBox( false, bg2 );
@@ -275,10 +275,10 @@ void ConfigDialog::setupTab5()
bg2Layout->setColStretch( 1, 3 );
- bg2Layout->addWidget( new QLabel( "1.", bg2 ), 0, 0 );
- bg2Layout->addWidget( new QLabel( "2.", bg2 ), 1, 0 );
- bg2Layout->addWidget( new QLabel( "3.", bg2 ), 2, 0 );
- bg2Layout->addWidget( new QLabel( "4.", bg2 ), 3, 0 );
+ bg2Layout->addWidget( new TQLabel( "1.", bg2 ), 0, 0 );
+ bg2Layout->addWidget( new TQLabel( "2.", bg2 ), 1, 0 );
+ bg2Layout->addWidget( new TQLabel( "3.", bg2 ), 2, 0 );
+ bg2Layout->addWidget( new TQLabel( "4.", bg2 ), 3, 0 );
bg2Layout->addWidget( onNewGroup1, 0, 1 );
bg2Layout->addWidget( onNewGroup2, 1, 1 );
@@ -340,12 +340,12 @@ void ConfigDialog::accept()
break;
}
- QDialog::accept();
+ TQDialog::accept();
}
void ConfigDialog::updateDatePreview()
{
- labelDate->setText( i18n("Preview: ") + QDateTime::currentDateTime().toString( date->text() ) );
+ labelDate->setText( i18n("Preview: ") + TQDateTime::tqcurrentDateTime().toString( date->text() ) );
}
#include "configdialog.moc"
diff --git a/kbarcode/configdialog.h b/kbarcode/configdialog.h
index 5838f78..02b31a7 100644
--- a/kbarcode/configdialog.h
+++ b/kbarcode/configdialog.h
@@ -28,19 +28,20 @@ class KIntNumInput;
class KDoubleNumInput;
class KLineEdit;
class KPushButton;
-class QRadioButton;
-class QCheckBox;
-class QLabel;
-class QString;
-class QWidget;
+class TQRadioButton;
+class TQCheckBox;
+class TQLabel;
+class TQString;
+class TQWidget;
class SqlWidget;
/** KBarcodes configuration dialog for advanced settings.
*/
class ConfigDialog : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
- ConfigDialog( QWidget* parent );
+ ConfigDialog( TQWidget* tqparent );
~ConfigDialog();
KLineEdit* comment;
@@ -53,10 +54,10 @@ class ConfigDialog : public KDialogBase {
KComboBox* printerQuality;
KComboBox* pageFormat;
- QLabel* labelDate;
+ TQLabel* labelDate;
- QCheckBox* checkNewDlg;
- QCheckBox* checkUseCustomNo;
+ TQCheckBox* checkNewDlg;
+ TQCheckBox* checkUseCustomNo;
KComboBox* combo1;
KComboBox* combo2;
diff --git a/kbarcode/confwizard.cpp b/kbarcode/confwizard.cpp
index 7809c6c..fff2fb1 100644
--- a/kbarcode/confwizard.cpp
+++ b/kbarcode/confwizard.cpp
@@ -20,15 +20,15 @@
#include "printersettings.h"
#include "dsmainwindow.h"
-// Qt includes
-#include <qbuttongroup.h>
-#include <qcheckbox.h>
-#include <qcursor.h>
-#include <qlayout.h>
-#include <qsqldatabase.h>
-#include <qradiobutton.h>
-#include <qprinter.h>
-#include <qtextbrowser.h>
+// TQt includes
+#include <tqbuttongroup.h>
+#include <tqcheckbox.h>
+#include <tqcursor.h>
+#include <tqlayout.h>
+#include <tqsqldatabase.h>
+#include <tqradiobutton.h>
+#include <tqprinter.h>
+#include <tqtextbrowser.h>
// KDE includes
#include <kapplication.h>
@@ -53,8 +53,8 @@ const char* description = I18N_NOOP(
"replacement for the creation of barcodes. All major types of barcodes "
"like EAN, UPC, CODE39 and ISBN are supported." );
-ConfWizard::ConfWizard( QWidget* parent, const char* name, bool modal )
- : KWizard( parent, name, modal )
+ConfWizard::ConfWizard( TQWidget* tqparent, const char* name, bool modal )
+ : KWizard( tqparent, name, modal )
{
setCaption( i18n( "Configure KBarcode" ) );
@@ -66,9 +66,9 @@ ConfWizard::ConfWizard( QWidget* parent, const char* name, bool modal )
setNextEnabled( page_2, false );
helpButton()->hide();
- connect( buttonCreate, SIGNAL( clicked() ), this, SLOT( create() ) );
- connect( buttonExample, SIGNAL( clicked() ), this, SLOT( example() ) );
- connect( checkDatabase, SIGNAL( clicked() ), this, SLOT( useDatabase() ) );
+ connect( buttonCreate, TQT_SIGNAL( clicked() ), this, TQT_SLOT( create() ) );
+ connect( buttonExample, TQT_SIGNAL( clicked() ), this, TQT_SLOT( example() ) );
+ connect( checkDatabase, TQT_SIGNAL( clicked() ), this, TQT_SLOT( useDatabase() ) );
}
ConfWizard::~ConfWizard()
@@ -83,21 +83,21 @@ void ConfWizard::accept()
void ConfWizard::setupPage1()
{
- page = new QWidget( this, "page" );
- pageLayout = new QVBoxLayout( page, 11, 6, "pageLayout");
+ page = new TQWidget( this, "page" );
+ pageLayout = new TQVBoxLayout( page, 11, 6, "pageLayout");
- Layout8 = new QHBoxLayout( 0, 0, 6, "Layout8");
+ Layout8 = new TQHBoxLayout( 0, 0, 6, "Layout8");
- Layout7 = new QVBoxLayout( 0, 0, 6, "Layout7");
+ Layout7 = new TQVBoxLayout( 0, 0, 6, "Layout7");
- logo = new QLabel( page, "logo" );
+ logo = new TQLabel( page, "logo" );
logo->setPixmap( locate("data", "kbarcode/logo.png") );
- QSpacerItem* spacer = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ TQSpacerItem* spacer = new TQSpacerItem( 0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
pageLayout->addWidget( logo );
Layout7->addItem( spacer );
Layout8->addLayout( Layout7 );
- TextLabel2_2 = new QLabel( page, "TextLabel2_2" );
+ TextLabel2_2 = new TQLabel( page, "TextLabel2_2" );
TextLabel2_2->setText( i18n( "<qt><h1>Welcome to KBarcode</h1><br><br>") +
i18n( description ) + "</qt>" );
Layout8->addWidget( TextLabel2_2 );
@@ -113,10 +113,10 @@ void ConfWizard::setupPage1()
void ConfWizard::setupPage0()
{
- QWidget* page_0 = new QWidget( this, "page_0" );
- QVBoxLayout* pageLayout = new QVBoxLayout( page_0, 11, 6, "pageLayout");
+ TQWidget* page_0 = new TQWidget( this, "page_0" );
+ TQVBoxLayout* pageLayout = new TQVBoxLayout( page_0, 11, 6, "pageLayout");
- QTextBrowser* b = new QTextBrowser( page_0, "b" );
+ TQTextBrowser* b = new TQTextBrowser( page_0, "b" );
b->setText( DSMainWindow::systemCheck() );
pageLayout->addWidget( b );
@@ -126,17 +126,17 @@ void ConfWizard::setupPage0()
void ConfWizard::setupPage2()
{
- page_2 = new QWidget( this, "page_2" );
- pageLayout_2 = new QVBoxLayout( page_2, 11, 6, "pageLayout_2");
+ page_2 = new TQWidget( this, "page_2" );
+ pageLayout_2 = new TQVBoxLayout( page_2, 11, 6, "pageLayout_2");
- checkDatabase = new QCheckBox( page_2 );
+ checkDatabase = new TQCheckBox( page_2 );
checkDatabase->setText( i18n("&Use database with KBarcode") );
checkDatabase->setChecked( true );
sqlwidget = new SqlWidget( true, page_2, "sqlwidget" );
- connect( sqlwidget, SIGNAL( databaseWorking( bool ) ), this, SLOT( testSettings( bool ) ) );
+ connect( sqlwidget, TQT_SIGNAL( databaseWorking( bool ) ), this, TQT_SLOT( testSettings( bool ) ) );
- QSpacerItem* spacer_5 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ TQSpacerItem* spacer_5 = new TQSpacerItem( 0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
pageLayout_2->addWidget( checkDatabase );
pageLayout_2->addWidget( sqlwidget );
pageLayout_2->addItem( spacer_5 );
@@ -146,15 +146,15 @@ void ConfWizard::setupPage2()
void ConfWizard::setupPage3()
{
- page_3 = new QWidget( this, "page_3" );
- pageLayout_3 = new QVBoxLayout( page_3, 11, 6, "pageLayout_3");
+ page_3 = new TQWidget( this, "page_3" );
+ pageLayout_3 = new TQVBoxLayout( page_3, 11, 6, "pageLayout_3");
- TextLabel1_2 = new QLabel( page_3, "TextLabel1_2" );
+ TextLabel1_2 = new TQLabel( page_3, "TextLabel1_2" );
TextLabel1_2->setText( i18n( "KBarcode can create the required SQL tables for you.<br>KBarcode will add also some Label Definitions to the tables.<br>After that you can fill the tables with some example data." ) );
- TextLabel1_2->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
+ TextLabel1_2->tqsetAlignment( int( TQLabel::WordBreak | TQLabel::AlignVCenter ) );
pageLayout_3->addWidget( TextLabel1_2 );
- Layout5_2 = new QVBoxLayout( 0, 0, 6, "Layout5_2");
+ Layout5_2 = new TQVBoxLayout( 0, 0, 6, "Layout5_2");
buttonCreate = new KPushButton( page_3, "buttonCreate" );
buttonCreate->setText( i18n( "&Create Tables" ) );
@@ -164,7 +164,7 @@ void ConfWizard::setupPage3()
buttonExample->setEnabled( FALSE );
buttonExample->setText( i18n( "&Add Example Data" ) );
Layout5_2->addWidget( buttonExample );
- QSpacerItem* spacer_6 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ TQSpacerItem* spacer_6 = new TQSpacerItem( 0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
Layout5_2->addItem( spacer_6 );
pageLayout_3->addLayout( Layout5_2 );
addPage( page_3, i18n( "Create Tables" ) );
@@ -177,7 +177,7 @@ void ConfWizard::testSettings( bool b )
void ConfWizard::create()
{
- KApplication::setOverrideCursor( Qt::WaitCursor );
+ KApplication::setOverrideCursor( TQt::WaitCursor );
if(!SqlTables::getInstance()->newTables( sqlwidget->username(), sqlwidget->password(), sqlwidget->hostname(), sqlwidget->database(), sqlwidget->driver() ) )
{
KApplication::restoreOverrideCursor();
@@ -186,7 +186,7 @@ void ConfWizard::create()
else
KApplication::restoreOverrideCursor();
- QSqlDatabase* db = QSqlDatabase::addDatabase( sqlwidget->driver() );
+ TQSqlDatabase* db = TQSqlDatabase::addDatabase( sqlwidget->driver() );
db->setDatabaseName( sqlwidget->database() );
db->setUserName( sqlwidget->username() );
db->setPassword( sqlwidget->password() );
@@ -197,7 +197,7 @@ void ConfWizard::create()
db->lastError().databaseText() + "</qt>" );
if( db->open() ) {
- KApplication::setOverrideCursor( Qt::WaitCursor );
+ KApplication::setOverrideCursor( TQt::WaitCursor );
SqlTables::getInstance()->importData(
locate("appdata", "labeldefinitions.sql"), db );
buttonExample->setEnabled( true );
@@ -209,7 +209,7 @@ void ConfWizard::create()
void ConfWizard::example()
{
- QSqlDatabase* db = QSqlDatabase::addDatabase( sqlwidget->driver() );
+ TQSqlDatabase* db = TQSqlDatabase::addDatabase( sqlwidget->driver() );
db->setDatabaseName( sqlwidget->database() );
db->setUserName( sqlwidget->username() );
db->setPassword( sqlwidget->password() );
@@ -227,15 +227,15 @@ void ConfWizard::example()
db->close();
}
-void ConfWizard::showPage( QWidget* page )
+void ConfWizard::showPage( TQWidget* page )
{
- QWizard::showPage(page);
+ TQWizard::showPage(page);
if( page == page_2 && !sqlwidget->driverCount() ) {
KMessageBox::information( this, i18n(
- "There are no Qt SQL drivers installed. "
+ "There are no TQt SQL drivers installed. "
"KBarcode needs those drivers to access the different SQL databases. "
- "This drivers are part of the Qt Source distribution and should also be part of "
+ "This drivers are part of the TQt Source distribution and should also be part of "
"your distribution. Please install them first.") );
}
diff --git a/kbarcode/confwizard.h b/kbarcode/confwizard.h
index c1bfc20..9df4a13 100644
--- a/kbarcode/confwizard.h
+++ b/kbarcode/confwizard.h
@@ -20,34 +20,35 @@
#include <kwizard.h>
-class QButtonGroup;
-class QCheckBox;
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
-class QRadioButton;
+class TQButtonGroup;
+class TQCheckBox;
+class TQVBoxLayout;
+class TQHBoxLayout;
+class TQGridLayout;
+class TQRadioButton;
class KComboBox;
class KLineEdit;
class KPushButton;
class KURLLabel;
-class QLabel;
-class QWidget;
+class TQLabel;
+class TQWidget;
class SqlWidget;
/** KBarcodes configuration wizard.
*/
class ConfWizard : public KWizard
{
Q_OBJECT
+ TQ_OBJECT
public:
- ConfWizard( QWidget* parent = 0, const char* name = 0, bool modal = true );
+ ConfWizard( TQWidget* tqparent = 0, const char* name = 0, bool modal = true );
~ConfWizard();
- void showPage( QWidget* page );
+ void showPage( TQWidget* page );
// used in dsmainwindow.cpp
// not a clean API, but I am lazy :-(
- QCheckBox* checkDatabase;
+ TQCheckBox* checkDatabase;
private slots:
void testSettings( bool b );
@@ -66,36 +67,36 @@ class ConfWizard : public KWizard
SqlWidget* sqlwidget;
- QWidget* page;
- QLabel* logo;
- QLabel* TextLabel2_2;
+ TQWidget* page;
+ TQLabel* logo;
+ TQLabel* TextLabel2_2;
KURLLabel* KURLLabel1;
- QWidget* page_2;
- QLabel* TextLabel1;
- QLabel* TextLabel2;
- QLabel* TextLabel3;
- QLabel* TextLabel4;
- QLabel* TextLabel5;
- QLabel* TextLabel6;
+ TQWidget* page_2;
+ TQLabel* TextLabel1;
+ TQLabel* TextLabel2;
+ TQLabel* TextLabel3;
+ TQLabel* TextLabel4;
+ TQLabel* TextLabel5;
+ TQLabel* TextLabel6;
KPushButton* buttonTest;
- QWidget* page_3;
- QLabel* TextLabel1_2;
+ TQWidget* page_3;
+ TQLabel* TextLabel1_2;
KPushButton* buttonCreate;
KPushButton* buttonExample;
- QButtonGroup* groupDatabase;
+ TQButtonGroup* groupDatabase;
protected:
- QVBoxLayout* pageLayout;
- QHBoxLayout* Layout8;
- QVBoxLayout* Layout7;
- QVBoxLayout* pageLayout_2;
- QVBoxLayout* pageLayout_4;
- QHBoxLayout* Layout5;
- QVBoxLayout* Layout3;
- QVBoxLayout* Layout4;
- QVBoxLayout* Layout6;
- QVBoxLayout* pageLayout_3;
- QVBoxLayout* Layout5_2;
+ TQVBoxLayout* pageLayout;
+ TQHBoxLayout* Layout8;
+ TQVBoxLayout* Layout7;
+ TQVBoxLayout* pageLayout_2;
+ TQVBoxLayout* pageLayout_4;
+ TQHBoxLayout* Layout5;
+ TQVBoxLayout* Layout3;
+ TQVBoxLayout* Layout4;
+ TQVBoxLayout* Layout6;
+ TQVBoxLayout* pageLayout_3;
+ TQVBoxLayout* Layout5_2;
};
#endif // CONFWIZARD_H
diff --git a/kbarcode/csvfile.cpp b/kbarcode/csvfile.cpp
index f8cc81f..880898f 100644
--- a/kbarcode/csvfile.cpp
+++ b/kbarcode/csvfile.cpp
@@ -19,10 +19,10 @@
#include "printersettings.h"
-#include <qbuffer.h>
-#include <qtextcodec.h>
+#include <tqbuffer.h>
+#include <tqtextcodec.h>
-CSVFile::CSVFile( const QString & filename )
+CSVFile::CSVFile( const TQString & filename )
{
m_eof = false;
m_csv = true;
@@ -35,10 +35,10 @@ CSVFile::CSVFile( const QString & filename )
m_file.open( IO_ReadOnly );
if( m_file.isOpen() )
- m_stream.setDevice( &m_file );
+ m_stream.setDevice( TQT_TQIODEVICE(&m_file) );
}
-CSVFile::CSVFile( QBuffer & buf )
+CSVFile::CSVFile( TQBuffer & buf )
{
m_eof = false;
m_csv = true;
@@ -50,24 +50,24 @@ CSVFile::CSVFile( QBuffer & buf )
buf.open( IO_ReadOnly );
if( buf.isOpen() )
- m_stream.setDevice( &buf );
+ m_stream.setDevice( TQT_TQIODEVICE(&buf) );
}
CSVFile::~CSVFile()
{
- if( m_stream.device() && m_stream.device()->isOpen() )
- m_stream.device()->close();
+ if( m_stream.tqdevice() && m_stream.tqdevice()->isOpen() )
+ m_stream.tqdevice()->close();
}
-QStringList CSVFile::readNextLine()
+TQStringList CSVFile::readNextLine()
{
- QString line;
+ TQString line;
- if( !m_stream.device() )
- return QStringList();
+ if( !m_stream.tqdevice() )
+ return TQStringList();
- if( !m_stream.device()->isOpen() )
- return QStringList();
+ if( !m_stream.tqdevice()->isOpen() )
+ return TQStringList();
// walk through the lines until a line containing valid data
for( ;; )
@@ -79,7 +79,7 @@ QStringList CSVFile::readNextLine()
if( line.isNull() )
{
m_eof = true;
- return QStringList();
+ return TQStringList();
}
// ignore comments and empty lines
@@ -92,10 +92,10 @@ QStringList CSVFile::readNextLine()
return m_csv ? readCsvLine( line ) : readFixedLine( line );
}
-QStringList CSVFile::readCsvLine( const QString & l )
+TQStringList CSVFile::readCsvLine( const TQString & l )
{
- QString line( l );
- QStringList sections;
+ TQString line( l );
+ TQStringList sections;
unsigned int start = 0;
unsigned int end = 0;
unsigned int len;
@@ -131,10 +131,10 @@ QStringList CSVFile::readCsvLine( const QString & l )
return sections;
}
-QStringList CSVFile::readFixedLine( const QString & line )
+TQStringList CSVFile::readFixedLine( const TQString & line )
{
- QString data( line );
- QStringList list;
+ TQString data( line );
+ TQStringList list;
for( unsigned int i=0;i<m_width.count();i++ )
{
@@ -145,9 +145,9 @@ QStringList CSVFile::readFixedLine( const QString & line )
return list;
}
-QString CSVFile::removeQuote( const QString & text )
+TQString CSVFile::removeQuote( const TQString & text )
{
- QString line = text.stripWhiteSpace();
+ TQString line = text.stripWhiteSpace();
if( m_quote.isEmpty() )
return text;
@@ -161,8 +161,8 @@ QString CSVFile::removeQuote( const QString & text )
return line;
}
-void CSVFile::setEncoding( const QString & enc )
+void CSVFile::setEncoding( const TQString & enc )
{
- m_stream.setCodec( QTextCodec::codecForName( enc.latin1() ) );
+ m_stream.setCodec( TQTextCodec::codecForName( enc.latin1() ) );
}
diff --git a/kbarcode/csvfile.h b/kbarcode/csvfile.h
index 8049d58..9a0c829 100644
--- a/kbarcode/csvfile.h
+++ b/kbarcode/csvfile.h
@@ -18,25 +18,25 @@
#ifndef CSVFILE_H
#define CSVFILE_H
-#include <qfile.h>
-#include <qstringlist.h>
-#include <qtextstream.h>
+#include <tqfile.h>
+#include <tqstringlist.h>
+#include <tqtextstream.h>
-class QBuffer;
+class TQBuffer;
/** This class makes it very easy to parse a comma separated value file
*/
class CSVFile {
public:
- CSVFile( const QString & filename );
- CSVFile( QBuffer & buf );
+ CSVFile( const TQString & filename );
+ CSVFile( TQBuffer & buf );
~CSVFile();
/** reads the next line from the CSV file and returns
* the line split into sections. Comments are ignored by this
* line.
*/
- QStringList readNextLine();
+ TQStringList readNextLine();
/** returns true when the CSVFile object is valid.
* returns false incase of an error
@@ -49,23 +49,23 @@ class CSVFile {
/** set the encoding to use for the data
*/
- void setEncoding( const QString & enc );
+ void setEncoding( const TQString & enc );
/** set the separator to use for the data
*/
- inline void setSeparator( const QString & sep );
+ inline void setSeparator( const TQString & sep );
/** set the quoting character
*/
- inline void setQuote( const QString & quote );
+ inline void setQuote( const TQString & quote );
/** set the comment character
*/
- inline void setComment( const QString & comment );
+ inline void setComment( const TQString & comment );
/** set the field widths for fixed field width files
*/
- inline void setFieldWidth( const QValueList<int> & width );
+ inline void setFieldWidth( const TQValueList<int> & width );
/** sets wether this is a CSV file or
* a file with fixed field width.
@@ -82,23 +82,23 @@ class CSVFile {
/** removes quoting characters as defined in lpdata from the
* string @p text
*/
- QString removeQuote( const QString & text );
+ TQString removeQuote( const TQString & text );
- QStringList readCsvLine( const QString & line );
+ TQStringList readCsvLine( const TQString & line );
- QStringList readFixedLine( const QString & line );
+ TQStringList readFixedLine( const TQString & line );
private:
/** the filehandle which is used to access the file
*/
- QFile m_file;
- QTextStream m_stream;
+ TQFile m_file;
+ TQTextStream m_stream;
- QString m_quote;
- QString m_separator;
- QString m_comment;
+ TQString m_quote;
+ TQString m_separator;
+ TQString m_comment;
- QValueList<int> m_width;
+ TQValueList<int> m_width;
bool m_csv;
bool m_eof;
@@ -106,10 +106,10 @@ class CSVFile {
bool CSVFile::isValid() const
{
- if( !m_stream.device() )
+ if( !m_stream.tqdevice() )
return false;
- return m_stream.device()->isOpen();
+ return m_stream.tqdevice()->isOpen();
}
bool CSVFile::isEof() const
@@ -127,22 +127,22 @@ bool CSVFile::isCSVFile() const
return m_csv;
}
-void CSVFile::setSeparator( const QString & sep )
+void CSVFile::setSeparator( const TQString & sep )
{
m_separator = sep;
}
-void CSVFile::setQuote( const QString & quote )
+void CSVFile::setQuote( const TQString & quote )
{
m_quote = quote;
}
-void CSVFile::setComment( const QString & comment )
+void CSVFile::setComment( const TQString & comment )
{
m_comment = comment;
}
-void CSVFile::setFieldWidth( const QValueList<int> & width )
+void CSVFile::setFieldWidth( const TQValueList<int> & width )
{
m_width = width;
}
diff --git a/kbarcode/csvimportdlg.cpp b/kbarcode/csvimportdlg.cpp
index 3da1899..767cb59 100644
--- a/kbarcode/csvimportdlg.cpp
+++ b/kbarcode/csvimportdlg.cpp
@@ -20,23 +20,23 @@
#include "sqltables.h"
#include "encodingcombo.h"
-// Qt includes
-#include <qcheckbox.h>
-#include <qcursor.h>
-#include <qfile.h>
-#include <qframe.h>
-#include <qgroupbox.h>
-#include <qhbuttongroup.h>
-#include <qheader.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qlistbox.h>
-#include <qprogressdialog.h>
-#include <qsqlquery.h>
-#include <qtable.h>
-#include <qradiobutton.h>
-#include <qtextstream.h>
-#include <qvbox.h>
+// TQt includes
+#include <tqcheckbox.h>
+#include <tqcursor.h>
+#include <tqfile.h>
+#include <tqframe.h>
+#include <tqgroupbox.h>
+#include <tqhbuttongroup.h>
+#include <tqheader.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqlistbox.h>
+#include <tqprogressdialog.h>
+#include <tqsqlquery.h>
+#include <tqtable.h>
+#include <tqradiobutton.h>
+#include <tqtextstream.h>
+#include <tqvbox.h>
// KDE includes
#include <kapplication.h>
@@ -50,33 +50,33 @@
#include "csvfile.h"
// import from labelprinter.cpp
-extern QString removeQuote( QString text, QString quote );
+extern TQString removeQuote( TQString text, TQString quote );
const char* NOFIELD = "<NONE>";
-CSVImportDlg::CSVImportDlg(QWidget *parent, const char *name )
+CSVImportDlg::CSVImportDlg(TQWidget *tqparent, const char *name )
: KDialogBase( KDialogBase::Tabbed, i18n("Import"),
- KDialogBase::Ok | KDialogBase::Close, KDialogBase::Ok, parent,name,false,true)
+ KDialogBase::Ok | KDialogBase::Close, KDialogBase::Ok, tqparent,name,false,true)
{
setButtonOKText( i18n("&Import"), i18n("Import the selected file into your tables.") );
createPage1();
createPage2();
- connect( requester, SIGNAL( textChanged( const QString & ) ), this, SLOT( settingsChanged() ) );
- connect( buttonSet, SIGNAL( clicked() ), this, SLOT( setCol() ) );
- connect( comboSQL, SIGNAL( activated( int ) ), this, SLOT( updateFields() ) );
- connect( databaseName, SIGNAL( textChanged( const QString & ) ), this, SLOT( updateFields() ) );
- connect( comboEncoding, SIGNAL( activated( int ) ), this, SLOT( settingsChanged() ) );
- connect( table->horizontalHeader(), SIGNAL( clicked( int ) ), this, SLOT( updateCol( int ) ) );
- connect( radioCSVFile, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioFixedFile, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( buttonAdd, SIGNAL( clicked() ), this, SLOT( addWidth() ) );
- connect( buttonRemove,SIGNAL( clicked() ), this, SLOT( removeWidth() ) );
- connect( comment, SIGNAL( textChanged( const QString & ) ), this, SLOT( settingsChanged() ) );
- connect( quote, SIGNAL( textChanged( const QString & ) ), this, SLOT( settingsChanged() ) );
- connect( separator, SIGNAL( textChanged( const QString & ) ), this, SLOT( settingsChanged() ) );
- connect( checkLoadAll, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
+ connect( requester, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( settingsChanged() ) );
+ connect( buttonSet, TQT_SIGNAL( clicked() ), this, TQT_SLOT( setCol() ) );
+ connect( comboSQL, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( updateFields() ) );
+ connect( databaseName, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( updateFields() ) );
+ connect( comboEncoding, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( settingsChanged() ) );
+ connect( table->horizontalHeader(), TQT_SIGNAL( clicked( int ) ), this, TQT_SLOT( updateCol( int ) ) );
+ connect( radioCSVFile, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioFixedFile, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( buttonAdd, TQT_SIGNAL( clicked() ), this, TQT_SLOT( addWidth() ) );
+ connect( buttonRemove,TQT_SIGNAL( clicked() ), this, TQT_SLOT( removeWidth() ) );
+ connect( comment, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( settingsChanged() ) );
+ connect( quote, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( settingsChanged() ) );
+ connect( separator, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( settingsChanged() ) );
+ connect( checkLoadAll, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
updateFields();
enableControls();
@@ -90,9 +90,9 @@ CSVImportDlg::~CSVImportDlg()
void CSVImportDlg::createPage1()
{
- QFrame* box = addPage( i18n("&Import Data") );
- QVBoxLayout* layout = new QVBoxLayout( box, 6, 6 );
- QGridLayout* grid = new QGridLayout( 2 );
+ TQFrame* box = addPage( i18n("&Import Data") );
+ TQVBoxLayout* tqlayout = new TQVBoxLayout( box, 6, 6 );
+ TQGridLayout* grid = new TQGridLayout( 2 );
requester = new KURLRequester( box );
comboEncoding = new EncodingCombo( box );
@@ -104,17 +104,17 @@ void CSVImportDlg::createPage1()
comboSQL->insertItem( i18n("Other table...") );
databaseName = new KLineEdit( box );
- checkLoadAll = new QCheckBox( i18n("&Load complete file into preview"), box );
+ checkLoadAll = new TQCheckBox( i18n("&Load complete file into preview"), box );
spinLoadOnly = new KIntNumInput( box );
spinLoadOnly->setLabel( i18n("Load only a number of datasets:"), AlignLeft | AlignVCenter );
spinLoadOnly->setRange( 0, 10000, 1, false );
checkLoadAll->setChecked( true );
- table = new QTable( box );
+ table = new TQTable( box );
table->setReadOnly( true );
- frame = new QFrame( box );
- QHBoxLayout* layout2 = new QHBoxLayout( frame, 6, 6 );
+ frame = new TQFrame( box );
+ TQHBoxLayout* tqlayout2 = new TQHBoxLayout( frame, 6, 6 );
spinCol = new KIntNumInput( frame );
spinCol->setLabel( i18n("Column:"), AlignLeft | AlignVCenter );
@@ -123,69 +123,69 @@ void CSVImportDlg::createPage1()
comboField = new KComboBox( false, frame );
buttonSet = new KPushButton( i18n("Set"), frame );
- layout2->addWidget( spinCol );
- layout2->addWidget( new QLabel( i18n("Database field to use for this column:"), frame ) );
- layout2->addWidget( comboField );
- layout2->addWidget( buttonSet );
+ tqlayout2->addWidget( spinCol );
+ tqlayout2->addWidget( new TQLabel( i18n("Database field to use for this column:"), frame ) );
+ tqlayout2->addWidget( comboField );
+ tqlayout2->addWidget( buttonSet );
- grid->addWidget( new QLabel( i18n("File to import:"), box ), 0, 0 );
+ grid->addWidget( new TQLabel( i18n("File to import:"), box ), 0, 0 );
grid->addWidget( requester, 0, 1 );
- grid->addWidget( new QLabel( i18n("Encoding:"), box ), 1, 0 );
+ grid->addWidget( new TQLabel( i18n("Encoding:"), box ), 1, 0 );
grid->addWidget( comboEncoding, 1, 1 );
- grid->addWidget( new QLabel( i18n("Import into table:"), box ), 2, 0 );
+ grid->addWidget( new TQLabel( i18n("Import into table:"), box ), 2, 0 );
grid->addWidget( comboSQL, 2, 1 );
- grid->addWidget( new QLabel( i18n("Table Name:"), box ), 3, 0 );
+ grid->addWidget( new TQLabel( i18n("Table Name:"), box ), 3, 0 );
grid->addWidget( databaseName, 3, 1 );
grid->addWidget( checkLoadAll, 4, 0 );
grid->addWidget( spinLoadOnly, 4, 1 );
- layout->addLayout( grid );
- layout->addWidget( table );
- layout->setStretchFactor( table, 2 );
- layout->addWidget( frame );
+ tqlayout->addLayout( grid );
+ tqlayout->addWidget( table );
+ tqlayout->setStretchFactor( table, 2 );
+ tqlayout->addWidget( frame );
}
void CSVImportDlg::createPage2()
{
labelprinterdata* lb = PrinterSettings::getInstance()->getData();
- QFrame* mainBox = addPage( i18n("&Import Settings") );
- QVBoxLayout* layout = new QVBoxLayout( mainBox, 6, 6 );
- QSpacerItem* spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
- QSpacerItem* spacer2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ TQFrame* mainBox = addPage( i18n("&Import Settings") );
+ TQVBoxLayout* tqlayout = new TQVBoxLayout( mainBox, 6, 6 );
+ TQSpacerItem* spacer1 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
+ TQSpacerItem* spacer2 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
- QHButtonGroup* buttonGroup = new QHButtonGroup( i18n("File Format:"), mainBox );
- radioCSVFile = new QRadioButton( i18n("&CSV File"), buttonGroup );
- radioFixedFile = new QRadioButton( i18n("File with &fixed field width"), buttonGroup );
+ TQHButtonGroup* buttonGroup = new TQHButtonGroup( i18n("File Format:"), mainBox );
+ radioCSVFile = new TQRadioButton( i18n("&CSV File"), buttonGroup );
+ radioFixedFile = new TQRadioButton( i18n("File with &fixed field width"), buttonGroup );
- QHBox* hboxFrame = new QHBox( mainBox );
+ TQHBox* hboxFrame = new TQHBox( mainBox );
- groupCSV = new QGroupBox( i18n("CSV File"), hboxFrame );
- groupFixed = new QGroupBox( i18n("Fixed Field Width File"), hboxFrame );
+ groupCSV = new TQGroupBox( i18n("CSV File"), hboxFrame );
+ groupFixed = new TQGroupBox( i18n("Fixed Field Width File"), hboxFrame );
groupCSV->setColumnLayout(0, Qt::Vertical );
- groupCSV->layout()->setSpacing( 6 );
- groupCSV->layout()->setMargin( 11 );
+ groupCSV->tqlayout()->setSpacing( 6 );
+ groupCSV->tqlayout()->setMargin( 11 );
- QVBoxLayout* vbox = new QVBoxLayout( groupCSV->layout() );
- QGridLayout* grid = new QGridLayout( 2, 2 );
+ TQVBoxLayout* vbox = new TQVBoxLayout( groupCSV->tqlayout() );
+ TQGridLayout* grid = new TQGridLayout( 2, 2 );
grid->setSpacing( 6 );
grid->setMargin( 11 );
- QLabel* label = new QLabel( groupCSV );
+ TQLabel* label = new TQLabel( groupCSV );
label->setText( i18n("Comment:") );
grid->addWidget( label, 0, 0 );
comment = new KLineEdit( lb->comment, groupCSV );
grid->addWidget( comment, 0, 1 );
- label = new QLabel( groupCSV );
+ label = new TQLabel( groupCSV );
label->setText( i18n( "Separator:" ) );
grid->addWidget( label, 1, 0 );
separator = new KLineEdit( lb->separator, groupCSV );
grid->addWidget( separator, 1, 1 );
- label = new QLabel( groupCSV );
+ label = new TQLabel( groupCSV );
label->setText( i18n("Quote Character:") );
grid->addWidget( label, 2, 0 );
@@ -196,10 +196,10 @@ void CSVImportDlg::createPage2()
vbox->addItem( spacer1 );
groupFixed->setColumnLayout(0, Qt::Horizontal );
- groupFixed->layout()->setSpacing( 6 );
- groupFixed->layout()->setMargin( 11 );
- QHBoxLayout* groupFixedLayout = new QHBoxLayout( groupFixed->layout() );
- groupFixedLayout->setAlignment( Qt::AlignTop );
+ groupFixed->tqlayout()->setSpacing( 6 );
+ groupFixed->tqlayout()->setMargin( 11 );
+ TQHBoxLayout* groupFixedLayout = new TQHBoxLayout( groupFixed->tqlayout() );
+ groupFixedLayout->tqsetAlignment( TQt::AlignTop );
listWidth = new KListBox( groupFixed );
@@ -214,17 +214,17 @@ void CSVImportDlg::createPage2()
spinNumber->setValue( 1 );
spinNumber->setFocus();
- QVBoxLayout* layout2 = new QVBoxLayout( 0, 6, 6 );
- layout2->addWidget( buttonAdd );
- layout2->addWidget( buttonRemove );
- layout2->addWidget( spinNumber );
- layout2->addItem( spacer2 );
+ TQVBoxLayout* tqlayout2 = new TQVBoxLayout( 0, 6, 6 );
+ tqlayout2->addWidget( buttonAdd );
+ tqlayout2->addWidget( buttonRemove );
+ tqlayout2->addWidget( spinNumber );
+ tqlayout2->addItem( spacer2 );
groupFixedLayout->addWidget( listWidth );
- groupFixedLayout->addLayout( layout2 );
+ groupFixedLayout->addLayout( tqlayout2 );
- layout->addWidget( buttonGroup );
- layout->addWidget( hboxFrame );
+ tqlayout->addWidget( buttonGroup );
+ tqlayout->addWidget( hboxFrame );
radioCSVFile->setChecked( true );
}
@@ -232,7 +232,7 @@ void CSVImportDlg::createPage2()
void CSVImportDlg::settingsChanged()
{
CSVFile file( requester->url() );
- QStringList list;
+ TQStringList list;
int i = 0;
unsigned int z;
@@ -273,20 +273,20 @@ void CSVImportDlg::settingsChanged()
void CSVImportDlg::setCol()
{
- QString text = comboField->currentText();
+ TQString text = comboField->currentText();
int v = spinCol->value() - 1;
if( text == NOFIELD )
- table->horizontalHeader()->setLabel( v, QString::number( v + 1 ) );
+ table->horizontalHeader()->setLabel( v, TQString::number( v + 1 ) );
else {
for( int i = 0; i < table->horizontalHeader()->count(); i++ )
if( table->horizontalHeader()->label( i ) == text )
- table->horizontalHeader()->setLabel( i, QString::number( i + 1 ) );
+ table->horizontalHeader()->setLabel( i, TQString::number( i + 1 ) );
table->horizontalHeader()->setLabel( v, text );
}
}
-QString CSVImportDlg::getDatabaseName()
+TQString CSVImportDlg::getDatabaseName()
{
bool b = comboSQL->currentItem() == (comboSQL->count()-1);
@@ -297,16 +297,16 @@ QString CSVImportDlg::getDatabaseName()
void CSVImportDlg::updateFields()
{
// also enables databaseName if necessary
- QString name = getDatabaseName();
+ TQString name = getDatabaseName();
comboField->clear();
comboField->insertItem( NOFIELD );
- QSqlQuery query( SqlTables::getInstance()->driver()->showColumns( name ) );
+ TQSqlQuery query( SqlTables::getInstance()->driver()->showColumns( name ) );
while( query.next() )
comboField->insertItem( query.value( 0 ).toString() );
for( int i = 0; i < table->horizontalHeader()->count(); i++ )
- table->horizontalHeader()->setLabel( i, QString::number( i + 1 ) );
+ table->horizontalHeader()->setLabel( i, TQString::number( i + 1 ) );
}
void CSVImportDlg::enableControls()
@@ -330,13 +330,13 @@ void CSVImportDlg::updateCol( int c )
void CSVImportDlg::accept()
{
CSVFile file( requester->url() );
- QHeader* h = table->horizontalHeader();
- QValueList<int> headers;
- QStringList list;
- QString name = getDatabaseName();
+ TQHeader* h = table->horizontalHeader();
+ TQValueList<int> headers;
+ TQStringList list;
+ TQString name = getDatabaseName();
int i = 0;
- QString q = "INSERT INTO " + name + " (";
+ TQString q = "INSERT INTO " + name + " (";
for( int c = 0; c < table->horizontalHeader()->count(); c++ ) {
bool ok = true;
h->label( c ).toInt( &ok );
@@ -358,12 +358,12 @@ void CSVImportDlg::accept()
- KApplication::setOverrideCursor( QCursor( Qt::WaitCursor) );
+ KApplication::setOverrideCursor( TQCursor( TQt::WaitCursor) );
while( !file.isEof() )
{
list = file.readNextLine();
- QString line = q;
+ TQString line = q;
for( unsigned int c = 0; c < headers.count(); c++ )
line.append( "'" + list[ headers[c] ] + "'" + "," );
@@ -373,7 +373,7 @@ void CSVImportDlg::accept()
line = line + ");";
- QSqlQuery query;
+ TQSqlQuery query;
if( !query.exec( line ) )
qDebug( i18n("Could not import the following line:") + line );
//KMessageBox::error( this, i18n("Could not import the following line:") + line );
@@ -386,7 +386,7 @@ void CSVImportDlg::accept()
void CSVImportDlg::addWidth()
{
- listWidth->insertItem( QString("%1").arg(spinNumber->value()), -1 );
+ listWidth->insertItem( TQString("%1").tqarg(spinNumber->value()), -1 );
settingsChanged();
}
@@ -404,9 +404,9 @@ void CSVImportDlg::removeWidth()
settingsChanged();
}
-QValueList<int> CSVImportDlg::getFieldWidth()
+TQValueList<int> CSVImportDlg::getFieldWidth()
{
- QValueList<int> list;
+ TQValueList<int> list;
for( unsigned int i=0;i<listWidth->count();i++ )
list << listWidth->text( i ).toInt();
@@ -416,7 +416,7 @@ QValueList<int> CSVImportDlg::getFieldWidth()
void CSVImportDlg::initCsvFile( CSVFile* file )
{
- QValueList<int> width = getFieldWidth();
+ TQValueList<int> width = getFieldWidth();
file->setEncoding( comboEncoding->currentText() );
file->setCSVFile( radioCSVFile->isChecked() );
diff --git a/kbarcode/csvimportdlg.h b/kbarcode/csvimportdlg.h
index b586880..254ded9 100644
--- a/kbarcode/csvimportdlg.h
+++ b/kbarcode/csvimportdlg.h
@@ -18,7 +18,7 @@
#ifndef CSVIMPORTDLG_H
#define CSVIMPORTDLG_H
-#include <qwidget.h>
+#include <tqwidget.h>
#include <kdialogbase.h>
class CSVFile;
@@ -28,11 +28,11 @@ class KIntNumInput;
class KLineEdit;
class KPushButton;
class KURLRequester;
-class QCheckBox;
-class QFrame;
-class QGroupBox;
-class QTable;
-class QRadioButton;
+class TQCheckBox;
+class TQFrame;
+class TQGroupBox;
+class TQTable;
+class TQRadioButton;
/** Import a CSV (comma separated value) file into
* a SQL table. CSV files can be generated by almost
@@ -46,8 +46,9 @@ class QRadioButton;
*/
class CSVImportDlg : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
- CSVImportDlg(QWidget *parent=0, const char *name=0);
+ CSVImportDlg(TQWidget *tqparent=0, const char *name=0);
~CSVImportDlg();
private slots:
@@ -69,12 +70,12 @@ class CSVImportDlg : public KDialogBase {
*
* \returns the name of the current database table.
*/
- QString getDatabaseName();
+ TQString getDatabaseName();
/** Get the field with from listWidth
* as an integer list.
*/
- QValueList<int> getFieldWidth();
+ TQValueList<int> getFieldWidth();
/** Create the first tab of the dialog
* to set the import data.
@@ -98,26 +99,26 @@ class CSVImportDlg : public KDialogBase {
KIntNumInput* spinCol;
KPushButton* buttonSet;
KURLRequester* requester;
- QFrame* frame;
- QTable* table;
+ TQFrame* frame;
+ TQTable* table;
KLineEdit* databaseName;
- QRadioButton* radioCSVFile;
- QRadioButton* radioFixedFile;
+ TQRadioButton* radioCSVFile;
+ TQRadioButton* radioFixedFile;
KLineEdit* comment;
KLineEdit* quote;
KLineEdit* separator;
- QGroupBox* groupCSV;
- QGroupBox* groupFixed;
+ TQGroupBox* groupCSV;
+ TQGroupBox* groupFixed;
KListBox* listWidth;
KPushButton* buttonAdd;
KPushButton* buttonRemove;
KIntNumInput* spinNumber;
- QCheckBox* checkLoadAll;
+ TQCheckBox* checkLoadAll;
KIntNumInput* spinLoadOnly;
protected slots:
diff --git a/kbarcode/databasebrowser.cpp b/kbarcode/databasebrowser.cpp
index 50af772..e4e5ef1 100644
--- a/kbarcode/databasebrowser.cpp
+++ b/kbarcode/databasebrowser.cpp
@@ -21,8 +21,8 @@
#include "sqltables.h"
#include "csvimportdlg.h"
-// Qt includes
-#include <qclipboard.h>
+// TQt includes
+#include <tqclipboard.h>
// KDE includes
#include <kaction.h>
@@ -35,8 +35,8 @@
#define CUR_TABLE_ID 6666
-DatabaseBrowser::DatabaseBrowser( QString _database, QWidget *parent, const char *name )
- : DSMainWindow(parent,name)
+DatabaseBrowser::DatabaseBrowser( TQString _database, TQWidget *tqparent, const char *name )
+ : DSMainWindow(tqparent,name)
{
m_direction = m_case = false;
@@ -49,10 +49,10 @@ DatabaseBrowser::DatabaseBrowser( QString _database, QWidget *parent, const char
database = _database;
- connect( table, SIGNAL( cursorChanged( QSql::Op ) ),
- SqlTables::getInstance(), SIGNAL( tablesChanged() ) );
+ connect( table, TQT_SIGNAL( cursorChanged( TQSql::Op ) ),
+ SqlTables::getInstance(), TQT_SIGNAL( tablesChanged() ) );
- connect( this, SIGNAL( connectedSQL() ), this, SLOT( setupSql() ) );
+ connect( TQT_TQOBJECT(this), TQT_SIGNAL( connectedSQL() ), this, TQT_SLOT( setupSql() ) );
findDlg = 0;
@@ -81,10 +81,10 @@ void DatabaseBrowser::setupActions()
DSMainWindow::setupActions();
KPopupMenu* editMenu = new KPopupMenu( this );
- KAction* acut = KStdAction::cut( this, SLOT( cut() ), actionCollection() );
- KAction* acopy = KStdAction::copy( this, SLOT( copy() ), actionCollection() );
- KAction* apaste = KStdAction::paste( this, SLOT( paste() ), actionCollection() );
- KAction* afind = KStdAction::find( this, SLOT( find() ), actionCollection() );
+ KAction* acut = KStdAction::cut( TQT_TQOBJECT(this), TQT_SLOT( cut() ), actionCollection() );
+ KAction* acopy = KStdAction::copy( TQT_TQOBJECT(this), TQT_SLOT( copy() ), actionCollection() );
+ KAction* apaste = KStdAction::paste( TQT_TQOBJECT(this), TQT_SLOT( paste() ), actionCollection() );
+ KAction* atqfind = KStdAction::find( TQT_TQOBJECT(this), TQT_SLOT( find() ), actionCollection() );
menuBar()->insertItem( i18n("&Edit"), editMenu, -1, 1 );
acut->plug( editMenu );
@@ -92,11 +92,11 @@ void DatabaseBrowser::setupActions()
apaste->plug( editMenu );
editMenu->insertSeparator();
- afind->plug( editMenu );
- KStdAction::findNext( this, SLOT( findNext() ), actionCollection() )->plug( editMenu );
+ atqfind->plug( editMenu );
+ KStdAction::findNext( TQT_TQOBJECT(this), TQT_SLOT( findNext() ), actionCollection() )->plug( editMenu );
editMenu->insertSeparator();
KAction* aimport = new KAction( i18n("&Import CSV File..."), "",
- 0, this, SLOT(import()), actionCollection(), "import" );
+ 0, TQT_TQOBJECT(this), TQT_SLOT(import()), actionCollection(), "import" );
aimport->plug( editMenu );
acut->plug( toolBar() );
@@ -104,14 +104,14 @@ void DatabaseBrowser::setupActions()
apaste->plug( toolBar() );
toolBar()->insertSeparator();
- afind->plug( toolBar() );
+ atqfind->plug( toolBar() );
DSMainWindow::loadConfig();
}
void DatabaseBrowser::setupSql()
{
- QSqlCursor* cur = new QSqlCursor( database, true );
+ TQSqlCursor* cur = new TQSqlCursor( database, true );
cur->select();
unsigned int i = 0;
unsigned int c = 0;
@@ -130,18 +130,18 @@ void DatabaseBrowser::setupSql()
table->setSorting( true );
table->setConfirmDelete( true );
table->setAutoEdit( true );
- table->refresh( QDataTable::RefreshAll );
+ table->refresh( TQDataTable::RefreshAll );
}
-void DatabaseBrowser::find()
+void DatabaseBrowser::tqfind()
{
if( !findDlg )
findDlg = new KEdFind( this, "findDlg", false );
- findDlg->setText( m_find );
+ findDlg->setText( m_tqfind );
findDlg->setDirection( m_direction );
findDlg->setCaseSensitive( m_case );
- connect( findDlg, SIGNAL( search() ), this, SLOT( findNext() ) );
+ connect( findDlg, TQT_SIGNAL( search() ), this, TQT_SLOT( findNext() ) );
findDlg->exec();
@@ -150,22 +150,22 @@ void DatabaseBrowser::find()
void DatabaseBrowser::findNext()
{
if( findDlg ) {
- m_find = findDlg->getText();
+ m_tqfind = findDlg->getText();
m_direction = findDlg->get_direction();
m_case = findDlg->case_sensitive();
} else
- find();
+ tqfind();
- table->find( m_find, m_case, m_direction );
+ table->tqfind( m_tqfind, m_case, m_direction );
}
void DatabaseBrowser::cut()
{
- QString text = table->value( table->currentRow(), table->currentColumn() ).toString();
+ TQString text = table->value( table->currentRow(), table->currentColumn() ).toString();
if( !text.isEmpty() ) {
kapp->clipboard()->setText( text );
- QSqlRecord* buffer = table->sqlCursor()->primeUpdate();
+ TQSqlRecord* buffer = table->sqlCursor()->primeUpdate();
if( buffer ) {
buffer->setValue( table->horizontalHeader()->label( table->currentColumn() ), "" );
table->sqlCursor()->update();
@@ -177,16 +177,16 @@ void DatabaseBrowser::cut()
void DatabaseBrowser::copy()
{
- QString text = table->value( table->currentRow(), table->currentColumn() ).toString();
+ TQString text = table->value( table->currentRow(), table->currentColumn() ).toString();
if( !text.isEmpty() )
kapp->clipboard()->setText( text );
}
void DatabaseBrowser::paste()
{
- QString text = kapp->clipboard()->text();
+ TQString text = kapp->clipboard()->text();
if( !text.isEmpty() ) {
- QSqlRecord* buffer = table->sqlCursor()->primeUpdate();
+ TQSqlRecord* buffer = table->sqlCursor()->primeUpdate();
if( buffer ) {
buffer->setValue( table->horizontalHeader()->label( table->currentColumn() ), text );
table->sqlCursor()->update();
diff --git a/kbarcode/databasebrowser.h b/kbarcode/databasebrowser.h
index 1968f88..ca196b1 100644
--- a/kbarcode/databasebrowser.h
+++ b/kbarcode/databasebrowser.h
@@ -32,8 +32,9 @@ class MyDataTable;
*/
class DatabaseBrowser : public DSMainWindow{
Q_OBJECT
+ TQ_OBJECT
public:
- DatabaseBrowser( QString _database, QWidget *parent=0, const char *name=0);
+ DatabaseBrowser( TQString _database, TQWidget *tqparent=0, const char *name=0);
~DatabaseBrowser();
private:
@@ -46,13 +47,13 @@ class DatabaseBrowser : public DSMainWindow{
void copy();
void paste();
- void find();
+ void tqfind();
void findNext();
void import();
protected:
- QString database;
+ TQString database;
MyDataTable* table;
KAction* undoAct;
@@ -61,7 +62,7 @@ class DatabaseBrowser : public DSMainWindow{
KEdFind* findDlg;
- QString m_find;
+ TQString m_tqfind;
bool m_direction;
bool m_case;
};
diff --git a/kbarcode/definition.cpp b/kbarcode/definition.cpp
index 675a36d..1ca3713 100644
--- a/kbarcode/definition.cpp
+++ b/kbarcode/definition.cpp
@@ -18,10 +18,10 @@
#include "definition.h"
#include "sqltables.h"
-// Qt includes
-#include <qtextstream.h>
-#include <qsqlquery.h>
-#include <qregexp.h>
+// TQt includes
+#include <tqtextstream.h>
+#include <tqsqlquery.h>
+#include <tqregexp.h>
// KDE includes
#include <kapplication.h>
@@ -29,7 +29,7 @@
#include <klocale.h>
#include <kmessagebox.h>
#include <kstandarddirs.h>
-#include <qprogressdialog.h>
+#include <tqprogressdialog.h>
// a simple helper function
// that copies a file
@@ -60,31 +60,31 @@ bool filecopy( const char* src, const char* dest )
class PrivateParser {
public:
- PrivateParser( QString line, bool all = true );
+ PrivateParser( TQString line, bool all = true );
~PrivateParser();
- const QString & getId() const { return m_label_def_id; }
- const QString & getProducer() const { return m_producer; }
- const QString & getType() const { return m_type; }
+ const TQString & getId() const { return m_label_def_id; }
+ const TQString & getProducer() const { return m_producer; }
+ const TQString & getType() const { return m_type; }
const Measurements & getMeasurements() const { return m_measure; };
private:
- QString removeQuote( const QString & q );
+ TQString removeQuote( const TQString & q );
- QString m_label_def_id;
- QString m_producer;
- QString m_type;
+ TQString m_label_def_id;
+ TQString m_producer;
+ TQString m_type;
Measurements m_measure;
};
-PrivateParser::PrivateParser( QString line, bool all )
+PrivateParser::PrivateParser( TQString line, bool all )
{
line = line.stripWhiteSpace();
- int pos = line.find("(");
+ int pos = line.tqfind("(");
line = line.mid( pos + 1, line.length() - pos - 1 );
- m_label_def_id = line.section( ",", 0, 0 ).stripWhiteSpace();
+ m_label_def_id = TQString(line.section( ",", 0, 0 )).stripWhiteSpace();
m_producer = removeQuote( line.section( ",", 1, 1 ) );
m_type = removeQuote( line.section( ",", 2, 2 ) );
@@ -111,9 +111,9 @@ PrivateParser::PrivateParser( QString line, bool all )
PrivateParser::~PrivateParser()
{ }
-QString PrivateParser::removeQuote( const QString & q )
+TQString PrivateParser::removeQuote( const TQString & q )
{
- QString quote = q.stripWhiteSpace();
+ TQString quote = q.stripWhiteSpace();
if( quote.startsWith("'") )
quote = quote.mid( 1, quote.length() - 1 );
@@ -127,29 +127,29 @@ QString PrivateParser::removeQuote( const QString & q )
/***************************************************************************/
-Definition::Definition( QWidget* parent )
- : m_parent( parent )
+Definition::Definition( TQWidget* tqparent )
+ : m_parent( tqparent )
{
id = -1;
}
-Definition::Definition( int label_def_id, QWidget* parent )
- : m_parent( parent )
+Definition::Definition( int label_def_id, TQWidget* tqparent )
+ : m_parent( tqparent )
{
- init( QString("%1").arg( label_def_id ) );
+ init( TQString("%1").tqarg( label_def_id ) );
}
-Definition::Definition( const QString & label_def_id, QWidget* parent )
- : m_parent( parent )
+Definition::Definition( const TQString & label_def_id, TQWidget* tqparent )
+ : m_parent( tqparent )
{
init( label_def_id );
}
-Definition::Definition( const QString & producer, const QString & type, QWidget* parent )
- : m_parent( parent )
+Definition::Definition( const TQString & producer, const TQString & type, TQWidget* tqparent )
+ : m_parent( tqparent )
{
if( SqlTables::isConnected() ) {
- QSqlQuery query(
+ TQSqlQuery query(
"select label_no from " TABLE_LABEL_DEF " WHERE manufacture='" + producer + "' AND type='" + type + "'");
while( query.next() )
init( query.value( 0 ).toString() );
@@ -159,7 +159,7 @@ Definition::Definition( const QString & producer, const QString & type, QWidget*
initProgress();
- QString s;
+ TQString s;
while( file->readLine( s, 1000 ) != -1 ) {
if( s.isEmpty() || s.left( 1 ) == "#" )
continue;
@@ -182,17 +182,17 @@ Definition::~Definition()
{
}
-QFile* Definition::file = 0;
-QByteArray* Definition::array = 0;
-QStringList* Definition::listProducers = 0;
-QMap<QString,QStringList> Definition::mapTypes;
-QProgressDialog* Definition::m_progress = 0;
+TQFile* Definition::file = 0;
+TQByteArray* Definition::array = 0;
+TQStringList* Definition::listProducers = 0;
+TQMap<TQString,TQStringList> Definition::mapTypes;
+TQProgressDialog* Definition::m_progress = 0;
void Definition::initProgress()
{
/*
if(!m_progress)
- m_progress = new QProgressDialog( i18n("Loading Label Definitions..."), QString::null, 0, NULL, "m_progress", true );
+ m_progress = new TQProgressDialog( i18n("Loading Label Definitions..."), TQString(), 0, NULL, "m_progress", true );
m_progress->setTotalSteps( 1000 );
m_progress->show();
@@ -217,20 +217,20 @@ void Definition::destroyProgress()
*/
}
-void Definition::setId( const QString & label_def_id )
+void Definition::setId( const TQString & label_def_id )
{
init( label_def_id );
}
void Definition::setId( int label_def_id )
{
- init( QString("%1").arg( label_def_id ) );
+ init( TQString("%1").tqarg( label_def_id ) );
}
-void Definition::init( const QString & label_def_id )
+void Definition::init( const TQString & label_def_id )
{
if( SqlTables::isConnected() ) {
- QSqlQuery* query = new QSqlQuery(
+ TQSqlQuery* query = new TQSqlQuery(
"select number_h, number_v, gap_left, gap_top, gap_v, gap_h, width, height, manufacture, type from " TABLE_LABEL_DEF
" WHERE label_no = " + label_def_id );
@@ -259,7 +259,7 @@ const Measurements & Definition::getMeasurements() const
return m_measure;
}
-void Definition::getFileMeasurements( const QString & label_def_id )
+void Definition::getFileMeasurements( const TQString & label_def_id )
{
if(!openFile()) {
m_measure = Measurements();
@@ -268,9 +268,9 @@ void Definition::getFileMeasurements( const QString & label_def_id )
initProgress();
- QTextStream stream(*array, IO_ReadOnly );
+ TQTextStream stream(*array, IO_ReadOnly );
while( !stream.atEnd() ) {
- QString s = stream.readLine();
+ TQString s = stream.readLine();
if( s.isEmpty() || s.startsWith( "#" ) )
continue;
@@ -296,21 +296,21 @@ bool Definition::openFile()
return true;
}
- QString f = locateLocal( "data", "kbarcode/labeldefinitions.sql" );
- if( !QFile::exists( f ) ) {
+ TQString f = locateLocal( "data", "kbarcode/labeldefinitions.sql" );
+ if( !TQFile::exists( f ) ) {
KConfig* config = kapp->config();
config->setGroup( "Definitions" );
// copy file to new location
- QString fname = config->readEntry( "defpath", locate( "data", "kbarcode/labeldefinitions.sql" ) );
- if( !QFile::exists( fname ) || fname.isEmpty() )
+ TQString fname = config->readEntry( "defpath", locate( "data", "kbarcode/labeldefinitions.sql" ) );
+ if( !TQFile::exists( fname ) || fname.isEmpty() )
return ( showFileError() ? openFile() : false );
if(!filecopy( (const char*)fname, (const char*)f ))
return ( showFileError() ? openFile() : false );
}
- file = new QFile( f );
+ file = new TQFile( f );
if( !file->open( IO_ReadOnly ) ) {
delete file;
file = 0;
@@ -320,22 +320,22 @@ bool Definition::openFile()
// keeping this array around
// increases speed quite a lot
// but does also cost lot's of memory
- array = new QByteArray();
+ array = new TQByteArray();
*array = file->readAll();
file->at( 0 );
return true;
}
-const QStringList Definition::getProducers()
+const TQStringList Definition::getProducers()
{
if( listProducers )
return *listProducers;
- listProducers = new QStringList();
+ listProducers = new TQStringList();
if( SqlTables::isConnected() ) {
- QSqlQuery query("SELECT manufacture FROM " TABLE_LABEL_DEF " GROUP by manufacture;");
+ TQSqlQuery query("SELECT manufacture FROM " TABLE_LABEL_DEF " GROUP by manufacture;");
while( query.next() )
listProducers->append( query.value( 0 ).toString() );
} else {
@@ -344,16 +344,16 @@ const QStringList Definition::getProducers()
initProgress();
- QTextStream stream(*array, IO_ReadOnly );
+ TQTextStream stream(*array, IO_ReadOnly );
while( !stream.atEnd() ) {
- QString s = stream.readLine();
+ TQString s = stream.readLine();
if( s.isEmpty() || s.startsWith( "#" ) )
continue;
increaseProgress();
PrivateParser p( s, false );
- if( !listProducers->contains( p.getProducer() ) )
+ if( !listProducers->tqcontains( p.getProducer() ) )
listProducers->append( p.getProducer() );
}
@@ -363,18 +363,18 @@ const QStringList Definition::getProducers()
return *listProducers;
}
-const QStringList Definition::getTypes( QString producer )
+const TQStringList Definition::getTypes( TQString producer )
{
- if( mapTypes.contains( producer ) ) {
+ if( mapTypes.tqcontains( producer ) ) {
return mapTypes[producer];
}
- QStringList list;
+ TQStringList list;
if( SqlTables::isConnected() ) {
- QSqlQuery query("SELECT type FROM " TABLE_LABEL_DEF " WHERE manufacture='" + producer + "'" );
+ TQSqlQuery query("SELECT type FROM " TABLE_LABEL_DEF " WHERE manufacture='" + producer + "'" );
while( query.next() )
- if( !list.contains( query.value( 0 ).toString() ) )
+ if( !list.tqcontains( query.value( 0 ).toString() ) )
list.append( query.value( 0 ).toString() );
} else {
if(!openFile())
@@ -382,9 +382,9 @@ const QStringList Definition::getTypes( QString producer )
initProgress();
- QTextStream stream(*array, IO_ReadOnly );
+ TQTextStream stream(*array, IO_ReadOnly );
while( !stream.atEnd() ) {
- QString s = stream.readLine();
+ TQString s = stream.readLine();
if( s.isEmpty() || s.startsWith( "#" ) )
continue;
@@ -392,7 +392,7 @@ const QStringList Definition::getTypes( QString producer )
PrivateParser p( s, false );
if( p.getProducer() == producer )
- if( !list.contains( p.getType() ) )
+ if( !list.tqcontains( p.getType() ) )
list.append( p.getType() );
}
@@ -426,7 +426,7 @@ void Definition::updateProducer()
}
}
-int Definition::write( const Measurements & c, QString type, QString producer )
+int Definition::write( const Measurements & c, TQString type, TQString producer )
{
int r = -1;
if( SqlTables::isConnected() )
@@ -438,22 +438,22 @@ int Definition::write( const Measurements & c, QString type, QString producer )
return r;
}
-int Definition::writeFile( const Measurements & c, QString type, QString producer )
+int Definition::writeFile( const Measurements & c, TQString type, TQString producer )
{
if( !openFile() )
return -1;
- QStringList data;
+ TQStringList data;
bool datawritten = false;
int index = 0;
- QString entry = ", '" +
+ TQString entry = ", '" +
producer + "', '" + type + "', 'C',"+ I2S(c.gapTopMM()) +
", " + I2S(c.gapLeftMM()) + ", " +
I2S(c.heightMM()) + ", " + I2S(c.widthMM()) + ", " +
I2S(c.gapVMM()) + ", " + I2S(c.gapHMM()) + ", " +
I2S(c.numH()) + ", " + I2S(c.numV()) + ", NULL, NULL )";
- QString s;
+ TQString s;
while( file->readLine( s, 1000 ) != -1 ) {
if( s.isEmpty() || s.left( 1 ) == "#" ) {
data.append( s );
@@ -484,9 +484,9 @@ int Definition::writeFile( const Measurements & c, QString type, QString produce
return -1;
}
- QTextStream t( file );
+ TQTextStream t( file );
for( unsigned int i = 0; i < data.count(); i++ )
- t << data[i].replace( QRegExp("\\n"), "" ) << "\n";
+ t << data[i].tqreplace( TQRegExp("\\n"), "" ) << "\n";
// get the file back to the normal stage
file->close();
@@ -495,10 +495,10 @@ int Definition::writeFile( const Measurements & c, QString type, QString produce
return index + 1;
}
-int Definition::writeSQL( const Measurements & c, QString type, QString producer )
+int Definition::writeSQL( const Measurements & c, TQString type, TQString producer )
{
bool newitem = true;
- QSqlQuery q( "SELECT manufacture, type FROM " TABLE_LABEL_DEF );
+ TQSqlQuery q( "SELECT manufacture, type FROM " TABLE_LABEL_DEF );
// TODO: use a more inteligent query using where=
while( q.next() )
if( q.value( 0 ) == producer &&
@@ -506,7 +506,7 @@ int Definition::writeSQL( const Measurements & c, QString type, QString producer
newitem = false;
if( newitem ) {
- QSqlQuery query(
+ TQSqlQuery query(
"INSERT INTO " TABLE_LABEL_DEF " (manufacture, type, gap_top, gap_left, "
"width, height, gap_v, gap_h, number_h, number_v) VALUES ('" +
producer + "', '" + type + "', '"+ I2S( c.gapTopMM() ) +
@@ -519,7 +519,7 @@ int Definition::writeSQL( const Measurements & c, QString type, QString producer
if(!query.isValid())
qDebug("Query to insert values not valid!");
} else {
- QSqlQuery query( "UPDATE " TABLE_LABEL_DEF " SET "
+ TQSqlQuery query( "UPDATE " TABLE_LABEL_DEF " SET "
"gap_top = " + I2S( c.gapTopMM() ) + " ,gap_left = " + I2S( c.gapLeftMM() ) +
" ,width = " + I2S( c.widthMM() ) + " ,height = " + I2S( c.heightMM() ) +
" ,gap_v = " + I2S( c.gapVMM() ) + " ,gap_h = " + I2S( c.gapHMM() ) +
@@ -531,7 +531,7 @@ int Definition::writeSQL( const Measurements & c, QString type, QString producer
qDebug("Query to update values not valid!\n%s\n", query.lastQuery().latin1() );
}
- QSqlQuery qi("SELECT label_no FROM " TABLE_LABEL_DEF " WHERE manufacture='" + producer + "' AND type='" + type + "'" );
+ TQSqlQuery qi("SELECT label_no FROM " TABLE_LABEL_DEF " WHERE manufacture='" + producer + "' AND type='" + type + "'" );
while( qi.next() )
return qi.value( 0 ).toInt();
@@ -550,8 +550,8 @@ bool Definition::showFileError()
"You will be prompted now to select the file containing the labeldefinitions."),
"", "NoDefinitionsFound" );
- QString f = KFileDialog::getOpenFileName( QString::null, QString::null, 0 );
- if( !f.isEmpty() && QFile::exists( f ) ) {
+ TQString f = KFileDialog::getOpenFileName( TQString(), TQString(), 0 );
+ if( !f.isEmpty() && TQFile::exists( f ) ) {
KConfig* config = kapp->config();
config->setGroup( "Definitions" );
config->writeEntry( "defpath", f );
@@ -565,9 +565,9 @@ bool Definition::showFileError()
return false;
}
-int Definition::getClosest( const QString & producer, const QString & type )
+int Definition::getClosest( const TQString & producer, const TQString & type )
{
- QStringList t = Definition::getTypes(producer);
+ TQStringList t = Definition::getTypes(producer);
for( unsigned int z = 0; z < t.count(); z++ ) {
if( t[z] == type ) {
Definition d( producer, type );
diff --git a/kbarcode/definition.h b/kbarcode/definition.h
index a853a67..4074a63 100644
--- a/kbarcode/definition.h
+++ b/kbarcode/definition.h
@@ -20,21 +20,21 @@
#include "measurements.h"
#include "labelutils.h"
-#include <qmap.h>
-#include <qstring.h>
+#include <tqmap.h>
+#include <tqstring.h>
#ifndef I2S
- #define I2S(x) QString::number(x)
+ #define I2S(x) TQString::number(x)
#endif // I2S
-class QWidget;
-class QFile;
-class QPaintDevice;
-class QString;
-class QStringList;
-class QSqlQuery;
+class TQWidget;
+class TQFile;
+class TQPaintDevice;
+class TQString;
+class TQStringList;
+class TQSqlQuery;
class Measurements;
-class QProgressDialog;
+class TQProgressDialog;
/** @short A label definition;
*
* Represents a label definition. The definition is either read from
@@ -46,53 +46,53 @@ class QProgressDialog;
*/
class Definition : private LabelUtils {
public:
- Definition( QWidget* parent = 0 );
- Definition( int label_def_id, QWidget* parent = 0 );
- Definition( const QString & label_def_id, QWidget* parent = 0 );
- Definition( const QString & producer, const QString & type, QWidget* parent = 0 );
+ Definition( TQWidget* tqparent = 0 );
+ Definition( int label_def_id, TQWidget* tqparent = 0 );
+ Definition( const TQString & label_def_id, TQWidget* tqparent = 0 );
+ Definition( const TQString & producer, const TQString & type, TQWidget* tqparent = 0 );
~Definition();
- void setId( const QString & label_def_id );
+ void setId( const TQString & label_def_id );
void setId( int label_def_id );
const Measurements & getMeasurements() const;
- static int write( const Measurements & c, QString type, QString producer );
- static int getClosest( const QString & producer, const QString & type );
+ static int write( const Measurements & c, TQString type, TQString producer );
+ static int getClosest( const TQString & producer, const TQString & type );
- static const QStringList getProducers();
- static const QStringList getTypes( QString producer );
+ static const TQStringList getProducers();
+ static const TQStringList getTypes( TQString producer );
/** reread the list of producers, because it has changed
* mapType is also cleared and reread when necessary.
*/
static void updateProducer();
int getId() const { return id; }
- const QString getProducer() const { return producer; }
- const QString getType() const { return type; }
+ const TQString getProducer() const { return producer; }
+ const TQString getType() const { return type; }
private:
- void init( const QString & label_def_id );
- void getFileMeasurements( const QString & label_def_id );
+ void init( const TQString & label_def_id );
+ void getFileMeasurements( const TQString & label_def_id );
static void initProgress();
static void increaseProgress();
static void destroyProgress();
- static int writeSQL( const Measurements & c, QString type, QString producer );
- static int writeFile( const Measurements & c, QString type, QString producer );
+ static int writeSQL( const Measurements & c, TQString type, TQString producer );
+ static int writeFile( const Measurements & c, TQString type, TQString producer );
static bool showFileError();
static bool openFile();
- static QStringList* listProducers;
- static QMap<QString,QStringList> mapTypes;
- static QFile* file;
- static QByteArray* array;
- static QProgressDialog* m_progress;
+ static TQStringList* listProducers;
+ static TQMap<TQString,TQStringList> mapTypes;
+ static TQFile* file;
+ static TQByteArray* array;
+ static TQProgressDialog* m_progress;
- QWidget* m_parent;
+ TQWidget* m_parent;
int id;
- QString producer;
- QString type;
+ TQString producer;
+ TQString type;
Measurements m_measure;
bool locked;
static bool nodefmsg;
diff --git a/kbarcode/definitiondialog.cpp b/kbarcode/definitiondialog.cpp
index d8f9484..253c9a2 100644
--- a/kbarcode/definitiondialog.cpp
+++ b/kbarcode/definitiondialog.cpp
@@ -23,33 +23,33 @@
#include <kcombobox.h>
#include <kpushbutton.h>
#include <krestrictedline.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpainter.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqpainter.h>
// KDE includes
#include <klocale.h>
-LabelPreview::LabelPreview( QWidget* parent, const char* name )
- : QWidget( parent, name)
+LabelPreview::LabelPreview( TQWidget* tqparent, const char* name )
+ : TQWidget( tqparent, name)
{
// For old DIN A4 preview
PrinterSettings* ps = PrinterSettings::getInstance();
- setFixedSize( QSize( ((int)ps->pageWidth() + 20)/2, ((int)ps->pageHeight() + 20)/2 ) );
+ setFixedSize( TQSize( ((int)ps->pageWidth() + 20)/2, ((int)ps->pageHeight() + 20)/2 ) );
m_prv_enabled = true;
}
LabelPreview::~LabelPreview()
{ }
-void LabelPreview::paintEvent( QPaintEvent* )
+void LabelPreview::paintEvent( TQPaintEvent* )
{
- QPainter p( this );
- p.fillRect( 0, 0, width(), height(), QBrush( Qt::white ) );
- p.setPen( QPen( Qt::black ) );
+ TQPainter p( this );
+ p.fillRect( 0, 0, width(), height(), TQBrush( TQt::white ) );
+ p.setPen( TQPen( TQt::black ) );
p.translate( 10, 10 );
- p.fillRect( 0, 0, 210/2, 297/2, QBrush( Qt::gray ) );
+ p.fillRect( 0, 0, 210/2, 297/2, TQBrush( TQt::gray ) );
p.drawRect( 0, 0, 210/2, 297/2 );
if(!m_prv_enabled)
@@ -59,13 +59,13 @@ void LabelPreview::paintEvent( QPaintEvent* )
for( int v = 0; v < measure.numV(); v++ ) {
for( int h = 0; h < measure.numH(); h++ ) {
if( !v && !h )
- p.setPen( QPen( Qt::red ) );
+ p.setPen( TQPen( TQt::red ) );
else
- p.setPen( QPen( Qt::black ) );
+ p.setPen( TQPen( TQt::black ) );
p.fillRect( int(measure.gapLeftMM() + (measure.gapHMM() * h)) / 2,
int(measure.gapTopMM() + (measure.gapVMM() * v)) / 2 ,
- (int)measure.widthMM() / 2 , (int)measure.heightMM() / 2, QBrush( Qt::white ) );
+ (int)measure.widthMM() / 2 , (int)measure.heightMM() / 2, TQBrush( TQt::white ) );
p.drawRect( int(measure.gapLeftMM() + (measure.gapHMM() * h)) / 2,
int(measure.gapTopMM() + (measure.gapVMM() * v)) / 2,
@@ -75,60 +75,60 @@ void LabelPreview::paintEvent( QPaintEvent* )
}
/*****************************************/
-DefinitionDialog::DefinitionDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
- : QDialog( parent, name, modal, fl )
+DefinitionDialog::DefinitionDialog( TQWidget* tqparent, const char* name, bool modal, WFlags fl )
+ : TQDialog( tqparent, name, modal, fl )
{
resize( 465, 345 );
setCaption( i18n( "Add Label Definition" ) );
- QHBoxLayout* layout = new QHBoxLayout( this, 6, 6 );
- DefinitionDialogLayout = new QVBoxLayout( 0, 11, 6, "DefinitionDialogLayout");
+ TQHBoxLayout* tqlayout = new TQHBoxLayout( this, 6, 6 );
+ DefinitionDialogLayout = new TQVBoxLayout( 0, 11, 6, "DefinitionDialogLayout");
- Layout17 = new QHBoxLayout( 0, 0, 6, "Layout17");
+ Layout17 = new TQHBoxLayout( 0, 0, 6, "Layout17");
- Layout13 = new QVBoxLayout( 0, 0, 6, "Layout13");
+ Layout13 = new TQVBoxLayout( 0, 0, 6, "Layout13");
- TextLabel1 = new QLabel( this, "TextLabel1" );
+ TextLabel1 = new TQLabel( this, "TextLabel1" );
TextLabel1->setText( i18n( "Producer:" ) );
Layout13->addWidget( TextLabel1 );
- TextLabel2 = new QLabel( this, "TextLabel2" );
+ TextLabel2 = new TQLabel( this, "TextLabel2" );
TextLabel2->setText( i18n( "Type:" ) );
Layout13->addWidget( TextLabel2 );
- TextLabel3 = new QLabel( this, "TextLabel3" );
- TextLabel3->setText( QString( i18n( "Width (in %1):" ) ).arg( Measurements::system() ) );
+ TextLabel3 = new TQLabel( this, "TextLabel3" );
+ TextLabel3->setText( TQString( i18n( "Width (in %1):" ) ).tqarg( Measurements::system() ) );
Layout13->addWidget( TextLabel3 );
- TextLabel4 = new QLabel( this, "TextLabel4" );
- TextLabel4->setText( QString( i18n( "Height (in %1):" ) ).arg( Measurements::system() ) );
+ TextLabel4 = new TQLabel( this, "TextLabel4" );
+ TextLabel4->setText( TQString( i18n( "Height (in %1):" ) ).tqarg( Measurements::system() ) );
Layout13->addWidget( TextLabel4 );
- TextLabel5 = new QLabel( this, "TextLabel5" );
+ TextLabel5 = new TQLabel( this, "TextLabel5" );
TextLabel5->setText( i18n( "Horizontal Gap:" ) );
Layout13->addWidget( TextLabel5 );
- TextLabel6 = new QLabel( this, "TextLabel6" );
+ TextLabel6 = new TQLabel( this, "TextLabel6" );
TextLabel6->setText( i18n( "Vertical Gap:" ) );
Layout13->addWidget( TextLabel6 );
- TextLabel7 = new QLabel( this, "TextLabel7" );
+ TextLabel7 = new TQLabel( this, "TextLabel7" );
TextLabel7->setText( i18n( "Top Gap:" ) );
Layout13->addWidget( TextLabel7 );
- TextLabel8 = new QLabel( this, "TextLabel8" );
+ TextLabel8 = new TQLabel( this, "TextLabel8" );
TextLabel8->setText( i18n( "Left Gap:" ) );
Layout13->addWidget( TextLabel8 );
- TextLabel9 = new QLabel( this, "TextLabel9" );
- TextLabel9->setText( i18n("Number Horizontal:") );
+ TextLabel9 = new TQLabel( this, "TextLabel9" );
+ TextLabel9->setText( i18n("NumberQt::Horizontal:") );
Layout13->addWidget( TextLabel9 );
- TextLabel10 = new QLabel( this, "TextLabel10" );
- TextLabel10->setText( i18n("Number Vertical:") );
+ TextLabel10 = new TQLabel( this, "TextLabel10" );
+ TextLabel10->setText( i18n("NumberQt::Vertical:") );
Layout13->addWidget( TextLabel10 );
Layout17->addLayout( Layout13 );
- Layout14 = new QVBoxLayout( 0, 0, 6, "Layout14");
+ Layout14 = new TQVBoxLayout( 0, 0, 6, "Layout14");
comboProducer = new KComboBox( FALSE, this, "comboProducer" );
comboProducer->setEditable( TRUE );
@@ -179,17 +179,17 @@ DefinitionDialog::DefinitionDialog( QWidget* parent, const char* name, bool mod
Layout14->addWidget( editNumV );
Layout17->addLayout( Layout14 );
- QSpacerItem* spacer = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ TQSpacerItem* spacer = new TQSpacerItem( 0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
Layout17->addItem( spacer );
DefinitionDialogLayout->addLayout( Layout17 );
- QSpacerItem* spacer_2 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ TQSpacerItem* spacer_2 = new TQSpacerItem( 0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
DefinitionDialogLayout->addItem( spacer_2 );
- Layout16 = new QHBoxLayout( 0, 0, 6, "Layout16");
+ Layout16 = new TQHBoxLayout( 0, 0, 6, "Layout16");
buttonInfo = new KPushButton( i18n("More &Information"), this );
Layout16->addWidget( buttonInfo );
- QSpacerItem* spacer_3 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ TQSpacerItem* spacer_3 = new TQSpacerItem( 0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
Layout16->addItem( spacer_3 );
buttonAdd = new KPushButton( this, "buttonAdd" );
@@ -202,39 +202,39 @@ DefinitionDialog::DefinitionDialog( QWidget* parent, const char* name, bool mod
DefinitionDialogLayout->addLayout( Layout16 );
preview = new LabelPreview( this );
- layout->addLayout( DefinitionDialogLayout );
- layout->addWidget( preview );
+ tqlayout->addLayout( DefinitionDialogLayout );
+ tqlayout->addWidget( preview );
- l = new QLabel( this );
+ l = new TQLabel( this );
setExtension( l );
- setOrientation( Vertical );
+ setOrientation(Qt::Vertical );
- connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
- connect( buttonAdd, SIGNAL( clicked() ), this, SLOT( add() ) );
+ connect( buttonCancel, TQT_SIGNAL( clicked() ), this, TQT_SLOT( reject() ) );
+ connect( buttonAdd, TQT_SIGNAL( clicked() ), this, TQT_SLOT( add() ) );
- connect( editWidth, SIGNAL( textChanged(const QString &) ), this, SLOT( updatePreview() ) );
- connect( editHeight, SIGNAL( textChanged(const QString &) ), this, SLOT( updatePreview() ) );
- connect( editHGap, SIGNAL( textChanged(const QString &) ), this, SLOT( updatePreview() ) );
- connect( editVGap, SIGNAL( textChanged(const QString &) ), this, SLOT( updatePreview() ) );
- connect( editTGap, SIGNAL( textChanged(const QString &) ), this, SLOT( updatePreview() ) );
- connect( editLGap, SIGNAL( textChanged(const QString &) ), this, SLOT( updatePreview() ) );
- connect( editNumH, SIGNAL( textChanged(const QString &) ), this, SLOT( updatePreview() ) );
- connect( editNumV, SIGNAL( textChanged(const QString &) ), this, SLOT( updatePreview() ) );
+ connect( editWidth, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( updatePreview() ) );
+ connect( editHeight, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( updatePreview() ) );
+ connect( editHGap, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( updatePreview() ) );
+ connect( editVGap, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( updatePreview() ) );
+ connect( editTGap, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( updatePreview() ) );
+ connect( editLGap, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( updatePreview() ) );
+ connect( editNumH, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( updatePreview() ) );
+ connect( editNumV, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( updatePreview() ) );
- comboProducer->setInsertionPolicy( QComboBox::NoInsertion );
- comboType->setInsertionPolicy( QComboBox::NoInsertion );
+ comboProducer->setInsertionPolicy( TQComboBox::NoInsertion );
+ comboType->setInsertionPolicy( TQComboBox::NoInsertion );
comboProducer->clear();
- QStringList list = Definition::getProducers();
+ TQStringList list = Definition::getProducers();
comboProducer->insertStringList( list );
- types = new QStringList[list.count()];
+ types = new TQStringList[list.count()];
for( unsigned int i = 0; i < list.count(); i++ )
types[i] = Definition::getTypes( list[i] );
- connect( comboProducer, SIGNAL( textChanged(const QString &) ), this, SLOT( updateType() ) );
- connect( comboType, SIGNAL( textChanged(const QString &) ), this, SLOT( updateText() ) );
- connect( buttonInfo, SIGNAL( clicked() ), this, SLOT( toggleExtension() ) );
+ connect( comboProducer, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( updateType() ) );
+ connect( comboType, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( updateText() ) );
+ connect( buttonInfo, TQT_SIGNAL( clicked() ), this, TQT_SLOT( toggleExtension() ) );
drawGraphic();
updateType();
@@ -299,61 +299,61 @@ void DefinitionDialog::updatePreview()
{
Measurements m = getCurrentMeasure();
- editHeight->setPaletteForegroundColor( Qt::black );
- editWidth->setPaletteForegroundColor( Qt::black );
- editVGap->setPaletteForegroundColor( Qt::black );
- editHGap->setPaletteForegroundColor( Qt::black );
- editTGap->setPaletteForegroundColor( Qt::black );
- editLGap->setPaletteForegroundColor( Qt::black );
- editNumH->setPaletteForegroundColor( Qt::black );
- editNumV->setPaletteForegroundColor( Qt::black );
+ editHeight->setPaletteForegroundColor( TQt::black );
+ editWidth->setPaletteForegroundColor( TQt::black );
+ editVGap->setPaletteForegroundColor( TQt::black );
+ editHGap->setPaletteForegroundColor( TQt::black );
+ editTGap->setPaletteForegroundColor( TQt::black );
+ editLGap->setPaletteForegroundColor( TQt::black );
+ editNumH->setPaletteForegroundColor( TQt::black );
+ editNumV->setPaletteForegroundColor( TQt::black );
// Mark errors in Red
if( m.heightMM() > PrinterSettings::getInstance()->pageHeight() )
- editHeight->setPaletteForegroundColor( Qt::red );
+ editHeight->setPaletteForegroundColor( TQt::red );
if( m.widthMM() > PrinterSettings::getInstance()->pageWidth() )
- editWidth->setPaletteForegroundColor( Qt::red );
+ editWidth->setPaletteForegroundColor( TQt::red );
if( m.gapVMM() < m.heightMM() )
- editVGap->setPaletteForegroundColor( Qt::red );
+ editVGap->setPaletteForegroundColor( TQt::red );
if( m.gapHMM() < m.widthMM() )
- editHGap->setPaletteForegroundColor( Qt::red );
+ editHGap->setPaletteForegroundColor( TQt::red );
if( m.gapTopMM() > PrinterSettings::getInstance()->pageHeight() - m.heightMM() )
- editTGap->setPaletteForegroundColor( Qt::red );
+ editTGap->setPaletteForegroundColor( TQt::red );
if( m.gapLeftMM() > PrinterSettings::getInstance()->pageWidth() - m.widthMM() )
- editLGap->setPaletteForegroundColor( Qt::red );
+ editLGap->setPaletteForegroundColor( TQt::red );
if( m.gapLeftMM() + m.numH() * m.gapHMM() > PrinterSettings::getInstance()->pageWidth() )
- editNumH->setPaletteForegroundColor( Qt::red );
+ editNumH->setPaletteForegroundColor( TQt::red );
if( m.gapTopMM() + m.numV() * m.gapVMM() > PrinterSettings::getInstance()->pageHeight() )
- editNumV->setPaletteForegroundColor( Qt::red );
+ editNumV->setPaletteForegroundColor( TQt::red );
- preview->setRect( QRect( (int)m.gapLeftMM(), (int)m.gapTopMM(), (int)m.widthMM(), (int)m.heightMM() ) );
+ preview->setRect( TQRect( (int)m.gapLeftMM(), (int)m.gapTopMM(), (int)m.widthMM(), (int)m.heightMM() ) );
preview->setMeasurements( m );
- preview->repaint();
+ preview->tqrepaint();
}
void DefinitionDialog::drawGraphic()
{
- QWMatrix wm;
+ TQWMatrix wm;
wm.rotate( 90 );
- QPixmap pic( 450, 330 );
- pic.fill( Qt::gray );
+ TQPixmap pic( 450, 330 );
+ pic.fill( TQt::gray );
- QPainter p( &pic );
- p.setPen( Qt::black );
+ TQPainter p( &pic );
+ p.setPen( TQt::black );
- p.fillRect( 60, 60, 450, 330, QColor( 255, 254, 217 ) );
+ p.fillRect( 60, 60, 450, 330, TQColor( 255, 254, 217 ) );
p.drawRect( 60, 60, 450, 330 );
- p.setBrush( Qt::white );
+ p.setBrush( TQt::white );
- p.setPen( Qt::DotLine );
+ p.setPen( TQt::DotLine );
p.drawRoundRect( 90, 90, 150, 90 );
p.drawRoundRect( 270, 90, 150, 90 );
@@ -361,14 +361,14 @@ void DefinitionDialog::drawGraphic()
p.drawRoundRect( 270, 210, 150, 90 );
// Draw width
- p.setPen( QPen( Qt::red, 2 ) );
+ p.setPen( TQPen( TQt::red, 2 ) );
p.drawLine( 90, 150, 240, 150 );
// Draw numh
p.drawLine( 90, 270, 450, 270 );
// Draw Gap Top
- p.setPen( QPen( Qt::red, 2, Qt::DotLine ) );
+ p.setPen( TQPen( TQt::red, 2, TQt::DotLine ) );
p.drawLine( 0, 60, 90, 60 );
p.drawLine( 0, 90, 90, 90 );
@@ -376,7 +376,7 @@ void DefinitionDialog::drawGraphic()
p.drawLine( 0, 210, 90, 210 );
// Draw height
- p.setPen( QPen( Qt::green, 2 ) );
+ p.setPen( TQPen( TQt::green, 2 ) );
p.drawLine( 150, 90, 150, 180 );
@@ -384,7 +384,7 @@ void DefinitionDialog::drawGraphic()
p.drawLine( 330, 90, 330, 330 );
// Draw Gap Left
- p.setPen( QPen( Qt::green, 2, Qt::DotLine ) );
+ p.setPen( TQPen( TQt::green, 2, TQt::DotLine ) );
p.drawLine( 60, 0, 60, 90 );
p.drawLine( 90, 0, 90, 90 );
@@ -392,12 +392,12 @@ void DefinitionDialog::drawGraphic()
p.drawLine( 270, 0, 270, 90 );
// draw Texts:
- p.setPen( Qt::black );
+ p.setPen( TQt::black );
p.drawText( 100, 140, i18n("Width") );
p.drawText( 160, 120, i18n("Height") );
p.drawText( 100, 260, i18n("Number of horizontal Labels") );
- QPixmap* pix = LabelUtils::drawString( i18n("Number of vertical Labels") );
+ TQPixmap* pix = LabelUtils::drawString( i18n("Number of vertical Labels") );
p.drawPixmap( 340, 110, pix->xForm( wm ) );
delete pix;
diff --git a/kbarcode/definitiondialog.h b/kbarcode/definitiondialog.h
index 701ce6f..10ff3d8 100644
--- a/kbarcode/definitiondialog.h
+++ b/kbarcode/definitiondialog.h
@@ -1,38 +1,39 @@
#ifndef DEFINITIONDIALOG_H
#define DEFINITIONDIALOG_H
-#include <qwidget.h>
-#include <qdialog.h>
+#include <tqwidget.h>
+#include <tqdialog.h>
#include "measurements.h"
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
+class TQVBoxLayout;
+class TQHBoxLayout;
+class TQGridLayout;
class KComboBox;
class KPushButton;
class KRestrictedLine;
-class QLabel;
-class QStringList;
-class QRect;
-class QPaintEvent;
+class TQLabel;
+class TQStringList;
+class TQRect;
+class TQPaintEvent;
/** Displays a preview of the given label measurements.
* The current page size setting of the user is used.
- * The labels are drawn using QPainter. Only one page is previewed.
+ * The labels are drawn using TQPainter. Only one page is previewed.
*/
-class LabelPreview : public QWidget {
+class LabelPreview : public TQWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- LabelPreview( QWidget* parent = 0, const char* name = 0 );
+ LabelPreview( TQWidget* tqparent = 0, const char* name = 0 );
~LabelPreview();
- void setRect( QRect label ) { size = label; }
+ void setRect( TQRect label ) { size = label; }
void setMeasurements( const Measurements & m ) { measure = m; }
void setPrvEnabled( bool b ) { m_prv_enabled = b; }
protected:
- void paintEvent( QPaintEvent* );
- QRect size;
+ void paintEvent( TQPaintEvent* );
+ TQRect size;
Measurements measure;
bool m_prv_enabled;
@@ -41,12 +42,13 @@ class LabelPreview : public QWidget {
/** A dialog which allows the user to create his/her own
* label definitions easily.
*/
-class DefinitionDialog : public QDialog
+class DefinitionDialog : public TQDialog
{
Q_OBJECT
+ TQ_OBJECT
public:
- DefinitionDialog( QWidget* parent = 0, const char* name = 0, bool modal = true, WFlags fl = 0 );
+ DefinitionDialog( TQWidget* tqparent = 0, const char* name = 0, bool modal = true, WFlags fl = 0 );
~DefinitionDialog();
private:
const Measurements getCurrentMeasure();
@@ -60,17 +62,17 @@ private slots:
void drawGraphic();
protected:
- QLabel* l;
- QLabel* TextLabel1;
- QLabel* TextLabel2;
- QLabel* TextLabel3;
- QLabel* TextLabel4;
- QLabel* TextLabel5;
- QLabel* TextLabel6;
- QLabel* TextLabel7;
- QLabel* TextLabel8;
- QLabel* TextLabel9;
- QLabel* TextLabel10;
+ TQLabel* l;
+ TQLabel* TextLabel1;
+ TQLabel* TextLabel2;
+ TQLabel* TextLabel3;
+ TQLabel* TextLabel4;
+ TQLabel* TextLabel5;
+ TQLabel* TextLabel6;
+ TQLabel* TextLabel7;
+ TQLabel* TextLabel8;
+ TQLabel* TextLabel9;
+ TQLabel* TextLabel10;
KComboBox* comboProducer;
KComboBox* comboType;
KRestrictedLine* editWidth;
@@ -85,15 +87,15 @@ protected:
KPushButton* buttonCancel;
KPushButton* buttonInfo;
- QStringList* types;
+ TQStringList* types;
LabelPreview* preview;
protected:
- QVBoxLayout* DefinitionDialogLayout;
- QHBoxLayout* Layout17;
- QVBoxLayout* Layout13;
- QVBoxLayout* Layout14;
- QHBoxLayout* Layout16;
+ TQVBoxLayout* DefinitionDialogLayout;
+ TQHBoxLayout* Layout17;
+ TQVBoxLayout* Layout13;
+ TQVBoxLayout* Layout14;
+ TQHBoxLayout* Layout16;
};
#endif // DEFINITIONDIALOG_H
diff --git a/kbarcode/documentitem.cpp b/kbarcode/documentitem.cpp
index 8d85eeb..e2c1426 100644
--- a/kbarcode/documentitem.cpp
+++ b/kbarcode/documentitem.cpp
@@ -22,13 +22,13 @@
#include <kapplication.h>
-#include <qpen.h>
-#include <qpaintdevicemetrics.h>
-#include <qpainter.h>
-#include <qdom.h>
+#include <tqpen.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqpainter.h>
+#include <tqdom.h>
DocumentItem::DocumentItem()
- : QObject(), XMLUtils()
+ : TQObject(), XMLUtils()
{
init();
}
@@ -37,17 +37,17 @@ void DocumentItem::init()
{
m_canvasitem = NULL;
m_token = NULL;
- m_device = KApplication::desktop();
+ m_device = TQT_TQPAINTDEVICE(KApplication::desktop());
m_z = 0;
m_border = true;
m_locked = false;
- m_pen = QPen( Qt::black, 1, Qt::SolidLine );
- m_rect = QRect( 0, 0, 0, 0 );
+ m_pen = TQPen( TQt::black, 1, TQt::SolidLine );
+ m_rect = TQRect( 0, 0, 0, 0 );
m_visibilityScript = "true";
}
-void DocumentItem::drawBorder(QPainter* painter)
+void DocumentItem::drawBorder(TQPainter* painter)
{
if( m_border )
{
@@ -58,7 +58,7 @@ void DocumentItem::drawBorder(QPainter* painter)
}
}
-void DocumentItem::loadXML (QDomElement* element)
+void DocumentItem::loadXML (TQDomElement* element)
{
LabelUtils l;
m_rect.setX( element->attribute( "x_mm", "0" ).toInt() );
@@ -66,7 +66,7 @@ void DocumentItem::loadXML (QDomElement* element)
m_rect.setWidth( element->attribute( "width_mm", "-1" ).toInt() );
m_rect.setHeight( element->attribute( "height_mm", "-1" ).toInt() );
- m_pen.setColor( readXMLColor( element, "line-color", Qt::black ) );
+ m_pen.setColor( readXMLColor( element, "line-color", TQt::black ) );
m_pen.setStyle( (Qt::PenStyle)element->attribute( "line-style", "0" ).toInt() );
m_pen.setWidth( element->attribute( "line-width", "1" ).toInt() );
m_border = (bool)element->attribute( "line-visible", "1" ).toInt();
@@ -75,7 +75,7 @@ void DocumentItem::loadXML (QDomElement* element)
m_visibilityScript = element->attribute( "visibilityScript", "true" );
}
-void DocumentItem::saveXML (QDomElement* element)
+void DocumentItem::saveXML (TQDomElement* element)
{
element->setAttribute( "x_mm", m_rect.x() );
element->setAttribute( "y_mm", m_rect.y() );
@@ -83,7 +83,7 @@ void DocumentItem::saveXML (QDomElement* element)
element->setAttribute( "height_mm", m_rect.height() );
writeXMLColor( element, "line-color", m_pen.color() );
- element->setAttribute( "line-style", (Qt::PenStyle)m_pen.style() );
+ element->setAttribute( "line-style", (TQt::PenStyle)m_pen.style() );
element->setAttribute( "line-width", m_pen.width() );
element->setAttribute( "line-visible", (int)m_border );
element->setAttribute( "z", m_z );
@@ -103,7 +103,7 @@ void DocumentItem::moveMM( int x, int y )
// Move is not relative!
/* m_rect.setX( m_rect.x() + x );
m_rect.setY( m_rect.y() + y );*/
- m_rect = QRect( x, y, m_rect.width(), m_rect.height() );
+ m_rect = TQRect( x, y, m_rect.width(), m_rect.height() );
}
void DocumentItem::setSize( int w, int h )
@@ -119,9 +119,9 @@ void DocumentItem::setSizeMM( int w, int h )
m_rect.setHeight( h );
}
-void DocumentItem::setBoundingRect( const QRect & rect )
+void DocumentItem::setBoundingRect( const TQRect & rect )
{
- QRect r;
+ TQRect r;
LabelUtils l;
r.setX( (int)(l.pixelToMm( rect.x(), m_device, LabelUtils::DpiX ) * 1000.0 ) );
r.setY( (int)(l.pixelToMm( rect.y(), m_device, LabelUtils::DpiY ) * 1000.0 ) );
@@ -132,9 +132,9 @@ void DocumentItem::setBoundingRect( const QRect & rect )
setRectMM( r.normalize() );
}
-QRect DocumentItem::boundingRect() const
+TQRect DocumentItem::boundingRect() const
{
- QRect r;
+ TQRect r;
LabelUtils l;
r.setX( (int)(l.mmToPixel( m_rect.x(), m_device, LabelUtils::DpiX ) / 1000.0 ) );
@@ -147,28 +147,28 @@ QRect DocumentItem::boundingRect() const
return r;
}
-void DocumentItem::setRect( const QRect & rect)
+void DocumentItem::setRect( const TQRect & rect)
{
// avoid resizing to negative values
- QRect r = rect.normalize();
- setBoundingRect( QRect( r.x() - m_pen.width(), r.y() - m_pen.width(), r.width() + 2 * m_pen.width(), r.height() + 2 * m_pen.width() ) );
+ TQRect r = rect.normalize();
+ setBoundingRect( TQRect( r.x() - m_pen.width(), r.y() - m_pen.width(), r.width() + 2 * m_pen.width(), r.height() + 2 * m_pen.width() ) );
}
-QRect DocumentItem::rect() const
+TQRect DocumentItem::rect() const
{
- QRect bound = boundingRect();
- QRect r( bound.x() + m_pen.width(), bound.y() + m_pen.width(), bound.width() - 2 * m_pen.width(), bound.height() - 2 * m_pen.width() );
+ TQRect bound = boundingRect();
+ TQRect r( bound.x() + m_pen.width(), bound.y() + m_pen.width(), bound.width() - 2 * m_pen.width(), bound.height() - 2 * m_pen.width() );
// qDebug("rect %i %i %i %i", r.x(), r.y(), r.width(), r.height() );
return r;
}
-void DocumentItem::setRectMM( const QRect & rect )
+void DocumentItem::setRectMM( const TQRect & rect )
{
// avoid resizing to negative values
m_rect = rect.normalize();
}
-QRect DocumentItem::rectMM() const
+TQRect DocumentItem::rectMM() const
{
return m_rect;
}
@@ -183,12 +183,12 @@ bool DocumentItem::border () const
return m_border;
}
-void DocumentItem::setPen( const QPen & pen )
+void DocumentItem::setPen( const TQPen & pen )
{
m_pen = pen;
}
-QPen DocumentItem::pen() const
+TQPen DocumentItem::pen() const
{
return m_pen;
}
@@ -213,12 +213,12 @@ void DocumentItem::setZ( int z )
m_z = z;
}
-void DocumentItem::setPaintDevice( QPaintDevice* device )
+void DocumentItem::setPaintDevice( TQPaintDevice* device )
{
m_device = device;
}
-QPaintDevice* DocumentItem::paintDevice() const
+TQPaintDevice* DocumentItem::paintDevice() const
{
return m_device;
}
diff --git a/kbarcode/documentitem.h b/kbarcode/documentitem.h
index ff528d3..d1891b1 100644
--- a/kbarcode/documentitem.h
+++ b/kbarcode/documentitem.h
@@ -19,13 +19,13 @@
#define DOCUMENTITEM_H
#include <xmlutils.h>
-#include <qobject.h>
-#include <qsortedlist.h>
-#include <qstring.h>
-#include <qtextstream.h>
+#include <tqobject.h>
+#include <tqsortedlist.h>
+#include <tqstring.h>
+#include <tqtextstream.h>
-#include <qcolor.h>
-#include <qpen.h>
+#include <tqcolor.h>
+#include <tqpen.h>
#include "zplutils.h"
@@ -40,10 +40,10 @@ enum ERtti {
//NY33
};
-class QDomElement;
-class QPainter;
-class QPaintDevice;
-class QTextStream;
+class TQDomElement;
+class TQPainter;
+class TQPaintDevice;
+class TQTextStream;
class TCanvasItem;
class TokenProvider;
@@ -51,7 +51,7 @@ class TokenProvider;
* Class DocumentItem
* Every object which can be placed on a document has to be a subclass of this class.
*/
-class DocumentItem : public QObject, protected XMLUtils {
+class DocumentItem : public TQObject, protected XMLUtils {
public:
DocumentItem ( );
virtual ~DocumentItem() { };
@@ -60,48 +60,48 @@ public:
*
* @param element
*/
- virtual void loadXML (QDomElement* element);
+ virtual void loadXML (TQDomElement* element);
/**
* save this item to XML
*/
- virtual void saveXML (QDomElement* element);
+ virtual void saveXML (TQDomElement* element);
/**
* Draws the item
*/
- virtual void draw (QPainter* painter) = 0;
+ virtual void draw (TQPainter* painter) = 0;
/**
* Draw a border around the item, has to be reimplemented for round items or barcodes which do not allow borders.
*/
- virtual void drawBorder (QPainter* painter);
+ virtual void drawBorder (TQPainter* painter);
virtual int rtti () const = 0;
/**
- * Write a ZPL string for drawing this item onto a zebra printer to a QTextStream
+ * Write a ZPL string for drawing this item onto a zebra printer to a TQTextStream
*/
- virtual void drawZpl( QTextStream* stream ) = 0;
+ virtual void drawZpl( TQTextStream* stream ) = 0;
/**
- * Write a IPL string for drawing this item onto a zebra printer to a QTextStream
+ * Write a IPL string for drawing this item onto a zebra printer to a TQTextStream
*/
- virtual void drawIpl( QTextStream* stream, IPLUtils* utils ) = 0;
+ virtual void drawIpl( TQTextStream* stream, IPLUtils* utils ) = 0;
/**
- * Write a EPCL string for drawing this item onto a zebra printer to a QTextStream
+ * Write a EPCL string for drawing this item onto a zebra printer to a TQTextStream
*/
- virtual void drawEPcl( QTextStream* stream ) = 0;
+ virtual void drawEPcl( TQTextStream* stream ) = 0;
void setCanvasItem( TCanvasItem* item );
TCanvasItem* canvasItem() const;
- void setPaintDevice( QPaintDevice* device );
- QPaintDevice* paintDevice() const;
+ void setPaintDevice( TQPaintDevice* device );
+ TQPaintDevice* paintDevice() const;
void setTokenProvider( TokenProvider* token );
TokenProvider* tokenProvider() const;
@@ -113,8 +113,8 @@ public:
void setBorder (bool b);
bool border () const;
- void setPen( const QPen& pen );
- QPen pen() const;
+ void setPen( const TQPen& pen );
+ TQPen pen() const;
/** move the documentitem using pixel coordinates on the current
* paint device
@@ -136,27 +136,27 @@ public:
/** The bounding rectangle. I.e. the rectangle including
* the border width
*/
- void setBoundingRect( const QRect & rect );
+ void setBoundingRect( const TQRect & rect );
/** The bounding rectangle. I.e. the rectangle including
* the border width
*/
- QRect boundingRect() const;
+ TQRect boundingRect() const;
/** The drawing rectangle. I.e. the rectangle with the
* border width substracted
*/
- void setRect( const QRect & rect );
+ void setRect( const TQRect & rect );
/** The drawing rectangle. I.e. the rectangle with the
* border width substracted
*/
- QRect rect() const;
+ TQRect rect() const;
/** the bounding rectangle including the border in 1/1000mm
*/
- void setRectMM( const QRect & rect );
+ void setRectMM( const TQRect & rect );
/** the bounding rectangle including the border in 1/1000mm
*/
- QRect rectMM() const;
+ TQRect rectMM() const;
/** set the item to be locked in the label editor
* i.e protect it from being move or resized by the user
@@ -170,8 +170,8 @@ public:
* The script shall return true if the item should be visible.
* If script returns false the item will not be printed.
*/
- inline void setVisibilityScript( const QString & script );
- inline const QString visibilityScript() const;
+ inline void setVisibilityScript( const TQString & script );
+ inline const TQString visibilityScript() const;
int z() const;
void setZ( int z );
@@ -197,34 +197,34 @@ private:
* Defines wether this item has a border or not
*/
bool m_border;
- QPen m_pen;
- QRect m_rect;
+ TQPen m_pen;
+ TQRect m_rect;
int m_z;
bool m_locked;
/**
* Background color of this document item
*/
- QColor m_background;
+ TQColor m_background;
- QString m_visibilityScript;
+ TQString m_visibilityScript;
- QPaintDevice* m_device;
+ TQPaintDevice* m_device;
TCanvasItem* m_canvasitem;
TokenProvider* m_token;
};
-void DocumentItem::setVisibilityScript( const QString & script )
+void DocumentItem::setVisibilityScript( const TQString & script )
{
m_visibilityScript = script;
}
-const QString DocumentItem::visibilityScript() const
+const TQString DocumentItem::visibilityScript() const
{
return m_visibilityScript;
}
-typedef QSortedList<DocumentItem> DocumentItemList;
+typedef TQSortedList<DocumentItem> DocumentItemList;
#endif //DOCUMENTITEM_H
diff --git a/kbarcode/documentitemdlg.cpp b/kbarcode/documentitemdlg.cpp
index 9055de4..28313a0 100644
--- a/kbarcode/documentitemdlg.cpp
+++ b/kbarcode/documentitemdlg.cpp
@@ -18,52 +18,52 @@
#include "documentitemdlg.h"
#include "tokenprovider.h"
-#include <qvbox.h>
+#include <tqvbox.h>
#include <kcommand.h>
#include <klocale.h>
-DocumentItemDlg::DocumentItemDlg( TokenProvider* token, DocumentItem* item, KCommandHistory* history, QWidget* parent )
+DocumentItemDlg::DocumentItemDlg( TokenProvider* token, DocumentItem* item, KCommandHistory* history, TQWidget* tqparent )
: KDialogBase( Tabbed, i18n("Properties"), KDialogBase::Ok|KDialogBase::Cancel,
- KDialogBase::Ok, parent, 0, true, true )
+ KDialogBase::Ok, tqparent, 0, true, true )
{
m_item = item;
m_history = history;
//m_list.setAutoDelete( false );
- QVBox* boxBorder = addVBoxPage(i18n("&Position && Size"), QString::null, QPixmap() );
+ TQVBox* boxBorder = addVBoxPage(i18n("&Position && Size"), TQString(), TQPixmap() );
addPage( new PropertySize( boxBorder ) );
- boxBorder = addVBoxPage(i18n("&Border"), QString::null, QPixmap() );
+ boxBorder = addVBoxPage(i18n("&Border"), TQString(), TQPixmap() );
addPage( new PropertyBorder( boxBorder ) );
if( m_item->rtti() == eRtti_Rect )
{
- boxBorder = addVBoxPage(i18n("&Fill Color"), QString::null, QPixmap() );
+ boxBorder = addVBoxPage(i18n("&Fill Color"), TQString(), TQPixmap() );
addPage( new PropertyFill( boxBorder) );
}
else if ( m_item->rtti() == eRtti_Barcode )
{
- boxBorder = addVBoxPage(i18n("&Barcode"), QString::null, QPixmap() );
+ boxBorder = addVBoxPage(i18n("&Barcode"), TQString(), TQPixmap() );
addPage( new PropertyBarcode( token, boxBorder) );
}
else if ( m_item->rtti() == eRtti_Text )
{
- boxBorder = addVBoxPage(i18n("&Rotation"), QString::null, QPixmap() );
+ boxBorder = addVBoxPage(i18n("&Rotation"), TQString(), TQPixmap() );
addPage( new PropertyRotation( boxBorder ) );
- boxBorder = addVBoxPage(i18n("&Text"), QString::null, QPixmap() );
+ boxBorder = addVBoxPage(i18n("&Text"), TQString(), TQPixmap() );
addPage( new PropertyText( token, boxBorder) );
}
else if( m_item->rtti() == eRtti_Image )
{
- boxBorder = addVBoxPage(i18n("&Image"), QString::null, QPixmap() );
+ boxBorder = addVBoxPage(i18n("&Image"), TQString(), TQPixmap() );
addPage( new PropertyImage( token, boxBorder) );
}
//NY19
else if ( m_item->rtti() == eRtti_TextLine )
{
- boxBorder = addVBoxPage(i18n("&Text"), QString::null, QPixmap() );
+ boxBorder = addVBoxPage(i18n("&Text"), TQString(), TQPixmap() );
addPage( new PropertyTextLine( token, boxBorder) );
}
//NY19
@@ -75,7 +75,7 @@ DocumentItemDlg::DocumentItemDlg( TokenProvider* token, DocumentItem* item, KCom
// as default page
if( TokenProvider::hasJavaScript() )
{
- boxBorder = addVBoxPage(i18n("&Visibility"), QString::null, QPixmap() );
+ boxBorder = addVBoxPage(i18n("&Visibility"), TQString(), TQPixmap() );
addPage( new PropertyVisible( boxBorder ) );
}
diff --git a/kbarcode/documentitemdlg.h b/kbarcode/documentitemdlg.h
index 732432e..4035847 100644
--- a/kbarcode/documentitemdlg.h
+++ b/kbarcode/documentitemdlg.h
@@ -28,8 +28,9 @@ class KCommandHistory;
class DocumentItemDlg : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- DocumentItemDlg( TokenProvider* token, DocumentItem* item, KCommandHistory* history, QWidget* parent );
+ DocumentItemDlg( TokenProvider* token, DocumentItem* item, KCommandHistory* history, TQWidget* tqparent );
~DocumentItemDlg();
void addPage( PropertyWidget* widget );
diff --git a/kbarcode/dsmainwindow.cpp b/kbarcode/dsmainwindow.cpp
index 0e30c4d..36ec1a9 100644
--- a/kbarcode/dsmainwindow.cpp
+++ b/kbarcode/dsmainwindow.cpp
@@ -23,10 +23,10 @@
#include "kactionmap.h"
#include "barkode.h"
-// Qt includes
-#include <qcheckbox.h>
-#include <qtextbrowser.h>
-#include <qsqldatabase.h>
+// TQt includes
+#include <tqcheckbox.h>
+#include <tqtextbrowser.h>
+#include <tqsqldatabase.h>
// KDE includes
#include <kaction.h>
@@ -43,15 +43,15 @@
bool DSMainWindow::autoconnect = true;
bool DSMainWindow::startwizard = true;
-DSMainWindow::DSMainWindow(QWidget *parent, const char *name, WFlags f)
- : KMainWindow(parent,name,f)
+DSMainWindow::DSMainWindow(TQWidget *tqparent, const char *name, WFlags f)
+ : KMainWindow(tqparent,name,f)
{
connectAct = 0;
first = false;
loadConfig();
- setAutoSaveSettings( QString("Window") + name, true );
- connect( kapp, SIGNAL( aboutToQuit() ), this, SLOT( saveConfig() ) );
+ setAutoSaveSettings( TQString("Window") + name, true );
+ connect( kapp, TQT_SIGNAL( aboutToQuit() ), TQT_TQOBJECT(this), TQT_SLOT( saveConfig() ) );
if( first && startwizard ) {
wizard();
@@ -66,23 +66,23 @@ DSMainWindow::~DSMainWindow()
void DSMainWindow::setupActions()
{
- KAction* quitAct = KStdAction::quit(kapp, SLOT(quit()), actionCollection());
- KAction* closeAct = KStdAction::close( this, SLOT( close() ), actionCollection(), "close" );
- KAction* configureAct = KStdAction::preferences( KBarcodeSettings::getInstance(), SLOT(configure()), actionCollection() );
- KAction* wizardAct = new KAction( i18n("&Start Configuration Wizard..."), BarIcon("wizard"), 0, this,
- SLOT(wizard()), actionCollection(), "wizard" );
- connectAct = new KAction(i18n("&Connect to Database"), BarIcon("connect_no"), 0, this, SLOT(connectMySQL()),
+ KAction* quitAct = KStdAction::quit(TQT_TQOBJECT(kapp), TQT_SLOT(quit()), actionCollection());
+ KAction* closeAct = KStdAction::close( TQT_TQOBJECT(this), TQT_SLOT( close() ), actionCollection(), "close" );
+ KAction* configureAct = KStdAction::preferences( KBarcodeSettings::getInstance(), TQT_SLOT(configure()), actionCollection() );
+ KAction* wizardAct = new KAction( i18n("&Start Configuration Wizard..."), BarIcon("wizard"), 0, TQT_TQOBJECT(this),
+ TQT_SLOT(wizard()), actionCollection(), "wizard" );
+ connectAct = new KAction(i18n("&Connect to Database"), BarIcon("connect_no"), 0, TQT_TQOBJECT(this), TQT_SLOT(connectMySQL()),
actionCollection(),"connect" );
- KAction* newTablesAct = new KAction( i18n("&Create Tables"), "", 0, this,
- SLOT(newTables()), actionCollection(), "tables" );
+ KAction* newTablesAct = new KAction( i18n("&Create Tables"), "", 0, TQT_TQOBJECT(this),
+ TQT_SLOT(newTables()), actionCollection(), "tables" );
importLabelDefAct = new KAction( i18n("&Import Label Definitions"), "", 0, SqlTables::getInstance(),
- SLOT(importLabelDef()), actionCollection(), "import" );
+ TQT_SLOT(importLabelDef()), actionCollection(), "import" );
importExampleAct = new KAction( i18n("&Import Example Data"), "", 0, SqlTables::getInstance(),
- SLOT(importExampleData()), actionCollection(), "import" );
+ TQT_SLOT(importExampleData()), actionCollection(), "import" );
KPopupMenu* file = new KPopupMenu( this );
KPopupMenu* settings = new KPopupMenu( this );
@@ -90,13 +90,13 @@ void DSMainWindow::setupActions()
int helpid = hlpMenu->idAt( 0 );
hlpMenu->removeItem( helpid );
hlpMenu->insertItem( SmallIconSet("contents"), i18n("&Help"),
- this, SLOT(appHelpActivated()), Key_F1, -1, 0 );
+ this, TQT_SLOT(appHelpActivated()), Key_F1, -1, 0 );
hlpMenu->insertSeparator(-1);
- hlpMenu->insertItem( i18n("&Action Map..."), this, SLOT( slotFunctionMap() ), 0, -1, 0 );
+ hlpMenu->insertItem( i18n("&Action Map..."), TQT_TQOBJECT(this), TQT_SLOT( slotFunctionMap() ), 0, -1, 0 );
hlpMenu->insertSeparator(-2);
- hlpMenu->insertItem( SmallIconSet("system"), i18n("&System Check..."), this, SLOT(showCheck() ), 0, -1, 0 );
- hlpMenu->insertItem( SmallIconSet("barcode"), i18n("&Barcode Help..."), this, SLOT( startInfo() ), 0, -1, 0 );
- hlpMenu->insertItem( i18n("&Donate..."), this, SLOT( donations() ), 0, -1, 0 );
+ hlpMenu->insertItem( SmallIconSet("system"), i18n("&System Check..."), TQT_TQOBJECT(this), TQT_SLOT(showCheck() ), 0, -1, 0 );
+ hlpMenu->insertItem( SmallIconSet("barcode"), i18n("&Barcode Help..."), TQT_TQOBJECT(this), TQT_SLOT( startInfo() ), 0, -1, 0 );
+ hlpMenu->insertItem( i18n("&Donate..."), TQT_TQOBJECT(this), TQT_SLOT( donations() ), 0, -1, 0 );
menuBar()->insertItem( i18n("&File"), file );
menuBar()->insertItem( i18n("&Settings"), settings );
@@ -108,7 +108,7 @@ void DSMainWindow::setupActions()
configureAct->plug( settings );
wizardAct->plug( settings );
connectAct->plug( settings );
- (new KActionSeparator( this ))->plug( settings );
+ (new KActionSeparator( TQT_TQOBJECT(this) ))->plug( settings );
newTablesAct->plug( settings );
importLabelDefAct->plug( settings );
importExampleAct->plug( settings );
@@ -160,7 +160,7 @@ void DSMainWindow::saveConfig()
void DSMainWindow::wizard()
{
ConfWizard* wiz = new ConfWizard( 0, "wiz", true );
- if( wiz->exec() == QDialog::Accepted && wiz->checkDatabase->isChecked() )
+ if( wiz->exec() == TQDialog::Accepted && wiz->checkDatabase->isChecked() )
SqlTables::getInstance()->connectMySQL();
delete wiz;
@@ -182,12 +182,12 @@ void DSMainWindow::appHelpActivated()
"<qt>The KBarcode documentation is avaible as PDF for download on our webpage.<br><br>") +
"<a href=\"http://www.kbarcode.net/17.0.html\">" +
i18n("Download Now") + "</a></qt>",
- QString::null, QString::null, KMessageBox::AllowLink );
+ TQString(), TQString(), KMessageBox::AllowLink );
}
void DSMainWindow::showCheck()
{
- QTextBrowser* b = new QTextBrowser( 0, "b" );
+ TQTextBrowser* b = new TQTextBrowser( 0, "b" );
b->setText( DSMainWindow::systemCheck() );
b->resize( 320, 240 );
b->show();
@@ -195,7 +195,7 @@ void DSMainWindow::showCheck()
void DSMainWindow::startInfo()
{
- QString info = locate("appdata", "barcodes.html");
+ TQString info = locate("appdata", "barcodes.html");
if( !info.isEmpty() )
kapp->invokeBrowser( info );
}
@@ -208,16 +208,16 @@ bool DSMainWindow::newTables()
void DSMainWindow::donations()
{
// orig =https://www.paypal.com/xclick/business=domseichter%40web.de&item_name=Support+KBarcode+Development&item_number=0&image_url=http%3A//www.kbarcode.net/themes/DeepBlue/images/logo.gif&no_shipping=1&return=http%3A//www.kbarcode.net&cancel_return=http%3A//www.kbarcode.net&cn=Suggestions%2C+Comments%3F&tax=0&currency_code=EUR
- QString url = "https://www.paypal.com/xclick/[email protected]&item_name=Support+KBarcode+Development&item_number=0&image_url=www.kbarcode.net/themes/DeepBlue/images/logo.gif&no_shipping=1&return=www.kbarcode.net&cancel_return=www.kbarcode.net&cn=Suggestions,+Comments,&tax=0&currency_code=EUR";
+ TQString url = "https://www.paypal.com/xclick/[email protected]&item_name=Support+KBarcode+Development&item_number=0&image_url=www.kbarcode.net/themes/DeepBlue/images/logo.gif&no_shipping=1&return=www.kbarcode.net&cancel_return=www.kbarcode.net&cn=Suggestions,+Comments,&tax=0&currency_code=EUR";
KMessageBox::information( this, i18n(
"<qt>It is possible to support the further development of KBarcode through donations. "
"PayPal will be used for processing the donation.<br><br>" ) +
"<a href=\"" + url + "\">" +
- i18n("Donate Now") + "</a></qt>", QString::null, QString::null, KMessageBox::AllowLink );
+ i18n("Donate Now") + "</a></qt>", TQString(), TQString(), KMessageBox::AllowLink );
}
-QString DSMainWindow::systemCheck()
+TQString DSMainWindow::systemCheck()
{
bool gnubarcode = !Barkode::haveGNUBarcode();
bool pdf = !Barkode::havePDFBarcode();
@@ -225,7 +225,7 @@ QString DSMainWindow::systemCheck()
bool tbarcode2 = !Barkode::haveTBarcode2();
bool pure = !Barkode::havePurePostscriptBarcode();
- QString text;
+ TQString text;
text.append( i18n("<p><h3>Barcode Support</h3></p>") );
text.append( "<p>GNU Barcode: ");
@@ -244,11 +244,11 @@ QString DSMainWindow::systemCheck()
text.append( i18n("<p><h3>Database Support</h3></p>") );
- QStringList list = QSqlDatabase::drivers();
+ TQStringList list = TQSqlDatabase::drivers();
if( list.count() ) {
text.append( "<ul>" );
- QStringList::Iterator it = list.begin();
+ TQStringList::Iterator it = list.begin();
while( it != list.end() ) {
text.append( i18n("<li>Driver found: ") + *it + "</li>" );
++it;
diff --git a/kbarcode/dsmainwindow.h b/kbarcode/dsmainwindow.h
index c43959b..7e049ac 100644
--- a/kbarcode/dsmainwindow.h
+++ b/kbarcode/dsmainwindow.h
@@ -18,7 +18,7 @@
#ifndef DSMAINWINDOW_H
#define DSMAINWINDOW_H
-#include <qwidget.h>
+#include <tqwidget.h>
#include <kmainwindow.h>
class KAction;
@@ -32,8 +32,9 @@ class KPopupMenu;
*/
class DSMainWindow : public KMainWindow {
Q_OBJECT
+ TQ_OBJECT
public:
- DSMainWindow(QWidget *parent=0, const char *name=0, WFlags f = WType_TopLevel | WDestructiveClose );
+ DSMainWindow(TQWidget *tqparent=0, const char *name=0, WFlags f = WType_TopLevel | WDestructiveClose );
~DSMainWindow();
/** Is this the first start of KBarcode ?
@@ -50,7 +51,7 @@ class DSMainWindow : public KMainWindow {
* and drivers for barcode support and database
* access.
*/
- static QString systemCheck();
+ static TQString systemCheck();
public slots:
void wizard();
diff --git a/kbarcode/dsrichtext.cpp b/kbarcode/dsrichtext.cpp
index 01f7182..15d08fe 100644
--- a/kbarcode/dsrichtext.cpp
+++ b/kbarcode/dsrichtext.cpp
@@ -17,12 +17,12 @@
#include "dsrichtext.h"
-#ifdef QT_TEXT_BUG
+#ifdef TQT_TEXT_BUG
-// Qt includes
-#include <qfontmetrics.h>
-#include <qpainter.h>
-#include <qregexp.h>
+// TQt includes
+#include <tqfontmetrics.h>
+#include <tqpainter.h>
+#include <tqregexp.h>
// for DSREPLACE
#include "sqltables.h"
@@ -31,7 +31,7 @@
EXAMPLE TEXT:
"<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body style=\"font-size:10pt;font-family:Nimbus Sans l\">"
"<p>A little bit <span style=\"font-style:italic;font-weight:600\">formated</span><span style=\"color:#4400ff\"> "
- "richtext</span> which should be printed to a <span style=\"font-weight:600\">QPrinter</span> with <span style=\"text-decoration:underline\">QSimpleRichText</span>. </p>"
+ "richtext</span> which should be printed to a <span style=\"font-weight:600\">TQPrinter</span> with <span style=\"text-decoration:underline\">TQSimpleRichText</span>. </p>"
"<p><span style=\"font-family:Times New Roman;font-size:16pt\">Printing should work in ScreenResolution as well as in HighResolution, but as you can see it will only work in ScreenResolution.</span></p>"
"</body></html>";
@@ -39,15 +39,15 @@ Another example
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:10pt;font-family:Nimbus Sans l">
<p align="center"><span style="font-size:12pt;font-weight:600;text-decoration:underline">Text test </span><span style="font-size:12pt;font-weight:600;text-decoration:underline;color:#ff0000">label</span></p>
<p>Resolution <span style="font-weight:600">formated</span> 108dpi. This text &amp; text should now overlap with the first line. 4 &lt; 6a</p>
-<p><span style="font-family:Nimbus Sans L;font-weight:600">A</span><span style="font-family:Nimbus Sans L"> longer paragraph with some text, so that I can test wether wordwrap is working. Another &quot;line&quot; to test line spacing without a bigger font (like the one found in the next sentence) messing up the spacing.</span><span style="font-family:Courier [Adobe];font-size:16pt"> Some text &quot;in&quot; a bigger courier font.</span><span style="font-family:Nimbus Sans L"> Also this paragraph should be justified as blockquote.</span><span style="font-family:Nimbus Sans L;color:#ff0004"> I hope it works</span><span style="font-family:Nimbus Sans L"> and KBarcodes text redering will be better than the one found in Qt.</span></p>
+<p><span style="font-family:Nimbus Sans L;font-weight:600">A</span><span style="font-family:Nimbus Sans L"> longer paragraph with some text, so that I can test wether wordwrap is working. Another &quot;line&quot; to test line spacing without a bigger font (like the one found in the next sentence) messing up the spacing.</span><span style="font-family:Courier [Adobe];font-size:16pt"> Some text &quot;in&quot; a bigger courier font.</span><span style="font-family:Nimbus Sans L"> Also this paragraph should be justified as blockquote.</span><span style="font-family:Nimbus Sans L;color:#ff0004"> I hope it works</span><span style="font-family:Nimbus Sans L"> and KBarcodes text redering will be better than the one found in TQt.</span></p>
</body></html>
*/
-DSRichText::DSRichText( const QString & t )
+DSRichText::DSRichText( const TQString & t )
: text( t )
{
- if( text.find("<html>") == -1 )
+ if( text.tqfind("<html>") == -1 )
text = "<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body style=\"font-size:10pt;font-family:Nimbus Sans l\"><p>"
+ t + "</p></body></html>";
@@ -56,9 +56,9 @@ DSRichText::DSRichText( const QString & t )
start = end = pos = 0;
x = y = 0;
sx = sy = 1.0;
- m_base = QFont();
+ m_base = TQFont();
- QString tmp = parse( text, "<body ", ">", 0 );
+ TQString tmp = parse( text, "<body ", ">", 0 );
if( !tmp.isNull() ) {
pos += tmp.length();
tmp = tmp.left( tmp.length() - 1 );
@@ -66,7 +66,7 @@ DSRichText::DSRichText( const QString & t )
m_base = parseStyle( parse( tmp, "style=\"", "\"", pos ), &m_color );
}
- pos = text.find( "<p", 0 ); // initalize pos correctly
+ pos = text.tqfind( "<p", 0 ); // initalize pos correctly
while( parseParagraph() ); // empty while loop
}
@@ -74,16 +74,16 @@ DSRichText::~DSRichText()
{
}
-void DSRichText::initFormat( formated_word* f, int alignment )
+void DSRichText::initFormat( formated_word* f, int tqalignment )
{
- f->text = QString::null;
+ f->text = TQString();
f->line = false;
- f->alignment = alignment;
+ f->tqalignment = tqalignment;
f->font = m_base;
f->color = m_color;
}
-void DSRichText::initLine( QValueList<formated_line>* l )
+void DSRichText::initLine( TQValueList<formated_line>* l )
{
formated_line li;
li.width = 0;
@@ -94,7 +94,7 @@ void DSRichText::initLine( QValueList<formated_line>* l )
l->append( li );
}
-void DSRichText::updateSpacing( QValueList<formated_line>* l, QFontMetrics* fm )
+void DSRichText::updateSpacing( TQValueList<formated_line>* l, TQFontMetrics* fm )
{
l->last().lineSpacing = (l->last().lineSpacing < fm->lineSpacing()) ? fm->lineSpacing() : l->last().lineSpacing;
l->last().ascent = (l->last().ascent < fm->ascent()) ? fm->ascent() : l->last().ascent;
@@ -111,7 +111,7 @@ void DSRichText::fillLines()
formated_word word = words[i];
lines.last().line = lines.last().line | word.line;
- QFontMetrics fm( word.font );
+ TQFontMetrics fm( word.font );
updateSpacing( &lines, &fm );
int tw = fm.width( word.text );
@@ -127,7 +127,7 @@ void DSRichText::fillLines()
}
}
-void DSRichText::draw( QPainter* p )
+void DSRichText::draw( TQPainter* p )
{
/* don't try to draw if there is no space to draw */
if( !w || !h )
@@ -137,7 +137,7 @@ void DSRichText::draw( QPainter* p )
painter = p;
painter->save();
- painter->setClipRect( xpos, ypos, int(w*sx), int(h*sy), QPainter::CoordPainter );
+ painter->setClipRect( xpos, ypos, int(w*sx), int(h*sy), TQPainter::CoordPainter );
for( unsigned int z = 0; z < line_p.count(); z++ ) {
LineList lines = line_p[z];
@@ -147,7 +147,7 @@ void DSRichText::draw( QPainter* p )
for( unsigned int i = 0; i < lines.count(); i++ ) {
formated_line l = lines[i];
- if( l.formats.count() && l.formats[0].alignment == Qt::AlignJustify && i != lines.count() - 1 ) {
+ if( l.formats.count() && l.formats[0].tqalignment == TQt::AlignJustify && i != lines.count() - 1 ) {
// last line in a paragraph is not justified (in blocksatz mode)!
drawJustified( &l );
} else {
@@ -155,15 +155,15 @@ void DSRichText::draw( QPainter* p )
formated_word f = l.formats[z];
painter->setFont( f.font );
- painter->setPen( QPen( f.color ) );
+ painter->setPen( TQPen( f.color ) );
- int a = f.alignment;
- if( a == Qt::AlignRight ) {
- a = Qt::AlignLeft;
+ int a = f.tqalignment;
+ if( a == TQt::AlignRight ) {
+ a = TQt::AlignLeft;
if( !x )
x = w - l.width;
- } else if( a == Qt::AlignHCenter ) {
- a = Qt::AlignLeft;
+ } else if( a == TQt::AlignHCenter ) {
+ a = TQt::AlignLeft;
if( !x )
x = ( w - l.width ) / 2;
}
@@ -187,7 +187,7 @@ void DSRichText::drawJustified( formated_line* line )
int all = 0;
for( unsigned int z = 0; z < line->formats.count(); z++ ) {
line->formats[z].text = line->formats[z].text.stripWhiteSpace();
- QFontMetrics fm( line->formats[z].font );
+ TQFontMetrics fm( line->formats[z].font );
all += fm.width( line->formats[z].text );
}
@@ -195,11 +195,11 @@ void DSRichText::drawJustified( formated_line* line )
int space = (w - all) / (line->formats.count() - 1);
for( unsigned int z = 0; z < line->formats.count(); z++ ) {
painter->setFont( line->formats[z].font );
- painter->setPen( QPen( line->formats[z].color ) );
+ painter->setPen( TQPen( line->formats[z].color ) );
int ya = yDeviation( line );
int tw = painter->fontMetrics().width(line->formats[z].text);
- painter->drawText( int(x*sx), int((y+ya)*sy), int(tw*sx), int(line->lineSpacing * sy), Qt::AlignAuto, line->formats[z].text );
+ painter->drawText( int(x*sx), int((y+ya)*sy), int(tw*sx), int(line->lineSpacing * sy), TQt::AlignAuto, line->formats[z].text );
x += tw;
x += space;
}
@@ -208,9 +208,9 @@ void DSRichText::drawJustified( formated_line* line )
bool DSRichText::parseParagraph()
{
- int alignment = 0;
+ int tqalignment = 0;
formated_word f;
- QString d = parse( text, "<p", "</p>", pos );
+ TQString d = parse( text, "<p", "</p>", pos );
//qDebug("D=" + d );
//qDebug("POS=%i", pos );
@@ -218,11 +218,11 @@ bool DSRichText::parseParagraph()
if( d.isNull() )
return false;
- d = parseParagraphTag( d, &alignment );
+ d = parseParagraphTag( d, &tqalignment );
WordList words;
- QString data;
- initFormat( &f, alignment );
+ TQString data;
+ initFormat( &f, tqalignment );
if( d.isEmpty() ) {
// found empty paragraph
@@ -237,8 +237,8 @@ bool DSRichText::parseParagraph()
data.append( d[i] );
parseWords( data, &f, &words );
- initFormat( &f, alignment );
- data = QString::null;
+ initFormat( &f, tqalignment );
+ data = TQString();
// bail out now, otherwise there is
// and endless loop for e.g. <p>a</p>
@@ -246,11 +246,11 @@ bool DSRichText::parseParagraph()
break;
if( d[i] == '<' ) {
- QString span = d.mid( i, d.find( ">", i ) - i + 1 );
+ TQString span = d.mid( i, d.tqfind( ">", i ) - i + 1 );
i += span.length();
if( span.startsWith( "<span " ) ) {
- initFormat( &f, alignment );
+ initFormat( &f, tqalignment );
f.font = parseStyle( parse( span, "style=\"", "\"", 0 ), &f.color );
}
}
@@ -264,19 +264,19 @@ bool DSRichText::parseParagraph()
return true;
}
-QFont DSRichText::parseStyle( const QString & s, QColor* color )
+TQFont DSRichText::parseStyle( const TQString & s, TQColor* color )
{
- QString style = QString( s );
+ TQString style = TQString( s );
style = style.left( style.length() - 1 );
if( style.startsWith("style=\"" ) )
style = style.mid( 7, style.length() - 7 );
- QFont f = m_base;
+ TQFont f = m_base;
*color = m_color;
- for ( int i = 0; i < style.contains(';')+1; i++ ) {
- QString s = style.section( ';', i, i );
+ for ( int i = 0; i < style.tqcontains(';')+1; i++ ) {
+ TQString s = style.section( ';', i, i );
if( s.isEmpty() )
continue;
@@ -289,7 +289,7 @@ QFont DSRichText::parseStyle( const QString & s, QColor* color )
} else if( s.startsWith("text-decoration:") ) {
if( s.endsWith( "underline" ) )
f.setUnderline( true );
-/*#if QT_VERSION >= 0x030200
+/*#if [[[TQT_VERSION IS DEPRECATED]]] >= 0x030200
else if( s.endsWith( "overline" ) )
f.setOverline( true );
#endif */
@@ -304,24 +304,24 @@ QFont DSRichText::parseStyle( const QString & s, QColor* color )
if( s.endsWith( "bold" ) )
f.setBold( true );
else if( ok )
- f.setWeight( n / 8 ); // convert CSS values to Qt values
+ f.setWeight( n / 8 ); // convert CSS values to TQt values
}
}
return f;
}
-QString DSRichText::parse( const QString & t, const QString & find, const QString & find2, int start )
+TQString DSRichText::parse( const TQString & t, const TQString & tqfind, const TQString & tqfind2, int start )
{
- int s = t.find( find, start );
+ int s = t.tqfind( tqfind, start );
if( s == -1 || s < start )
- return QString::null;
+ return TQString();
- int pend = t.find( find2, s + find.length() );
- if( pend == -1 || pend < (signed int)(s + find.length()) )
- return QString::null;
+ int pend = t.tqfind( tqfind2, s + tqfind.length() );
+ if( pend == -1 || pend < (signed int)(s + tqfind.length()) )
+ return TQString();
- QString text = t.mid( s, pend - s + find2.length() );
+ TQString text = t.mid( s, pend - s + tqfind2.length() );
return text;
}
@@ -345,9 +345,9 @@ void DSRichText::setHeight( int height )
h = height;
}
-int DSRichText::parseAlignment( const QString & align )
+int DSRichText::parseAlignment( const TQString & align )
{
- QString a = QString( align );
+ TQString a = TQString( align );
if( a.endsWith("\"") )
a = a.left( a.length() - 1 );
@@ -355,18 +355,18 @@ int DSRichText::parseAlignment( const QString & align )
a = a.mid( 7, a.length() - 7 );
if( a == "left" )
- return Qt::AlignLeft;
+ return TQt::AlignLeft;
else if( a == "center" )
- return Qt::AlignHCenter;
+ return TQt::AlignHCenter;
else if( a == "right" )
- return Qt::AlignRight;
+ return TQt::AlignRight;
else if( a == "justify" )
- return Qt::AlignJustify;
+ return TQt::AlignJustify;
return 0;
}
-void DSRichText::parseWords( const QString & t, formated_word* w, WordList* words )
+void DSRichText::parseWords( const TQString & t, formated_word* w, WordList* words )
{
unsigned int p = 0;
for( unsigned int i = 0; i < t.length(); i++ ) {
@@ -393,25 +393,25 @@ inline int DSRichText::yDeviation( const formated_line* line )
}
}
-QString DSRichText::replaceEscapeSequences( const QString & t )
+TQString DSRichText::replaceEscapeSequences( const TQString & t )
{
- QString tmp = QString( t );
- tmp = tmp.replace( DSREPLACE( "&lt;" ), "<" );
- tmp = tmp.replace( DSREPLACE( "&gt;" ), ">" );
- tmp = tmp.replace( DSREPLACE( "&amp;" ), "&" );
- tmp = tmp.replace( DSREPLACE( "&quot;" ), "\"" );
+ TQString tmp = TQString( t );
+ tmp = tmp.tqreplace( DSREPLACE( "&lt;" ), "<" );
+ tmp = tmp.tqreplace( DSREPLACE( "&gt;" ), ">" );
+ tmp = tmp.tqreplace( DSREPLACE( "&amp;" ), "&" );
+ tmp = tmp.tqreplace( DSREPLACE( "&quot;" ), "\"" );
return tmp;
}
-QString DSRichText::parseParagraphTag( const QString &t, int* alignment )
+TQString DSRichText::parseParagraphTag( const TQString &t, int* tqalignment )
{
- QString d = QString( t );
+ TQString d = TQString( t );
if( d.startsWith("<p>") ) {
d = d.mid( 3, d.length() - 3 );
} else if( d.startsWith("<p ") ) {
- *alignment = parseAlignment( parse( d, "align=\"", "\"", 0 ) );
- if( d.contains( ">" ) ) {
- int x = d.find(">" ) + 1;
+ *tqalignment = parseAlignment( parse( d, "align=\"", "\"", 0 ) );
+ if( d.tqcontains( ">" ) ) {
+ int x = d.tqfind(">" ) + 1;
d = d.mid( x, d.length() - x );
}
}
@@ -422,6 +422,6 @@ QString DSRichText::parseParagraphTag( const QString &t, int* alignment )
return d;
}
-#endif // QT_TEXT_BUG
+#endif // TQT_TEXT_BUG
diff --git a/kbarcode/dsrichtext.h b/kbarcode/dsrichtext.h
index 5da22b1..dcd9c60 100644
--- a/kbarcode/dsrichtext.h
+++ b/kbarcode/dsrichtext.h
@@ -18,30 +18,30 @@
#ifndef DSRICHTEXT_H
#define DSRICHTEXT_H
-#define QT_TEXT_BUG
-/*#undef QT_TEXT_BUG*/
-#ifdef QT_TEXT_BUG
+#define TQT_TEXT_BUG
+/*#undef TQT_TEXT_BUG*/
+#ifdef TQT_TEXT_BUG
-#include <qcolor.h>
-#include <qfont.h>
-#include <qstring.h>
-#include <qvaluelist.h>
+#include <tqcolor.h>
+#include <tqfont.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
class DSRichText;
/** This class represents one word,
* formated with a font, a color and an
- * alignment.
+ * tqalignment.
*/
struct formated_word {
- QString text;
- QFont font;
- QColor color;
- int alignment;
+ TQString text;
+ TQFont font;
+ TQColor color;
+ int tqalignment;
bool line;
};
-typedef QValueList<formated_word> WordList;
+typedef TQValueList<formated_word> WordList;
/** This structure represents a single line.
* Every line contains a list of formated_words.
@@ -59,15 +59,15 @@ struct formated_line {
WordList formats;
};
-typedef QValueList<formated_line> LineList;
+typedef TQValueList<formated_line> LineList;
-class QColor;
-class QPainter;
+class TQColor;
+class TQPainter;
/** A richtext rendering class, which draws a piece
- * of HTML formated richtext on any QPainter.
+ * of HTML formated richtext on any TQPainter.
* This class works with all printer resolutions compared
- * to the buggy QSimpleRichText
+ * to the buggy TQSimpleRichText
*
* rendering the richtext happens in 3 steps:
* <ul>
@@ -81,20 +81,20 @@ class QPainter;
* of text may of course contain different formattings. A line struct is always
* a single line of drawn text, not more and not less.
* happens in draw() and fillLines()</li>
- * <li> the line structure is drawn line by line using QPainter.
+ * <li> the line structure is drawn line by line using TQPainter.
* happens in draw()</li>
* </ul>
*
* Printing to the screen is easy and the usage does not differ from
- * QSimpleRichText. Drawing on QPrinter is a little bit more complicated.
- * The most important thing is that you may not use QPainter::scale().
- * A small example on how to print on a QPrinter:
+ * TQSimpleRichText. Drawing on TQPrinter is a little bit more complicated.
+ * The most important thing is that you may not use TQPainter::scale().
+ * A small example on how to print on a TQPrinter:
* <pre>
- * QPrinter printer( QPrinter::HighResolution );
- * QPainter painter( &printer );
- * QPaintDeviceMetrics metrics( &printer );
- * double scalex = (double)metrics.logicalDpiX() / (double)QPaintDevice::x11AppDpiX();
- * double scaley = (double)metrics.logicalDpiY() / (double)QPaintDevice::x11AppDpiY();
+ * TQPrinter printer( TQPrinter::HighResolution );
+ * TQPainter painter( &printer );
+ * TQPaintDeviceMetrics metrics( &printer );
+ * double scalex = (double)metrics.logicalDpiX() / (double)TQPaintDevice::x11AppDpiX();
+ * double scaley = (double)metrics.logicalDpiY() / (double)TQPaintDevice::x11AppDpiY();
*
* DSRichText dsr( "&lt;html&gt;&lt;p&gt;Hallo World&lt;/p&gt;&lt;/html&gt;" );
* dsr.setWidth( 200 ); // in screenresolution coordinates
@@ -108,17 +108,17 @@ class QPainter;
*/
class DSRichText {
public:
- /** construct a DSRichText object. @p t is formated text as produces by QTextEdit.
+ /** construct a DSRichText object. @p t is formated text as produces by TQTextEdit.
*/
- DSRichText( const QString & t );
+ DSRichText( const TQString & t );
~DSRichText();
void setX( int x );
void setY( int y );
- /** draw the formated text on the QPainter* @p p
+ /** draw the formated text on the TQPainter* @p p
*/
- void draw( QPainter* p );
+ void draw( TQPainter* p );
/** set the width of the clipping rectangle
*/
void setWidth( int width );
@@ -126,7 +126,7 @@ class DSRichText {
*/
void setHeight( int height );
/** scale everything. This is necessary to print on devices
- * with another resolution than the screen. QPainter::scale() won't work.
+ * with another resolution than the screen. TQPainter::scale() won't work.
*/
void setScale( double x, double y ) {
sx = x; sy = y;
@@ -136,23 +136,23 @@ class DSRichText {
/** parse a single pare of <p></p> elements
*/
bool parseParagraph();
- /** remove <p> and </p> from the QString @p t and return it.
+ /** remove <p> and </p> from the TQString @p t and return it.
* This function is also responsible for getting the
- * correct alignment of the paragraph.
+ * correct tqalignment of the paragraph.
*/
- QString parseParagraphTag( const QString & t, int* alignment );
- /** parse the align attribute of a <p> tag and return the corresponding Qt alignment value.
+ TQString parseParagraphTag( const TQString & t, int* tqalignment );
+ /** parse the align attribute of a <p> tag and return the corresponding TQt tqalignment value.
*/
- int parseAlignment( const QString & align );
- /** parse the css style attribute of a <span> tag and return a matching QFont for these
- * style. The font color is saved in the QColor* @p color.
+ int parseAlignment( const TQString & align );
+ /** parse the css style attribute of a <span> tag and return a matching TQFont for these
+ * style. The font color is saved in the TQColor* @p color.
*/
- QFont parseStyle( const QString & s, QColor* color );
- QString parse( const QString & t, const QString & find, const QString & end, int start );
- void parseWords( const QString & t, formated_word* w, WordList* words );
- void initFormat( formated_word* f, int alignment );
- void initLine( QValueList<formated_line>* l );
- void updateSpacing( QValueList<formated_line>* l, QFontMetrics* fm );
+ TQFont parseStyle( const TQString & s, TQColor* color );
+ TQString parse( const TQString & t, const TQString & tqfind, const TQString & end, int start );
+ void parseWords( const TQString & t, formated_word* w, WordList* words );
+ void initFormat( formated_word* f, int tqalignment );
+ void initLine( TQValueList<formated_line>* l );
+ void updateSpacing( TQValueList<formated_line>* l, TQFontMetrics* fm );
/** draw the line @p line justified as blockquote
*/
void drawJustified( formated_line* line );
@@ -161,7 +161,7 @@ class DSRichText {
inline int yDeviation( const formated_line* line );
/** replace HTML escape sequences such as &lt; to their real character meaning (i.e. < )
*/
- QString replaceEscapeSequences( const QString & t );
+ TQString replaceEscapeSequences( const TQString & t );
/** fill the line structures with data
*/
@@ -180,14 +180,14 @@ class DSRichText {
double sx;
double sy;
- QString text;
- QFont m_base;
- QColor m_color;
- QPainter* painter;
+ TQString text;
+ TQFont m_base;
+ TQColor m_color;
+ TQPainter* painter;
- QValueList<LineList> line_p;
- QValueList<WordList> word_p;
+ TQValueList<LineList> line_p;
+ TQValueList<WordList> word_p;
};
-#endif // QT_TEXT_BUG
+#endif // TQT_TEXT_BUG
#endif
diff --git a/kbarcode/dstextedit.cpp b/kbarcode/dstextedit.cpp
index e059e96..370d88c 100644
--- a/kbarcode/dstextedit.cpp
+++ b/kbarcode/dstextedit.cpp
@@ -17,36 +17,36 @@
#include "dstextedit.h"
#include "dstextedit.moc"
-#include <qregexp.h>
+#include <tqregexp.h>
-DSTextEdit::DSTextEdit( QWidget* parent, const char* name )
- : TextEditBase( parent, name )
+DSTextEdit::DSTextEdit( TQWidget* tqparent, const char* name )
+ : TextEditBase( tqparent, name )
{
- connect( this, SIGNAL( textChanged() ), this, SLOT( fixParagraphs() ) );
+ connect( this, TQT_SIGNAL( textChanged() ), this, TQT_SLOT( fixParagraphs() ) );
}
void DSTextEdit::fixParagraphs()
{
struct {
- QFont font;
- QColor color;
- int alignment;
+ TQFont font;
+ TQColor color;
+ int tqalignment;
} tFormattings;
- QString t;
+ TQString t;
int pos = 0;
int count = 0;
int i;
int para, index; // needed to save the cursor position
int paraFrom, indexFrom, paraTo, indexTo; // needed to save the selection
- QValueList<int> chars;
- QRegExp reg("<p[^>]*>");
+ TQValueList<int> chars;
+ TQRegExp reg("<p[^>]*>");
for( i = 0; i < paragraphs(); i++ )
chars.append( paragraphLength( i ) );
// disconnect us first as we change the text here
- disconnect( this, SIGNAL( textChanged() ), this, SLOT( fixParagraphs() ) );
+ disconnect( this, TQT_SIGNAL( textChanged() ), this, TQT_SLOT( fixParagraphs() ) );
getCursorPosition( &para, &index );
getSelection( &paraFrom, &indexFrom, &paraTo, &indexTo );
@@ -57,7 +57,7 @@ void DSTextEdit::fixParagraphs()
t = this->text();
tFormattings.font = this->currentFont();
tFormattings.color = this->color();
- tFormattings.alignment = this->alignment();
+ tFormattings.tqalignment = this->tqalignment();
while( pos != -1 )
{
@@ -85,13 +85,13 @@ void DSTextEdit::fixParagraphs()
while( pos != -1 )
{
- pos = t.findRev( "</p>", pos );
+ pos = t.tqfindRev( "</p>", pos );
if( pos != -1 )
{
++count;
if( count > 1 ) //&& pos != -1 )
- t = t.replace( pos, 4, "<br />" );
+ t = t.tqreplace( pos, 4, "<br />" );
else
pos -= 4;
}
@@ -101,11 +101,11 @@ void DSTextEdit::fixParagraphs()
this->setCursorPosition( 0, index );
this->setCurrentFont( tFormattings.font );
this->setColor( tFormattings.color );
- this->setAlignment( tFormattings.alignment );
+ this->tqsetAlignment( tFormattings.tqalignment );
this->setSelection( paraFrom, indexFrom, paraTo, indexTo );
- connect( this, SIGNAL( textChanged() ), this, SLOT( fixParagraphs() ) );
+ connect( this, TQT_SIGNAL( textChanged() ), this, TQT_SLOT( fixParagraphs() ) );
}
/*
@@ -120,7 +120,7 @@ bool DSTextEdit::cursorIsInToken()
{
int para, index;
int firstopen, firstclose;
- QString data;
+ TQString data;
getCursorPosition( &para, &index );
@@ -128,14 +128,14 @@ bool DSTextEdit::cursorIsInToken()
qDebug("data=" + data );
--index;
- firstopen = data.findRev( "[", index );
- firstclose = data.findRev( "]", index );
+ firstopen = data.tqfindRev( "[", index );
+ firstclose = data.tqfindRev( "]", index );
++index;
if( firstopen != -1 && firstopen > firstclose )
{
- firstopen = data.find( "[", index );
- firstclose = data.find( "]", index );
+ firstopen = data.tqfind( "[", index );
+ firstclose = data.tqfind( "]", index );
if( ( firstclose != -1 && firstopen != -1 && firstclose < firstopen ) ||
( firstclose != -1 && firstopen == -1 ) )
return true;
diff --git a/kbarcode/dstextedit.h b/kbarcode/dstextedit.h
index 15192a3..8169dc7 100644
--- a/kbarcode/dstextedit.h
+++ b/kbarcode/dstextedit.h
@@ -18,26 +18,19 @@
#ifndef _DS_TEXT_EDIT_H_
#define _DS_TEXT_EDIT_H_
-#include <qnamespace.h>
+#include <tqnamespace.h>
-#if QT_VERSION >= 0x030100
- #include <ktextedit.h>
-#else
- #include <qtextedit.h>
-#endif
+#include <ktextedit.h>
-// Otherwise moc will complain
-#if QT_VERSION >= 0x030100
- #define TextEditBase KTextEdit
-#else
- #define TextEditBase QTextEdit
-#endif
+// Otherwise tqmoc will complain
+#define TextEditBase KTextEdit
class DSTextEdit : public TextEditBase {
Q_OBJECT
+ TQ_OBJECT
public:
- DSTextEdit( QWidget* parent, const char* name = 0 );
+ DSTextEdit( TQWidget* tqparent, const char* name = 0 );
//virtual void moveCursor( CursorAction action, bool select );
private slots:
diff --git a/kbarcode/editoriface.h b/kbarcode/editoriface.h
index a568879..73a1b35 100644
--- a/kbarcode/editoriface.h
+++ b/kbarcode/editoriface.h
@@ -27,7 +27,7 @@ class EditorIface : virtual public DCOPObject
public:
k_dcop:
- virtual const QString fileName() const = 0;
+ virtual const TQString fileName() const = 0;
virtual bool isChanged() = 0;
virtual void print() = 0;
virtual bool newLabel() = 0;
@@ -47,8 +47,8 @@ class EditorIface : virtual public DCOPObject
virtual void closeLabel() = 0;
- virtual bool openUrl( const QString & url ) = 0;
- virtual bool save( QString url ) = 0;
+ virtual bool openUrl( const TQString & url ) = 0;
+ virtual bool save( TQString url ) = 0;
};
diff --git a/kbarcode/encodingcombo.cpp b/kbarcode/encodingcombo.cpp
index 52f7a21..6cfa6ff 100644
--- a/kbarcode/encodingcombo.cpp
+++ b/kbarcode/encodingcombo.cpp
@@ -20,20 +20,20 @@
#include <kcharsets.h>
#include <kglobal.h>
#include <klocale.h>
-#include <qtextcodec.h>
+#include <tqtextcodec.h>
-EncodingCombo::EncodingCombo( QWidget* parent )
- : KComboBox( parent )
+EncodingCombo::EncodingCombo( TQWidget* tqparent )
+ : KComboBox( tqparent )
{
- QString sEncoding = QString( KGlobal::locale()->encoding() );
- QStringList encodings (KGlobal::charsets()->availableEncodingNames());
+ TQString sEncoding = TQString( KGlobal::locale()->encoding() );
+ TQStringList encodings (KGlobal::charsets()->availableEncodingNames());
this->insertStringList( encodings );
for (int i=0; i < encodings.count(); i++)
{
bool found = false;
- QTextCodec *codecForEnc = KGlobal::charsets()->codecForName(encodings[i], found);
+ TQTextCodec *codecForEnc = KGlobal::charsets()->codecForName(encodings[i], found);
if (found && ( (codecForEnc->name() == sEncoding) || (encodings[i] == sEncoding) ) )
{
this->setCurrentItem(i);
diff --git a/kbarcode/encodingcombo.h b/kbarcode/encodingcombo.h
index f6e0762..589df7a 100644
--- a/kbarcode/encodingcombo.h
+++ b/kbarcode/encodingcombo.h
@@ -22,8 +22,9 @@
class EncodingCombo : public KComboBox {
Q_OBJECT
+ TQ_OBJECT
public:
- EncodingCombo( QWidget* parent );
+ EncodingCombo( TQWidget* tqparent );
~EncodingCombo();
diff --git a/kbarcode/gnubarcode.cpp b/kbarcode/gnubarcode.cpp
index 6f69644..d009802 100644
--- a/kbarcode/gnubarcode.cpp
+++ b/kbarcode/gnubarcode.cpp
@@ -24,9 +24,9 @@
#include <string.h>
#include <ctype.h>
-#include <qfont.h>
-#include <qpainter.h>
-#include <qpaintdevicemetrics.h>
+#include <tqfont.h>
+#include <tqpainter.h>
+#include <tqpaintdevicemetrics.h>
#include <klocale.h>
@@ -38,7 +38,7 @@ GnuBarcode::GnuBarcode()
: BarkodeEngine()
{
m_item = NULL;
- m_size = QSize( 0, 0 );
+ m_size = TQSize( 0, 0 );
m_scalex = 1.0;
m_scaley = 1.0;
@@ -52,9 +52,9 @@ GnuBarcode::~GnuBarcode()
Barcode_Delete( m_item );
}
-void GnuBarcode::update( const QPaintDevice* device )
+void GnuBarcode::update( const TQPaintDevice* device )
{
- QString val = barkode->parsedValue();
+ TQString val = barkode->parsedValue();
m_valid = false;
if( m_item )
@@ -91,9 +91,9 @@ void GnuBarcode::update( const QPaintDevice* device )
delete [] value;
- QPaintDeviceMetrics metrics( device );
- m_scalex = (double)metrics.logicalDpiX() / (double)QPaintDevice::x11AppDpiX();
- m_scaley = (double)metrics.logicalDpiY() / (double)QPaintDevice::x11AppDpiY();
+ TQPaintDeviceMetrics metrics( device );
+ m_scalex = (double)metrics.logicalDpiX() / (double)TQPaintDevice::x11AppDpiX();
+ m_scaley = (double)metrics.logicalDpiY() / (double)TQPaintDevice::x11AppDpiY();
// 72.0 is the postscript resolution generated by GNU barcode
m_scale_ps_x = (double)metrics.logicalDpiX() / 72.0;
@@ -107,15 +107,15 @@ void GnuBarcode::update( const QPaintDevice* device )
m_valid = true;
}
-const QSize GnuBarcode::size() const
+const TQSize GnuBarcode::size() const
{
if( m_size.isNull() )
- return QSize( 100, 80 );
+ return TQSize( 100, 80 );
else
return m_size;
}
-void GnuBarcode::drawBarcode( QPainter & painter, int x, int y )
+void GnuBarcode::drawBarcode( TQPainter & painter, int x, int y )
{
int dx = x + barkode->quietZone();
int dy = y + barkode->quietZone();
@@ -134,7 +134,7 @@ void GnuBarcode::drawBarcode( QPainter & painter, int x, int y )
drawBars( &painter, (int)(dx/m_scalex), (int)(dy/m_scaley) );
// Only scale for the bars, text should be scaled
- // correctly by Qt on Qt >= 3.3.2
+ // correctly by TQt on TQt >= 3.3.2
painter.restore();
// draw the text
@@ -165,7 +165,7 @@ void GnuBarcode::setupSize()
m_size.setHeight( (int)(m_item->height * m_scaley) );
}
-int GnuBarcode::drawBars( QPainter* painter, int x, int y )
+int GnuBarcode::drawBars( TQPainter* painter, int x, int y )
{
#if 0
int height = 0; // height of the bar to draw
@@ -267,7 +267,7 @@ int GnuBarcode::drawBars( QPainter* painter, int x, int y )
return xpos;
}
-int GnuBarcode::drawText( QPainter* painter, int x, int y )
+int GnuBarcode::drawText( TQPainter* painter, int x, int y )
{
#if 0
unsigned int infosz = strlen( m_item->textinfo );
@@ -281,7 +281,7 @@ int GnuBarcode::drawText( QPainter* painter, int x, int y )
char printer;
char *temp_info = new char[infosz+1];
- painter.setFont( QFont( "Helvetica", 12 ) );
+ painter.setFont( TQFont( "Helvetica", 12 ) );
while(i < infosz)
{
for(j = 0; m_item->textinfo[i + j + 1] != ' ' &&
@@ -298,7 +298,7 @@ int GnuBarcode::drawText( QPainter* painter, int x, int y )
prev_x = xpos;
painter.drawText( x + ((xpos-correction) * m_scalex),
y + ((m_bar_height + (unsigned int)(barkode->fontsize()/ 2) + FONT_SPACE) * m_scaley),
- QChar( printer ) );
+ TQChar( printer ) );
}
delete [] temp_info;
#endif
@@ -336,8 +336,8 @@ int GnuBarcode::drawText( QPainter* painter, int x, int y )
if( painter )
{
- painter->setFont( QFont( "Helvetica", m_font_size ) );
- painter->drawText( x + (int)(f1 * m_scalex * barkode->scaling() ), y0, QChar( c ) );
+ painter->setFont( TQFont( "Helvetica", m_font_size ) );
+ painter->drawText( x + (int)(f1 * m_scalex * barkode->scaling() ), y0, TQChar( c ) );
}
}
diff --git a/kbarcode/gnubarcode.h b/kbarcode/gnubarcode.h
index afdec8e..a70498c 100644
--- a/kbarcode/gnubarcode.h
+++ b/kbarcode/gnubarcode.h
@@ -33,20 +33,20 @@ class GnuBarcode : public BarkodeEngine {
inline EEngine engine() const;
- const QSize size() const;
- void update( const QPaintDevice* device );
- void drawBarcode( QPainter & painter, int x, int y );
+ const TQSize size() const;
+ void update( const TQPaintDevice* device );
+ void drawBarcode( TQPainter & painter, int x, int y );
private:
/** Draws the barcodes bars if @p painter is not 0.
* Otherwise only the required width is returned.
*/
- int drawBars( QPainter* painter, int x, int y );
+ int drawBars( TQPainter* painter, int x, int y );
/** Draws the text if @p painter is not 0.
* Otherwise only the required width is returned.
*/
- int drawText( QPainter* painter, int x, int y );
+ int drawText( TQPainter* painter, int x, int y );
/** Fill m_size with the needed space
*/
@@ -63,7 +63,7 @@ class GnuBarcode : public BarkodeEngine {
double m_scale_ps_y;
Barcode_Item* m_item;
- QSize m_size;
+ TQSize m_size;
};
EEngine GnuBarcode::engine() const
diff --git a/kbarcode/imageitem.cpp b/kbarcode/imageitem.cpp
index 139504f..ea6b40b 100644
--- a/kbarcode/imageitem.cpp
+++ b/kbarcode/imageitem.cpp
@@ -18,11 +18,11 @@
#include "imageitem.h"
#include "tokenprovider.h"
-#include <qbuffer.h>
-#include <qdom.h>
-#include <qimage.h>
-#include <qpaintdevicemetrics.h>
-#include <qpainter.h>
+#include <tqbuffer.h>
+#include <tqdom.h>
+#include <tqimage.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqpainter.h>
#include <klocale.h>
#include <kmdcodec.h>
@@ -45,10 +45,10 @@ void ImageItem::init()
m_scaling = eImage_Original;
setBorder( false );
- setRect( QRect( 0, 0, 20, 20 ) );
+ setRect( TQRect( 0, 0, 20, 20 ) );
}
-void ImageItem::draw(QPainter* painter)
+void ImageItem::draw(TQPainter* painter)
{
createImage();
@@ -58,60 +58,60 @@ void ImageItem::draw(QPainter* painter)
DocumentItem::drawBorder(painter);
}
-void ImageItem::drawZpl( QTextStream* stream )
+void ImageItem::drawZpl( TQTextStream* stream )
{
createImage();
- QBuffer buffer;
+ TQBuffer buffer;
if( buffer.open( IO_WriteOnly ) )
{
// TODO: bmp????
- QImageIO io( &buffer, "PNG" );
- QImage image = m_tmp.convertToImage();
+ TQImageIO io( &buffer, "PNG" );
+ TQImage image = m_tmp.convertToImage();
// create a black and white image
io.setImage( image.convertDepth( 1 ) );
io.write();
buffer.close();
- QByteArray data = buffer.buffer();
+ TQByteArray data = buffer.buffer();
*stream << ZPLUtils::fieldOrigin( rect().x(), rect().y() );
- *stream << "~DYD,p,P," << QString::number( data.size() ) + ",0,";
+ *stream << "~DYD,p,P," << TQString::number( data.size() ) + ",0,";
for( unsigned int i=0;i<data.size();i++)
*stream << data[i];
}
}
-void ImageItem::drawIpl( QTextStream*, IPLUtils* )
+void ImageItem::drawIpl( TQTextStream*, IPLUtils* )
{
qDebug("ImageItem is not implemented for IPL!");
}
-void ImageItem::drawEPcl( QTextStream* stream )
+void ImageItem::drawEPcl( TQTextStream* stream )
{
createImage();
- // you can access m_tmp (which is a QPixmap now)
+ // you can access m_tmp (which is a TQPixmap now)
// m_tmp is an image which has all transformations
// (i.e. rotation, scaling, flipping) already apllied
- QImage si = m_tmp.convertToImage();
+ TQImage si = m_tmp.convertToImage();
int width = si.width();
int height = si.height();
int c;
char out;
for( int buf=0; buf < 3; buf++ ){
- *stream << QString("GS %1 32 %1 %1 %1 %1 ")
- .arg(buf).arg(rect().x()).arg(rect().y()).arg(width).arg(height);
+ *stream << TQString("GS %1 32 %1 %1 %1 %1 ")
+ .tqarg(buf).tqarg(rect().x()).tqarg(rect().y()).tqarg(width).tqarg(height);
for( int i=width-1; i >= 0; i-- ){
for( int j=0; j < height; j++ ){
if( buf == 0 )
- c = qBlue(si.pixel(i,j)); // Yellow
+ c = tqBlue(si.pixel(i,j)); // Yellow
else if( buf == 1 )
- c = qGreen(si.pixel(i,j)); // Magenta
+ c = tqGreen(si.pixel(i,j)); // Magenta
else if( buf == 2 )
- c = qRed(si.pixel(i,j)); // Cyan
+ c = tqRed(si.pixel(i,j)); // Cyan
// printer has 5-bits per color - drop 3
// we also need to subtract from 255 to convert from RGB to CMY
@@ -124,16 +124,16 @@ void ImageItem::drawEPcl( QTextStream* stream )
}
}
-void ImageItem::loadXML(QDomElement* element)
+void ImageItem::loadXML(TQDomElement* element)
{
- QByteArray out;
+ TQByteArray out;
if( !element->text().isEmpty() )
{
KCodecs::base64Decode( element->text().utf8(), out );
m_pixmap.loadFromData( out, "PNG" );
}
- m_expression = element->attribute( "expression", QString::null );
+ m_expression = element->attribute( "expression", TQString() );
m_scaling = (EImageScaling)element->attribute( "scaling", "0" ).toInt();
m_mirror_h = (bool)element->attribute("mirror_horizontal", "0" ).toInt();
m_mirror_v = (bool)element->attribute("mirror_vertical", "0" ).toInt();
@@ -143,9 +143,9 @@ void ImageItem::loadXML(QDomElement* element)
updateImage();
}
-void ImageItem::saveXML(QDomElement* element)
+void ImageItem::saveXML(TQDomElement* element)
{
- QBuffer buf;
+ TQBuffer buf;
if( !m_pixmap.isNull() )
{
if(!buf.open( IO_WriteOnly ))
@@ -166,19 +166,19 @@ void ImageItem::saveXML(QDomElement* element)
DocumentItem::saveXML(element);
}
-void ImageItem::setExpression( const QString & ex )
+void ImageItem::setExpression( const TQString & ex )
{
m_expression = ex;
updateImage();
}
-void ImageItem::setPixmap( const QPixmap & pix )
+void ImageItem::setPixmap( const TQPixmap & pix )
{
m_pixmap = pix;
updateImage();
}
-const QPixmap & ImageItem::pixmap()
+const TQPixmap & ImageItem::pixmap()
{
return m_pixmap;
}
@@ -196,14 +196,14 @@ EImageScaling ImageItem::scaling() const
void ImageItem::updateImage()
{
- m_tmp.resize( QSize(0,0) );
+ m_tmp.resize( TQSize(0,0) );
}
void ImageItem::createImage()
{
if( m_tmp.isNull() )
{
- QImage img;
+ TQImage img;
if( m_pixmap.isNull() )
img.load( tokenProvider() ? tokenProvider()->parse( m_expression ) : m_expression );
@@ -214,7 +214,7 @@ void ImageItem::createImage()
{
if( m_rotation != 0.0 )
{
- QWMatrix matrix;
+ TQWMatrix matrix;
matrix.rotate( m_rotation );
img = img.xForm( matrix );
}
@@ -225,21 +225,21 @@ void ImageItem::createImage()
{
if( DocumentItem::paintDevice()->isExtDev() )
img = img.smoothScale( rect().width(), rect().height(),
- (m_scaling == eImage_Scaled ? QImage::ScaleMin : QImage::ScaleFree) );
+ (m_scaling == eImage_Scaled ? TQ_ScaleMin : TQ_ScaleFree) );
else
img = img.scale( rect().width(), rect().height(),
- (m_scaling == eImage_Scaled ? QImage::ScaleMin : QImage::ScaleFree) );
+ (m_scaling == eImage_Scaled ? TQ_ScaleMin : TQ_ScaleFree) );
}
else
{
// we have to scale because of the bigger printer resolution
if( DocumentItem::paintDevice()->isExtDev() )
{
- QPaintDeviceMetrics metrics( DocumentItem::paintDevice() );
+ TQPaintDeviceMetrics metrics( DocumentItem::paintDevice() );
- img = img.smoothScale( (int)(img.width() * ((double)metrics.logicalDpiX()/QPaintDevice::x11AppDpiX())),
- (int)(img.height() * ((double)metrics.logicalDpiY()/QPaintDevice::x11AppDpiY())),
- QImage::ScaleMin );
+ img = img.smoothScale( (int)(img.width() * ((double)metrics.logicalDpiX()/TQPaintDevice::x11AppDpiX())),
+ (int)(img.height() * ((double)metrics.logicalDpiY()/TQPaintDevice::x11AppDpiY())),
+ TQ_ScaleMin );
}
}
@@ -254,16 +254,16 @@ void ImageItem::createImage()
// or the user did not specify a image to load
// make sure that we do not get a 0 0 0 0 rectangle
- QRect myrect( 0, 0, rect().width() ? rect().width() : 100 , rect().height() ? rect().height() : 80 );
+ TQRect myrect( 0, 0, rect().width() ? rect().width() : 100 , rect().height() ? rect().height() : 80 );
m_tmp.resize( rect().width(), rect().height() );
- QPainter painter( &m_tmp );
- painter.fillRect( myrect, Qt::white );
- painter.setPen( QPen( Qt::red, 2 ) );
+ TQPainter painter( &m_tmp );
+ painter.fillRect( myrect, TQt::white );
+ painter.setPen( TQPen( TQt::red, 2 ) );
painter.drawRect( myrect );
painter.drawLine( 0, 0, myrect.width(), myrect.height() );
painter.drawLine( 0, myrect.height(), myrect.width(), 0 );
- painter.setPen( Qt::black );
+ painter.setPen( TQt::black );
painter.drawText( 0, painter.fontMetrics().lineSpacing(), i18n("Expression: ") + m_expression );
painter.end();
}
diff --git a/kbarcode/imageitem.h b/kbarcode/imageitem.h
index d3f4194..a1fe809 100644
--- a/kbarcode/imageitem.h
+++ b/kbarcode/imageitem.h
@@ -19,7 +19,7 @@
#include "documentitem.h"
-#include <qpixmap.h>
+#include <tqpixmap.h>
enum EImageScaling { eImage_Original = 0, eImage_Scaled, eImage_Zoomed };
@@ -32,11 +32,11 @@ class ImageItem : public DocumentItem
ImageItem();
~ImageItem();
- void setExpression( const QString & ex );
- inline QString expression() const { return m_expression; };
+ void setExpression( const TQString & ex );
+ inline TQString expression() const { return m_expression; };
- void setPixmap( const QPixmap & pix );
- const QPixmap & pixmap();
+ void setPixmap( const TQPixmap & pix );
+ const TQPixmap & pixmap();
void setScaling( EImageScaling scaling );
EImageScaling scaling() const;
@@ -51,12 +51,12 @@ class ImageItem : public DocumentItem
bool mirrorVertical() const;
virtual int rtti() const { return eRtti_Image;}
- virtual void draw(QPainter* painter);
- virtual void drawZpl( QTextStream* stream );
- virtual void drawIpl( QTextStream* stream, IPLUtils* utils );
- virtual void drawEPcl( QTextStream* stream );
- virtual void loadXML(QDomElement* element);
- virtual void saveXML(QDomElement* element);
+ virtual void draw(TQPainter* painter);
+ virtual void drawZpl( TQTextStream* stream );
+ virtual void drawIpl( TQTextStream* stream, IPLUtils* utils );
+ virtual void drawEPcl( TQTextStream* stream );
+ virtual void loadXML(TQDomElement* element);
+ virtual void saveXML(TQDomElement* element);
void updateImage();
void createImage();
@@ -65,9 +65,9 @@ class ImageItem : public DocumentItem
void init();
private:
- QString m_expression;
- QPixmap m_pixmap;
- QPixmap m_tmp;
+ TQString m_expression;
+ TQPixmap m_pixmap;
+ TQPixmap m_tmp;
double m_rotation;
bool m_mirror_v;
diff --git a/kbarcode/kactionmap.cpp b/kbarcode/kactionmap.cpp
index 7ef48ce..eb92ade 100644
--- a/kbarcode/kactionmap.cpp
+++ b/kbarcode/kactionmap.cpp
@@ -17,15 +17,15 @@
#include "kactionmap.h"
-#include <qimage.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qmenubar.h>
-#include <qmenudata.h>
-#include <qpixmap.h>
-#include <qpopupmenu.h>
-#include <qregexp.h>
-#include <qvbox.h>
+#include <tqimage.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqmenubar.h>
+#include <tqmenudata.h>
+#include <tqpixmap.h>
+#include <tqpopupmenu.h>
+#include <tqregexp.h>
+#include <tqvbox.h>
#include <kaction.h>
#include <kapplication.h>
@@ -37,15 +37,15 @@
class KListViewActionItem : public KListViewItem {
public:
- KListViewActionItem( KListView* parent, KAction* action )
- : KListViewItem( parent ), m_action( action )
+ KListViewActionItem( KListView* tqparent, KAction* action )
+ : KListViewItem( tqparent ), m_action( action )
{
- QPixmap pix;
- QSize size = QIconSet::iconSize( QIconSet::Large );
- QIconSet iconset = m_action->iconSet( KIcon::Panel, KIcon::SizeLarge );
- QRegExp regtag( "<[^>]*>" );
+ TQPixmap pix;
+ TQSize size = TQIconSet::iconSize( TQIconSet::Large );
+ TQIconSet iconset = m_action->iconSet( KIcon::Panel, KIcon::SizeLarge );
+ TQRegExp regtag( "<[^>]*>" );
- pix = iconset.pixmap( QIconSet::Large, QIconSet::Normal ); // m_action->isEnabled() ? QIconSet::Normal : QIconSet::Disabled );
+ pix = iconset.pixmap( TQIconSet::Large, TQIconSet::Normal ); // m_action->isEnabled() ? TQIconSet::Normal : TQIconSet::Disabled );
if( pix.isNull() )
{
pix.resize( size );
@@ -62,20 +62,20 @@ public:
setText( 0, m_action->plainText() );
setText( 1, m_action->shortcutText() );
// replace HTML tags in What's this help
- setText( 2, m_action->whatsThis().replace( regtag, "" ) );
+ setText( 2, m_action->whatsThis().tqreplace( regtag, "" ) );
setPixmap( 0, pix );
}
- void paintCell( QPainter *p, const QColorGroup &cg,
- int column, int width, int alignment )
+ void paintCell( TQPainter *p, const TQColorGroup &cg,
+ int column, int width, int tqalignment )
{
- QColorGroup _cg( cg );
- QColor c = _cg.text();
+ TQColorGroup _cg( cg );
+ TQColor c = _cg.text();
if( m_action && !m_action->isEnabled() )
- _cg.setColor( QColorGroup::Text, Qt::gray );
+ _cg.setColor( TQColorGroup::Text, TQt::gray );
- KListViewItem::paintCell( p, _cg, column, width, alignment );
- _cg.setColor( QColorGroup::Text, c );
+ KListViewItem::paintCell( p, _cg, column, width, tqalignment );
+ _cg.setColor( TQColorGroup::Text, c );
}
inline KAction* action() const
@@ -87,12 +87,12 @@ private:
KAction* m_action;
};
-KActionMapDlg::KActionMapDlg( KActionCollection* actions, QWidget* parent, const char* name )
- : KDialogBase( parent, name, false, i18n("Action Map"), KDialogBase::Close, KDialogBase::Close )
+KActionMapDlg::KActionMapDlg( KActionCollection* actions, TQWidget* tqparent, const char* name )
+ : KDialogBase( tqparent, name, false, i18n("Action Map"), KDialogBase::Close, KDialogBase::Close )
{
- QVBox *page = makeVBoxMainWidget();
+ TQVBox *page = makeVBoxMainWidget();
- new QLabel( i18n("Find and execute actions."), page );
+ new TQLabel( i18n("Find and execute actions."), page );
m_map = new KActionMap( actions, page );
show();
@@ -103,10 +103,10 @@ void KActionMapDlg::updateEnabledState()
m_map->updateEnabledState();
}
-KActionMap::KActionMap( KActionCollection* actions, QWidget* parent, const char* name )
- : QWidget( parent, name ), m_actions( actions ), m_showMenuTree( true ), m_grayOutItems( false )
+KActionMap::KActionMap( KActionCollection* actions, TQWidget* tqparent, const char* name )
+ : TQWidget( tqparent, name ), m_actions( actions ), m_showMenuTree( true ), m_grayOutItems( false )
{
- QVBoxLayout* layout = new QVBoxLayout( this );
+ TQVBoxLayout* tqlayout = new TQVBoxLayout( this );
m_listView = new KListView( this );
#if KDE_VERSION >= 0x030500
@@ -116,20 +116,20 @@ KActionMap::KActionMap( KActionCollection* actions, QWidget* parent, const char*
m_listView->addColumn( i18n("Action") );
m_listView->addColumn( i18n("Shortcut") );
m_listView->addColumn( i18n("Description") );
- m_listView->setColumnWidthMode( 0, QListView::Maximum );
- m_listView->setColumnWidthMode( 1, QListView::Maximum );
- m_listView->setColumnWidthMode( 2, QListView::Manual );
+ m_listView->setColumnWidthMode( 0, TQListView::Maximum );
+ m_listView->setColumnWidthMode( 1, TQListView::Maximum );
+ m_listView->setColumnWidthMode( 2, TQListView::Manual );
m_listView->setSorting( 0 );
m_listView->setAllColumnsShowFocus( true );
#if KDE_VERSION >= 0x030500
- layout->addWidget( m_searchLine );
+ tqlayout->addWidget( m_searchLine );
#endif
- layout->addWidget( m_listView );
+ tqlayout->addWidget( m_listView );
- connect( m_listView, SIGNAL( executed( QListViewItem* ) ), this, SLOT( slotExecuteAction( QListViewItem* ) ) );
- connect( actions, SIGNAL( inserted( KAction* ) ), this, SLOT( slotActionCollectionChanged() ) );
- connect( actions, SIGNAL( removed( KAction* ) ), this, SLOT( slotActionCollectionChanged() ) );
+ connect( m_listView, TQT_SIGNAL( executed( TQListViewItem* ) ), this, TQT_SLOT( slotExecuteAction( TQListViewItem* ) ) );
+ connect( actions, TQT_SIGNAL( inserted( KAction* ) ), this, TQT_SLOT( slotActionCollectionChanged() ) );
+ connect( actions, TQT_SIGNAL( removed( KAction* ) ), this, TQT_SLOT( slotActionCollectionChanged() ) );
slotActionCollectionChanged();
}
@@ -161,14 +161,14 @@ void KActionMap::slotActionCollectionChanged()
new KListViewActionItem( m_listView, (*it) );
- connect( *it, SIGNAL( enabled(bool) ), this, SLOT( updateEnabledState() ) );
+ connect( *it, TQT_SIGNAL( enabled(bool) ), this, TQT_SLOT( updateEnabledState() ) );
++it;
}
}
-void KActionMap::slotExecuteAction( QListViewItem* item )
+void KActionMap::slotExecuteAction( TQListViewItem* item )
{
KListViewActionItem* action = dynamic_cast<KListViewActionItem*>(item);
if( !action )
@@ -182,7 +182,7 @@ void KActionMap::slotExecuteAction( QListViewItem* item )
void KActionMap::updateEnabledState()
{
- m_listView->repaintContents();
+ m_listView->tqrepaintContents();
}
#include "kactionmap.moc"
diff --git a/kbarcode/kactionmap.h b/kbarcode/kactionmap.h
index a8d687b..2ec3401 100644
--- a/kbarcode/kactionmap.h
+++ b/kbarcode/kactionmap.h
@@ -18,7 +18,7 @@
#ifndef _KACTION_MAP_H_
#define _KACTION_MAP_H_
-#include <qwidget.h>
+#include <tqwidget.h>
#include <kdeversion.h>
#include <kdialogbase.h>
@@ -28,13 +28,13 @@ class KActionMap;
class KListViewSearchLineWidget;
#endif
class KListView;
-class QListViewItem;
+class TQListViewItem;
/** Open a simple dialog containing an action map.
*/
class KActionMapDlg : public KDialogBase {
public:
- KActionMapDlg( KActionCollection* actions, QWidget* parent = NULL, const char* name = NULL );
+ KActionMapDlg( KActionCollection* actions, TQWidget* tqparent = NULL, const char* name = NULL );
/** Call this function whenever you changed the enabled/disalbed state of an action
* in your application.
@@ -53,7 +53,7 @@ class KActionMapDlg : public KDialogBase {
* What is an Action Map?
*
* Almost every web page has a site map. According to Wikipedia,
- * a site map "helps visitors, and search engine robots, to find
+ * a site map "helps visitors, and search engine robots, to tqfind
* pages on the site". Similar an Action Map should help the
* user to find actions (i.e. functions or menu items) in an application.
*
@@ -66,15 +66,16 @@ class KActionMapDlg : public KDialogBase {
* grayed out and cannot be clicked. The dialog is modeless so that
* it can always be open and the normal usage of the application is not disturbed.
*/
-class KActionMap : public QWidget {
+class KActionMap : public TQWidget {
Q_OBJECT
+ TQ_OBJECT
public:
/** Creates a new KActionMap widget
* @param action all actions from this KActionCollection are displayed.
- * @param parent the parent
+ * @param tqparent the tqparent
* @param name the name
*/
- KActionMap( KActionCollection* actions, QWidget* parent = NULL, const char* name = NULL );
+ KActionMap( KActionCollection* actions, TQWidget* tqparent = NULL, const char* name = NULL );
~KActionMap();
public slots:
@@ -85,7 +86,7 @@ class KActionMap : public QWidget {
private slots:
void slotActionCollectionChanged();
- void slotExecuteAction( QListViewItem* item );
+ void slotExecuteAction( TQListViewItem* item );
private:
KActionCollection* m_actions;
diff --git a/kbarcode/kbarcode.cpp b/kbarcode/kbarcode.cpp
index 773c975..c6167f2 100644
--- a/kbarcode/kbarcode.cpp
+++ b/kbarcode/kbarcode.cpp
@@ -25,9 +25,9 @@
#include "sqltables.h"
#include "kbarcodesettings.h"
-// Qt includes
-#include <qgroupbox.h>
-#include <qlayout.h>
+// TQt includes
+#include <tqgroupbox.h>
+#include <tqlayout.h>
// KDE includes
#include <kaction.h>
@@ -39,13 +39,13 @@
#include <kpushbutton.h>
#include <kmessagebox.h>
-KBarcode::KBarcode( QWidget *parent, const char *name, WFlags f)
+KBarcode::KBarcode( TQWidget *tqparent, const char *name, WFlags f)
: DCOPObject("KBarcode"),
- DSMainWindow( parent, name, f )
+ DSMainWindow( tqparent, name, f )
{
- QGroupBox* w = new QGroupBox( this );
+ TQGroupBox* w = new TQGroupBox( this );
w->setColumnLayout(0, Qt::Vertical );
- QVBoxLayout* layout = new QVBoxLayout( w->layout() );
+ TQVBoxLayout* tqlayout = new TQVBoxLayout( w->tqlayout() );
setCentralWidget( w );
buttonSingle = new KPushButton( i18n("Barcode &Generator..."), w );
@@ -59,33 +59,33 @@ KBarcode::KBarcode( QWidget *parent, const char *name, WFlags f)
buttonEditor->setIconSet( BarIconSet( "edit" ) );
buttonBatch->setIconSet( BarIconSet( "fileprint" ) );
- layout->addWidget( buttonSingle );
- layout->addWidget( buttonEditor );
- layout->addWidget( buttonBatch );
- layout->addWidget( buttonData );
+ tqlayout->addWidget( buttonSingle );
+ tqlayout->addWidget( buttonEditor );
+ tqlayout->addWidget( buttonBatch );
+ tqlayout->addWidget( buttonData );
- connect( buttonSingle, SIGNAL( clicked() ), this, SLOT( startBarcode() ) );
- connect( buttonEditor, SIGNAL( clicked() ), this, SLOT( startLabelEditor() ) );
- connect( buttonBatch, SIGNAL( clicked() ), this, SLOT( startBatchPrint() ) );
- connect( SqlTables::getInstance(), SIGNAL( connectedSQL() ), this, SLOT( enableData() ) );
+ connect( buttonSingle, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(this), TQT_SLOT( startBarcode() ) );
+ connect( buttonEditor, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(this), TQT_SLOT( startLabelEditor() ) );
+ connect( buttonBatch, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(this), TQT_SLOT( startBatchPrint() ) );
+ connect( SqlTables::getInstance(), TQT_SIGNAL( connectedSQL() ), TQT_TQOBJECT(this), TQT_SLOT( enableData() ) );
setupActions();
show();
KAction* editLabelDefAct = new KAction(i18n("&Edit Label Definitions"), "",
- 0, this, SLOT(editLabelDef()), actionCollection(), "design" );
+ 0, TQT_TQOBJECT(this), TQT_SLOT(editLabelDef()), actionCollection(), "design" );
KAction* editArticleAct = new KAction(i18n("&Edit Articles"), "",
- 0, this, SLOT(editArticles()), actionCollection(), "design" );
+ 0, TQT_TQOBJECT(this), TQT_SLOT(editArticles()), actionCollection(), "design" );
KAction* editCustomerAct = new KAction(i18n("&Edit Customers"), "",
- 0, this, SLOT(editCustomers()), actionCollection(), "design" );
+ 0, TQT_TQOBJECT(this), TQT_SLOT(editCustomers()), actionCollection(), "design" );
KAction* editCustomerTextAct = new KAction(i18n("&Edit Customer Text"), "",
- 0, this, SLOT(editCustomerText()), actionCollection() );
+ 0, TQT_TQOBJECT(this), TQT_SLOT(editCustomerText()), actionCollection() );
KAction* importCSVAct = new KAction(i18n("&Import CSV File..."), "",
- 0, this, SLOT(importCSV()), actionCollection() );
+ 0, TQT_TQOBJECT(this), TQT_SLOT(importCSV()), actionCollection() );
KPopupMenu* data = new KPopupMenu( buttonData );
editLabelDefAct->plug( data );
@@ -116,8 +116,8 @@ void KBarcode::startBarcode()
void KBarcode::startLabelEditor()
{
- LabelEditor* ed = new LabelEditor( NULL, QString::null, "LabelEditorWindow" );
- ed->startupDlg( LabelEditor::eCreateNewLabel, QString::null );
+ LabelEditor* ed = new LabelEditor( NULL, TQString(), "LabelEditorWindow" );
+ ed->startupDlg( LabelEditor::eCreateNewLabel, TQString() );
}
void KBarcode::startBatchPrint()
@@ -158,16 +158,16 @@ bool KBarcode::parseCmdLine()
BatchPrinter::EOutputFormat eFormat = BatchPrinter::POSTSCRIPT;
LabelEditor* pEdit = NULL;
- QString serial;
- QString sqlquery = QString::null;
- QString csvfile = QString::null;
- QString printer = QString::null;
+ TQString serial;
+ TQString sqlquery = TQString();
+ TQString csvfile = TQString();
+ TQString printer = TQString();
bool bPrintNow = args->isSet("print");
int serialinc = 0;
int numlabels = -1;
- QString format = args->getOption("output");
+ TQString format = args->getOption("output");
if( format.upper() == "BARCODE" )
eFormat = BatchPrinter::BCP;
else if( format.upper() == "IMAGE" )
@@ -176,7 +176,7 @@ bool KBarcode::parseCmdLine()
eFormat = BatchPrinter::POSTSCRIPT;
else
{
- KMessageBox::error( this, i18n("%1 is no valid output format for --output. Valid values are POSTSCRIPT, IMAGE and BARCODE.").arg( format ) );
+ KMessageBox::error( this, i18n("%1 is no valid output format for --output. Valid values are POSTSCRIPT, IMAGE and BARCODE.").tqarg( format ) );
}
if( args->isSet("barcode") )
@@ -268,7 +268,7 @@ void KBarcode::importCSV()
new CSVImportDlg( this, "csvimportdlg" );
}
-bool KBarcode::isSQLConnected() const
+bool KBarcode::isSTQLConnected() const
{
return SqlTables::isConnected();
}
diff --git a/kbarcode/kbarcode.h b/kbarcode/kbarcode.h
index f00c6d8..d501ac8 100644
--- a/kbarcode/kbarcode.h
+++ b/kbarcode/kbarcode.h
@@ -22,7 +22,7 @@
#include <config.h>
#endif
-#include <qstring.h>
+#include <tqstring.h>
enum linebreak {
NO_BREAK,
@@ -44,8 +44,9 @@ class KPushButton;
*/
class KBarcode: public DSMainWindow, public KBarcodeIface {
Q_OBJECT
+ TQ_OBJECT
public:
- KBarcode( QWidget *parent=0, const char *name="kbarcode", WFlags f = WType_TopLevel | WDestructiveClose );
+ KBarcode( TQWidget *tqparent=0, const char *name="kbarcode", WFlags f = WType_TopLevel | WDestructiveClose );
~KBarcode();
/** Parse all commandline options and start batchprinting
@@ -74,7 +75,7 @@ class KBarcode: public DSMainWindow, public KBarcodeIface {
/** allow the DCOP interface
* to check for an SQL connection.
*/
- bool isSQLConnected() const;
+ bool isSTQLConnected() const;
/** allow the DCOP interface
* to connect to the databases.
*/
diff --git a/kbarcode/kbarcodeiface.h b/kbarcode/kbarcodeiface.h
index b53f260..8e13403 100644
--- a/kbarcode/kbarcodeiface.h
+++ b/kbarcode/kbarcodeiface.h
@@ -37,7 +37,7 @@ class KBarcodeIface : virtual public DCOPObject
virtual void importCSV() = 0;
- virtual bool isSQLConnected() const = 0;
+ virtual bool isSTQLConnected() const = 0;
virtual bool connectSQL() = 0;
virtual void showWizard() = 0;
virtual void showConfigure() = 0;
diff --git a/kbarcode/kbarcodesettings.cpp b/kbarcode/kbarcodesettings.cpp
index aaa33d0..91dc9ae 100644
--- a/kbarcode/kbarcodesettings.cpp
+++ b/kbarcode/kbarcodesettings.cpp
@@ -28,13 +28,13 @@
#include <knuminput.h>
// QT includes
-#include <qcheckbox.h>
+#include <tqcheckbox.h>
KBarcodeSettings* KBarcodeSettings::m_instance = 0;
int KBarcodeSettings::gridsize = 30;
bool KBarcodeSettings::newdlg = true;
-QColor KBarcodeSettings::gridcolor = Qt::black;
-QString KBarcodeSettings::dateFormat = "";
+TQColor KBarcodeSettings::gridcolor = TQt::black;
+TQString KBarcodeSettings::dateFormat = "";
KBarcodeSettings* KBarcodeSettings::getInstance()
{
@@ -69,7 +69,7 @@ void KBarcodeSettings::loadConfig()
{
KConfig* config = kapp->config();
- QColor tmpc( Qt::lightGray );
+ TQColor tmpc( TQt::lightGray );
config->setGroup("LabelEditor");
gridsize = config->readNumEntry("grid", 5);
gridcolor = config->readColorEntry("gridcolor", &tmpc );
@@ -84,12 +84,12 @@ void KBarcodeSettings::configure()
cd->colorGrid->setColor( gridcolor );
cd->checkNewDlg->setChecked( newdlg );
cd->date->setText( dateFormat );
- if( cd->exec() == QDialog::Accepted ) {
+ if( cd->exec() == TQDialog::Accepted ) {
PrinterSettings::getInstance()->saveConfig();
SqlTables::getInstance()->saveConfig();
int oldgrid = gridsize;
- QColor oldcolor = gridcolor;
+ TQColor oldcolor = gridcolor;
gridsize = cd->spinGrid->value();
gridcolor = cd->colorGrid->color();
// gridsize or gridcolor has been changed
diff --git a/kbarcode/kbarcodesettings.h b/kbarcode/kbarcodesettings.h
index 7a4cfea..46abc5c 100644
--- a/kbarcode/kbarcodesettings.h
+++ b/kbarcode/kbarcodesettings.h
@@ -18,7 +18,7 @@
#ifndef KBARCODESETTINGS_H
#define KBARCODESETTINGS_H
-#include <qobject.h>
+#include <tqobject.h>
/**
A singleton which is responsible for loading and saving KBarcodes settings.
@@ -26,18 +26,19 @@
@author Dominik Seichter
*/
-class KBarcodeSettings : public QObject
+class KBarcodeSettings : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
static KBarcodeSettings* getInstance();
- static const QString getDateFormat() {
+ static const TQString getDateFormat() {
return dateFormat;
}
int gridSize() const { return gridsize; }
- const QColor & gridColor() const { return gridcolor; }
+ const TQColor & gridColor() const { return gridcolor; }
bool newDialog() const { return newdlg; }
public slots:
void loadConfig();
@@ -58,8 +59,8 @@ class KBarcodeSettings : public QObject
// LabelEditor settings:
static int gridsize;
static bool newdlg;
- static QColor gridcolor;
- static QString dateFormat;
+ static TQColor gridcolor;
+ static TQString dateFormat;
};
#endif
diff --git a/kbarcode/label.cpp b/kbarcode/label.cpp
index 2537fcb..f565c77 100644
--- a/kbarcode/label.cpp
+++ b/kbarcode/label.cpp
@@ -27,21 +27,21 @@
#include "imageitem.h"
#include "textitem.h"
-// Qt includes
-#include <qimage.h>
-#include <qiodevice.h>
-#include <qpaintdevicemetrics.h>
-#include <qpainter.h>
-#include <qpen.h>
-#include <qsqlcursor.h>
-#include <qxml.h>
+// TQt includes
+#include <tqimage.h>
+#include <tqiodevice.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqpainter.h>
+#include <tqpen.h>
+#include <tqsqlcursor.h>
+#include <tqxml.h>
// KDE includes
#include <kapplication.h>
#include <klocale.h>
#include <kprinter.h>
-Label::Label( Definition* _def, QIODevice* device, QString labelname, QPaintDevice* _printer, QString customer_id, QString _article_no, QString _group )
+Label::Label( Definition* _def, TQIODevice* device, TQString labelname, TQPaintDevice* _printer, TQString customer_id, TQString _article_no, TQString _group )
: TokenProvider( _printer )
{
m_sequence = false;
@@ -50,20 +50,20 @@ Label::Label( Definition* _def, QIODevice* device, QString labelname, QPaintDevi
setCustomerNo( customer_id );
setArticleNo( _article_no );
setGroup( _group );
- setLabelName( labelname.right( labelname.length() - labelname.findRev( "/" ) - 1 ) );
+ setLabelName( labelname.right( labelname.length() - labelname.tqfindRev( "/" ) - 1 ) );
d = _def;
load( device );
}
-Label::Label( Definition* _def, QIODevice* device, QString labelname, QPaintDevice* _printer )
+Label::Label( Definition* _def, TQIODevice* device, TQString labelname, TQPaintDevice* _printer )
: TokenProvider( _printer )
{
m_sequence = false;
m_printer = _printer;
- setLabelName( labelname.right( labelname.length() - labelname.findRev( "/" ) - 1 ) );
+ setLabelName( labelname.right( labelname.length() - labelname.tqfindRev( "/" ) - 1 ) );
d = _def;
@@ -74,7 +74,7 @@ Label::~Label()
{
}
-void Label::epcl( QTextStream* stream )
+void Label::epcl( TQTextStream* stream )
{
*stream << EPCLUtils::header();
@@ -86,7 +86,7 @@ void Label::epcl( QTextStream* stream )
*stream << EPCLUtils::footer();
}
-void Label::ipl( QTextStream* stream )
+void Label::ipl( TQTextStream* stream )
{
IPLUtils utils;
*stream << utils.header();
@@ -100,7 +100,7 @@ void Label::ipl( QTextStream* stream )
}
-void Label::zpl( QTextStream* stream )
+void Label::zpl( TQTextStream* stream )
{
*stream << ZPLUtils::header();
@@ -147,10 +147,10 @@ void Label::InitBarcodes()
updateDone();
}
-void Label::draw( QPainter* painter, int x, int y )
+void Label::draw( TQPainter* painter, int x, int y )
{
- QSize label( (int)d->getMeasurements().width( painter->device() ),
- (int)d->getMeasurements().height( painter->device() ) );
+ TQSize label( (int)d->getMeasurements().width( TQT_TQPAINTDEVICE(painter->device()) ),
+ (int)d->getMeasurements().height( TQT_TQPAINTDEVICE(painter->device()) ) );
InitBarcodes();
@@ -161,7 +161,7 @@ void Label::draw( QPainter* painter, int x, int y )
// add x and y to clip coordinates
// as clip has its top left corner
// at (0,0)
- QRect clip( item->boundingRect() );
+ TQRect clip( item->boundingRect() );
if( x + clip.x() < x )
clip.setX( 0 );
@@ -176,7 +176,7 @@ void Label::draw( QPainter* painter, int x, int y )
painter->save();
painter->translate( x,y );
- painter->setClipRect( clip, QPainter::CoordPainter );
+ painter->setClipRect( clip, TQPainter::CoordPainter );
item->draw( painter );
painter->restore();
}
@@ -187,10 +187,10 @@ void Label::setBarcodeValue( Barkode* barcode )
// use the same i18n() for static as in BarcodeSettingsDlg
if( barcode->databaseMode().lower() != "static" && barcode->databaseMode().lower() != i18n("Static") )
{
- QString encoding_type = getTypeFromCaption( barcode->databaseMode() );
- QString mode = getModeFromCaption( barcode->databaseMode() );
+ TQString encoding_type = getTypeFromCaption( barcode->databaseMode() );
+ TQString mode = getModeFromCaption( barcode->databaseMode() );
- QSqlQuery query( "select barcode_no, encoding_type from " TABLE_BASIC
+ TQSqlQuery query( "select barcode_no, encoding_type from " TABLE_BASIC
" where article_no = '" + articleNo() + "'" );
while ( query.next() )
{
@@ -200,7 +200,7 @@ void Label::setBarcodeValue( Barkode* barcode )
if( mode.lower() != "main" )
{
- QSqlQuery query1( "select barcode_no from " TABLE_CUSTOMER_TEXT " where customer_no ='"+ mode +
+ TQSqlQuery query1( "select barcode_no from " TABLE_CUSTOMER_TEXT " where customer_no ='"+ mode +
"' and article_no='" + articleNo() + "'" );
while ( query1.next() )
{
@@ -214,18 +214,18 @@ void Label::setBarcodeValue( Barkode* barcode )
}
}
-void Label::load( QIODevice* device )
+void Label::load( TQIODevice* device )
{
if( !device ) return;
if( !device->isOpen() )
device->open( IO_ReadOnly );
- QDomDocument doc( "KBarcodeLabel" );
+ TQDomDocument doc( "KBarcodeLabel" );
doc.setContent( device );
bool kbarcode18;
- QString description;
+ TQString description;
Definition* definition = NULL;
readXMLHeader( &doc, description, kbarcode18, &definition );
delete definition;
@@ -247,16 +247,16 @@ void Label::load( QIODevice* device )
device->close();
}
-void Label::getXLabel( double x, double y, double width, double height, QPainter* painter, int mode, QString value )
+void Label::getXLabel( double x, double y, double width, double height, TQPainter* painter, int mode, TQString value )
{
painter->save();
if( mode == LABEL_X ) {
- painter->setPen( QPen( Qt::black, 5) );
+ painter->setPen( TQPen( TQt::black, 5) );
painter->drawLine( (int)x, (int)y, int(x+width), int(y+height) );
painter->drawLine( (int)x, int(y+height), int(x+width), (int)y );
} else if( mode == ARTICLE_GROUP_NO ) {
- painter->setPen( QPen( QPen::black, 1 ) );
- QFont f( "helvetica", 15 );
+ painter->setPen( TQPen( TQPen::black, 1 ) );
+ TQFont f( "helvetica", 15 );
int w = 0;
do {
f.setPointSize( f.pointSize() - 1 );
@@ -281,7 +281,7 @@ int Label::getId() const
bool Label::drawThisItem( const DocumentItem* item )
{
- QString script = item->visibilityScript();
+ TQString script = item->visibilityScript();
// make things go faster if the script is just "true"
if( script.isEmpty() || script == "true" )
diff --git a/kbarcode/label.h b/kbarcode/label.h
index 698b861..3e9f814 100644
--- a/kbarcode/label.h
+++ b/kbarcode/label.h
@@ -18,8 +18,8 @@
#ifndef LABEL_H
#define LABEL_H
-#include <qfont.h>
-#include <qpicture.h>
+#include <tqfont.h>
+#include <tqpicture.h>
#include "labelutils.h"
#include "xmlutils.h"
#include "definition.h"
@@ -27,30 +27,30 @@
class BarCode;
class Barkode;
-class QDomDocument;
-class QIODevice;
-class QString;
-class QPainter;
-class QPaintDevice;
-class QTextStream;
+class TQDomDocument;
+class TQIODevice;
+class TQString;
+class TQPainter;
+class TQPaintDevice;
+class TQTextStream;
class KPrinter;
-/** Creates a QPicture from the XML KBarcode file. If a SQL connections is available
+/** Creates a TQPicture from the XML KBarcode file. If a SQL connections is available
* the data from the SQL tables will be used, too.
*/
class Label : private LabelUtils, private XMLUtils, public TokenProvider {
public:
- Label( Definition* _def, QIODevice* device, QString labelname, QPaintDevice* _printer, QString customer_id, QString _article_no, QString _group = "" );
- Label( Definition* _def, QIODevice* device, QString labelname, QPaintDevice* _printer );
+ Label( Definition* _def, TQIODevice* device, TQString labelname, TQPaintDevice* _printer, TQString customer_id, TQString _article_no, TQString _group = "" );
+ Label( Definition* _def, TQIODevice* device, TQString labelname, TQPaintDevice* _printer );
~Label();
- void epcl( QTextStream* stream );
- void ipl( QTextStream* stream );
- void zpl( QTextStream* stream );
+ void epcl( TQTextStream* stream );
+ void ipl( TQTextStream* stream );
+ void zpl( TQTextStream* stream );
- void draw( QPainter* painter,int x, int y );
+ void draw( TQPainter* painter,int x, int y );
int getId() const;
- static void getXLabel( double x, double y, double width, double height, QPainter* painter, int mode, QString value = "" );
+ static void getXLabel( double x, double y, double width, double height, TQPainter* painter, int mode, TQString value = "" );
//void setPrinter( KPrinter* p ) { m_printer = p; }
@@ -60,7 +60,7 @@ class Label : private LabelUtils, private XMLUtils, public TokenProvider {
bool update();
private:
- void load( QIODevice* device );
+ void load( TQIODevice* device );
void setBarcodeValue( Barkode* barcode );
void InitBarcodes();
bool drawThisItem( const DocumentItem* item );
@@ -69,7 +69,7 @@ class Label : private LabelUtils, private XMLUtils, public TokenProvider {
DocumentItemList m_list;
Definition* d;
- QPaintDevice* m_printer;
+ TQPaintDevice* m_printer;
bool m_sequence;
};
diff --git a/kbarcode/labeleditor.cpp b/kbarcode/labeleditor.cpp
index 144d9a1..4cbab7c 100644
--- a/kbarcode/labeleditor.cpp
+++ b/kbarcode/labeleditor.cpp
@@ -51,33 +51,30 @@
//NY34
// QT includes
-#include <qbuffer.h>
-#include <qcanvas.h>
-#include <qcheckbox.h>
-#include <qclipboard.h>
-#include <qdockarea.h>
-#include <qdom.h>
-#include <qdragobject.h>
-#include <qgroupbox.h>
-#include <qimage.h>
-#include <qinputdialog.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qmap.h>
-#include <qmime.h>
-#include <qpainter.h>
-#include <qpaintdevicemetrics.h>
-#include <qpicture.h>
-#include <qpoint.h>
-#include <qprogressdialog.h>
-#include <qsqlquery.h>
-#include <qtextbrowser.h>
-#include <qtooltip.h>
-#include <qvalidator.h>
-#include <qxml.h>
-#if QT_VERSION <= 0x030100
- #include <qregexp.h>
-#endif
+#include <tqbuffer.h>
+#include <tqcanvas.h>
+#include <tqcheckbox.h>
+#include <tqclipboard.h>
+#include <tqdockarea.h>
+#include <tqdom.h>
+#include <tqdragobject.h>
+#include <tqgroupbox.h>
+#include <tqimage.h>
+#include <tqinputdialog.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqmap.h>
+#include <tqmime.h>
+#include <tqpainter.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqpicture.h>
+#include <tqpoint.h>
+#include <tqprogressdialog.h>
+#include <tqsqlquery.h>
+#include <tqtextbrowser.h>
+#include <tqtooltip.h>
+#include <tqvalidator.h>
+#include <tqxml.h>
// KDE includes
#include <kabc/stdaddressbook.h>
@@ -124,17 +121,17 @@
using namespace KABC;
-LabelEditor::LabelEditor( QWidget *parent, QString _filename, const char *name, WFlags f )
+LabelEditor::LabelEditor( TQWidget *tqparent, TQString _filename, const char *name, WFlags f )
: DCOPObject( "LabelEditor" ),
- DSMainWindow( parent, name, f )
+ DSMainWindow( tqparent, name, f )
{
undoAct =
redoAct = NULL;
history = NULL;
- description = QString::null;
+ description = TQString();
d = new Definition();
- m_token = new TokenProvider( KApplication::desktop() );
+ m_token = new TokenProvider( TQT_TQPAINTDEVICE(KApplication::desktop()) );
statusBar()->insertItem( "", STATUS_ID_TEMPLATE, 0, true );
statusBar()->insertItem( "", STATUS_ID_SIZE, 0, true );
@@ -142,7 +139,7 @@ LabelEditor::LabelEditor( QWidget *parent, QString _filename, const char *name,
statusBar()->setSizeGripEnabled( true );
statusBar()->show();
- c = new MyCanvas( this );
+ c = new MyCanvas( TQT_TQOBJECT(this) );
c->setDoubleBuffering( true );
c->setUpdatePeriod( CANVAS_UPDATE_PERIOD );
@@ -152,7 +149,7 @@ LabelEditor::LabelEditor( QWidget *parent, QString _filename, const char *name,
setupActions();
setupContextMenu();
- setAutoSaveSettings( QString("Window") + name, true );
+ setAutoSaveSettings( TQString("Window") + name, true );
clearLabel();
@@ -160,16 +157,16 @@ LabelEditor::LabelEditor( QWidget *parent, QString _filename, const char *name,
show();
// if( isFirstStart() )
-// moveDockWindow( tools, Qt::DockLeft );
+// moveDockWindow( tools, TQt::DockLeft );
- connect( cv, SIGNAL( doubleClickedItem(TCanvasItem*) ), this, SLOT( doubleClickedItem(TCanvasItem*) ) );
- connect( cv, SIGNAL( showContextMenu(QPoint) ), this, SLOT( showContextMenu(QPoint) ) );
- connect( cv, SIGNAL( movedSomething() ), this, SLOT( setEdited() ) );
- connect( KBarcodeSettings::getInstance(), SIGNAL( updateGrid( int ) ), cv, SLOT( updateGUI() ) );
- connect( kapp, SIGNAL( aboutToQuit() ), this, SLOT( saveConfig() ) );
+ connect( cv, TQT_SIGNAL( doubleClickedItem(TCanvasItem*) ), TQT_TQOBJECT(this), TQT_SLOT( doubleClickedItem(TCanvasItem*) ) );
+ connect( cv, TQT_SIGNAL( showContextMenu(TQPoint) ), TQT_TQOBJECT(this), TQT_SLOT( showContextMenu(TQPoint) ) );
+ connect( cv, TQT_SIGNAL( movedSomething() ), TQT_TQOBJECT(this), TQT_SLOT( setEdited() ) );
+ connect( KBarcodeSettings::getInstance(), TQT_SIGNAL( updateGrid( int ) ), cv, TQT_SLOT( updateGUI() ) );
+ connect( kapp, TQT_SIGNAL( aboutToQuit() ), TQT_TQOBJECT(this), TQT_SLOT( saveConfig() ) );
- connect( history, SIGNAL( commandExecuted() ), cv, SLOT( updateGUI() ) );
- connect( history, SIGNAL( commandExecuted() ), this, SLOT( setEdited() ) );
+ connect( history, TQT_SIGNAL( commandExecuted() ), cv, TQT_SLOT( updateGUI() ) );
+ connect( history, TQT_SIGNAL( commandExecuted() ), TQT_TQOBJECT(this), TQT_SLOT( setEdited() ) );
if( !_filename.isEmpty() )
openUrl( _filename );
@@ -242,20 +239,20 @@ void LabelEditor::createCommandHistoryActions()
void LabelEditor::clearLabel()
{
TCanvasItem* citem;
- QCanvasItemList::Iterator it;
+ TQCanvasItemList::Iterator it;
- description = QString::null;
+ description = TQString();
delete history;
createCommandHistory();
createCommandHistoryActions();
- connect( history, SIGNAL( commandExecuted() ), cv, SLOT( updateGUI() ) );
- connect( history, SIGNAL( commandExecuted() ), this, SLOT( setEdited() ) );
+ connect( history, TQT_SIGNAL( commandExecuted() ), cv, TQT_SLOT( updateGUI() ) );
+ connect( history, TQT_SIGNAL( commandExecuted() ), TQT_TQOBJECT(this), TQT_SLOT( setEdited() ) );
m_edited = false;
- QCanvasItemList list = c->allItems();
+ TQCanvasItemList list = c->allItems();
it = list.begin();
for (; it != list.end(); ++it)
{
@@ -265,7 +262,7 @@ void LabelEditor::clearLabel()
updateInfo();
c->update();
- cv->repaintContents();
+ cv->tqrepaintContents();
}
bool LabelEditor::save()
@@ -287,7 +284,7 @@ bool LabelEditor::save()
bool LabelEditor::saveas()
{
- QString name = KFileDialog::getSaveFileName ( NULL, "*.kbarcode", this );
+ TQString name = KFileDialog::getSaveFileName ( NULL, "*.kbarcode", this );
if(name.isEmpty())
return false;
@@ -297,18 +294,18 @@ bool LabelEditor::saveas()
return save( name );
}
-bool LabelEditor::save( QString name )
+bool LabelEditor::save( TQString name )
{
- if( QFile::exists( name ) )
- QFile::remove( name );
+ if( TQFile::exists( name ) )
+ TQFile::remove( name );
- QFile f( name );
+ TQFile f( name );
if ( !f.open( IO_WriteOnly ) )
return false;
- save( &f );
+ save( TQT_TQIODEVICE(&f) );
- m_token->setLabelName( filename.right( filename.length() - filename.findRev( "/" ) - 1 ) );
+ m_token->setLabelName( filename.right( filename.length() - filename.tqfindRev( "/" ) - 1 ) );
// maybe we should redraw all items on the canvas now.
// if there is a label with [filename], the filename might not
// get updated if the label gets saved with another filename.
@@ -323,16 +320,16 @@ bool LabelEditor::save( QString name )
return true;
}
-void LabelEditor::save( QIODevice* device )
+void LabelEditor::save( TQIODevice* device )
{
- QDomDocument doc( "KBarcodeLabel" );
- QDomElement root = doc.createElement( "kbarcode" );
+ TQDomDocument doc( "KBarcodeLabel" );
+ TQDomElement root = doc.createElement( "kbarcode" );
doc.appendChild( root );
writeXMLHeader( &root, description, d );
- QCanvasItemList list = c->allItems();
+ TQCanvasItemList list = c->allItems();
for( unsigned int i = 0; i < list.count(); i++ )
{
TCanvasItem* item = static_cast<TCanvasItem*>(list[i]);
@@ -341,20 +338,20 @@ void LabelEditor::save( QIODevice* device )
writeXMLDocumentItem( &root, &ditem );
}
- QCString xml = doc.toCString();
+ TQCString xml = doc.toCString();
device->writeBlock( xml, xml.length() );
device->close();
}
bool LabelEditor::open()
{
- QString name = KFileDialog::getOpenFileName ( NULL, "*.kbarcode", this, i18n("Select Label") );
+ TQString name = KFileDialog::getOpenFileName ( NULL, "*.kbarcode", this, i18n("Select Label") );
if(name.isEmpty()) return false;
return openUrl( name );
}
-bool LabelEditor::openUrl( const QString & url )
+bool LabelEditor::openUrl( const TQString & url )
{
if( url.isEmpty() ) {
return open();
@@ -362,15 +359,15 @@ bool LabelEditor::openUrl( const QString & url )
filename = url;
setCaption( filename, false );
- m_token->setLabelName( filename.right( filename.length() - filename.findRev( "/" ) - 1 ) );
+ m_token->setLabelName( filename.right( filename.length() - filename.tqfindRev( "/" ) - 1 ) );
- QFile f( filename );
+ TQFile f( filename );
if ( !f.open( IO_ReadOnly ) )
return false;
clearLabel();
- QDomDocument doc( "KBarcodeLabel" );
+ TQDomDocument doc( "KBarcodeLabel" );
if ( !doc.setContent( &f ) ) {
f.close();
return false;
@@ -385,7 +382,7 @@ bool LabelEditor::openUrl( const QString & url )
if( !d || d->getId() == -1 )
{
- KMessageBox::error( this, QString( i18n("<qt>The file <b>%1</b> cannot be loaded as the label definition is missing.</qt>") ).arg( filename ) );
+ KMessageBox::error( this, TQString( i18n("<qt>The file <b>%1</b> cannot be loaded as the label definition is missing.</qt>") ).tqarg( filename ) );
return false;
}
@@ -406,7 +403,7 @@ bool LabelEditor::openUrl( const QString & url )
recentAct->addURL( murl );
enableActions();
- cv->repaintContents( true );
+ cv->tqrepaintContents( true );
return true;
}
@@ -414,7 +411,7 @@ bool LabelEditor::openUrl( const QString & url )
bool LabelEditor::newLabel()
{
NewLabel* nl = new NewLabel( this );
- if( nl->exec() != QDialog::Accepted ) {
+ if( nl->exec() != TQDialog::Accepted ) {
delete nl;
return false;
}
@@ -430,8 +427,8 @@ bool LabelEditor::newLabel()
delete nl;
- filename = QString::null;
- m_token->setLabelName( filename.right( filename.length() - filename.findRev( "/" ) - 1 ) );
+ filename = TQString();
+ m_token->setLabelName( filename.right( filename.length() - filename.tqfindRev( "/" ) - 1 ) );
setCaption( filename, false );
enableActions();
@@ -440,47 +437,47 @@ bool LabelEditor::newLabel()
void LabelEditor::setupActions()
{
- KAction* newAct = KStdAction::openNew( this, SLOT(startEditor()), actionCollection() );
- KAction* loadAct = KStdAction::open( this, SLOT(startLoadEditor()), actionCollection() );
- KAction* quitAct = KStdAction::quit(kapp, SLOT(quit()), actionCollection());
- KAction* closeAct = KStdAction::close( this, SLOT( close() ), actionCollection(), "close" );
- closeLabelAct = new KAction( i18n("Close &Label" ), 0, 0, this, SLOT( closeLabel() ), actionCollection() );
-
- recentAct = new KRecentFilesAction( i18n("&Recent Files"), 0, this, SLOT( loadRecentEditor( const KURL& ) ) );
-
- KAction* importPrintFileAct = new KAction( i18n("&Import and Print Batch File..."), BarIconSet( "fileprint" ), 0, this, SLOT( batchPrint() ), actionCollection() );
-
- saveAct = KStdAction::save( this, SLOT( save() ), actionCollection(), "save" );
- saveAsAct = KStdAction::saveAs( this, SLOT( saveas() ), actionCollection(), "saveas" );
- descriptionAct = new KAction( i18n("&Change description..."), 0, 0, this, SLOT(changeDes()), actionCollection() );
- deleteAct = new KAction( i18n("&Delete Object"), QIconSet( BarIcon("editdelete") ), Key_Delete, cv, SLOT( deleteCurrent() ), actionCollection() );
- editPropAct = new KAction( i18n("&Properties..."), 0, 0, this, SLOT( doubleClickedCurrent() ), actionCollection() );
- printAct = KStdAction::print( this, SLOT( print() ), actionCollection(), "print" );
- bcpAct = new KAction( i18n("Print to &Barcode Printer..."), 0, 0, this, SLOT( printBCP() ), actionCollection() );
- imgAct = new KAction( i18n("Print to &Image..."), 0, 0, this, SLOT(printImage() ), actionCollection() );
- changeSizeAct = new KAction( i18n("&Change Label..."), 0, 0, this, SLOT( changeSize() ), actionCollection() );
- barcodeAct = new KAction( i18n("Insert &Barcode"), QIconSet( BarIcon("barcode") ), 0, this, SLOT( insertBarcode() ), actionCollection() );
+ KAction* newAct = KStdAction::openNew( TQT_TQOBJECT(this), TQT_SLOT(startEditor()), actionCollection() );
+ KAction* loadAct = KStdAction::open( TQT_TQOBJECT(this), TQT_SLOT(startLoadEditor()), actionCollection() );
+ KAction* quitAct = KStdAction::quit(TQT_TQOBJECT(kapp), TQT_SLOT(quit()), actionCollection());
+ KAction* closeAct = KStdAction::close( TQT_TQOBJECT(this), TQT_SLOT( close() ), actionCollection(), "close" );
+ closeLabelAct = new KAction( i18n("Close &Label" ), 0, 0, TQT_TQOBJECT(this), TQT_SLOT( closeLabel() ), actionCollection() );
+
+ recentAct = new KRecentFilesAction( i18n("&Recent Files"), 0, TQT_TQOBJECT(this), TQT_SLOT( loadRecentEditor( const KURL& ) ) );
+
+ KAction* importPrintFileAct = new KAction( i18n("&Import and Print Batch File..."), BarIconSet( "fileprint" ), 0, TQT_TQOBJECT(this), TQT_SLOT( batchPrint() ), actionCollection() );
+
+ saveAct = KStdAction::save( TQT_TQOBJECT(this), TQT_SLOT( save() ), actionCollection(), "save" );
+ saveAsAct = KStdAction::saveAs( TQT_TQOBJECT(this), TQT_SLOT( saveas() ), actionCollection(), "saveas" );
+ descriptionAct = new KAction( i18n("&Change description..."), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(changeDes()), actionCollection() );
+ deleteAct = new KAction( i18n("&Delete Object"), TQIconSet( BarIcon("editdelete") ), Key_Delete, TQT_TQOBJECT(cv), TQT_SLOT( deleteCurrent() ), actionCollection() );
+ editPropAct = new KAction( i18n("&Properties..."), 0, 0, TQT_TQOBJECT(this), TQT_SLOT( doubleClickedCurrent() ), actionCollection() );
+ printAct = KStdAction::print( TQT_TQOBJECT(this), TQT_SLOT( print() ), actionCollection(), "print" );
+ bcpAct = new KAction( i18n("Print to &Barcode Printer..."), 0, 0, TQT_TQOBJECT(this), TQT_SLOT( printBCP() ), actionCollection() );
+ imgAct = new KAction( i18n("Print to &Image..."), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(printImage() ), actionCollection() );
+ changeSizeAct = new KAction( i18n("&Change Label..."), 0, 0, TQT_TQOBJECT(this), TQT_SLOT( changeSize() ), actionCollection() );
+ barcodeAct = new KAction( i18n("Insert &Barcode"), TQIconSet( BarIcon("barcode") ), 0, TQT_TQOBJECT(this), TQT_SLOT( insertBarcode() ), actionCollection() );
barcodeAct->setEnabled( Barkode::haveBarcode() );
- pictureAct = new KAction( i18n("Insert &Picture"), QIconSet( BarIcon("inline_image") ), 0, this, SLOT( insertPicture() ), actionCollection() );
- textAct = new KAction( i18n("Insert &Text"), QIconSet( BarIcon("text") ), 0, this, SLOT( insertText() ), actionCollection() );
- textDataAct = new KAction( i18n("Insert &Data Field"), QIconSet( BarIcon("contents") ), 0, this, SLOT( insertDataText() ), actionCollection() );
- textLineAct = new KAction( i18n("Insert &Text Line"), QIconSet( BarIcon("text") ), 0, this, SLOT( insertTextLine() ), actionCollection() );
- lineAct = new KAction( i18n("Insert &Line"), QIconSet( BarIcon("kbarcodelinetool") ), 0, this, SLOT( insertLine() ), actionCollection() );
- rectAct = new KAction( i18n("Insert &Rectangle"), QIconSet( BarIcon("kbarcoderect") ), 0, this, SLOT( insertRect() ), actionCollection() );
- circleAct = new KAction( i18n("Insert &Ellipse"), QIconSet( BarIcon("kbarcodeellipse") ), 0, this, SLOT( insertCircle() ), actionCollection() );
- spellAct = KStdAction::spelling( this, SLOT(spellCheck()), actionCollection(), "spell" );
- gridAct = new KToggleAction( i18n("&Grid"), QIconSet( BarIcon("kbarcodegrid") ), 0, this, SLOT( toggleGrid() ), actionCollection() );
- previewAct = new KAction( i18n("&Preview..."), 0, 0, this, SLOT( preview() ), actionCollection() );
- sep = new KActionSeparator( this );
- cutAct = KStdAction::cut( this, SLOT( cut() ), actionCollection(), "cut" );
- copyAct = KStdAction::copy( this, SLOT( copy() ), actionCollection(), "copy" );
- pasteAct = KStdAction::paste( this, SLOT( paste() ), actionCollection(), "paste" );
- selectAllAct = KStdAction::selectAll( cv, SLOT( selectAll() ), actionCollection(), "select_all" );
- deSelectAllAct = KStdAction::deselect( cv, SLOT( deSelectAll() ), actionCollection(), "de_select_all" );
- addressBookAct = new KAction( i18n("Address&book"), QIconSet( BarIcon("kaddressbook") ), 0, this, SLOT( launchAddressBook() ), actionCollection() );
+ pictureAct = new KAction( i18n("Insert &Picture"), TQIconSet( BarIcon("inline_image") ), 0, TQT_TQOBJECT(this), TQT_SLOT( insertPicture() ), actionCollection() );
+ textAct = new KAction( i18n("Insert &Text"), TQIconSet( BarIcon("text") ), 0, TQT_TQOBJECT(this), TQT_SLOT( insertText() ), actionCollection() );
+ textDataAct = new KAction( i18n("Insert &Data Field"), TQIconSet( BarIcon("contents") ), 0, TQT_TQOBJECT(this), TQT_SLOT( insertDataText() ), actionCollection() );
+ textLineAct = new KAction( i18n("Insert &Text Line"), TQIconSet( BarIcon("text") ), 0, TQT_TQOBJECT(this), TQT_SLOT( insertTextLine() ), actionCollection() );
+ lineAct = new KAction( i18n("Insert &Line"), TQIconSet( BarIcon("kbarcodelinetool") ), 0, TQT_TQOBJECT(this), TQT_SLOT( insertLine() ), actionCollection() );
+ rectAct = new KAction( i18n("Insert &Rectangle"), TQIconSet( BarIcon("kbarcoderect") ), 0, TQT_TQOBJECT(this), TQT_SLOT( insertRect() ), actionCollection() );
+ circleAct = new KAction( i18n("Insert &Ellipse"), TQIconSet( BarIcon("kbarcodeellipse") ), 0, TQT_TQOBJECT(this), TQT_SLOT( insertCircle() ), actionCollection() );
+ spellAct = KStdAction::spelling( TQT_TQOBJECT(this), TQT_SLOT(spellCheck()), actionCollection(), "spell" );
+ gridAct = new KToggleAction( i18n("&Grid"), TQIconSet( BarIcon("kbarcodegrid") ), 0, TQT_TQOBJECT(this), TQT_SLOT( toggleGrid() ), actionCollection() );
+ previewAct = new KAction( i18n("&Preview..."), 0, 0, TQT_TQOBJECT(this), TQT_SLOT( preview() ), actionCollection() );
+ sep = new KActionSeparator( TQT_TQOBJECT(this) );
+ cutAct = KStdAction::cut( TQT_TQOBJECT(this), TQT_SLOT( cut() ), actionCollection(), "cut" );
+ copyAct = KStdAction::copy( TQT_TQOBJECT(this), TQT_SLOT( copy() ), actionCollection(), "copy" );
+ pasteAct = KStdAction::paste( TQT_TQOBJECT(this), TQT_SLOT( paste() ), actionCollection(), "paste" );
+ selectAllAct = KStdAction::selectAll( TQT_TQOBJECT(cv), TQT_SLOT( selectAll() ), actionCollection(), "select_all" );
+ deSelectAllAct = KStdAction::deselect( TQT_TQOBJECT(cv), TQT_SLOT( deSelectAll() ), actionCollection(), "de_select_all" );
+ addressBookAct = new KAction( i18n("Address&book"), TQIconSet( BarIcon("kaddressbook") ), 0, TQT_TQOBJECT(this), TQT_SLOT( launchAddressBook() ), actionCollection() );
KAction* singleBarcodeAct = new KAction(i18n("&Create Single Barcode..."), "",
- 0, this, SLOT(startBarcodeGen()),
+ 0, TQT_TQOBJECT(this), TQT_SLOT(startBarcodeGen()),
actionCollection(), "create" );
singleBarcodeAct->setEnabled( Barkode::haveBarcode() );
@@ -503,12 +500,12 @@ void LabelEditor::setupActions()
lineAct->plug( tools );
rectAct->plug( tools );
circleAct->plug( tools );
- (new KActionSeparator( this ))->plug( tools );
+ (new KActionSeparator( TQT_TQOBJECT(this) ))->plug( tools );
// spellAct->plug( tools ); // KDE 3.2
gridAct->plug( tools );
DSMainWindow::setupActions();
- connect( recentAct, SIGNAL( urlSelected( const KURL& ) ), this, SLOT( startLoadRecentEditor( const KURL& ) ) );
+ connect( recentAct, TQT_SIGNAL( urlSelected( const KURL& ) ), TQT_TQOBJECT(this), TQT_SLOT( startLoadRecentEditor( const KURL& ) ) );
KPopupMenu* fileMenu = new KPopupMenu( this );
editMenu = new KPopupMenu( this );
@@ -582,22 +579,22 @@ void LabelEditor::setupContextMenu()
m_mnuContext->setCheckable( true );
KPopupMenu* orderMenu = new KPopupMenu( m_mnuContext );
- orderMenu->insertItem( i18n("&On Top"), this, SLOT( onTopCurrent() ) );
- orderMenu->insertItem( i18n("&Raise"), this, SLOT( raiseCurrent() ) );
- orderMenu->insertItem( i18n("&Lower"), this, SLOT( lowerCurrent() ) );
- orderMenu->insertItem( i18n("&To Background"), this, SLOT( backCurrent() ) );
+ orderMenu->insertItem( i18n("&On Top"), TQT_TQOBJECT(this), TQT_SLOT( onTopCurrent() ) );
+ orderMenu->insertItem( i18n("&Raise"), TQT_TQOBJECT(this), TQT_SLOT( raiseCurrent() ) );
+ orderMenu->insertItem( i18n("&Lower"), TQT_TQOBJECT(this), TQT_SLOT( lowerCurrent() ) );
+ orderMenu->insertItem( i18n("&To Background"), TQT_TQOBJECT(this), TQT_SLOT( backCurrent() ) );
KPopupMenu* centerMenu = new KPopupMenu( m_mnuContext );
- centerMenu->insertItem( i18n("Center &Horizontally"), this, SLOT( centerHorizontal() ) );
- centerMenu->insertItem( i18n("Center &Vertically"), this, SLOT( centerVertical() ) );
+ centerMenu->insertItem( i18n("Center &Horizontally"), TQT_TQOBJECT(this), TQT_SLOT( centerHorizontal() ) );
+ centerMenu->insertItem( i18n("Center &Vertically"), TQT_TQOBJECT(this), TQT_SLOT( centerVertical() ) );
m_mnuContext->insertItem( i18n("&Order"), orderMenu );
m_mnuContext->insertItem( i18n("&Center"), centerMenu );
m_mnuContext->insertSeparator();
- m_mnuContext->insertItem( SmallIcon("editdelete"), i18n("&Delete"), cv, SLOT( deleteCurrent() ) );
- m_mnuContext->insertItem( i18n("&Protect Position and Size"), this, SLOT( lockItem() ), 0, ID_LOCK_ITEM );
+ m_mnuContext->insertItem( SmallIcon("editdelete"), i18n("&Delete"), cv, TQT_SLOT( deleteCurrent() ) );
+ m_mnuContext->insertItem( i18n("&Protect Position and Size"), TQT_TQOBJECT(this), TQT_SLOT( lockItem() ), 0, ID_LOCK_ITEM );
m_mnuContext->insertSeparator();
- m_mnuContext->insertItem( i18n("&Properties"), this, SLOT( doubleClickedCurrent() ) );
+ m_mnuContext->insertItem( i18n("&Properties"), TQT_TQOBJECT(this), TQT_SLOT( doubleClickedCurrent() ) );
}
void LabelEditor::insertBarcode()
@@ -629,14 +626,14 @@ void LabelEditor::insertText()
void LabelEditor::insertDataText()
{
// DocumentItemList list = cv->getAllItems();
-// QStringList vars = m_token->listUserVars( &list );
+// TQStringList vars = m_token->listUserVars( &list );
- TokenDialog dlg( m_token, this, "dlg" );
- if( dlg.exec() == QDialog::Accepted )
+ TokenDialog dlg( m_token, this, "dlg" );
+ if( dlg.exec() == TQDialog::Accepted )
insertText( dlg.token() );
}
-void LabelEditor::insertText( QString caption )
+void LabelEditor::insertText( TQString caption )
{
NewTextCommand* tc = new NewTextCommand( caption, cv, m_token );
history->addCommand( tc, true );
@@ -648,7 +645,7 @@ void LabelEditor::insertTextLine()
insertTextLine( "Some Plain Text" );
}
-void LabelEditor::insertTextLine( QString caption )
+void LabelEditor::insertTextLine( TQString caption )
{
NewTextLineCommand* tc = new NewTextLineCommand( caption, cv, m_token );
history->addCommand( tc, true );
@@ -675,8 +672,8 @@ void LabelEditor::insertLine()
void LabelEditor::changeDes()
{
- QString tmp = QInputDialog::getText( i18n("Label Description"),
- i18n("Please enter a description:"), QLineEdit::Normal, description );
+ TQString tmp = TQInputDialog::getText( i18n("Label Description"),
+ i18n("Please enter a description:"), TQLineEdit::Normal, description );
if( !tmp.isEmpty() )
description = tmp;
}
@@ -685,7 +682,7 @@ void LabelEditor::changeSize()
{
NewLabel* nl = new NewLabel( this, "nl", true, true );
nl->setLabelId( d->getId() );
- if( nl->exec() == QDialog::Rejected )
+ if( nl->exec() == TQDialog::Rejected )
{
delete nl;
return;
@@ -699,15 +696,15 @@ void LabelEditor::changeSize()
// TODO: make sure that all items are redrawn.
// Otherwise barcodes might become invisible when changing the label
c->update();
- cv->repaint();
+ cv->tqrepaint();
delete nl;
}
void LabelEditor::updateInfo()
{
- statusBar()->changeItem( i18n("Size: ") + QString("%1%2 x %3%4").arg(
- d->getMeasurements().width() ).arg( Measurements::system()
- ).arg( d->getMeasurements().height() ).arg( Measurements::system() ), STATUS_ID_SIZE );
+ statusBar()->changeItem( i18n("Size: ") + TQString("%1%2 x %3%4").tqarg(
+ d->getMeasurements().width() ).tqarg( Measurements::system()
+ ).tqarg( d->getMeasurements().height() ).tqarg( Measurements::system() ), STATUS_ID_SIZE );
statusBar()->changeItem( i18n("Label Template: ") + d->getProducer() + " - " + d->getType(), STATUS_ID_TEMPLATE );
}
@@ -715,10 +712,10 @@ void LabelEditor::doubleClickedItem( TCanvasItem* item )
{
m_token->setCurrentDocumentItems( cv->getAllItems() );
DocumentItemDlg dlg( m_token, item->item(), history, this );
- if( dlg.exec() == QDialog::Accepted )
+ if( dlg.exec() == TQDialog::Accepted )
{
c->update();
- cv->repaintContents();
+ cv->tqrepaintContents();
}
}
@@ -728,7 +725,7 @@ void LabelEditor::doubleClickedCurrent()
doubleClickedItem( cv->getActive() );
}
-void LabelEditor::showContextMenu( QPoint pos )
+void LabelEditor::showContextMenu( TQPoint pos )
{
TCanvasItemList list = cv->getSelected();
@@ -757,7 +754,7 @@ void LabelEditor::lockItem()
void LabelEditor::print()
{
PrintLabelDlg pld( this, "pld" );
- if( pld.exec() != QDialog::Accepted )
+ if( pld.exec() != TQDialog::Accepted )
return;
PrinterSettings::getInstance()->getData()->border = pld.border();
@@ -777,9 +774,9 @@ void LabelEditor::print()
void LabelEditor::printBCP()
{
BarcodePrinterDlg dlg(this);
- if( dlg.exec() == QDialog::Accepted )
+ if( dlg.exec() == TQDialog::Accepted )
{
- QString name( dlg.printToFile() ? dlg.fileName() : dlg.deviceName() );
+ TQString name( dlg.printToFile() ? dlg.fileName() : dlg.deviceName() );
BatchPrinter batch( name, dlg.outputFormat(), this );
batchPrint( &batch, 1, BatchPrinter::BCP );
@@ -788,11 +785,11 @@ void LabelEditor::printBCP()
void LabelEditor::printImage()
{
- KFileDialog fd( ":save_image", KImageIO::pattern( KImageIO::Writing ), this, "fd", true );
+ KFileDialog fd( ":save_image", KImageIO::pattern( KImageIO::Writing ), this, "fd", true );
fd.setMode( KFile::File );
fd.setOperationMode( KFileDialog::Saving );
- if( fd.exec() == QDialog::Accepted ) {
- QString path = fd.selectedURL().path();
+ if( fd.exec() == TQDialog::Accepted ) {
+ TQString path = fd.selectedURL().path();
BatchPrinter batch( path, this );
batchPrint( &batch, 1, BatchPrinter::IMAGE );
}
@@ -800,24 +797,24 @@ void LabelEditor::printImage()
void LabelEditor::batchPrint( BatchPrinter* batch, int copies, int mode )
{
- QBuffer buffer;
+ TQBuffer buffer;
if( !buffer.open( IO_WriteOnly ) )
return;
- save( &buffer );
+ save( TQT_TQIODEVICE(&buffer) );
batch->setBuffer( &buffer );
- batch->setSerial( QString::null, 1 );
+ batch->setSerial( TQString(), 1 );
batch->setName( filename );
batch->setDefinition( d );
- batch->setCustomer( QString::null );
+ batch->setCustomer( TQString() );
batch->setEvents( false );
- QValueList<BatchPrinter::data>* list = new QValueList<BatchPrinter::data>;
+ TQValueList<BatchPrinter::data>* list = new TQValueList<BatchPrinter::data>;
BatchPrinter::data m_data;
m_data.number = copies;
- m_data.article_no = QString::null;
- m_data.group = QString::null;
+ m_data.article_no = TQString();
+ m_data.group = TQString();
list->append( m_data );
batch->setData( list );
@@ -839,12 +836,12 @@ void LabelEditor::batchPrint( BatchPrinter* batch, int copies, int mode )
void LabelEditor::spellCheck()
{
KMacroCommand* sc = new KMacroCommand( i18n("Spellchecking") );
- QCanvasItemList list = c->allItems();
+ TQCanvasItemList list = c->allItems();
for( unsigned int i = 0; i < list.count(); i++ )
if( list[i]->rtti() == eRtti_Text ) {
TCanvasItem* item = (TCanvasItem*)list[i];
TextItem* mytext = (TextItem*)item->item();
- QString text = mytext->text();
+ TQString text = mytext->text();
bool nocheck = false;
// for( int z = 0; z < comboText->count(); z++ )
// if( text == "[" + comboText->text(z) + "]" ) {
@@ -853,7 +850,7 @@ void LabelEditor::spellCheck()
// }
if( !nocheck ) {
- QString textbefore = text;
+ TQString textbefore = text;
KSpell::modalCheck( text );
if( text != textbefore ) {
TextChangeCommand* tc = new TextChangeCommand( mytext, text );
@@ -913,7 +910,7 @@ void LabelEditor::onTopCurrent()
int z = 0;
- QCanvasItemList list = c->allItems();
+ TQCanvasItemList list = c->allItems();
for( unsigned int i = 0; i < list.count(); i++ )
if( list[i]->z() > z )
z = (int)list[i]->z();
@@ -930,7 +927,7 @@ void LabelEditor::backCurrent()
int z = 0;
- QCanvasItemList list = c->allItems();
+ TQCanvasItemList list = c->allItems();
for( unsigned int i = 0; i < list.count(); i++ )
if( list[i]->z() < z )
z = (int)list[i]->z();
@@ -939,28 +936,28 @@ void LabelEditor::backCurrent()
history->addCommand( czc, true );
}
-const QString LabelEditor::fileName() const
+const TQString LabelEditor::fileName() const
{
- return filename.right( filename.length() - filename.findRev( "/" ) - 1 );
+ return filename.right( filename.length() - filename.tqfindRev( "/" ) - 1 );
}
void LabelEditor::preview()
{
- QBuffer buffer;
+ TQBuffer buffer;
if( !buffer.open( IO_WriteOnly ) )
return;
- save( &buffer );
+ save( TQT_TQIODEVICE(&buffer) );
// No need to delete pd as it has WDestructiveClose set!
- PreviewDialog* pd = new PreviewDialog( &buffer, d, fileName(), this );
+ PreviewDialog* pd = new PreviewDialog( TQT_TQIODEVICE(&buffer), d, fileName(), this );
pd->exec();
}
void LabelEditor::toggleGrid()
{
c->setGrid( gridAct->isChecked() );
- cv->repaintContents();
+ cv->tqrepaintContents();
}
void LabelEditor::cut()
@@ -981,16 +978,12 @@ void LabelEditor::copy()
DocumentItemDrag* drag = new DocumentItemDrag();
drag->setDocumentItem( &items );
-#if QT_VERSION >= 0x030100
- kapp->clipboard()->setData( drag, QClipboard::Clipboard );
-#else
- kapp->clipboard()->setData( drag );
-#endif
+ kapp->tqclipboard()->setData( drag, TQClipboard::Clipboard );
}
void LabelEditor::paste()
{
- QMimeSource* data = QApplication::clipboard()->data();
+ TQMimeSource* data = TQApplication::tqclipboard()->data();
if ( DocumentItemDrag::canDecode( data ) )
DocumentItemDrag::decode( data, cv, m_token, history );
}
@@ -998,8 +991,8 @@ void LabelEditor::paste()
void LabelEditor::startEditor()
{
if( isChanged() ) {
- LabelEditor* lb = new LabelEditor( NULL, QString::null, "LabelEditorWindow" );
- lb->startupDlg( eCreateNewLabel, QString::null );
+ LabelEditor* lb = new LabelEditor( NULL, TQString(), "LabelEditorWindow" );
+ lb->startupDlg( eCreateNewLabel, TQString() );
} else
newLabel();
}
@@ -1011,8 +1004,8 @@ void LabelEditor::startBarcodeGen()
void LabelEditor::startLoadRecentEditor( const KURL& url )
{
- if( !QFile::exists( url.path() ) ) {
- KMessageBox::information( this, i18n("The file %1 does not exist.").arg( url.path() ) );
+ if( !TQFile::exists( url.path() ) ) {
+ KMessageBox::information( this, i18n("The file %1 does not exist.").tqarg( url.path() ) );
recentAct->removeURL( url );
return;
}
@@ -1026,8 +1019,8 @@ void LabelEditor::startLoadRecentEditor( const KURL& url )
void LabelEditor::startLoadEditor()
{
if( isChanged() ) {
- LabelEditor* lb = new LabelEditor( 0, QString::null, "LabelEditorWindow" );
- lb->startupDlg( eLoadLabel, QString::null );
+ LabelEditor* lb = new LabelEditor( 0, TQString(), "LabelEditorWindow" );
+ lb->startupDlg( eLoadLabel, TQString() );
} else
open();
}
@@ -1037,7 +1030,7 @@ void LabelEditor::batchPrint()
new BatchWizard( NULL );
}
-void LabelEditor::closeEvent( QCloseEvent* e )
+void LabelEditor::closeEvent( TQCloseEvent* e )
{
if( !isChanged() ) {
saveConfig();
@@ -1075,7 +1068,7 @@ bool LabelEditor::isChanged()
return false;
}
-bool LabelEditor::startupDlg( ELabelEditorMode mode, QString f )
+bool LabelEditor::startupDlg( ELabelEditorMode mode, TQString f )
{
if( mode == eCreateNewLabel && KBarcodeSettings::getInstance()->newDialog() )
{
@@ -1107,7 +1100,7 @@ void LabelEditor::closeLabel()
cv->setDefinition( d );
- filename = QString::null;
+ filename = TQString();
setCaption( filename, false );
}
diff --git a/kbarcode/labeleditor.h b/kbarcode/labeleditor.h
index 9bd9b30..1321323 100644
--- a/kbarcode/labeleditor.h
+++ b/kbarcode/labeleditor.h
@@ -30,8 +30,8 @@
#include "editoriface.h"
#include <kdialogbase.h>
-#include <qdialog.h>
-#include <qmap.h>
+#include <tqdialog.h>
+#include <tqmap.h>
class BatchPrinter;
class KURL;
@@ -52,23 +52,23 @@ class MyCanvasRectangle;
class MyCanvasView;
class BarcodeItem;
class MyCanvas;
-class QCanvasItemList;
-class QCheckBox;
+class TQCanvasItemList;
+class TQCheckBox;
class KComboBox;
-class QDockArea;
-class QDockWindow;
-class QGroupBox;
-class QLabel;
-class QImage;
-class QHBoxLayout;
-class QVBoxLayout;
-class QPoint;
-class QRect;
-class QPaintDevice;
-class QString;
+class TQDockArea;
+class TQDockWindow;
+class TQGroupBox;
+class TQLabel;
+class TQImage;
+class TQHBoxLayout;
+class TQVBoxLayout;
+class TQPoint;
+class TQRect;
+class TQPaintDevice;
+class TQString;
class KPushButton;
class KPrinter;
-class QCanvasItem;
+class TQCanvasItem;
class TCanvasItem;
class RectItem;
class LineItem;
@@ -81,21 +81,22 @@ class TokenProvider;
*/
class LabelEditor : public DSMainWindow, public EditorIface, private LabelUtils, private XMLUtils {
Q_OBJECT
+ TQ_OBJECT
public:
enum ELabelEditorMode {
eCreateNewLabel,
eLoadLabel
};
- LabelEditor( QWidget *parent=0, QString _filename = QString::null,
+ LabelEditor( TQWidget *tqparent=0, TQString _filename = TQString(),
const char *name="labeleditor", WFlags f = WType_TopLevel | WDestructiveClose );
~LabelEditor();
- bool startupDlg( ELabelEditorMode mode, QString f = QString::null );
+ bool startupDlg( ELabelEditorMode mode, TQString f = TQString() );
/**
* returns the filename of the currently loaded label.
*/
- const QString fileName() const;
+ const TQString fileName() const;
public slots:
void print();
@@ -115,12 +116,12 @@ class LabelEditor : public DSMainWindow, public EditorIface, private LabelUtils,
*/
void createCommandHistoryActions();
- QString getCustomerName( int mode = 0, QString text = "" );
+ TQString getCustomerName( int mode = 0, TQString text = "" );
void clearLabel();
//void setupBarcode( BarcodeItem* bcode );
- void insertText( QString caption );
+ void insertText( TQString caption );
//NY35
- void insertTextLine( QString caption );
+ void insertTextLine( TQString caption );
//NY35
void setupActions();
void enableActions();
@@ -131,11 +132,11 @@ class LabelEditor : public DSMainWindow, public EditorIface, private LabelUtils,
private slots:
void startEditor();
bool open();
- bool openUrl( const QString & url );
+ bool openUrl( const TQString & url );
bool save();
bool saveas();
- bool save( QString url );
- void save( QIODevice* device );
+ bool save( TQString url );
+ void save( TQIODevice* device );
bool newLabel();
void insertBarcode();
void insertPicture();
@@ -152,7 +153,7 @@ class LabelEditor : public DSMainWindow, public EditorIface, private LabelUtils,
void changeSize();
void updateInfo();
void doubleClickedItem( TCanvasItem* item );
- void showContextMenu( QPoint pos );
+ void showContextMenu( TQPoint pos );
void doubleClickedCurrent();
void spellCheck();
void centerVertical();
@@ -178,7 +179,7 @@ class LabelEditor : public DSMainWindow, public EditorIface, private LabelUtils,
void lockItem();
protected:
- void closeEvent( QCloseEvent* e );
+ void closeEvent( TQCloseEvent* e );
KCommandHistory* history;
@@ -235,15 +236,15 @@ class LabelEditor : public DSMainWindow, public EditorIface, private LabelUtils,
TokenProvider* m_token;
// Label info's:
- QString description; // description
- QString filename; // current file
+ TQString description; // description
+ TQString filename; // current file
KListBox* listFields;
KPushButton* buttonText;
- QVBoxLayout* pageLayout;
+ TQVBoxLayout* pageLayout;
- QMap<QString,QString> fields;
+ TQMap<TQString,TQString> fields;
bool m_edited;
};
diff --git a/kbarcode/labelutils.cpp b/kbarcode/labelutils.cpp
index 7325f3e..515f54b 100644
--- a/kbarcode/labelutils.cpp
+++ b/kbarcode/labelutils.cpp
@@ -18,12 +18,12 @@
#include "labelutils.h"
#include "dsrichtext.h"
-// Qt includes
-#include <qbitmap.h>
-#include <qimage.h>
-#include <qpaintdevicemetrics.h>
-#include <qpainter.h>
-#include <qsimplerichtext.h>
+// TQt includes
+#include <tqbitmap.h>
+#include <tqimage.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqpainter.h>
+#include <tqsimplerichtext.h>
// KDE includes
#include <kapplication.h>
@@ -42,16 +42,16 @@ LabelUtils::LabelUtils()
LabelUtils::~LabelUtils()
{ }
-double LabelUtils::pixelToMm( double pixel, const QPaintDevice* device, int mode )
+double LabelUtils::pixelToMm( double pixel, const TQPaintDevice* device, int mode )
{
- QPaintDeviceMetrics pdm( device ? device : KApplication::desktop() );
+ TQPaintDeviceMetrics pdm( device ? device : TQT_TQPAINTDEVICE(KApplication::desktop()) );
if( mode == DpiX )
return (pixel * CONVERSION_FACTOR) / (double)pdm.logicalDpiX();
else
return (pixel * CONVERSION_FACTOR) / (double)pdm.logicalDpiY();
}
-double LabelUtils::mmToPixel( double mm, const QPaintDevice* device, int mode )
+double LabelUtils::mmToPixel( double mm, const TQPaintDevice* device, int mode )
{
if( !mm )
return 0;
@@ -59,7 +59,7 @@ double LabelUtils::mmToPixel( double mm, const QPaintDevice* device, int mode )
// We don't get valid metrics from the printer - and we want a better resolution
// anyway (it's the PS driver that takes care of the printer resolution).
- QPaintDeviceMetrics pdm( device ? device : KApplication::desktop() );
+ TQPaintDeviceMetrics pdm( device ? device : TQT_TQPAINTDEVICE(KApplication::desktop()) );
// qDebug("DpiX=%i", pdm.logicalDpiX());
// qDebug("DpiY=%i", pdm.logicalDpiY());
@@ -69,49 +69,49 @@ double LabelUtils::mmToPixel( double mm, const QPaintDevice* device, int mode )
return (mm / CONVERSION_FACTOR) * (double)pdm.logicalDpiY();
}
-double LabelUtils::pixelToPixelX( double unit, const QPaintDevice* src, const QPaintDevice* dest )
+double LabelUtils::pixelToPixelX( double unit, const TQPaintDevice* src, const TQPaintDevice* dest )
{
- QPaintDeviceMetrics p1( src );
- QPaintDeviceMetrics p2( dest );
+ TQPaintDeviceMetrics p1( src );
+ TQPaintDeviceMetrics p2( dest );
return ( unit * (double)p2.logicalDpiX() ) / (double)p1.logicalDpiX();
}
-double LabelUtils::pixelToPixelY( double unit, const QPaintDevice* src, const QPaintDevice* dest )
+double LabelUtils::pixelToPixelY( double unit, const TQPaintDevice* src, const TQPaintDevice* dest )
{
- QPaintDeviceMetrics p1( src );
- QPaintDeviceMetrics p2( dest );
+ TQPaintDeviceMetrics p1( src );
+ TQPaintDeviceMetrics p2( dest );
//return pixelToPixelX( unit, src, dest );
return ( unit * (double)p2.logicalDpiY() ) / (double)p1.logicalDpiY();
}
-const QString LabelUtils::getTypeFromCaption( const QString & cap )
+const TQString LabelUtils::getTypeFromCaption( const TQString & cap )
{
// TODO: remove this function
- QString search = cap.right( cap.length() - cap.find(":") - 1 ).lower().stripWhiteSpace();
+ TQString search = cap.right( cap.length() - cap.tqfind(":") - 1 ).lower().stripWhiteSpace();
return search;
}
-const QString LabelUtils::getModeFromCaption( const QString & cap )
+const TQString LabelUtils::getModeFromCaption( const TQString & cap )
{
- return cap.left( cap.find(":") ).lower().stripWhiteSpace();
+ return cap.left( cap.tqfind(":") ).lower().stripWhiteSpace();
}
-QSize LabelUtils::stringSize( const QString & t )
+TQSize LabelUtils::stringSize( const TQString & t )
{
- QSimpleRichText srt( t, KApplication::font() );
- QSize s;
+ TQSimpleRichText srt( t, KApplication::font() );
+ TQSize s;
s.setWidth( srt.widthUsed() );
s.setHeight( srt.height() );
return s;
}
-void LabelUtils::renderString( QPainter* painter, const QString & t, const QRect & rect, double scalex, double scaley )
+void LabelUtils::renderString( TQPainter* painter, const TQString & t, const TQRect & rect, double scalex, double scaley )
{
// DSRichText cannot calculate the width on its own
- QSimpleRichText srt( t, KApplication::font() );
+ TQSimpleRichText srt( t, KApplication::font() );
int width = (rect.width() > 0) ? rect.width() : srt.widthUsed();
int height = (rect.height() > 0) ? rect.height() : srt.height();
@@ -124,40 +124,40 @@ void LabelUtils::renderString( QPainter* painter, const QString & t, const QRect
r.draw( painter );
}
-QPixmap* LabelUtils::drawString( const QString & t, int w, int h, double rot )
+TQPixmap* LabelUtils::drawString( const TQString & t, int w, int h, double rot )
{
- QSimpleRichText srt( t, KApplication::font() );
+ TQSimpleRichText srt( t, KApplication::font() );
int width = (w > 0) ? w : srt.widthUsed();
int height = (h > 0) ? h : srt.height();
srt.setWidth( width );
- QPixmap* pix;
- QPainter painter;
+ TQPixmap* pix;
+ TQPainter painter;
if( rot == 0.0 ) {
- QBitmap bm( width, height );
- bm.fill( Qt::color0 ); //transparent
+ TQBitmap bm( width, height );
+ bm.fill( TQt::color0 ); //transparent
painter.begin( &bm );
painter.save();
- painter.setPen( Qt::color1 );
- QColorGroup cg;
- cg.setColor( QColorGroup::Foreground, Qt::color1 );
- cg.setColor( QColorGroup::Text, Qt::color1 );
- cg.setColor( QColorGroup::Base, Qt::color0 );
+ painter.setPen( TQt::color1 );
+ TQColorGroup cg;
+ cg.setColor( TQColorGroup::Foreground, TQt::color1 );
+ cg.setColor( TQColorGroup::Text, TQt::color1 );
+ cg.setColor( TQColorGroup::Base, TQt::color0 );
srt.draw( &painter, 0, 0, bm.rect(), cg );
painter.restore();
painter.end();
- pix = new QPixmap( width, height );
- pix->fill( Qt::white );
+ pix = new TQPixmap( width, height );
+ pix->fill( TQt::white );
pix->setMask( bm );
if( !pix->isNull() ) {
painter.begin( pix );
- painter.setPen( Qt::black );
- QColorGroup cg;
+ painter.setPen( TQt::black );
+ TQColorGroup cg;
srt.draw( &painter, 0, 0, pix->rect(), cg );
painter.end();
}
@@ -165,14 +165,14 @@ QPixmap* LabelUtils::drawString( const QString & t, int w, int h, double rot )
int w2 = (w > 0) ? w : srt.widthUsed();
int h2 = (h > 0) ? h : srt.height();
- QWMatrix wm;
+ TQWMatrix wm;
wm.rotate( rot );
- QSize s = LabelUtils::stringSize( t );
- QPixmap* tmp = LabelUtils::drawString( t, s.width(), s.height() );
+ TQSize s = LabelUtils::stringSize( t );
+ TQPixmap* tmp = LabelUtils::drawString( t, s.width(), s.height() );
- QPixmap* p = new QPixmap( w2, h2 );
- p->fill( Qt::white );
+ TQPixmap* p = new TQPixmap( w2, h2 );
+ p->fill( TQt::white );
painter.begin( p );
painter.drawPixmap( 0, 0, tmp->xForm( wm ) );
painter.end();
diff --git a/kbarcode/labelutils.h b/kbarcode/labelutils.h
index 724000d..777a0af 100644
--- a/kbarcode/labelutils.h
+++ b/kbarcode/labelutils.h
@@ -20,18 +20,18 @@
class Definition;
class KPrinter;
-class QDomElement;
-class QFont;
-class QImage;
-class QPainter;
-class QPixmap;
-class QPaintDevice;
-class QPoint;
-class QRect;
-class QSize;
-class QString;
-class QStringList;
-class QSqlQuery;
+class TQDomElement;
+class TQFont;
+class TQImage;
+class TQPainter;
+class TQPixmap;
+class TQPaintDevice;
+class TQPoint;
+class TQRect;
+class TQSize;
+class TQString;
+class TQStringList;
+class TQSqlQuery;
class LabelUtils {
public:
LabelUtils();
@@ -42,20 +42,20 @@ class LabelUtils {
DpiY
};
- double pixelToMm( double pixel, const QPaintDevice* device, int mode = DpiX );
- double mmToPixel( double mm, const QPaintDevice* device, int mode = DpiX );
+ double pixelToMm( double pixel, const TQPaintDevice* device, int mode = DpiX );
+ double mmToPixel( double mm, const TQPaintDevice* device, int mode = DpiX );
- double pixelToPixelX( double unit, const QPaintDevice* src, const QPaintDevice* dest );
- double pixelToPixelY( double unit, const QPaintDevice* src, const QPaintDevice* dest );
- static QSize stringSize( const QString & t );
- static QPixmap* drawString( const QString & t, int w, int h, double rot = 0 );
- static QPixmap* drawString( const QString & t ) {
+ double pixelToPixelX( double unit, const TQPaintDevice* src, const TQPaintDevice* dest );
+ double pixelToPixelY( double unit, const TQPaintDevice* src, const TQPaintDevice* dest );
+ static TQSize stringSize( const TQString & t );
+ static TQPixmap* drawString( const TQString & t, int w, int h, double rot = 0 );
+ static TQPixmap* drawString( const TQString & t ) {
return LabelUtils::drawString( t, 0, 0, 0 );
}
- static void renderString( QPainter* painter, const QString & t, const QRect & r, double scalex, double scaley );
+ static void renderString( TQPainter* painter, const TQString & t, const TQRect & r, double scalex, double scaley );
- const QString getTypeFromCaption( const QString & cap );
- const QString getModeFromCaption( const QString & cap );
+ const TQString getTypeFromCaption( const TQString & cap );
+ const TQString getModeFromCaption( const TQString & cap );
};
#endif
diff --git a/kbarcode/lineitem.cpp b/kbarcode/lineitem.cpp
index 5e7ae65..4ebf622 100644
--- a/kbarcode/lineitem.cpp
+++ b/kbarcode/lineitem.cpp
@@ -15,12 +15,12 @@
***************************************************************************/
-#include <qstring.h>
+#include <tqstring.h>
#include "documentitem.h"
#include "lineitem.h"
-#include <qpainter.h>
+#include <tqpainter.h>
LineItem::LineItem()
: DocumentItem()
@@ -30,10 +30,10 @@ LineItem::LineItem()
void LineItem::init()
{
- setRect( QRect( 0, 0, 20, 20 ) );
+ setRect( TQRect( 0, 0, 20, 20 ) );
}
-void LineItem::draw(QPainter* painter)
+void LineItem::draw(TQPainter* painter)
{
painter->save();
painter->setPen( pen() );
@@ -41,27 +41,27 @@ void LineItem::draw(QPainter* painter)
painter->restore();
}
-void LineItem::drawZpl( QTextStream* )
+void LineItem::drawZpl( TQTextStream* )
{
qDebug("LineItem not implemented for ZPL");
}
-void LineItem::drawEPcl( QTextStream* )
+void LineItem::drawEPcl( TQTextStream* )
{
qDebug("LineItem not implemented for EPCL");
}
-void LineItem::drawIpl( QTextStream*, IPLUtils* )
+void LineItem::drawIpl( TQTextStream*, IPLUtils* )
{
qDebug("LineItem not implemented for IPL");
}
-void LineItem::loadXML(QDomElement* element)
+void LineItem::loadXML(TQDomElement* element)
{
DocumentItem::loadXML(element);
}
-void LineItem::saveXML(QDomElement* element)
+void LineItem::saveXML(TQDomElement* element)
{
DocumentItem::saveXML(element);
}
diff --git a/kbarcode/lineitem.h b/kbarcode/lineitem.h
index 0843a42..d378b7d 100644
--- a/kbarcode/lineitem.h
+++ b/kbarcode/lineitem.h
@@ -17,9 +17,9 @@
#ifndef LINEITEM_H
#define LINEITEM_H
-#include <qstring.h>
+#include <tqstring.h>
#include "documentitem.h"
-#include "qcolor.h"
+#include "tqcolor.h"
/**
* Class LineItem
@@ -30,12 +30,12 @@ public:
LineItem ();
virtual int rtti() const { return eRtti_Line; }
- virtual void draw(QPainter* painter);
- virtual void drawZpl( QTextStream* stream );
- virtual void drawIpl( QTextStream* stream, IPLUtils* utils );
- virtual void drawEPcl( QTextStream* stream );
- virtual void loadXML(QDomElement* element);
- virtual void saveXML(QDomElement* element);
+ virtual void draw(TQPainter* painter);
+ virtual void drawZpl( TQTextStream* stream );
+ virtual void drawIpl( TQTextStream* stream, IPLUtils* utils );
+ virtual void drawEPcl( TQTextStream* stream );
+ virtual void loadXML(TQDomElement* element);
+ virtual void saveXML(TQDomElement* element);
private:
void init();
diff --git a/kbarcode/main.cpp b/kbarcode/main.cpp
index 081cf08..d851b76 100644
--- a/kbarcode/main.cpp
+++ b/kbarcode/main.cpp
@@ -55,15 +55,15 @@ void setupDirs()
if( locate("data", "kbarcode/logo.png").isEmpty() ) {
// Maybe KBarcode was not installed into $KDEDIR
KStandardDirs* dirs = KGlobal::dirs();
- QString kdedir = dirs->kfsstnd_prefixes();
+ TQString kdedir = dirs->kfsstnd_prefixes();
- if( !kdedir.contains( "/usr/local/" ) )
+ if( !kdedir.tqcontains( "/usr/local/" ) )
dirs->addPrefix( "/usr/local/" );
- if( !kdedir.contains( "/usr/local/kde/" ) )
+ if( !kdedir.tqcontains( "/usr/local/kde/" ) )
dirs->addPrefix( "/usr/local/kde/" );
- if( !kdedir.contains( "/usr/" ) )
+ if( !kdedir.tqcontains( "/usr/" ) )
dirs->addPrefix( "/usr/" );
qDebug("WARNING: Prefix changed: %s", dirs->kfsstnd_prefixes().latin1() );
@@ -110,7 +110,7 @@ int main(int argc, char *argv[])
setupDirs();
KImageIO::registerFormats();
- a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
+ a.connect( &a, TQT_SIGNAL(lastWindowClosed()), &a, TQT_SLOT(quit()));
KBarcode* kbc = new KBarcode( 0, "KBarcodeMainWindow" );
diff --git a/kbarcode/measurements.cpp b/kbarcode/measurements.cpp
index 07044ec..a945406 100644
--- a/kbarcode/measurements.cpp
+++ b/kbarcode/measurements.cpp
@@ -17,8 +17,8 @@
#include "measurements.h"
-// Qt includes
-#include <qpaintdevicemetrics.h>
+// TQt includes
+#include <tqpaintdevicemetrics.h>
// KDE includes
#include <kglobal.h>
@@ -41,7 +41,7 @@ Measurements::Measurements( const Measurements & rhs )
Measurements::~Measurements() {}
int Measurements::m_system = None;
-QString Measurements::m_string = QString::null;
+TQString Measurements::m_string = TQString();
void Measurements::init()
{
@@ -77,35 +77,35 @@ void Measurements::operator=( const Measurements & m ) {
m_height = m.m_height;
}
-double Measurements::mmToPixel( double mm, const QPaintDevice* device, int mode ) const {
- QPaintDeviceMetrics pdm( device );
+double Measurements::mmToPixel( double mm, const TQPaintDevice* device, int mode ) const {
+ TQPaintDeviceMetrics pdm( device );
if( mode == DpiX )
return (mm / 25.4) * pdm.logicalDpiX();
else
return (mm / 25.4 ) * pdm.logicalDpiY();
}
-double Measurements::gapLeft( const QPaintDevice* device ) const {
+double Measurements::gapLeft( const TQPaintDevice* device ) const {
return mmToPixel( gap_left, device, DpiX );
}
-double Measurements::gapTop( const QPaintDevice* device ) const {
+double Measurements::gapTop( const TQPaintDevice* device ) const {
return mmToPixel( gap_top, device, DpiY );
}
-double Measurements::gapV( const QPaintDevice* device ) const {
+double Measurements::gapV( const TQPaintDevice* device ) const {
return mmToPixel( gap_v, device, DpiX );
}
-double Measurements::gapH( const QPaintDevice* device ) const {
+double Measurements::gapH( const TQPaintDevice* device ) const {
return mmToPixel( gap_h, device, DpiY );
}
-double Measurements::width( const QPaintDevice* device ) const {
+double Measurements::width( const TQPaintDevice* device ) const {
return mmToPixel( m_width, device, DpiX );
}
-double Measurements::height( const QPaintDevice* device ) const {
+double Measurements::height( const TQPaintDevice* device ) const {
return mmToPixel( m_height, device, DpiY );
}
diff --git a/kbarcode/measurements.h b/kbarcode/measurements.h
index a95e666..486439b 100644
--- a/kbarcode/measurements.h
+++ b/kbarcode/measurements.h
@@ -20,7 +20,7 @@
#include <klocale.h>
-class QPaintDevice;
+class TQPaintDevice;
/**
* This class keeps all measurements required to correctly draw a label.
@@ -66,12 +66,12 @@ class Measurements {
double width() const;
double height() const;
- double gapLeft( const QPaintDevice* device ) const;
- double gapTop( const QPaintDevice* device ) const;
- double gapV( const QPaintDevice* device ) const;
- double gapH( const QPaintDevice* device ) const;
- double width( const QPaintDevice* device ) const;
- double height( const QPaintDevice* device ) const;
+ double gapLeft( const TQPaintDevice* device ) const;
+ double gapTop( const TQPaintDevice* device ) const;
+ double gapV( const TQPaintDevice* device ) const;
+ double gapH( const TQPaintDevice* device ) const;
+ double width( const TQPaintDevice* device ) const;
+ double height( const TQPaintDevice* device ) const;
void setNumH( int n ) { num_h = n; }
void setNumV( int n ) { num_v = n; }
@@ -99,7 +99,7 @@ class Measurements {
* to a measurement number visible to the user. I.e.
* "mm" or "in".
*/
- static const QString & system() { Measurements::init(); return m_string; }
+ static const TQString & system() { Measurements::init(); return m_string; }
/** return the measurements system to be used.
*/
@@ -113,13 +113,13 @@ class Measurements {
void defaultMeasurements();
- double mmToPixel( double mm, const QPaintDevice* device, int mode = DpiX ) const;
+ double mmToPixel( double mm, const TQPaintDevice* device, int mode = DpiX ) const;
/** Measurement system to use:
* milimeters or inch
*/
static int m_system;
- static QString m_string;
+ static TQString m_string;
int num_h;
int num_v;
diff --git a/kbarcode/mimesources.cpp b/kbarcode/mimesources.cpp
index c02ded7..f3dce8d 100644
--- a/kbarcode/mimesources.cpp
+++ b/kbarcode/mimesources.cpp
@@ -23,9 +23,9 @@
#include <kcommand.h>
-#include <qbuffer.h>
-#include <qcstring.h>
-#include <qdom.h>
+#include <tqbuffer.h>
+#include <tqcstring.h>
+#include <tqdom.h>
class DragCommand : public NewItemCommand {
public:
@@ -46,24 +46,24 @@ class DragCommand : public NewItemCommand {
-DocumentItemDrag::DocumentItemDrag( QWidget* dragSource, const char* name )
- : QStoredDrag( DocumentItemDrag::mimeType(), dragSource, name )
+DocumentItemDrag::DocumentItemDrag( TQWidget* dragSource, const char* name )
+ : TQStoredDrag( DocumentItemDrag::mimeType(), dragSource, name )
{
}
-QString DocumentItemDrag::mimeType()
+TQString DocumentItemDrag::mimeType()
{
return "application/x-kbarcode-document-item";
}
void DocumentItemDrag::setDocumentItem( DocumentItemList* list )
{
- QByteArray data;
- QBuffer buffer( data );
+ TQByteArray data;
+ TQBuffer buffer( data );
if( buffer.open( IO_WriteOnly ) )
{
- QDomDocument doc("KBarcodeClipboard");
- QDomElement root = doc.createElement( "root" );
+ TQDomDocument doc("KBarcodeClipboard");
+ TQDomElement root = doc.createElement( "root" );
doc.appendChild( root );
XMLUtils xml;
@@ -73,7 +73,7 @@ void DocumentItemDrag::setDocumentItem( DocumentItemList* list )
xml.writeXMLDocumentItem( &root, &item );
}
- QTextStream t( &buffer );
+ TQTextStream t( &buffer );
doc.save( t, 0 );
buffer.close();
@@ -81,27 +81,27 @@ void DocumentItemDrag::setDocumentItem( DocumentItemList* list )
}
}
-bool DocumentItemDrag::canDecode( QMimeSource* e )
+bool DocumentItemDrag::canDecode( TQMimeSource* e )
{
return e->provides( DocumentItemDrag::mimeType() );
}
-bool DocumentItemDrag::decode( QMimeSource* mime, MyCanvasView* cv, TokenProvider* token, KCommandHistory* history )
+bool DocumentItemDrag::decode( TQMimeSource* mime, MyCanvasView* cv, TokenProvider* token, KCommandHistory* history )
{
- QByteArray data = mime->encodedData( DocumentItemDrag::mimeType() );
- QDomDocument doc( "KBarcodeClipboard" );
+ TQByteArray data = mime->tqencodedData( DocumentItemDrag::mimeType() );
+ TQDomDocument doc( "KBarcodeClipboard" );
if( !doc.setContent( data ) )
return false;
- QDomNode n = doc.documentElement();
- QDomNodeList list = n.childNodes();
+ TQDomNode n = doc.documentElement();
+ TQDomNodeList list = n.childNodes();
KMacroCommand* commands = new KMacroCommand( i18n("Paste") );
for( unsigned int i=0;i<list.length();i++)
{
- QDomNode n = list.item(i);
+ TQDomNode n = list.item(i);
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
if( !e.isNull() )
{
XMLUtils xml;
diff --git a/kbarcode/mimesources.h b/kbarcode/mimesources.h
index abaf5d7..5790efd 100644
--- a/kbarcode/mimesources.h
+++ b/kbarcode/mimesources.h
@@ -18,24 +18,25 @@
#ifndef MIMESOURCES_H
#define MIMESOURCES_H
-#include <qdragobject.h>
+#include <tqdragobject.h>
#include "documentitem.h"
class KCommandHistory;
class TokenProvider;
class MyCanvasView;
-class DocumentItemDrag : public QStoredDrag {
+class DocumentItemDrag : public TQStoredDrag {
Q_OBJECT
+ TQ_OBJECT
public:
- DocumentItemDrag( QWidget* dragSource = NULL, const char* name = 0 );
+ DocumentItemDrag( TQWidget* dragSource = NULL, const char* name = 0 );
- static QString mimeType();
+ static TQString mimeType();
void setDocumentItem( DocumentItemList* list );
- static bool canDecode( QMimeSource * );
- static bool decode( QMimeSource *, MyCanvasView* cv, TokenProvider* token, KCommandHistory* history );
+ static bool canDecode( TQMimeSource * );
+ static bool decode( TQMimeSource *, MyCanvasView* cv, TokenProvider* token, KCommandHistory* history );
};
#endif
diff --git a/kbarcode/multilineeditdlg.cpp b/kbarcode/multilineeditdlg.cpp
index 650f58e..9fd2e11 100644
--- a/kbarcode/multilineeditdlg.cpp
+++ b/kbarcode/multilineeditdlg.cpp
@@ -29,31 +29,31 @@
#include <ktoolbar.h>
#include <kcombobox.h>
-// Qt includes
-#include <qdockarea.h>
-#include <qregexp.h>
+// TQt includes
+#include <tqdockarea.h>
+#include <tqregexp.h>
-MultiLineEditor::MultiLineEditor( TokenProvider* token, QWidget *parent, const char *name )
- : QWidget( parent, name ), m_token( token )
+MultiLineEditor::MultiLineEditor( TokenProvider* token, TQWidget *tqparent, const char *name )
+ : TQWidget( tqparent, name ), m_token( token )
{
- QVBoxLayout* layout = new QVBoxLayout( this, 6, 6 );
+ TQVBoxLayout* tqlayout = new TQVBoxLayout( this, 6, 6 );
// ksc = new KSpellConfig( this );
editor = new DSTextEdit( this );
- editor->setTextFormat( Qt::RichText );
+ editor->setTextFormat( TQt::RichText );
//editor->setText( text, "" );
editor->setFocus();
- QDockArea* area = new QDockArea( Qt::Horizontal, QDockArea::Normal, this );
+ TQDockArea* area = new TQDockArea( Qt::Horizontal, TQDockArea::Normal, this );
toolBar = new KToolBar( area );
tool2Bar = new KToolBar( area );
tool3Bar = new KToolBar( area );
setupActions();
- layout->addWidget( area );
- layout->addWidget( editor );
+ tqlayout->addWidget( area );
+ tqlayout->addWidget( editor );
}
@@ -66,76 +66,76 @@ void MultiLineEditor::setupActions()
{
ac = new KActionCollection( this );
- KAction* action_export = new KAction( i18n("Export"), "fileexport", 0, this, SLOT( save() ), ac );
+ KAction* action_export = new KAction( i18n("Export"), "fileexport", 0, TQT_TQOBJECT(this), TQT_SLOT( save() ), ac );
//
// Edit Actions
//
- KAction *action_undo = KStdAction::undo( editor, SLOT( undo() ), ac );
+ KAction *action_undo = KStdAction::undo( TQT_TQOBJECT(editor), TQT_SLOT( undo() ), ac );
action_undo->setEnabled( false );
- connect( editor, SIGNAL( undoAvailable(bool) ), action_undo, SLOT( setEnabled(bool) ) );
+ connect( editor, TQT_SIGNAL( undoAvailable(bool) ), action_undo, TQT_SLOT( setEnabled(bool) ) );
- KAction *action_redo = KStdAction::redo( editor, SLOT( redo() ), ac );
+ KAction *action_redo = KStdAction::redo( TQT_TQOBJECT(editor), TQT_SLOT( redo() ), ac );
action_redo->setEnabled( false );
- connect( editor, SIGNAL( redoAvailable(bool) ), action_redo, SLOT( setEnabled(bool) ) );
+ connect( editor, TQT_SIGNAL( redoAvailable(bool) ), action_redo, TQT_SLOT( setEnabled(bool) ) );
- KAction *action_cut = KStdAction::cut( editor, SLOT( cut() ), ac );
+ KAction *action_cut = KStdAction::cut( TQT_TQOBJECT(editor), TQT_SLOT( cut() ), ac );
action_cut->setEnabled( false );
- connect( editor, SIGNAL( copyAvailable(bool) ), action_cut, SLOT( setEnabled(bool) ) );
+ connect( editor, TQT_SIGNAL( copyAvailable(bool) ), action_cut, TQT_SLOT( setEnabled(bool) ) );
- KAction *action_copy = KStdAction::copy( editor, SLOT( copy() ), ac );
+ KAction *action_copy = KStdAction::copy( TQT_TQOBJECT(editor), TQT_SLOT( copy() ), ac );
action_copy->setEnabled( false );
- connect( editor, SIGNAL( copyAvailable(bool) ), action_copy, SLOT( setEnabled(bool) ) );
+ connect( editor, TQT_SIGNAL( copyAvailable(bool) ), action_copy, TQT_SLOT( setEnabled(bool) ) );
- KAction* action_paste = KStdAction::paste( editor, SLOT( paste() ), ac );
+ KAction* action_paste = KStdAction::paste( TQT_TQOBJECT(editor), TQT_SLOT( paste() ), ac );
//
// Character Formatting
//
action_bold = new KToggleAction( i18n("&Bold"), "text_bold", CTRL+Key_B, ac, "format_bold" );
- connect( action_bold, SIGNAL( toggled(bool) ), editor, SLOT( setBold(bool) ) );
+ connect( action_bold, TQT_SIGNAL( toggled(bool) ), editor, TQT_SLOT( setBold(bool) ) );
action_italic = new KToggleAction( i18n("&Italic"), "text_italic", CTRL+Key_I, ac, "format_italic" );
- connect( action_italic, SIGNAL( toggled(bool) ), editor, SLOT( setItalic(bool) ) );
+ connect( action_italic, TQT_SIGNAL( toggled(bool) ), editor, TQT_SLOT( setItalic(bool) ) );
action_underline = new KToggleAction( i18n("&Underline"), "text_under", CTRL+Key_U, ac, "format_underline" );
- connect( action_underline, SIGNAL( toggled(bool) ), editor, SLOT( setUnderline(bool) ) );
+ connect( action_underline, TQT_SIGNAL( toggled(bool) ), editor, TQT_SLOT( setUnderline(bool) ) );
- KAction* action_color = new KAction( i18n("Text &Color..."), "colorpicker", 0, this, SLOT( formatColor() ), ac, "format_color" );
+ KAction* action_color = new KAction( i18n("Text &Color..."), "colorpicker", 0, TQT_TQOBJECT(this), TQT_SLOT( formatColor() ), ac, "format_color" );
//
// Font
//
action_font = new KFontAction( i18n("&Font"), 0, ac, "format_font" );
- connect( action_font, SIGNAL( activated( const QString & ) ), editor, SLOT( setFamily( const QString & ) ) );
+ connect( action_font, TQT_SIGNAL( activated( const TQString & ) ), editor, TQT_SLOT( setFamily( const TQString & ) ) );
action_font_size = new KFontSizeAction( i18n("Font &Size"), 0, ac, "format_font_size" );
- connect( action_font_size, SIGNAL( fontSizeChanged(int) ), editor, SLOT( setPointSize(int) ) );
+ connect( action_font_size, TQT_SIGNAL( fontSizeChanged(int) ), editor, TQT_SLOT( setPointSize(int) ) );
//
// Alignment
//
action_align_left = new KToggleAction( i18n("Align &Left"), "text_left", 0, ac, "format_align_left" );
- connect( action_align_left, SIGNAL( toggled(bool) ), this, SLOT( setAlignLeft(bool) ) );
+ connect( action_align_left, TQT_SIGNAL( toggled(bool) ), TQT_TQOBJECT(this), TQT_SLOT( setAlignLeft(bool) ) );
action_align_center = new KToggleAction( i18n("Align &Center"), "text_center", 0, ac, "format_align_center" );
- connect( action_align_center, SIGNAL( toggled(bool) ), this, SLOT( setAlignCenter(bool) ) );
+ connect( action_align_center, TQT_SIGNAL( toggled(bool) ), TQT_TQOBJECT(this), TQT_SLOT( setAlignCenter(bool) ) );
action_align_right = new KToggleAction( i18n("Align &Right"), "text_right", 0, ac, "format_align_right" );
- connect( action_align_right, SIGNAL( toggled(bool) ), this, SLOT( setAlignRight(bool) ) );
+ connect( action_align_right, TQT_SIGNAL( toggled(bool) ), TQT_TQOBJECT(this), TQT_SLOT( setAlignRight(bool) ) );
action_align_justify = new KToggleAction( i18n("&Justify"), "text_block", 0, ac, "format_align_justify" );
- connect( action_align_justify, SIGNAL( toggled(bool) ), this, SLOT( setAlignJustify(bool) ) );
+ connect( action_align_justify, TQT_SIGNAL( toggled(bool) ), TQT_TQOBJECT(this), TQT_SLOT( setAlignJustify(bool) ) );
- action_align_left->setExclusiveGroup( "alignment" );
- action_align_center->setExclusiveGroup( "alignment" );
- action_align_right->setExclusiveGroup( "alignment" );
- action_align_justify->setExclusiveGroup( "alignment" );
+ action_align_left->setExclusiveGroup( "tqalignment" );
+ action_align_center->setExclusiveGroup( "tqalignment" );
+ action_align_right->setExclusiveGroup( "tqalignment" );
+ action_align_justify->setExclusiveGroup( "tqalignment" );
- //KAction* action_spell = KStdAction::spelling( this, SLOT( checkSpelling() ), ac );
+ //KAction* action_spell = KStdAction::spelling( this, TQT_SLOT( checkSpelling() ), ac );
- KAction* textDataAct = new KAction( i18n("Insert &Data Field"), "contents", 0, this, SLOT( insertNewField() ), ac, "text_data_act"); action_export->plug( toolBar );
+ KAction* textDataAct = new KAction( i18n("Insert &Data Field"), "contents", 0, TQT_TQOBJECT(this), TQT_SLOT( insertNewField() ), ac, "text_data_act"); action_export->plug( toolBar );
toolBar->insertSeparator();
action_undo->plug( toolBar );
@@ -169,17 +169,17 @@ void MultiLineEditor::setupActions()
//
updateActions();
- connect( editor, SIGNAL( currentFontChanged( const QFont & ) ), this, SLOT( updateFont() ) );
- connect( editor, SIGNAL( currentFontChanged( const QFont & ) ), this, SLOT( updateCharFmt() ) );
- connect( editor, SIGNAL( cursorPositionChanged( int,int ) ), this, SLOT( updateAligment() ) );
+ connect( editor, TQT_SIGNAL( currentFontChanged( const TQFont & ) ), TQT_TQOBJECT(this), TQT_SLOT( updateFont() ) );
+ connect( editor, TQT_SIGNAL( currentFontChanged( const TQFont & ) ), TQT_TQOBJECT(this), TQT_SLOT( updateCharFmt() ) );
+ connect( editor, TQT_SIGNAL( cursorPositionChanged( int,int ) ), TQT_TQOBJECT(this), TQT_SLOT( updateAligment() ) );
}
-QString MultiLineEditor::text()
+TQString MultiLineEditor::text()
{
return editor->text();
}
-void MultiLineEditor::setText( const QString & t )
+void MultiLineEditor::setText( const TQString & t )
{
editor->setText( t );
}
@@ -193,7 +193,7 @@ void MultiLineEditor::updateCharFmt()
void MultiLineEditor::updateAligment()
{
- int align = editor->alignment();
+ int align = editor->tqalignment();
switch ( align ) {
case AlignRight:
@@ -229,10 +229,10 @@ void MultiLineEditor::updateActions()
void MultiLineEditor::formatColor()
{
- QColor col;
+ TQColor col;
int s = KColorDialog::getColor( col, editor->color(), editor );
- if ( s != QDialog::Accepted )
+ if ( s != TQDialog::Accepted )
return;
editor->setColor( col );
@@ -241,31 +241,31 @@ void MultiLineEditor::formatColor()
void MultiLineEditor::setAlignLeft( bool yes )
{
if ( yes )
- editor->setAlignment( AlignLeft );
+ editor->tqsetAlignment( AlignLeft );
}
void MultiLineEditor::setAlignRight( bool yes )
{
if ( yes )
- editor->setAlignment( AlignRight );
+ editor->tqsetAlignment( AlignRight );
}
void MultiLineEditor::setAlignCenter( bool yes )
{
if ( yes )
- editor->setAlignment( AlignCenter );
+ editor->tqsetAlignment( AlignCenter );
}
void MultiLineEditor::setAlignJustify( bool yes )
{
if ( yes )
- editor->setAlignment( AlignJustify );
+ editor->tqsetAlignment( AlignJustify );
}
void MultiLineEditor::insertNewField()
{
- TokenDialog dlg( m_token, this, "dlg" );
- if( dlg.exec() == QDialog::Accepted )
+ TokenDialog dlg( m_token, this, "dlg" );
+ if( dlg.exec() == TQDialog::Accepted )
editor->insert( dlg.token() );
}
@@ -273,7 +273,7 @@ void MultiLineEditor::checkSpelling()
{
/*
#if KDE_IS_VERSION( 3, 1, 90 )
- QString s;
+ TQString s;
if ( editor->hasSelectedText() )
s = editor->selectedText();
else
@@ -282,14 +282,14 @@ void MultiLineEditor::checkSpelling()
spell = new KSpell( this, i18n("Spell Checking"), 0, 0, 0, true, true, KSpell::HTML );
spell->setAutoDelete( true );
spell->check( s, true );
- connect( spell, SIGNAL( done(const QString &) ), this, SLOT( spellCheckDone(const QString &) ) );
+ connect( spell, TQT_SIGNAL( done(const TQString &) ), TQT_TQOBJECT(this), TQT_SLOT( spellCheckDone(const TQString &) ) );
spell->cleanUp();
#endif
*/
}
-void MultiLineEditor::spellCheckDone(const QString & buffer)
+void MultiLineEditor::spellCheckDone(const TQString & buffer)
{
editor->setText( buffer );
spell->cleanUp();
@@ -297,13 +297,13 @@ void MultiLineEditor::spellCheckDone(const QString & buffer)
void MultiLineEditor::save()
{
- QString name = KFileDialog::getSaveFileName ( NULL, "*", this );
+ TQString name = KFileDialog::getSaveFileName ( NULL, "*", this );
if( name.isEmpty() )
return;
- QFile file( name );
+ TQFile file( name );
if ( file.open( IO_WriteOnly ) ) {
- QTextStream ts( &file );
+ TQTextStream ts( &file );
ts << editor->text();
}
}
diff --git a/kbarcode/multilineeditdlg.h b/kbarcode/multilineeditdlg.h
index 8941950..9ab5813 100644
--- a/kbarcode/multilineeditdlg.h
+++ b/kbarcode/multilineeditdlg.h
@@ -18,7 +18,7 @@
#ifndef MULTILINEEDITDLG_H
#define MULTILINEEDITDLG_H
-#include <qwidget.h>
+#include <tqwidget.h>
#include "documentitem.h"
class KActionCollection;
@@ -31,18 +31,19 @@ class KSpellConfig;
class DSTextEdit;
class TokenProvider;
-class MultiLineEditor : public QWidget {
+class MultiLineEditor : public TQWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- MultiLineEditor( TokenProvider* token, QWidget *parent=0, const char *name=0);
+ MultiLineEditor( TokenProvider* token, TQWidget *tqparent=0, const char *name=0);
~MultiLineEditor();
- QString text();
- void setText( const QString & t );
+ TQString text();
+ void setText( const TQString & t );
private slots:
void setupActions();
void updateActions();
- void spellCheckDone(const QString & buffer);
+ void spellCheckDone(const TQString & buffer);
void save();
void updateFont();
diff --git a/kbarcode/mybarcode.cpp b/kbarcode/mybarcode.cpp
index 64160df..74eb5f8 100644
--- a/kbarcode/mybarcode.cpp
+++ b/kbarcode/mybarcode.cpp
@@ -21,11 +21,11 @@ f/***************************************************************************
#include "mybarcode.h"
#include <stdio.h>
-// Qt includes
-#include <qdir.h>
-#include <qpainter.h>
-#include <qpaintdevicemetrics.h>
-#include <qsqlquery.h>
+// TQt includes
+#include <tqdir.h>
+#include <tqpainter.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqsqlquery.h>
// KDE includes
#include <kapplication.h>
@@ -38,7 +38,7 @@ f/***************************************************************************
#define BARCODE_MARGIN 10 /* Margin added by GNU Barcode to the barcodes */
-QValueList<barcodeFormat> codes;
+TQValueList<barcodeFormat> codes;
void init() {
BarCode::setHaveBarcode();
@@ -76,7 +76,7 @@ BarCode::~BarCode()
{
}
-const QPixmap BarCode::pixmap()
+const TQPixmap BarCode::pixmap()
{
if( p.isNull() )
createBarcode( &p, KApplication::desktop() );
@@ -89,12 +89,12 @@ const QPixmap BarCode::pixmap()
return p;
}
-bool BarCode::createPixmap( QPixmap* target, int resx, int resy )
+bool BarCode::createPixmap( TQPixmap* target, int resx, int resy )
{
- KTempFile* output = new KTempFile( QString::null, ".ps" );;
+ KTempFile* output = new KTempFile( TQString(), ".ps" );;
output->file()->close();
- KTempFile* input = new KTempFile( QString::null, ".pbm" );
+ KTempFile* input = new KTempFile( TQString(), ".pbm" );
input->file()->close();
m_value = createSequence( barcode.value );
@@ -110,7 +110,7 @@ bool BarCode::createPixmap( QPixmap* target, int resx, int resy )
return false;
}
} else { // if( BarCode::hasFeature( barcode.type, GNU_BARCODE ) ) {
- QString flag = barcode.text ? "" : "-n";
+ TQString flag = barcode.text ? "" : "-n";
KShellProcess proc;
proc << "barcode" << "-E"
@@ -126,20 +126,20 @@ bool BarCode::createPixmap( QPixmap* target, int resx, int resy )
}
}
- QFileInfo fi( output->name() );
+ TQFileInfo fi( output->name() );
// if file size = 0, error in generation
if( !fi.size() ) {
cleanUp( output, input, target );
return false;
}
- QSize s = getBoundingBox( output->name() );
+ TQSize s = getBoundingBox( output->name() );
double sw = (double)s.width()/72 * resx;
double sh = (double)s.height()/72 * resy;
KShellProcess proc2;
- proc2 << "gs" << QString("-g%1x%2").arg(int(sw*(double)barcode.scale)).arg(int(sh*(double)barcode.scale))
- << "-r" + QString::number( resx*(double)barcode.scale ) + "x" + QString::number( resy*(double)barcode.scale )
+ proc2 << "gs" << TQString("-g%1x%2").tqarg(int(sw*(double)barcode.scale)).tqarg(int(sh*(double)barcode.scale))
+ << "-r" + TQString::number( resx*(double)barcode.scale ) + "x" + TQString::number( resy*(double)barcode.scale )
<< "-sDEVICE=pbmraw" << "-sOutputFile=" + input->name() << "-sNOPAUSE"
<< "-q " + output->name() << "-c showpage" << "-c quit";
@@ -163,14 +163,14 @@ bool BarCode::createPixmap( QPixmap* target, int resx, int resy )
return true;
}
-void BarCode::createBarcode( QPixmap* target, QPaintDevice* device )
+void BarCode::createBarcode( TQPixmap* target, TQPaintDevice* device )
{
- QPaintDeviceMetrics pdm( device );
+ TQPaintDeviceMetrics pdm( device );
int resx = pdm.logicalDpiX();
int resy = pdm.logicalDpiY();
- QString value = createSequence( barcode.value );
- QPixmap* cached = 0;//BarcodeCache::instance()->read( barcode, resx, resy, value );
+ TQString value = createSequence( barcode.value );
+ TQPixmap* cached = 0;//BarcodeCache::instance()->read( barcode, resx, resy, value );
// no matching barcode found in cache
if( !cached ) {
@@ -185,11 +185,11 @@ void BarCode::createBarcode( QPixmap* target, QPaintDevice* device )
// we have to scale to the correct resolution.
// we scale already here and not at the end,
// so that the addMargin function does not get a scaled margin.
- QPaintDeviceMetrics pdm( KApplication::desktop() );
+ TQPaintDeviceMetrics pdm( KApplication::desktop() );
int screenresx = pdm.logicalDpiX();
int screenresy = pdm.logicalDpiY();
- QWMatrix m;
+ TQWMatrix m;
double scalex = (resx/screenresx)*barcode.scale;
double scaley = (resy/screenresy)*barcode.scale;
m.scale( scalex, scaley );
@@ -199,7 +199,7 @@ void BarCode::createBarcode( QPixmap* target, QPaintDevice* device )
*target = addMargin( target, barcode.margin );
// Rotate
- QWMatrix m;
+ TQWMatrix m;
m.rotate( (double)barcode.rotation );
*target = target->xForm( m );
@@ -208,8 +208,8 @@ void BarCode::createBarcode( QPixmap* target, QPaintDevice* device )
bool BarCode::createPdf417( KTempFile* output )
{
- KTempFile text( QString::null, ".txt" );
- QTextStream t( text.file() );
+ KTempFile text( TQString(), ".txt" );
+ TQTextStream t( text.file() );
t << m_value;
text.file()->close();
@@ -235,7 +235,7 @@ bool BarCode::createPdf417( KTempFile* output )
bool BarCode::createTBarcode( KTempFile* output )
{
// print text
- QString flag = barcode.text ? "" : "n";
+ TQString flag = barcode.text ? "" : "n";
// escape text
flag.append( barcode.tbarcode.escape ? " son" : " soff" );
// autocorrection
@@ -246,17 +246,17 @@ bool BarCode::createTBarcode( KTempFile* output )
KShellProcess proc;
proc << "tbarcodeclient" << "-f" + output->name();
if( !BarCode::hasFeature( barcode.type, BARCODE2D ) )
- proc << QString( "m%1" ).arg( barcode.tbarcode.modulewidth * 1000 );
+ proc << TQString( "m%1" ).tqarg( barcode.tbarcode.modulewidth * 1000 );
if( BarCode::hasFeature( barcode.type, DATAMATRIX ) )
- proc << QString( "Ds%1" ).arg( barcode.datamatrix.size );
+ proc << TQString( "Ds%1" ).tqarg( barcode.datamatrix.size );
if( BarCode::hasFeature( barcode.type, PDF417BARCODE ) )
- proc << QString( "Pr%1 Pc%2 Pe%3" ).arg( barcode.pdf417.row )
- .arg( barcode.pdf417.col )
- .arg( barcode.pdf417.err );
+ proc << TQString( "Pr%1 Pc%2 Pe%3" ).tqarg( barcode.pdf417.row )
+ .tqarg( barcode.pdf417.col )
+ .tqarg( barcode.pdf417.err );
- proc << barcode.type << "tPS" << QString("c%1").arg( barcode.tbarcode.checksum ) << flag << "d" + KShellProcess::quote( m_value );
+ proc << barcode.type << "tPS" << TQString("c%1").tqarg( barcode.tbarcode.checksum ) << flag << "d" + KShellProcess::quote( m_value );
proc.start( KProcess::Block, KProcess::NoCommunication );
proc.resume();
@@ -266,7 +266,7 @@ bool BarCode::createTBarcode( KTempFile* output )
return true;
}
-const QPixmap BarCode::printerPixmap( QPaintDevice* device )
+const TQPixmap BarCode::printerPixmap( TQPaintDevice* device )
{
if( pp.isNull() )
createBarcode( &pp, device );
@@ -313,15 +313,15 @@ void BarCode::redrawBarcode()
pp.resize( 0, 0 );
}
-QPixmap BarCode::cut( QPixmap* pic, double cut)
+TQPixmap BarCode::cut( TQPixmap* pic, double cut)
{
if( cut == 1.0 )
return (*pic);
- QPixmap pcut( pic->width(), int((double)pic->height() * cut) );
- pcut.fill( Qt::white ); // barcode.bg
+ TQPixmap pcut( pic->width(), int((double)pic->height() * cut) );
+ pcut.fill( TQt::white ); // barcode.bg
- QWMatrix m;
+ TQWMatrix m;
/*
* if text is above the barcode cut from
* below the barcode.
@@ -334,15 +334,15 @@ QPixmap BarCode::cut( QPixmap* pic, double cut)
} else
m.rotate( 180 );
- QPainter painter( &pcut );
+ TQPainter painter( &pcut );
painter.drawPixmap( 0, 0, pic->xForm( m ) );
return pcut.xForm( m );
}
-QPixmap BarCode::addMargin( QPixmap* pic, int margin )
+TQPixmap BarCode::addMargin( TQPixmap* pic, int margin )
{
- QPixmap p;
+ TQPixmap p;
/* We have to handle UPC special because of the checksum character
* which is printed on the right margin.
@@ -366,32 +366,32 @@ QPixmap BarCode::addMargin( QPixmap* pic, int margin )
} else
p.resize( pic->width() + int(margin*2 - barm * 2), pic->height() + int(margin * 2 - barm * 2) );
- p.fill( Qt::white ); // barcode.bg
- QPainter painter( &p );
+ p.fill( TQt::white ); // barcode.bg
+ TQPainter painter( &p );
painter.drawPixmap( margin, margin, *pic, (int)sx, (int)sy, (int)sw, (int)sh );
painter.end();
return p;
}
-const QString BarCode::getMaxLength( const QString & name )
+const TQString BarCode::getMaxLength( const TQString & name )
{
- QSqlQuery query("select uid, (length(barcode_no)) as LEN from " TABLE_BASIC
+ TQSqlQuery query("select uid, (length(barcode_no)) as LEN from " TABLE_BASIC
" where encoding_type = '" + name +"' ORDER by LEN DESC LIMIT 1" );
while( query.next() ) {
- QSqlQuery queryuid("select barcode_no from barcode_basic where uid = '"
+ TQSqlQuery queryuid("select barcode_no from barcode_basic where uid = '"
+ query.value( 0 ).toString() + "'" );
while( queryuid.next() )
if(!queryuid.value( 0 ).toString().isEmpty())
return queryuid.value( 0 ).toString();
}
- QSqlQuery query1("select uid, (length(barcode_no)) as LEN from " TABLE_CUSTOMER_TEXT
+ TQSqlQuery query1("select uid, (length(barcode_no)) as LEN from " TABLE_CUSTOMER_TEXT
" where encoding_type = '" + name +"' ORDER by LEN DESC LIMIT 1" );
while( query1.next() ) {
- QSqlQuery queryuid("select barcode_no from customer_text where uid = '"
+ TQSqlQuery queryuid("select barcode_no from customer_text where uid = '"
+ query1.value( 0 ).toString() + "'" );
while( queryuid.next() )
if(!queryuid.value( 0 ).toString().isEmpty())
@@ -401,7 +401,7 @@ const QString BarCode::getMaxLength( const QString & name )
return "1234567";
}
-void BarCode::cleanUp( KTempFile* file, KTempFile* file2, QPixmap* target )
+void BarCode::cleanUp( KTempFile* file, KTempFile* file2, TQPixmap* target )
{
target->resize( 0, 0 );
@@ -411,26 +411,26 @@ void BarCode::cleanUp( KTempFile* file, KTempFile* file2, QPixmap* target )
delete file2;
}
-QString BarCode::createSequence( const QString & value )
+TQString BarCode::createSequence( const TQString & value )
{
if( !barcode.sequence.enabled )
return value;
- if( value.contains( '#' ) <= 0 )
+ if( value.tqcontains( '#' ) <= 0 )
return value;
- QString text = value;
+ TQString text = value;
int pos = 0, counter = 1;
- pos = text.find("#", pos);
+ pos = text.tqfind("#", pos);
pos++;
while( text[pos] == '#' ) {
text.remove(pos, 1);
counter++;
}
- pos = text.find("#", 0);
- QString temp;
+ pos = text.tqfind("#", 0);
+ TQString temp;
if( barcode.sequence.mode == NUM ) {
int v = barcode.sequence.start + m_index*barcode.sequence.step;
@@ -446,11 +446,11 @@ QString BarCode::createSequence( const QString & value )
v -= z*('Z'-'A');
if( v <= 'Z' ) {
- temp[p] = QChar(v);
+ temp[p] = TQChar(v);
break;
} else if( v > 'Z' )
v = 'Z';
- temp[p] = QChar(v);
+ temp[p] = TQChar(v);
} else if( barcode.sequence.mode == ALPHANUM ) {
qDebug("NOT IMPLEMENTED");
/* char array[36];
@@ -467,17 +467,17 @@ QString BarCode::createSequence( const QString & value )
}
}
- text.replace( pos, 1, temp);
+ text.tqreplace( pos, 1, temp);
return text;
}
-QString BarCode::sequenceValue()
+TQString BarCode::sequenceValue()
{
return createSequence( barcode.value );
}
-bool BarCode::hasFeature( const QString & type, unsigned int feature )
+bool BarCode::hasFeature( const TQString & type, unsigned int feature )
{
for( unsigned int i = 0; i < codes.count(); i++ )
if( codes[i].name == type )
@@ -486,14 +486,14 @@ bool BarCode::hasFeature( const QString & type, unsigned int feature )
return false;
}
-QSize BarCode::getBoundingBox( const QString & filename )
+TQSize BarCode::getBoundingBox( const TQString & filename )
{
- QSize s(0,0);
- QFile f( filename );
+ TQSize s(0,0);
+ TQFile f( filename );
if( !f.open( IO_ReadOnly ) )
return s;
- QString t;
+ TQString t;
while( f.readLine( t, 1000 ) != -1 )
{
if( t.startsWith( "%%BoundingBox:") )
@@ -504,7 +504,7 @@ QSize BarCode::getBoundingBox( const QString & filename )
int h = 0;
t = t.right( t.length() - 14 );
sscanf( (const char*)t, "%d %d %d %d", &x, &y, &w, &h );
- s = QSize( w, h );
+ s = TQSize( w, h );
break;
}
}
@@ -517,7 +517,7 @@ bool BarCode::m_haveGnuBarcode = false;
bool BarCode::m_havePdfEncode = false;
bool BarCode::m_haveTBarcode = false;
-barcodeFormat BarCode::fillStruct( const QString & name, const QString & text, const int feature )
+barcodeFormat BarCode::fillStruct( const TQString & name, const TQString & text, const int feature )
{
barcodeFormat t;
t.name = name;
diff --git a/kbarcode/mybarcode.h b/kbarcode/mybarcode.h
index 5865b2d..2ba514e 100644
--- a/kbarcode/mybarcode.h
+++ b/kbarcode/mybarcode.h
@@ -18,10 +18,10 @@
#ifndef MY_BARCODE_H
#define MY_BARCODE_H
-#include <qpixmap.h>
-#include <qobject.h>
+#include <tqpixmap.h>
+#include <tqobject.h>
-#include <qvaluelist.h>
+#include <tqvaluelist.h>
#include "barkode.h"
void init();
@@ -42,11 +42,11 @@ typedef union u_settings {
} tbarcode;
};
-class QColor;
-class QString;
+class TQColor;
+class TQString;
typedef struct barcodeData {
- QString value;
- QString type;
+ TQString value;
+ TQString type;
int margin;
int rotation;
double scale;
@@ -91,7 +91,7 @@ typedef struct barcodeData {
// only important
// when this struct
// is read from XML
- QString caption;
+ TQString caption;
int x;
int y;
} xml;
@@ -136,16 +136,16 @@ enum { NOCUT = 0x00001, MULTILINE = 0x00002, NOTEXT = 0x00004, NOSCALE = 0x00008
#endif
typedef struct barcodeFormat {
- QString name;
- QString text;
+ TQString name;
+ TQString text;
unsigned int features;
};
class KProcess;
class KTempFile;
-class QPaintDevice;
+class TQPaintDevice;
/**
- * This class creates a QPixmap from a barcodeData struct.
+ * This class creates a TQPixmap from a barcodeData struct.
* Several backends are supported to generate the pixmap.
* GNU Barcode
* pdf417_enc
@@ -167,7 +167,7 @@ class QPaintDevice;
* data.value = "KBARCODE";
* data.type = "code39";
* BarCode b( &data ); // create a barcode object
- * QPixmap p = b.pixmap(); // get a pixmap of the barcode
+ * TQPixmap p = b.pixmap(); // get a pixmap of the barcode
* </pre>
*
* @see BarcodeCache @see BarcodeWidget
@@ -185,15 +185,15 @@ class BarCode {
BarCode();
~BarCode();
- /** Get a QPixmap of the current barcodeData in
+ /** Get a TQPixmap of the current barcodeData in
* screen resolution-
*/
- const QPixmap pixmap();
- /** Get a QPixmap of the barcode in the same resolution as the
- * QPaintDevice* @p device. This is necessary if you want to print
+ const TQPixmap pixmap();
+ /** Get a TQPixmap of the barcode in the same resolution as the
+ * TQPaintDevice* @p device. This is necessary if you want to print
* your barcodes, as they won't be scanable in screen resolution.
*/
- const QPixmap printerPixmap( QPaintDevice* device );
+ const TQPixmap printerPixmap( TQPaintDevice* device );
/** Set the index of the barcodes for barcode sequences.
*/
@@ -205,7 +205,7 @@ class BarCode {
barcodeData data() const { return barcode; }
- QString sequenceValue();
+ TQString sequenceValue();
/** Fill @p barcodeData* data with its default parameters.
* Always call this function, after you have created a new
@@ -214,18 +214,18 @@ class BarCode {
static void fillDefault( barcodeData* data );
/** Test if the encodingType @p type has a certain
- * @p feature, as defined in the codes QValueList.
+ * @p feature, as defined in the codes TQValueList.
*/
- static bool hasFeature( const QString & type, unsigned int feature );
+ static bool hasFeature( const TQString & type, unsigned int feature );
/** get the meximum length of value for the encoding type @p name
* from the SQL databases.
*/
- static const QString getMaxLength( const QString & name );
+ static const TQString getMaxLength( const TQString & name );
/** This function has to be called befor barcode support is avaible.
* It searches for the barcode generation backends
- * (gnu barcode, tbarcode and pdf417) and fills the QValueList codes
+ * (gnu barcode, tbarcode and pdf417) and fills the TQValueList codes
* with data and information about the avaible barcode encoding types.
* You only have to call this function once.
* The results can be retrieved with the following functions:
@@ -252,49 +252,49 @@ class BarCode {
*/
void redrawBarcode();
private:
- bool createPixmap( QPixmap* target, int resx, int resy );
- void createBarcode( QPixmap* target, QPaintDevice* device );
+ bool createPixmap( TQPixmap* target, int resx, int resy );
+ void createBarcode( TQPixmap* target, TQPaintDevice* device );
bool createPdf417( KTempFile* output );
bool createTBarcode( KTempFile* output );
- QString createSequence( const QString & value );
+ TQString createSequence( const TQString & value );
/** reads the bounding box information from a postscript file
*/
- QSize getBoundingBox( const QString & filename );
+ TQSize getBoundingBox( const TQString & filename );
- void cleanUp( KTempFile* file, KTempFile* file2, QPixmap* target );
- static barcodeFormat fillStruct( const QString & name, const QString & text, const int feature );
+ void cleanUp( KTempFile* file, KTempFile* file2, TQPixmap* target );
+ static barcodeFormat fillStruct( const TQString & name, const TQString & text, const int feature );
/**
* Cut the barcode either on the top or
* on the bottom, depending on the text position.
*
- * @param pic the QPixmap that will be cutted
+ * @param pic the TQPixmap that will be cutted
* @param cut a value between 0.0 and 1.0. If cut = 1.0
* then no cut will happen, if cut = 0.5, half of
* the barcode is going to be cutted away.
*/
- QPixmap cut( QPixmap* pic, double cut );
+ TQPixmap cut( TQPixmap* pic, double cut );
/**
- * Add a margin to the QPixmap pic.
- * @param pic the QPixmap pic which should get a margin
+ * Add a margin to the TQPixmap pic.
+ * @param pic the TQPixmap pic which should get a margin
* @param margin the margin size in pixels.
*/
- QPixmap addMargin( QPixmap* pic, int margin );
+ TQPixmap addMargin( TQPixmap* pic, int margin );
/**
* The barcode is generated from this value.
* This is necessary so that sequences will work.
*/
- QString m_value;
+ TQString m_value;
/** index for barcode sequences;
*/
int m_index;
- QPixmap p;
- QPixmap pp;
+ TQPixmap p;
+ TQPixmap pp;
barcodeData barcode;
static bool m_haveGnuBarcode;
static bool m_havePdfEncode;
diff --git a/kbarcode/mycanvasitem.cpp b/kbarcode/mycanvasitem.cpp
index 43cc56d..4338451 100644
--- a/kbarcode/mycanvasitem.cpp
+++ b/kbarcode/mycanvasitem.cpp
@@ -23,15 +23,15 @@
#include <kapplication.h>
// QT includes
-#include <qbitmap.h>
-#include <qpainter.h>
+#include <tqbitmap.h>
+#include <tqpainter.h>
SpotProvider::SpotProvider()
{
- m_spot = new QPixmap( SPOTSIZE, SPOTSIZE );
- m_spot->fill( Qt::green );
+ m_spot = new TQPixmap( SPOTSIZE, SPOTSIZE );
+ m_spot->fill( TQt::green );
- QPainter p( m_spot );
+ TQPainter p( m_spot );
p.drawRect( 0, 0, SPOTSIZE, SPOTSIZE );
p.end();
}
@@ -42,7 +42,7 @@ SpotProvider::~SpotProvider()
}
SpotProvider* SpotProvider::instance = 0;
-QPixmap* SpotProvider::m_spot = 0;
+TQPixmap* SpotProvider::m_spot = 0;
SpotProvider* SpotProvider::getInstance()
{
diff --git a/kbarcode/mycanvasitem.h b/kbarcode/mycanvasitem.h
index a01d9c2..81a35d3 100644
--- a/kbarcode/mycanvasitem.h
+++ b/kbarcode/mycanvasitem.h
@@ -18,15 +18,15 @@
#ifndef MYCANVASITEM_H
#define MYCANVASITEM_H
-#include <qcanvas.h>
-#include <qpoint.h>
-#include <qimage.h>
-#include <qpicture.h>
+#include <tqcanvas.h>
+#include <tqpoint.h>
+#include <tqimage.h>
+#include <tqpicture.h>
#include "tokenprovider.h"
#define SPOTSIZE 7
-class QPixmap;
+class TQPixmap;
/** A very small singleton, which creates a pixmap
* for the accesor points in the label editor.
*
@@ -36,7 +36,7 @@ class SpotProvider {
public:
static SpotProvider* getInstance();
- const QPixmap* spot() const {
+ const TQPixmap* spot() const {
return m_spot;
}
@@ -45,7 +45,7 @@ class SpotProvider {
~SpotProvider();
static SpotProvider* instance;
- static QPixmap* m_spot;
+ static TQPixmap* m_spot;
};
diff --git a/kbarcode/mycanvasview.cpp b/kbarcode/mycanvasview.cpp
index b9bd295..9620412 100644
--- a/kbarcode/mycanvasview.cpp
+++ b/kbarcode/mycanvasview.cpp
@@ -21,21 +21,21 @@
#include "measurements.h"
#include "kbarcodesettings.h"
-// Qt includes
-#include <qcursor.h>
-#include <qpainter.h>
-#include <qpaintdevicemetrics.h>
+// TQt includes
+#include <tqcursor.h>
+#include <tqpainter.h>
+#include <tqpaintdevicemetrics.h>
// KDE includes
#include <kruler.h>
#include <kstatusbar.h>
-MyCanvas::MyCanvas( QObject* parent, const char* name )
- : QCanvas( parent, name )
+MyCanvas::MyCanvas( TQObject* tqparent, const char* name )
+ : TQCanvas( tqparent, name )
{
m_grid = false;
- setBackgroundColor( Qt::lightGray );
+ setBackgroundColor( TQt::lightGray );
resize( 0, 0 );
}
@@ -44,27 +44,27 @@ MyCanvas::~MyCanvas()
{
}
-void MyCanvas::drawBackground( QPainter & painter, const QRect & clip )
+void MyCanvas::drawBackground( TQPainter & painter, const TQRect & clip )
{
- QCanvas::drawBackground( painter, clip );
+ TQCanvas::drawBackground( painter, clip );
- QRect shadow1( int(m_rect.x() + m_rect.width()), m_rect.y() + 5, 5, m_rect.height() );
- QRect shadow2( m_rect.x()+ 5, int(m_rect.y() + m_rect.height()), m_rect.width(), 5 );
+ TQRect shadow1( int(m_rect.x() + m_rect.width()), m_rect.y() + 5, 5, m_rect.height() );
+ TQRect shadow2( m_rect.x()+ 5, int(m_rect.y() + m_rect.height()), m_rect.width(), 5 );
// draw background shadow
if( clip.intersects( shadow1 ) )
- painter.fillRect( shadow1, Qt::black );
+ painter.fillRect( shadow1, TQt::black );
if( clip.intersects( shadow2 ) )
- painter.fillRect( shadow2, Qt::black );
+ painter.fillRect( shadow2, TQt::black );
if( clip.intersects( m_rect ) ) {
- painter.fillRect( m_rect, Qt::white );
+ painter.fillRect( m_rect, TQt::white );
if( m_grid ) {
painter.translate( m_rect.x(), m_rect.y() );
- painter.setPen( QPen( KBarcodeSettings::getInstance()->gridColor(), 0 ) );
+ painter.setPen( TQPen( KBarcodeSettings::getInstance()->gridColor(), 0 ) );
for( int y = 0; y <= m_rect.height(); y += KBarcodeSettings::getInstance()->gridSize() )
for( int x = 0; x <= m_rect.width(); x += KBarcodeSettings::getInstance()->gridSize() )
painter.drawPoint( x, y );
@@ -74,8 +74,8 @@ void MyCanvas::drawBackground( QPainter & painter, const QRect & clip )
}
}
-MyCanvasView::MyCanvasView( Definition* d, MyCanvas* c, QWidget* parent, const char* name, WFlags f)
- : QCanvasView(c,parent,name,f)
+MyCanvasView::MyCanvasView( Definition* d, MyCanvas* c, TQWidget* tqparent, const char* name, WFlags f)
+ : TQCanvasView(c,tqparent,name,f)
{
statusbar = 0;
m_commov = 0;
@@ -101,7 +101,7 @@ MyCanvasView::~MyCanvasView()
{
}
-void MyCanvasView::snapPoint(QPoint * point, TCanvasItem* item )
+void MyCanvasView::snapPoint(TQPoint * point, TCanvasItem* item )
{
// move item to next grid position
// TODO: align the top left to the grid not the current mouse position!
@@ -140,18 +140,18 @@ void MyCanvasView::snapPoint(QPoint * point, TCanvasItem* item )
}
}
-void MyCanvasView::contentsMouseMoveEvent(QMouseEvent* e)
+void MyCanvasView::contentsMouseMoveEvent(TQMouseEvent* e)
{
rulerh->slotNewValue( e->x() );
rulerv->slotNewValue( e->y() );
if( statusbar ) {
LabelUtils l;
- int x = (int)l.pixelToMm( e->x(), this, LabelUtils::DpiX );
- int y = (int)l.pixelToMm( e->y(), this, LabelUtils::DpiY );
+ int x = (int)l.pixelToMm( e->x(), TQT_TQPAINTDEVICE(this), LabelUtils::DpiX );
+ int y = (int)l.pixelToMm( e->y(), TQT_TQPAINTDEVICE(this), LabelUtils::DpiY );
statusbar->changeItem( i18n("Position: ") +
- QString( "%1%2 x %3%4" ).arg( x )
- .arg( Measurements::system() ).arg( y ).arg( Measurements::system()), mouseid );
+ TQString( "%1%2 x %3%4" ).tqarg( x )
+ .tqarg( Measurements::system() ).tqarg( y ).tqarg( Measurements::system()), mouseid );
}
updateCursor( e->pos() );
@@ -162,25 +162,25 @@ void MyCanvasView::contentsMouseMoveEvent(QMouseEvent* e)
return;
}
- bool shift_pressed = e->state() & Qt::ShiftButton;
+ bool shift_pressed = e->state() & TQt::ShiftButton;
TCanvasItem* moving = getActive();
if( moving && !moving->item()->locked() ) {
- QPoint p = inverseWorldMatrix().map(e->pos());
+ TQPoint p = inverseWorldMatrix().map(e->pos());
if( m_mode == Barcode || m_mode == Inside ) {
TCanvasItemList list = getSelected();
for( unsigned int i = 0; i < list.count(); i++ ) {
TCanvasItem* moving = list[i];
- QPoint new_pt = QPoint(p.x() - delta_pt.x(),p.y() - delta_pt.y());
+ TQPoint new_pt = TQPoint(p.x() - delta_pt.x(),p.y() - delta_pt.y());
if( canv->grid() ) {
snapPoint(&new_pt, moving) ;
}
LabelUtils l;
- QPoint pmm;
- pmm.setX( (int)l.pixelToMm( new_pt.x() - getTranslation().x(), this, LabelUtils::DpiX ) * 1000 );
- pmm.setY( (int)l.pixelToMm( new_pt.y() - getTranslation().y(), this, LabelUtils::DpiY ) * 1000 );
+ TQPoint pmm;
+ pmm.setX( (int)l.pixelToMm( new_pt.x() - getTranslation().x(), TQT_TQPAINTDEVICE(this), LabelUtils::DpiX ) * 1000 );
+ pmm.setY( (int)l.pixelToMm( new_pt.y() - getTranslation().y(), TQT_TQPAINTDEVICE(this), LabelUtils::DpiY ) * 1000 );
// Move the item
MoveCommand* mv = new MoveCommand( pmm.x() - moving->item()->rectMM().x(),
@@ -196,11 +196,11 @@ void MyCanvasView::contentsMouseMoveEvent(QMouseEvent* e)
LabelUtils l;
- QPoint pmm;
- pmm.setX( (int)l.pixelToMm( p.x() - getTranslation().x(), this, LabelUtils::DpiX ) * 1000 );
- pmm.setY( (int)l.pixelToMm( p.y() - getTranslation().y(), this, LabelUtils::DpiY ) * 1000 );
+ TQPoint pmm;
+ pmm.setX( (int)l.pixelToMm( p.x() - getTranslation().x(), TQT_TQPAINTDEVICE(this), LabelUtils::DpiX ) * 1000 );
+ pmm.setY( (int)l.pixelToMm( p.y() - getTranslation().y(), TQT_TQPAINTDEVICE(this), LabelUtils::DpiY ) * 1000 );
- QRect rmm = moving->item()->rectMM();
+ TQRect rmm = moving->item()->rectMM();
ResizeCommand* mv = new ResizeCommand( moving, shift_pressed );
switch( m_mode ) {
@@ -241,28 +241,28 @@ void MyCanvasView::contentsMouseMoveEvent(QMouseEvent* e)
}
}
-void MyCanvasView::contentsMousePressEvent(QMouseEvent* e)
+void MyCanvasView::contentsMousePressEvent(TQMouseEvent* e)
{
- setActive( 0, e->state() & Qt::ControlButton );
+ setActive( 0, e->state() & TQt::ControlButton );
- QCanvasItemList list = canvas()->allItems();
+ TQCanvasItemList list = canvas()->allItems();
for( int z = MyCanvasView::getLowestZ( list ); z <= MyCanvasView::getHighestZ( list ); z++ )
for( unsigned int i = 0; i < list.count(); i++ )
if( list[i]->z() == z && isInside( e->pos(), list[i] ) )
- setActive( list[i], (e->state() & Qt::ControlButton) );
+ setActive( list[i], (e->state() & TQt::ControlButton) );
if( getActive() ) {
moving_start = inverseWorldMatrix().map(e->pos());
m_mode = updateCursor( e->pos() );
old = getActive()->boundingRect();
- delta_pt=QPoint(e->x() - old.x(),e->y() - old.y());
+ delta_pt=TQPoint(e->x() - old.x(),e->y() - old.y());
}
if( e->button() == Qt::RightButton && getActive() )
emit showContextMenu( e->globalPos() );
}
-void MyCanvasView::contentsMouseReleaseEvent(QMouseEvent* e)
+void MyCanvasView::contentsMouseReleaseEvent(TQMouseEvent* e)
{
if( e->button() != Qt::LeftButton || getSelected().isEmpty() )
return;
@@ -283,10 +283,10 @@ KMacroCommand* MyCanvasView::getMoveCommand()
return m_commov;
}
-void MyCanvasView::contentsMouseDoubleClickEvent(QMouseEvent* e)
+void MyCanvasView::contentsMouseDoubleClickEvent(TQMouseEvent* e)
{
setActive( 0 );
- QCanvasItemList list = canvas()->allItems();
+ TQCanvasItemList list = canvas()->allItems();
for( int z = MyCanvasView::getHighestZ( list ); z >= MyCanvasView::getLowestZ( list ); z-- )
for( unsigned int i = 0; i < list.count(); i++ )
if( list[i]->z() == z && isInside( e->pos(), list[i] ) ) {
@@ -296,20 +296,20 @@ void MyCanvasView::contentsMouseDoubleClickEvent(QMouseEvent* e)
}
}
-bool MyCanvasView::isInside( QPoint p, QCanvasItem* item )
+bool MyCanvasView::isInside( TQPoint p, TQCanvasItem* item )
{
if( !item->isVisible() )
return false;
- return item->boundingRect().contains( p );
+ return item->boundingRect().tqcontains( p );
}
-int MyCanvasView::isEdge( QPoint p, QCanvasItem* item )
+int MyCanvasView::isEdge( TQPoint p, TQCanvasItem* item )
{
if( !isInside( p, item ) )
return Outside;
- QRect r = item->boundingRect();
+ TQRect r = item->boundingRect();
int rh = r.y() + r.height();
int rw = r.x() + r.width();
@@ -387,7 +387,7 @@ void MyCanvasView::deleteCurrent()
}
}
-void MyCanvasView::setCurrent( QCanvasItem* item )
+void MyCanvasView::setCurrent( TQCanvasItem* item )
{
setSelected( item );
setActive( item );
@@ -399,13 +399,13 @@ void MyCanvasView::updateRuler()
rulerv->setGeometry( 0, 20, 20, height() - 20 );
if( def ) {
- canv->setRect( QRect( translation.x(), translation.y(), (int)def->getMeasurements().width( this ), (int)def->getMeasurements().height( this )) );
+ canv->setRect( TQRect( translation.x(), translation.y(), (int)def->getMeasurements().width( TQT_TQPAINTDEVICE(this) ), (int)def->getMeasurements().height( TQT_TQPAINTDEVICE(this) )) );
rulerv->setMaxValue( height() );
rulerh->setMaxValue( width() );
- QPaintDeviceMetrics pdm( this );
+ TQPaintDeviceMetrics pdm( this );
if( Measurements::measurementSystem() == Measurements::Metric ) {
rulerh->setPixelPerMark( (1/ 25.4)* pdm.logicalDpiX() );
rulerv->setPixelPerMark( (1/25.4)* pdm.logicalDpiY() );
@@ -414,20 +414,20 @@ void MyCanvasView::updateRuler()
}
-void MyCanvasView::resizeEvent( QResizeEvent * r )
+void MyCanvasView::resizeEvent( TQResizeEvent * r )
{
setUpdatesEnabled( false );
- QPoint old = translation;
+ TQPoint old = translation;
- QCanvasView::resizeEvent( r );
+ TQCanvasView::resizeEvent( r );
reposition();
updateRuler();
- repaintContents();
+ tqrepaintContents();
old = translation - old;
- QCanvasItemList list = canvas()->allItems();
+ TQCanvasItemList list = canvas()->allItems();
for( unsigned int i = 0; i < list.count(); i++ )
list[i]->moveBy( old.x(), old.y() );
@@ -443,21 +443,21 @@ void MyCanvasView::reposition()
* and multiply with the new one.
* As a result we have the correct width.
*/
- int x = int((width() - (def->getMeasurements().width( this )) ) / 2);
- int y = int((height() - (def->getMeasurements().height( this )) ) / 2);
+ int x = int((width() - (def->getMeasurements().width( TQT_TQPAINTDEVICE(this) )) ) / 2);
+ int y = int((height() - (def->getMeasurements().height( TQT_TQPAINTDEVICE(this) )) ) / 2);
// move label 30 pixels away from top/left if necessary
x = x > 0 ? x : 30;
y = y > 0 ? y : 30;
// make sure that there is some space around the label, therefore at 60 pixel
- int w = ( this->width() - 2 > def->getMeasurements().width( this ) ? this->width() - 2 : int(def->getMeasurements().width( this ) + 60) );
- int h = ( this->height() - 2 > def->getMeasurements().height( this ) ? this->height() - 2 : int(def->getMeasurements().height( this ) + 60) );
+ int w = ( this->width() - 2 > def->getMeasurements().width( TQT_TQPAINTDEVICE(this) ) ? this->width() - 2 : int(def->getMeasurements().width( TQT_TQPAINTDEVICE(this) ) + 60) );
+ int h = ( this->height() - 2 > def->getMeasurements().height( TQT_TQPAINTDEVICE(this) ) ? this->height() - 2 : int(def->getMeasurements().height( TQT_TQPAINTDEVICE(this) ) + 60) );
canvas()->resize( w, h );
- translation = QPoint( x, y );
+ translation = TQPoint( x, y );
}
void MyCanvasView::setDefinition( Definition* d )
@@ -465,12 +465,12 @@ void MyCanvasView::setDefinition( Definition* d )
def = d;
reposition();
updateRuler();
- repaintContents( true );
+ tqrepaintContents( true );
}
void MyCanvasView::selectAll()
{
- QCanvasItemList list = canvas()->allItems();
+ TQCanvasItemList list = canvas()->allItems();
for( unsigned int i = 0; i < list.count(); i++ )
setSelected( list[i], true );
}
@@ -480,7 +480,7 @@ void MyCanvasView::deSelectAll()
setSelected( 0 );
}
-int MyCanvasView::getLowestZ( QCanvasItemList list )
+int MyCanvasView::getLowestZ( TQCanvasItemList list )
{
int v = 0;
for( unsigned int i = 0; i < list.count(); i++ )
@@ -490,7 +490,7 @@ int MyCanvasView::getLowestZ( QCanvasItemList list )
return v;
}
-int MyCanvasView::getHighestZ( QCanvasItemList list )
+int MyCanvasView::getHighestZ( TQCanvasItemList list )
{
int v = 0;
for( unsigned int i = 0; i < list.count(); i++ )
@@ -502,7 +502,7 @@ int MyCanvasView::getHighestZ( QCanvasItemList list )
TCanvasItem* MyCanvasView::getActive()
{
- QCanvasItemList list = canvas()->allItems();
+ TQCanvasItemList list = canvas()->allItems();
for( unsigned int i = 0; i < list.count(); i++ )
if( list[i]->isActive() )
return (TCanvasItem*)list[i];
@@ -510,10 +510,10 @@ TCanvasItem* MyCanvasView::getActive()
return 0;
}
-void MyCanvasView::setActive( QCanvasItem* item, bool control )
+void MyCanvasView::setActive( TQCanvasItem* item, bool control )
{
emit selectionChanged();
- QCanvasItemList list = canvas()->allItems();
+ TQCanvasItemList list = canvas()->allItems();
for( unsigned int i = 0; i < list.count(); i++ )
list[i]->setActive( false );
@@ -527,7 +527,7 @@ DocumentItemList MyCanvasView::getAllItems()
{
DocumentItemList l;
- QCanvasItemList list = canvas()->allItems();
+ TQCanvasItemList list = canvas()->allItems();
for( unsigned int i = 0; i < list.count(); i++ )
l.append( ((TCanvasItem*)list[i])->item() );
@@ -537,7 +537,7 @@ DocumentItemList MyCanvasView::getAllItems()
TCanvasItemList MyCanvasView::getSelected()
{
TCanvasItemList l;
- QCanvasItemList list = canvas()->allItems();
+ TQCanvasItemList list = canvas()->allItems();
for( unsigned int i = 0; i < list.count(); i++ )
if( list[i]->isSelected() )
l.append( (TCanvasItem*)list[i] );
@@ -545,10 +545,10 @@ TCanvasItemList MyCanvasView::getSelected()
return l;
}
-void MyCanvasView::setSelected( QCanvasItem* item, bool control )
+void MyCanvasView::setSelected( TQCanvasItem* item, bool control )
{
if( !control ) {
- QCanvasItemList list = canvas()->allItems();
+ TQCanvasItemList list = canvas()->allItems();
for( unsigned int i = 0; i < list.count(); i++ )
list[i]->setSelected( false );
}
@@ -557,10 +557,10 @@ void MyCanvasView::setSelected( QCanvasItem* item, bool control )
item->setSelected( true );
}
-int MyCanvasView::updateCursor( QPoint pos, bool pressed )
+int MyCanvasView::updateCursor( TQPoint pos, bool pressed )
{
if( !getActive() ) {
- this->setCursor( QCursor::ArrowCursor );
+ this->setCursor( TQCursor::ArrowCursor );
return -1;
}
@@ -568,12 +568,12 @@ int MyCanvasView::updateCursor( QPoint pos, bool pressed )
if( getActive()->item()->locked() )
{
- pressed && mode != Outside ? setCursor( Qt::ForbiddenCursor ) : setCursor( QCursor::ArrowCursor );
+ pressed && mode != Outside ? setCursor( TQt::ForbiddenCursor ) : setCursor( TQCursor::ArrowCursor );
return mode;
}
if( getActive()->rtti() == eRtti_Barcode ) {
- pressed && mode != Outside ? setCursor( QCursor::SizeAllCursor ) : setCursor( QCursor::ArrowCursor );
+ pressed && mode != Outside ? setCursor( TQCursor::SizeAllCursor ) : setCursor( TQCursor::ArrowCursor );
mode = Barcode;
return mode;
}
@@ -581,26 +581,26 @@ int MyCanvasView::updateCursor( QPoint pos, bool pressed )
switch( mode ) {
case TopLeft:
case BottomRight:
- this->setCursor( QCursor::SizeFDiagCursor );
+ this->setCursor( TQCursor::SizeFDiagCursor );
break;
case TopMiddle:
case BottomMiddle:
- this->setCursor( QCursor::SizeVerCursor );
+ this->setCursor( TQCursor::SizeVerCursor );
break;
case TopRight:
case BottomLeft:
- this->setCursor( QCursor::SizeBDiagCursor );
+ this->setCursor( TQCursor::SizeBDiagCursor );
break;
case RightMiddle:
case LeftMiddle:
- this->setCursor( QCursor::SizeHorCursor );
+ this->setCursor( TQCursor::SizeHorCursor );
break;
case Inside:
- pressed ? setCursor( QCursor::SizeAllCursor ) : setCursor( QCursor::ArrowCursor );
+ pressed ? setCursor( TQCursor::SizeAllCursor ) : setCursor( TQCursor::ArrowCursor );
break;
case Outside:
default:
- this->setCursor( QCursor::ArrowCursor );
+ this->setCursor( TQCursor::ArrowCursor );
break;
};
diff --git a/kbarcode/mycanvasview.h b/kbarcode/mycanvasview.h
index 0922717..e1bfb67 100644
--- a/kbarcode/mycanvasview.h
+++ b/kbarcode/mycanvasview.h
@@ -18,29 +18,30 @@
#ifndef MYCANVASVIEW_H
#define MYCANVASVIEW_H
-#include <qcanvas.h>
-#include <qvaluelist.h>
+#include <tqcanvas.h>
+#include <tqvaluelist.h>
#include "documentitem.h"
class TCanvasItem;
-typedef QValueList<TCanvasItem*> TCanvasItemList;
+typedef TQValueList<TCanvasItem*> TCanvasItemList;
-class QRect;
-class QPainter;
-class MyCanvas : public QCanvas {
+class TQRect;
+class TQPainter;
+class MyCanvas : public TQCanvas {
Q_OBJECT
+ TQ_OBJECT
public:
- MyCanvas( QObject* parent, const char* name = 0 );
+ MyCanvas( TQObject* tqparent, const char* name = 0 );
~MyCanvas();
- void setRect( QRect r ) {
+ void setRect( TQRect r ) {
m_rect = r;
}
- QRect rect() const {
+ TQRect rect() const {
return m_rect;
}
@@ -51,24 +52,25 @@ class MyCanvas : public QCanvas {
bool grid() const { return m_grid; }
protected:
- void drawBackground( QPainter & painter, const QRect & clip );
+ void drawBackground( TQPainter & painter, const TQRect & clip );
private:
- QRect m_rect;
+ TQRect m_rect;
bool m_grid;
};
class Definition;
-class QColor;
-class QLabel;
-class QPoint;
+class TQColor;
+class TQLabel;
+class TQPoint;
class KCommandHistory;
class KMacroCommand;
class KRuler;
class KStatusBar;
-class MyCanvasView : public QCanvasView
+class MyCanvasView : public TQCanvasView
{
Q_OBJECT
+ TQ_OBJECT
enum edges {
TopLeft,
@@ -85,7 +87,7 @@ class MyCanvasView : public QCanvasView
};
public:
- MyCanvasView( Definition* d, MyCanvas *c, QWidget* parent=0, const char* name=0, WFlags f=0);
+ MyCanvasView( Definition* d, MyCanvas *c, TQWidget* tqparent=0, const char* name=0, WFlags f=0);
~MyCanvasView();
/** return a list of all DocumentItems on the canvas
@@ -95,15 +97,15 @@ class MyCanvasView : public QCanvasView
TCanvasItemList getSelected();
TCanvasItem* getActive();
- void setActive( QCanvasItem* item = 0, bool control = false );
+ void setActive( TQCanvasItem* item = 0, bool control = false );
- void setCurrent( QCanvasItem* item );
+ void setCurrent( TQCanvasItem* item );
void setHistory( KCommandHistory* hist ) {
history = hist;
}
- QPoint getTranslation() const {
+ TQPoint getTranslation() const {
return translation;
}
@@ -113,10 +115,10 @@ class MyCanvasView : public QCanvasView
statusbar = s;
}
- static int getLowestZ( QCanvasItemList list );
- static int getHighestZ( QCanvasItemList list );
+ static int getLowestZ( TQCanvasItemList list );
+ static int getHighestZ( TQCanvasItemList list );
- void snapPoint(QPoint* point, TCanvasItem* item) ;
+ void snapPoint(TQPoint* point, TCanvasItem* item) ;
public slots:
void selectAll();
@@ -126,24 +128,24 @@ class MyCanvasView : public QCanvasView
void updateGUI() {
canvas()->update();
- repaintContents();
+ tqrepaintContents();
}
protected:
- void contentsMousePressEvent(QMouseEvent*);
- void contentsMouseMoveEvent(QMouseEvent*);
- void contentsMouseReleaseEvent(QMouseEvent *);
- void contentsMouseDoubleClickEvent(QMouseEvent*);
- void resizeEvent( QResizeEvent * r );
+ void contentsMousePressEvent(TQMouseEvent*);
+ void contentsMouseMoveEvent(TQMouseEvent*);
+ void contentsMouseReleaseEvent(TQMouseEvent *);
+ void contentsMouseDoubleClickEvent(TQMouseEvent*);
+ void resizeEvent( TQResizeEvent * r );
signals:
void selectionChanged();
void movedSomething();
void doubleClickedItem( TCanvasItem* );
- void showContextMenu( QPoint );
+ void showContextMenu( TQPoint );
private:
- void setSelected( QCanvasItem* item = 0, bool control = false );
+ void setSelected( TQCanvasItem* item = 0, bool control = false );
KMacroCommand* getMoveCommand();
Definition* def;
@@ -158,18 +160,18 @@ class MyCanvasView : public QCanvasView
int mouseid;
KStatusBar* statusbar;
- QPoint moving_start;
- QPoint translation;
+ TQPoint moving_start;
+ TQPoint translation;
- QRect old;
+ TQRect old;
- bool isInside( QPoint p, QCanvasItem* item );
- int isEdge( QPoint p, QCanvasItem* item );
+ bool isInside( TQPoint p, TQCanvasItem* item );
+ int isEdge( TQPoint p, TQCanvasItem* item );
void reposition();
void updateRuler();
- int updateCursor( QPoint pos, bool pressed = false );
+ int updateCursor( TQPoint pos, bool pressed = false );
int m_mode;
- QPoint delta_pt ;
+ TQPoint delta_pt ;
};
#endif
diff --git a/kbarcode/mydatatable.cpp b/kbarcode/mydatatable.cpp
index 9ec9dd1..88f149b 100644
--- a/kbarcode/mydatatable.cpp
+++ b/kbarcode/mydatatable.cpp
@@ -17,8 +17,8 @@
#include "mydatatable.h"
-MyDataTable::MyDataTable(QWidget *parent, const char *name )
- : QDataTable(parent,name)
+MyDataTable::MyDataTable(TQWidget *tqparent, const char *name )
+ : TQDataTable(tqparent,name)
{ }
MyDataTable::~MyDataTable()
diff --git a/kbarcode/mydatatable.h b/kbarcode/mydatatable.h
index fa55fb4..ec8087f 100644
--- a/kbarcode/mydatatable.h
+++ b/kbarcode/mydatatable.h
@@ -18,15 +18,16 @@
#ifndef MYDATATABLE_H
#define MYDATATABLE_H
-#include <qwidget.h>
-#include <qdatatable.h>
+#include <tqwidget.h>
+#include <tqdatatable.h>
/** A table to modify SQL tables.
*/
-class MyDataTable : public QDataTable {
+class MyDataTable : public TQDataTable {
Q_OBJECT
+ TQ_OBJECT
public:
- MyDataTable(QWidget *parent=0, const char *name=0);
+ MyDataTable(TQWidget *tqparent=0, const char *name=0);
~MyDataTable();
bool update();
diff --git a/kbarcode/newlabel.cpp b/kbarcode/newlabel.cpp
index 4ca7f04..ea6c14f 100644
--- a/kbarcode/newlabel.cpp
+++ b/kbarcode/newlabel.cpp
@@ -19,12 +19,12 @@
#include "definitiondialog.h"
#include "sqltables.h"
-// Qt includes
-#include <qcheckbox.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qsqlquery.h>
+// TQt includes
+#include <tqcheckbox.h>
+#include <tqgroupbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqsqlquery.h>
// KDE includes
#include <klocale.h>
@@ -32,19 +32,19 @@
#include <kpushbutton.h>
#ifndef I2S
- #define I2S(x) QString("%1").arg(x)
+ #define I2S(x) TQString("%1").tqarg(x)
#endif // I2S
-NewLabel::NewLabel( QWidget* parent, const char* name, bool change, WFlags fl )
- : QDialog( parent, name, true, fl )
+NewLabel::NewLabel( TQWidget* tqparent, const char* name, bool change, WFlags fl )
+ : TQDialog( tqparent, name, true, fl )
{
setCaption( i18n( "New Label" ) );
curid = 0;
types = 0;
- NewLabelLayout = new QVBoxLayout( this, 11, 6, "NewLabelLayout");
+ NewLabelLayout = new TQVBoxLayout( this, 11, 6, "NewLabelLayout");
- TextLabel1 = new QLabel( this, "TextLabel1" );
+ TextLabel1 = new TQLabel( this, "TextLabel1" );
if( !change )
TextLabel1->setText( i18n( "<h1>Create a new Label</h1><br><br>" ) );
else
@@ -52,24 +52,24 @@ NewLabel::NewLabel( QWidget* parent, const char* name, bool change, WFlags fl )
NewLabelLayout->addWidget( TextLabel1 );
- QGroupBox* group1 = new QGroupBox( this );
+ TQGroupBox* group1 = new TQGroupBox( this );
group1->setTitle( i18n( "Label" ) );
group1->setColumnLayout(0, Qt::Vertical );
- group1->layout()->setSpacing( 6 );
- group1->layout()->setMargin( 11 );
- QGridLayout* group1Layout = new QGridLayout( group1->layout() );
- group1Layout->setAlignment( Qt::AlignTop );
+ group1->tqlayout()->setSpacing( 6 );
+ group1->tqlayout()->setMargin( 11 );
+ TQGridLayout* group1Layout = new TQGridLayout( group1->tqlayout() );
+ group1Layout->tqsetAlignment( TQt::AlignTop );
- TextLabel2 = new QLabel( group1, "TextLabel2" );
+ TextLabel2 = new TQLabel( group1, "TextLabel2" );
TextLabel2->setText( i18n( "Producer:" ) );
- TextLabel3 = new QLabel( group1, "TextLabel3" );
+ TextLabel3 = new TQLabel( group1, "TextLabel3" );
TextLabel3->setText( i18n( "Type:" ) );
comboProducer = new KComboBox( FALSE, group1, "comboProducer" );
comboType = new KComboBox( FALSE, group1, "comboType" );
- checkEmpty = new QCheckBox( i18n("&Start with an empty label"), group1 );
+ checkEmpty = new TQCheckBox( i18n("&Start with an empty label"), group1 );
checkEmpty->setEnabled( !change );
group1Layout->addMultiCellWidget( checkEmpty, 0, 0, 0, 1 );
@@ -80,29 +80,29 @@ NewLabel::NewLabel( QWidget* parent, const char* name, bool change, WFlags fl )
NewLabelLayout->addWidget( group1 );
- Layout2 = new QHBoxLayout( 0, 0, 6, "Layout2");
+ Layout2 = new TQHBoxLayout( 0, 0, 6, "Layout2");
- QSpacerItem* spacer_2 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ TQSpacerItem* spacer_2 = new TQSpacerItem( 0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
Layout2->addItem( spacer_2 );
NewLabelLayout->addLayout( Layout2 );
- TextLabel4 = new QLabel( this, "TextLabel4" );
+ TextLabel4 = new TQLabel( this, "TextLabel4" );
preview = new LabelPreview( this, "preview" );
- QHBoxLayout* hlayout = new QHBoxLayout( 0, 6, 6 );
- hlayout->addWidget( TextLabel4 );
- hlayout->addWidget( preview );
- NewLabelLayout->addLayout( hlayout );
- QSpacerItem* spacer_3 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ TQHBoxLayout* htqlayout = new TQHBoxLayout( 0, 6, 6 );
+ htqlayout->addWidget( TextLabel4 );
+ htqlayout->addWidget( preview );
+ NewLabelLayout->addLayout( htqlayout );
+ TQSpacerItem* spacer_3 = new TQSpacerItem( 0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
NewLabelLayout->addItem( spacer_3 );
- Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1");
+ Layout1 = new TQHBoxLayout( 0, 0, 6, "Layout1");
buttonOwnFormat = new KPushButton( this, "buttonOwnFormat" );
buttonOwnFormat->setText( i18n( "&Add own Label Definition" ) );
Layout1->addWidget( buttonOwnFormat );
- QSpacerItem* spacer_4 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ TQSpacerItem* spacer_4 = new TQSpacerItem( 0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
Layout1->addItem( spacer_4 );
buttonOk = new KPushButton( this, "buttonOk" );
@@ -115,14 +115,14 @@ NewLabel::NewLabel( QWidget* parent, const char* name, bool change, WFlags fl )
Layout1->addWidget( buttonCancel );
NewLabelLayout->addLayout( Layout1 );
- connect( comboProducer, SIGNAL( activated(int) ), this, SLOT( updateType() ) );
- connect( comboProducer, SIGNAL( activated(int) ), this, SLOT( updateText() ) );
- connect( comboType, SIGNAL( activated(int) ), this, SLOT( updateText() ) );
- connect( checkEmpty, SIGNAL( clicked() ), this, SLOT( updateText() ) );
+ connect( comboProducer, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( updateType() ) );
+ connect( comboProducer, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( updateText() ) );
+ connect( comboType, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( updateText() ) );
+ connect( checkEmpty, TQT_SIGNAL( clicked() ), this, TQT_SLOT( updateText() ) );
- connect( buttonOk, SIGNAL( clicked() ), this, SLOT(accept() ) );
- connect( buttonCancel, SIGNAL( clicked() ), this, SLOT(reject() ) );
- connect( buttonOwnFormat, SIGNAL( clicked() ), this, SLOT(add() ) );
+ connect( buttonOk, TQT_SIGNAL( clicked() ), this, TQT_SLOT(accept() ) );
+ connect( buttonCancel, TQT_SIGNAL( clicked() ), this, TQT_SLOT(reject() ) );
+ connect( buttonOwnFormat, TQT_SIGNAL( clicked() ), this, TQT_SLOT(add() ) );
fillData();
updateType();
updateText();
@@ -137,11 +137,11 @@ NewLabel::~NewLabel()
void NewLabel::fillData()
{
comboProducer->clear();
- QStringList list = Definition::getProducers();
+ TQStringList list = Definition::getProducers();
comboProducer->insertStringList( list );
if( comboProducer->count() ) {
- types = new QStringList[comboProducer->count()];
+ types = new TQStringList[comboProducer->count()];
for( int i = 0; i < comboProducer->count(); i++ )
types[i] = Definition::getTypes( comboProducer->text( i ) );
}
@@ -164,38 +164,38 @@ void NewLabel::updateText()
if(!checkEmpty->isChecked())
{
Definition d( comboProducer->currentText(), comboType->currentText() );
- TextLabel4->setText( QString(i18n(
+ TextLabel4->setText( TQString(i18n(
"<b>Format:</b><br>\nWidth: ") + I2S(d.getMeasurements().width()) +
i18n("%1<br>Height: ") + I2S(d.getMeasurements().height()) +
i18n("%2<br>Horizontal Gap: ") + I2S(d.getMeasurements().gapH()) +
i18n("%3<br>Vertical Gap: ") + I2S(d.getMeasurements().gapV()) +
i18n("%4<br>Top Gap: ") + I2S(d.getMeasurements().gapTop()) +
i18n("%5<br>Left Gap: ") + I2S(d.getMeasurements().gapLeft()) + "%6<br>"
- ).arg( Measurements::system() )
- .arg( Measurements::system() )
- .arg( Measurements::system() )
- .arg( Measurements::system() )
- .arg( Measurements::system() )
- .arg( Measurements::system() ) );
+ ).tqarg( Measurements::system() )
+ .tqarg( Measurements::system() )
+ .tqarg( Measurements::system() )
+ .tqarg( Measurements::system() )
+ .tqarg( Measurements::system() )
+ .tqarg( Measurements::system() ) );
- preview->setRect( QRect( (int)d.getMeasurements().gapLeftMM(),
+ preview->setRect( TQRect( (int)d.getMeasurements().gapLeftMM(),
(int)d.getMeasurements().gapTopMM(),
(int)d.getMeasurements().widthMM(),
(int)d.getMeasurements().heightMM() ) );
preview->setMeasurements( d.getMeasurements() );
preview->setPrvEnabled( true );
- preview->repaint();
+ preview->tqrepaint();
curid = d.getId();
}
else
{
TextLabel4->setText( i18n("No label selected.") );
preview->setPrvEnabled( false );
- preview->repaint();
+ preview->tqrepaint();
}
}
-bool NewLabel::isInCombo( QComboBox* combo, QString text )
+bool NewLabel::isInCombo( TQComboBox* combo, TQString text )
{
if( combo->count() == 0 )
return false;
@@ -208,8 +208,8 @@ bool NewLabel::isInCombo( QComboBox* combo, QString text )
void NewLabel::setLabelId( int id )
{
- QString name;
- QSqlQuery query("SELECT type FROM " TABLE_LABEL_DEF " WHERE label_no='" + QString::number( id ) + "'" );
+ TQString name;
+ TQSqlQuery query("SELECT type FROM " TABLE_LABEL_DEF " WHERE label_no='" + TQString::number( id ) + "'" );
while( query.next() )
name = query.value( 0 ).toString();
@@ -231,7 +231,7 @@ void NewLabel::setLabelId( int id )
void NewLabel::add()
{
DefinitionDialog* d = new DefinitionDialog( this );
- if( d->exec() == QDialog::Accepted ){
+ if( d->exec() == TQDialog::Accepted ){
fillData();
updateType();
updateText();
diff --git a/kbarcode/newlabel.h b/kbarcode/newlabel.h
index 5c5da06..aa480e5 100644
--- a/kbarcode/newlabel.h
+++ b/kbarcode/newlabel.h
@@ -18,26 +18,27 @@
#ifndef NEWLABEL_H
#define NEWLABEL_H
-#include <qdialog.h>
-#include <qwidget.h>
+#include <tqdialog.h>
+#include <tqwidget.h>
#include "definition.h"
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
-class QCheckBox;
-class QComboBox;
+class TQVBoxLayout;
+class TQHBoxLayout;
+class TQGridLayout;
+class TQCheckBox;
+class TQComboBox;
class KComboBox;
class KPushButton;
-class QLabel;
-class QString;
+class TQLabel;
+class TQString;
class LabelPreview;
-class NewLabel : public QDialog
+class NewLabel : public TQDialog
{
Q_OBJECT
+ TQ_OBJECT
public:
- NewLabel( QWidget* parent = 0, const char* name = 0, bool change = FALSE, WFlags fl = 0 );
+ NewLabel( TQWidget* tqparent = 0, const char* name = 0, bool change = FALSE, WFlags fl = 0 );
~NewLabel();
int labelId() const { return curid; }
@@ -45,7 +46,7 @@ class NewLabel : public QDialog
void setLabelId( int id );
- static bool isInCombo( QComboBox* combo, QString text );
+ static bool isInCombo( TQComboBox* combo, TQString text );
private slots:
void updateType();
@@ -55,25 +56,25 @@ class NewLabel : public QDialog
private:
void fillData();
- QLabel* TextLabel1;
- QLabel* TextLabel2;
- QLabel* TextLabel3;
- QCheckBox* checkEmpty;
+ TQLabel* TextLabel1;
+ TQLabel* TextLabel2;
+ TQLabel* TextLabel3;
+ TQCheckBox* checkEmpty;
KComboBox* comboProducer;
KComboBox* comboType;
KPushButton* buttonOwnFormat;
- QLabel* TextLabel4;
+ TQLabel* TextLabel4;
KPushButton* buttonOk;
KPushButton* buttonCancel;
LabelPreview* preview;
- QStringList* types;
+ TQStringList* types;
protected:
int curid;
- QVBoxLayout* NewLabelLayout;
- QHBoxLayout* Layout5;
- QHBoxLayout* Layout2;
- QHBoxLayout* Layout1;
+ TQVBoxLayout* NewLabelLayout;
+ TQHBoxLayout* Layout5;
+ TQHBoxLayout* Layout2;
+ TQHBoxLayout* Layout1;
};
#endif // NEWLABEL_H
diff --git a/kbarcode/pixmapbarcode.cpp b/kbarcode/pixmapbarcode.cpp
index 56a597e..ce07836 100644
--- a/kbarcode/pixmapbarcode.cpp
+++ b/kbarcode/pixmapbarcode.cpp
@@ -25,14 +25,14 @@
#include <kprocess.h>
#include <ktempfile.h>
-#include <qbuffer.h>
-#include <qdom.h>
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qpainter.h>
-#include <qpaintdevicemetrics.h>
-#include <qpixmap.h>
-#include <qtextstream.h>
+#include <tqbuffer.h>
+#include <tqdom.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqpainter.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqpixmap.h>
+#include <tqtextstream.h>
/* Margin added by GNU Barcode to the barcodes */
#define BARCODE_MARGIN 10
@@ -63,14 +63,14 @@ void PDF417Options::defaults()
m_err = 5;
}
-void PDF417Options::load( const QDomElement* tag )
+void PDF417Options::load( const TQDomElement* tag )
{
m_row = tag->attribute( "pdf417.row", "24" ).toInt();
m_col = tag->attribute( "pdf417.col", "8" ).toInt();
m_err = tag->attribute( "pdf417.err", "5" ).toInt();
}
-void PDF417Options::save( QDomElement* tag )
+void PDF417Options::save( TQDomElement* tag )
{
tag->setAttribute( "pdf417.row", m_row );
tag->setAttribute( "pdf417.col", m_col );
@@ -100,21 +100,21 @@ const PixmapBarcode & PixmapBarcode::operator=( const BarkodeEngine & rhs )
return *this;
}
-const QSize PixmapBarcode::size() const
+const TQSize PixmapBarcode::size() const
{
- return ( p.size().isNull() ? QSize( 100, 80 ) : p.size() );
+ return ( p.size().isNull() ? TQSize( 100, 80 ) : p.size() );
}
-void PixmapBarcode::update( const QPaintDevice* device )
+void PixmapBarcode::update( const TQPaintDevice* device )
{
p.resize( 0, 0 );
createBarcode( &p, device );
}
-void PixmapBarcode::drawBarcode( QPainter & painter, int x, int y )
+void PixmapBarcode::drawBarcode( TQPainter & painter, int x, int y )
{
if( p.isNull() )
- createBarcode( &p, painter.device() );
+ createBarcode( &p, TQT_TQPAINTDEVICE(painter.device()) );
if( p.isNull() ) // still no barcode....
{
@@ -125,18 +125,18 @@ void PixmapBarcode::drawBarcode( QPainter & painter, int x, int y )
painter.drawPixmap( x, y, p );
}
-bool PixmapBarcode::createPixmap( QPixmap* target, int resx, int resy )
+bool PixmapBarcode::createPixmap( TQPixmap* target, int resx, int resy )
{
char* postscript = NULL;
long postscript_size = 0;
- QString cmd;
+ TQString cmd;
bool bMonocrome;
- bMonocrome = ( barkode->foreground() == Qt::black &&
- barkode->background() == Qt::white &&
- barkode->textColor() == Qt::black );
+ bMonocrome = ( barkode->foreground() == TQt::black &&
+ barkode->background() == TQt::white &&
+ barkode->textColor() == TQt::black );
- KTempFile* input = new KTempFile( QString::null, bMonocrome ? ".pbm" : ".ppm" );
+ KTempFile* input = new KTempFile( TQString(), bMonocrome ? ".pbm" : ".ppm" );
input->file()->close();
if( Barkode::engineForType( barkode->type() ) == PDF417 ) {
@@ -162,7 +162,7 @@ bool PixmapBarcode::createPixmap( QPixmap* target, int resx, int resy )
return false;
}
- QRect size = bbox( postscript, postscript_size );
+ TQRect size = bbox( postscript, postscript_size );
double sw = (double)(size.x() + size.width())/72 * resx;
double sh = (double)(size.y() + size.height())/72 * resy;
@@ -172,9 +172,9 @@ bool PixmapBarcode::createPixmap( QPixmap* target, int resx, int resy )
sh = (double)(size.y() + size.height());
}
- cmd = QString("gs -g%1x%2").arg(int(sw*(double)barkode->scaling())).arg(int(sh*(double)barkode->scaling()));
- cmd += " -r" + QString::number( resx*(double)barkode->scaling()) + "x" + QString::number( resy*(double)barkode->scaling() );
- cmd += QString(" -sDEVICE=%1 -sOutputFile=").arg( bMonocrome ? "pbmraw" : "ppm" );
+ cmd = TQString("gs -g%1x%2").tqarg(int(sw*(double)barkode->scaling())).tqarg(int(sh*(double)barkode->scaling()));
+ cmd += " -r" + TQString::number( resx*(double)barkode->scaling()) + "x" + TQString::number( resy*(double)barkode->scaling() );
+ cmd += TQString(" -sDEVICE=%1 -sOutputFile=").tqarg( bMonocrome ? "pbmraw" : "ppm" );
cmd += input->name();
cmd += " -sNOPAUSE -q - -c showpage quit";
@@ -204,7 +204,7 @@ bool PixmapBarcode::createPixmap( QPixmap* target, int resx, int resy )
bool PixmapBarcode::createPostscript( char** postscript, long* postscript_size )
{
- QString cmd;
+ TQString cmd;
/*
if( Barkode::engineForType( barkode->type() ) == TBARCODE )
@@ -226,30 +226,30 @@ bool PixmapBarcode::createPostscript( char** postscript, long* postscript_size )
return true;
}
-QRect PixmapBarcode::bbox( const char* data, long size )
+TQRect PixmapBarcode::bbox( const char* data, long size )
{
int x = 0, y = 0, w = 0, h = 0;
const char* bbox = "%%BoundingBox:";
int len = strlen( bbox );
- QRect s(0,0,0,0);
- QByteArray array;
+ TQRect s(0,0,0,0);
+ TQByteArray array;
array.setRawData( data, size );
- QBuffer b( array );
+ TQBuffer b( array );
if( !b.open( IO_ReadOnly ) )
return s;
- QTextStream t( &b );
+ TQTextStream t( &b );
- QString text = t.readLine();
+ TQString text = t.readLine();
while( !text.isNull() )
{
if( text.startsWith( bbox ) )
{
text = text.right( text.length() - len );
sscanf( (const char*)text, "%d %d %d %d", &x, &y, &w, &h );
- s = QRect( x, y, w, h );
+ s = TQRect( x, y, w, h );
break;
}
@@ -304,13 +304,13 @@ bool PixmapBarcode::readFromPipe( const char* command, char** buffer, long* buff
return true;
}
-void PixmapBarcode::createBarcode( QPixmap* target, const QPaintDevice* device )
+void PixmapBarcode::createBarcode( TQPixmap* target, const TQPaintDevice* device )
{
- QPaintDeviceMetrics pdm( device );
+ TQPaintDeviceMetrics pdm( device );
int resx = pdm.logicalDpiX();
int resy = pdm.logicalDpiY();
- QPixmap* cached = 0;//BarcodeCache::instance()->read( barcode, resx, resy, value );
+ TQPixmap* cached = 0;//BarcodeCache::instance()->read( barcode, resx, resy, value );
// no matching barcode found in cache
if( !cached ) {
@@ -325,11 +325,11 @@ void PixmapBarcode::createBarcode( QPixmap* target, const QPaintDevice* device )
// we have to scale to the correct resolution.
// we scale already here and not at the end,
// so that the addMargin function does not get a scaled margin.
- QPaintDeviceMetrics pdm( KApplication::desktop() );
+ TQPaintDeviceMetrics pdm( KApplication::desktop() );
int screenresx = pdm.logicalDpiX();
int screenresy = pdm.logicalDpiY();
- QWMatrix m;
+ TQWMatrix m;
double scalex = (resx/screenresx)*barkode->scaling();
double scaley = (resy/screenresy)*barkode->scaling();
m.scale( scalex, scaley );
@@ -339,7 +339,7 @@ void PixmapBarcode::createBarcode( QPixmap* target, const QPaintDevice* device )
*target = addMargin( target );
// Rotate
- QWMatrix m;
+ TQWMatrix m;
m.rotate( (double)barkode->rotation() );
*target = target->xForm( m );
@@ -356,8 +356,8 @@ bool PixmapBarcode::createPdf417( KTempFile* output )
return false;
}
- KTempFile text( QString::null, ".txt" );
- QTextStream t( text.file() );
+ KTempFile text( TQString(), ".txt" );
+ TQTextStream t( text.file() );
t << barkode->parsedValue();
text.file()->close();
@@ -383,42 +383,42 @@ bool PixmapBarcode::createPdf417( KTempFile* output )
}
#if 0
-QString PixmapBarcode::createTBarcodeCmd()
+TQString PixmapBarcode::createTBarcodeCmd()
{
- QString cmd;
+ TQString cmd;
// print text
- QString flag = barkode->textVisible() ? " Ton" : " n Toff"; // we pass the old parameter Ton and the new one: n
+ TQString flag = barkode->textVisible() ? " Ton" : " n Toff"; // we pass the old parameter Ton and the new one: n
// escape text
flag.append( barkode->tbarcodeOptions()->escape() ? " son" : " soff" );
// autocorrection
flag.append( barkode->tbarcodeOptions()->autocorrect() ? " Aon" : " Aoff" );
// barcode height
- flag.append( QString( " h%1" ).arg( barkode->tbarcodeOptions()->height() ) );
+ flag.append( TQString( " h%1" ).tqarg( barkode->tbarcodeOptions()->height() ) );
// text above
if( barkode->tbarcodeOptions()->above() )
flag.append( " a" );
cmd = "tbarcodeclient ";
if( !Barkode::hasFeature( barkode->type(), BARCODE2D ) )
- cmd += QString( " m%1" ).arg( barkode->tbarcodeOptions()->moduleWidth() * 1000 );
+ cmd += TQString( " m%1" ).tqarg( barkode->tbarcodeOptions()->moduleWidth() * 1000 );
if( Barkode::hasFeature( barkode->type(), DATAMATRIX ) )
- cmd += QString( " Ds%1" ).arg( barkode->datamatrixSize() );
+ cmd += TQString( " Ds%1" ).tqarg( barkode->datamatrixSize() );
if( Barkode::hasFeature( barkode->type(), PDF417BARCODE ) )
- cmd += QString( " Pr%1 Pc%2 Pe%3" ).arg( barkode->pdf417Options()->row() )
- .arg( barkode->pdf417Options()->col() )
- .arg( barkode->pdf417Options()->err() );
+ cmd += TQString( " Pr%1 Pc%2 Pe%3" ).tqarg( barkode->pdf417Options()->row() )
+ .tqarg( barkode->pdf417Options()->col() )
+ .tqarg( barkode->pdf417Options()->err() );
- cmd += " " + barkode->type() + QString(" tPS c%1").arg( barkode->tbarcodeOptions()->checksum() );
+ cmd += " " + barkode->type() + TQString(" tPS c%1").tqarg( barkode->tbarcodeOptions()->checksum() );
cmd += flag + " d" + KShellProcess::quote( barkode->parsedValue() );
return cmd;
}
#endif // 0
-void PixmapBarcode::cleanUp( KTempFile* file, QPixmap* target )
+void PixmapBarcode::cleanUp( KTempFile* file, TQPixmap* target )
{
target->resize( 0, 0 );
@@ -426,15 +426,15 @@ void PixmapBarcode::cleanUp( KTempFile* file, QPixmap* target )
delete file;
}
-QPixmap PixmapBarcode::cut( QPixmap* pic, double cut)
+TQPixmap PixmapBarcode::cut( TQPixmap* pic, double cut)
{
if( cut == 1.0 )
return (*pic);
- QPixmap pcut( pic->width(), int((double)pic->height() * cut) );
- pcut.fill( Qt::white ); // barcode.bg
+ TQPixmap pcut( pic->width(), int((double)pic->height() * cut) );
+ pcut.fill( TQt::white ); // barcode.bg
- QWMatrix m;
+ TQWMatrix m;
/*
* if text is above the barcode cut from
* below the barcode.
@@ -447,15 +447,15 @@ QPixmap PixmapBarcode::cut( QPixmap* pic, double cut)
} else
m.rotate( 180 );
- QPainter painter( &pcut );
+ TQPainter painter( &pcut );
painter.drawPixmap( 0, 0, pic->xForm( m ) );
return pcut.xForm( m );
}
-QPixmap PixmapBarcode::addMargin( QPixmap* pic )
+TQPixmap PixmapBarcode::addMargin( TQPixmap* pic )
{
- QPixmap p;
+ TQPixmap p;
/* We have to handle UPC special because of the checksum character
* which is printed on the right margin.
@@ -484,7 +484,7 @@ QPixmap PixmapBarcode::addMargin( QPixmap* pic )
p.resize( pic->width() + margin, pic->height() + margin );
p.fill( barkode->background() );
- QPainter painter( &p );
+ TQPainter painter( &p );
painter.drawPixmap( barkode->quietZone(), barkode->quietZone(), *pic, (int)sx, (int)sy, (int)sw, (int)sh );
painter.end();
diff --git a/kbarcode/pixmapbarcode.h b/kbarcode/pixmapbarcode.h
index 76591a2..1683cb1 100644
--- a/kbarcode/pixmapbarcode.h
+++ b/kbarcode/pixmapbarcode.h
@@ -19,10 +19,10 @@
#define PIXMAPBARCODE_H
#include "barkodeengine.h"
-#include <qpixmap.h>
+#include <tqpixmap.h>
class KTempFile;
-class QPainter;
+class TQPainter;
class PDF417Options : public BarkodeEngineOptions {
public:
@@ -31,8 +31,8 @@ class PDF417Options : public BarkodeEngineOptions {
const PDF417Options& operator=( const BarkodeEngineOptions& rhs );
void defaults();
- void load( const QDomElement* tag );
- void save( QDomElement* tag );
+ void load( const TQDomElement* tag );
+ void save( TQDomElement* tag );
inline int row() const { return m_row; }
inline int col() const { return m_col; }
@@ -66,40 +66,40 @@ class PixmapBarcode : public BarkodeEngine
const PixmapBarcode & operator=( const BarkodeEngine & rhs );
inline EEngine engine() const;
- const QSize size() const;
- void update( const QPaintDevice* device );
- void drawBarcode( QPainter & painter, int x, int y );
+ const TQSize size() const;
+ void update( const TQPaintDevice* device );
+ void drawBarcode( TQPainter & painter, int x, int y );
inline BarkodeEngineOptions* options();
private:
- bool createPixmap( QPixmap* target, int resx, int resy );
- void createBarcode( QPixmap* target, const QPaintDevice* device );
+ bool createPixmap( TQPixmap* target, int resx, int resy );
+ void createBarcode( TQPixmap* target, const TQPaintDevice* device );
bool createPdf417( KTempFile* output );
- //QString createTBarcodeCmd();
+ //TQString createTBarcodeCmd();
virtual bool createPostscript( char** postscript, long* postscript_size );
/** Mage sure the temporaray file @p file
* gets closed and deleted properly
*/
- void cleanUp( KTempFile* file, QPixmap* target );
+ void cleanUp( KTempFile* file, TQPixmap* target );
/**
* Cut the barcode either on the top or
* on the bottom, depending on the text position.
*g
- * @param pic the QPixmap that will be cutted
+ * @param pic the TQPixmap that will be cutted
* @param cut a value between 0.0 and 1.0. If cut = 1.0
* then no cut will happen, if cut = 0.5, half of
* the barcode is going to be cutted away.
*/
- QPixmap cut( QPixmap* pic, double cut );
+ TQPixmap cut( TQPixmap* pic, double cut );
/**
- * Add a margin to the QPixmap pic.
- * @param pic the QPixmap pic which should get a margin
+ * Add a margin to the TQPixmap pic.
+ * @param pic the TQPixmap pic which should get a margin
*/
- QPixmap addMargin( QPixmap* pic );
+ TQPixmap addMargin( TQPixmap* pic );
protected:
/** Creates a pipe and read the data returned by the command into a buffer.
@@ -116,10 +116,10 @@ class PixmapBarcode : public BarkodeEngine
* \returns the BoundingBox of the postscript or EPS file
* so that it can be cropped correctly
*/
- virtual QRect bbox( const char* postscript, long postscript_size );
+ virtual TQRect bbox( const char* postscript, long postscript_size );
private:
- QPixmap p;
+ TQPixmap p;
PDF417Options m_pdf417_options;
};
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() );
diff --git a/kbarcode/previewdialog.h b/kbarcode/previewdialog.h
index db3c056..a7e2419 100644
--- a/kbarcode/previewdialog.h
+++ b/kbarcode/previewdialog.h
@@ -18,7 +18,7 @@
#ifndef PREVIEWDIALOG_H
#define PREVIEWDIALOG_H
-#include <qdialog.h>
+#include <tqdialog.h>
#include <kabc/addressee.h>
class Definition;
@@ -26,13 +26,14 @@ class KComboBox;
class KIntNumInput;
class KLineEdit;
class KPushButton;
-class QIODevice;
-class QLabel;
-class QWidget;
-class PreviewDialog : public QDialog {
+class TQIODevice;
+class TQLabel;
+class TQWidget;
+class PreviewDialog : public TQDialog {
Q_OBJECT
+ TQ_OBJECT
public:
- PreviewDialog( QIODevice* device, Definition* d, QString filename, QWidget *parent=0, const char *name=0);
+ PreviewDialog( TQIODevice* device, Definition* d, TQString filename, TQWidget *tqparent=0, const char *name=0);
~PreviewDialog();
private slots:
@@ -43,7 +44,7 @@ class PreviewDialog : public QDialog {
void selectAddress();
private:
- QLabel* preview;
+ TQLabel* preview;
KLineEdit* articleId;
KLineEdit* groupName;
@@ -63,14 +64,14 @@ class PreviewDialog : public QDialog {
KABC::Addressee m_address;
Definition* def;
- QIODevice* file;
+ TQIODevice* file;
- QString m_filename;
+ TQString m_filename;
static int customer_index;
static int m_index;
- static QString group;
- static QString article;
+ static TQString group;
+ static TQString article;
};
#endif
diff --git a/kbarcode/printersettings.cpp b/kbarcode/printersettings.cpp
index 1668f44..908f74f 100644
--- a/kbarcode/printersettings.cpp
+++ b/kbarcode/printersettings.cpp
@@ -71,12 +71,12 @@ const PageFormatInfo pageFormatInfo[]=
PrinterSettings* PrinterSettings::printerInstance = 0;
PrinterSettings::PrinterSettings()
- :QObject( 0, "printersettings" )
+ :TQObject( 0, "printersettings" )
{
lpdata = new labelprinterdata;
loadConfig();
- connect( kapp, SIGNAL( aboutToQuit() ), this, SLOT( saveConfig() ) );
+ connect( kapp, TQT_SIGNAL( aboutToQuit() ), this, TQT_SLOT( saveConfig() ) );
}
PrinterSettings::~PrinterSettings()
@@ -157,9 +157,9 @@ int PrinterSettings::getQuality() const
return lpdata->quality == Middle || lpdata->quality == VeryHigh? High : lpdata->quality;
};
-KPrinter* PrinterSettings::setupPrinter( const KURL & url, QWidget* parent, bool immediately, const QString & prn )
+KPrinter* PrinterSettings::setupPrinter( const KURL & url, TQWidget* tqparent, bool immediately, const TQString & prn )
{
- KPrinter* printer = new KPrinter( true, (enum QPrinter::PrinterMode)getQuality() );
+ KPrinter* printer = new KPrinter( true, (enum TQPrinter::PrinterMode)getQuality() );
if( getData()->quality == Middle )
printer->setResolution( 300 );
else if( getData()->quality == VeryHigh )
@@ -167,7 +167,7 @@ KPrinter* PrinterSettings::setupPrinter( const KURL & url, QWidget* parent, bool
printer->setFullPage( true ); // don't use build in margin system
- if( !immediately && !printer->setup( parent ) )
+ if( !immediately && !printer->setup( tqparent ) )
return 0;
if( immediately && !prn.isEmpty() )
diff --git a/kbarcode/printersettings.h b/kbarcode/printersettings.h
index 8083fcb..e248237 100644
--- a/kbarcode/printersettings.h
+++ b/kbarcode/printersettings.h
@@ -18,8 +18,8 @@
#ifndef PRINTERSETTINGS_H
#define PRINTERSETTINGS_H
-#include <qobject.h>
-#include <qstring.h>
+#include <tqobject.h>
+#include <tqstring.h>
#include <kprinter.h>
class KURL;
@@ -41,9 +41,9 @@ typedef struct labelprinterdata {
bool border;
int format; // index of the page format
- QString comment;
- QString separator;
- QString quote;
+ TQString comment;
+ TQString separator;
+ TQString quote;
};
typedef struct PageFormatInfo
@@ -57,10 +57,11 @@ typedef struct PageFormatInfo
class KPrinter;
class KComboBox;
-class PrinterSettings: public QObject {
+class PrinterSettings: public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
- enum { High = QPrinter::HighResolution, Middle, VeryHigh };
+ enum { High = TQPrinter::HighResolution, Middle, VeryHigh };
enum { TEC, ZEBRA, INTERMEC, EPCL };
PrinterSettings();
@@ -80,7 +81,7 @@ class PrinterSettings: public QObject {
static PrinterSettings* getInstance();
// don't forget to delete printer
- KPrinter* setupPrinter( const KURL & url, QWidget* parent, bool immediately = false, const QString & prn = QString::null );
+ KPrinter* setupPrinter( const KURL & url, TQWidget* tqparent, bool immediately = false, const TQString & prn = TQString() );
public slots:
void loadConfig();
diff --git a/kbarcode/printlabeldlg.cpp b/kbarcode/printlabeldlg.cpp
index 849750f..7aa10d8 100644
--- a/kbarcode/printlabeldlg.cpp
+++ b/kbarcode/printlabeldlg.cpp
@@ -18,19 +18,19 @@
#include "printlabeldlg.h"
#include "printersettings.h"
-// Qt includes
-#include <qcheckbox.h>
-#include <qlayout.h>
+// TQt includes
+#include <tqcheckbox.h>
+#include <tqlayout.h>
// KDE includes
#include <knuminput.h>
#include <klocale.h>
-PrintLabelDlg::PrintLabelDlg(QWidget *parent, const char *name )
+PrintLabelDlg::PrintLabelDlg(TQWidget *tqparent, const char *name )
: KDialogBase( KDialogBase::Plain, i18n("Print"),
- KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, parent,name)
+ KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, tqparent,name)
{
- QVBoxLayout* box = new QVBoxLayout( plainPage() );
+ TQVBoxLayout* box = new TQVBoxLayout( plainPage() );
numLabels = new KIntNumInput( plainPage() );
numLabels->setLabel( i18n("Number of labels:" ), KNumInput::AlignLeft | KNumInput::AlignVCenter );
@@ -40,10 +40,10 @@ PrintLabelDlg::PrintLabelDlg(QWidget *parent, const char *name )
numPos->setLabel( i18n("Start at label position:" ), KNumInput::AlignLeft | KNumInput::AlignVCenter );
numPos->setRange( 1, 100, 1, false );
- checkBorder = new QCheckBox( i18n("&Print crop marks (borders)"), plainPage() );
+ checkBorder = new TQCheckBox( i18n("&Print crop marks (borders)"), plainPage() );
checkBorder->setChecked( PrinterSettings::getInstance()->getData()->border );
- QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding );
+ TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Expanding );
box->addWidget( numLabels );
box->addWidget( numPos );
diff --git a/kbarcode/printlabeldlg.h b/kbarcode/printlabeldlg.h
index 4760359..4e272ee 100644
--- a/kbarcode/printlabeldlg.h
+++ b/kbarcode/printlabeldlg.h
@@ -18,10 +18,10 @@
#ifndef PRINTLABELDLG_H
#define PRINTLABELDLG_H
-#include <qwidget.h>
+#include <tqwidget.h>
#include <kdialogbase.h>
-class QCheckBox;
+class TQCheckBox;
class KIntNumInput;
/**
@@ -33,8 +33,9 @@ class KIntNumInput;
*/
class PrintLabelDlg : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
- PrintLabelDlg(QWidget *parent=0, const char *name=0);
+ PrintLabelDlg(TQWidget *tqparent=0, const char *name=0);
~PrintLabelDlg();
/**
@@ -63,7 +64,7 @@ class PrintLabelDlg : public KDialogBase {
private:
KIntNumInput* numLabels;
KIntNumInput* numPos;
- QCheckBox* checkBorder;
+ TQCheckBox* checkBorder;
};
#endif
diff --git a/kbarcode/propertywidget.cpp b/kbarcode/propertywidget.cpp
index ee56af5..9528a19 100644
--- a/kbarcode/propertywidget.cpp
+++ b/kbarcode/propertywidget.cpp
@@ -43,14 +43,14 @@
#include <ktextedit.h>
#include <kurlrequester.h>
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpainter.h>
-#include <qradiobutton.h>
-#include <qsqlquery.h>
-#include <qvbox.h>
-#include <qvbuttongroup.h>
+#include <tqcheckbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqpainter.h>
+#include <tqradiobutton.h>
+#include <tqsqlquery.h>
+#include <tqvbox.h>
+#include <tqvbuttongroup.h>
#include <kmessagebox.h>
#define IMAGE_INTERNAL i18n("Image Saved in KBarcode")
@@ -58,18 +58,18 @@
void FillLineCombo( KComboBox* box )
{
/* A small helper function to fill
- * a combobox with all by Qt
+ * a combobox with all by TQt
* supported pen styles.
*/
- // TODO: Use the enum for Qt line styles here!
+ // TODO: Use the enum for TQt line styles here!
- QPainter p;
+ TQPainter p;
for( int i = 1; i < 6; i++ ) {
- QPixmap pixmap( 60, 20 );
- pixmap.fill( Qt::white );
+ TQPixmap pixmap( 60, 20 );
+ pixmap.fill( TQt::white );
p.begin( &pixmap );
- p.setPen( QPen( Qt::black, 3, (Qt::PenStyle)i ) );
+ p.setPen( TQPen( TQt::black, 3, (TQt::PenStyle)i ) );
p.drawLine( 5, 10, 55, 10 );
p.end();
@@ -77,16 +77,16 @@ void FillLineCombo( KComboBox* box )
}
}
-PropertyWidget::PropertyWidget(QWidget* parent )
- : QWidget( parent, 0 )
+PropertyWidget::PropertyWidget(TQWidget* tqparent )
+ : TQWidget( tqparent, 0 )
{
- grid = new QGridLayout( this, 2, 2 );
+ grid = new TQGridLayout( this, 2, 2 );
}
-PropertyBorder::PropertyBorder( QWidget* parent )
- : PropertyWidget( parent )
+PropertyBorder::PropertyBorder( TQWidget* tqparent )
+ : PropertyWidget( tqparent )
{
- checkBorder = new QCheckBox( this );
+ checkBorder = new TQCheckBox( this );
checkBorder->setText( i18n("&Border Visible") );
buttonColor = new KColorButton( this );
@@ -98,20 +98,20 @@ PropertyBorder::PropertyBorder( QWidget* parent )
FillLineCombo( comboLine );
grid->addMultiCellWidget( checkBorder, 0, 0, 0, 1 );
- grid->addWidget( new QLabel( i18n("Color:"), this ), 1, 0 );
+ grid->addWidget( new TQLabel( i18n("Color:"), this ), 1, 0 );
grid->addWidget( buttonColor, 1, 1 );
- grid->addWidget( new QLabel( i18n("Line Width:"), this ), 2, 0 );
+ grid->addWidget( new TQLabel( i18n("Line Width:"), this ), 2, 0 );
grid->addWidget( spinWidth, 2, 1 );
- grid->addWidget( new QLabel( i18n("Line Style:"), this ), 3, 0 );
+ grid->addWidget( new TQLabel( i18n("Line Style:"), this ), 3, 0 );
grid->addWidget( comboLine, 3, 1 );
- connect( checkBorder, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
+ connect( checkBorder, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
}
void PropertyBorder::applySettings( DocumentItem* item, KMacroCommand* command )
{
- BorderCommand* bc = new BorderCommand( checkBorder->isChecked(), QPen( buttonColor->color(), spinWidth->value(), (Qt::PenStyle)(comboLine->currentItem() + 1) ), item );
+ BorderCommand* bc = new BorderCommand( checkBorder->isChecked(), TQPen( buttonColor->color(), spinWidth->value(), (TQt::PenStyle)(comboLine->currentItem() + 1) ), item );
bc->execute();
command->addCommand( bc );
}
@@ -134,10 +134,10 @@ void PropertyBorder::enableControls()
}
-PropertyRotation::PropertyRotation( QWidget* parent )
- : PropertyWidget( parent )
+PropertyRotation::PropertyRotation( TQWidget* tqparent )
+ : PropertyWidget( tqparent )
{
- QLabel* label = new QLabel( i18n("&Rotation:"), this );
+ TQLabel* label = new TQLabel( i18n("&Rotation:"), this );
comboRotation = new KComboBox( FALSE, this );
label->setBuddy( comboRotation );
@@ -182,12 +182,12 @@ void PropertyRotation::initSettings( DocumentItem* item )
comboRotation->setCurrentItem( 3 );
}
-PropertyFill::PropertyFill( QWidget* parent )
- : PropertyWidget( parent )
+PropertyFill::PropertyFill( TQWidget* tqparent )
+ : PropertyWidget( tqparent )
{
buttonColor = new KColorButton( this );
- grid->addWidget( new QLabel( i18n("Color:"), this ), 0, 0 );
+ grid->addWidget( new TQLabel( i18n("Color:"), this ), 0, 0 );
grid->addWidget( buttonColor, 0, 1 );
}
@@ -205,22 +205,22 @@ void PropertyFill::initSettings( DocumentItem* item )
buttonColor->setColor( rect->color() );
}
-PropertyBarcode::PropertyBarcode( TokenProvider* token, QWidget* parent )
- : PropertyWidget( parent )
+PropertyBarcode::PropertyBarcode( TokenProvider* token, TQWidget* tqparent )
+ : PropertyWidget( tqparent )
{
- QLabel* TextLabel1 = new QLabel( this, "TextLabel1" );
+ TQLabel* TextLabel1 = new TQLabel( this, "TextLabel1" );
TextLabel1->setText( i18n( "Barcode Settings:" ) );
comboComplex = new KComboBox( FALSE, this );
if( SqlTables::isConnected() )
{
- QSqlQuery* query = new QSqlQuery("select encoding_type from barcode_basic group by encoding_type");
+ TQSqlQuery* query = new TQSqlQuery("select encoding_type from barcode_basic group by encoding_type");
while( query->next() )
comboComplex->insertItem( "Main:" + query->value( 0 ).toString() );
delete query;
- query = new QSqlQuery("select customer_no, encoding_type from customer_text group by customer_no, encoding_type");
+ query = new TQSqlQuery("select customer_no, encoding_type from customer_text group by customer_no, encoding_type");
while( query->next() )
comboComplex->insertItem( query->value( 0 ).toString() + ":" + query->value( 1 ).toString() );
delete query;
@@ -231,8 +231,8 @@ PropertyBarcode::PropertyBarcode( TokenProvider* token, QWidget* parent )
barcode = new BarcodeWidget( this, "barcode" );
barcode->setTokenProvider( token );
- //connect( this, SIGNAL( defaultClicked() ), this, SLOT( defaults() ) );
- connect( comboComplex, SIGNAL( activated(int) ), this, SLOT(changedCombo() ) );
+ //connect( this, TQT_SIGNAL( defaultClicked() ), this, TQT_SLOT( defaults() ) );
+ connect( comboComplex, TQT_SIGNAL( activated(int) ), this, TQT_SLOT(changedCombo() ) );
grid->addWidget( TextLabel1, 0, 0 );
grid->addWidget( comboComplex, 0, 1 );
@@ -287,8 +287,8 @@ void PropertyBarcode::initSettings( DocumentItem* item )
changedCombo();
}
-PropertyText::PropertyText( TokenProvider* token, QWidget* parent )
- : PropertyWidget( parent )
+PropertyText::PropertyText( TokenProvider* token, TQWidget* tqparent )
+ : PropertyWidget( tqparent )
{
m_editor = new MultiLineEditor( token, this, "m_editor" );
grid->addWidget( m_editor, 0, 0 );
@@ -310,8 +310,8 @@ void PropertyText::initSettings( DocumentItem* item )
}
//NY21
-PropertyTextLine::PropertyTextLine( TokenProvider* token, QWidget* parent )
- : PropertyWidget( parent )
+PropertyTextLine::PropertyTextLine( TokenProvider* token, TQWidget* tqparent )
+ : PropertyWidget( tqparent )
{
m_editor = new TextLineEditor( token, this );
grid->addWidget( m_editor, 0, 0 );
@@ -336,14 +336,14 @@ void PropertyTextLine::initSettings( DocumentItem* item )
}
//NY21
-PropertySize::PropertySize( QWidget* parent )
- : PropertyWidget( parent )
+PropertySize::PropertySize( TQWidget* tqparent )
+ : PropertyWidget( tqparent )
{
const double low = -1000.0;
const double max = 1000.0;
- QVBox* box = new QVBox( this );
+ TQVBox* box = new TQVBox( this );
- checkLock = new QCheckBox( i18n("&Protect item from being moved or resized"), box );
+ checkLock = new TQCheckBox( i18n("&Protect item from being moved or resized"), box );
numTop = new KDoubleNumInput( low, max, 0.0, 0.2, 3, box );
numLeft = new KDoubleNumInput( numTop, low, max, 0.0, 0.2, 3, box );
numHeight = new KDoubleNumInput( numLeft, low, max, 0.0, 0.2, 3, box );
@@ -361,7 +361,7 @@ PropertySize::PropertySize( QWidget* parent )
grid->addWidget( box, 0, 0 );
- connect( checkLock, SIGNAL( clicked() ), this, SLOT( enableControls() ));
+ connect( checkLock, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ));
}
void PropertySize::enableControls()
@@ -374,8 +374,8 @@ void PropertySize::enableControls()
void PropertySize::applySettings( DocumentItem* item, KMacroCommand* command )
{
- QRect r = item->rect();
- QPoint translation( 0, 0 );
+ TQRect r = item->rect();
+ TQPoint translation( 0, 0 );
TCanvasItem* canvasItem = item->canvasItem();
if( canvasItem )
@@ -431,8 +431,8 @@ void PropertySize::applySettings( DocumentItem* item, KMacroCommand* command )
void PropertySize::initSettings( DocumentItem* item )
{
- QRect r = item->rectMM();
- QPoint translation( 0, 0 );
+ TQRect r = item->rectMM();
+ TQPoint translation( 0, 0 );
TCanvasItem* canvasItem = item->canvasItem();
if( canvasItem )
@@ -460,40 +460,40 @@ void PropertySize::initSettings( DocumentItem* item )
enableControls();
}
-PropertyImage::PropertyImage( TokenProvider* token, QWidget* parent )
- : PropertyWidget( parent ), m_token( token )
+PropertyImage::PropertyImage( TokenProvider* token, TQWidget* tqparent )
+ : PropertyWidget( tqparent ), m_token( token )
{
- QLabel* label = new QLabel( i18n("&Rotation:"), this );
+ TQLabel* label = new TQLabel( i18n("&Rotation:"), this );
comboRotation = new KComboBox( FALSE, this );
label->setBuddy( comboRotation );
- QVButtonGroup* groupFile = new QVButtonGroup( i18n("&Image"), this );
- radioImagePath = new QRadioButton( i18n("&Load image from path"), groupFile );
+ TQVButtonGroup* groupFile = new TQVButtonGroup( i18n("&Image"), this );
+ radioImagePath = new TQRadioButton( i18n("&Load image from path"), groupFile );
imgUrl = new KURLRequester( groupFile );
imgUrl->setFilter( KImageIO::pattern( KImageIO::Reading ) );
imgUrl->setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly );
- radioImageExpression = new QRadioButton( i18n("&Read image path from expression"), groupFile );
+ radioImageExpression = new TQRadioButton( i18n("&Read image path from expression"), groupFile );
- imgHBox = new QHBox( groupFile );
+ imgHBox = new TQHBox( groupFile );
imgHBox->setSpacing( 5 );
imgExpression = new KLineEdit( imgHBox );
buttonToken = new KPushButton( i18n("&Insert Data Field..."), imgHBox );
- buttonToken->setIconSet( QIconSet( SmallIcon("contents") ) );
+ buttonToken->setIconSet( TQIconSet( SmallIcon("contents") ) );
comboRotation->insertItem( i18n("0") );
comboRotation->insertItem( i18n("90") );
comboRotation->insertItem( i18n("180") );
comboRotation->insertItem( i18n("270") );
- QVButtonGroup* group = new QVButtonGroup( i18n("&Size"), this );
+ TQVButtonGroup* group = new TQVButtonGroup( i18n("&Size"), this );
- radioOriginal = new QRadioButton( i18n("&None"), group );
- radioZoomed = new QRadioButton( i18n("&Zoom"), group );
- radioScaled = new QRadioButton( i18n("S&cale"), group );
+ radioOriginal = new TQRadioButton( i18n("&None"), group );
+ radioZoomed = new TQRadioButton( i18n("&Zoom"), group );
+ radioScaled = new TQRadioButton( i18n("S&cale"), group );
- checkMirrorH = new QCheckBox( i18n("Mirror &Horizontaly"), this );
- checkMirrorV = new QCheckBox( i18n("Mirror &Vertically"), this );
+ checkMirrorH = new TQCheckBox( i18n("Mirror &Horizontaly"), this );
+ checkMirrorV = new TQCheckBox( i18n("Mirror &Vertically"), this );
grid->addMultiCellWidget( groupFile, 0, 1, 0, 1 );
grid->addMultiCellWidget( group, 2, 3, 0, 1 );
@@ -502,9 +502,9 @@ PropertyImage::PropertyImage( TokenProvider* token, QWidget* parent )
grid->addMultiCellWidget( checkMirrorH, 5, 5, 0, 1 );
grid->addMultiCellWidget( checkMirrorV, 6, 6, 0, 1 );
- connect( radioImageExpression, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioImagePath, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( buttonToken, SIGNAL( clicked() ), this, SLOT( slotTokens() ) );
+ connect( radioImageExpression, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioImagePath, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( buttonToken, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotTokens() ) );
}
void PropertyImage::applySettings( DocumentItem* item, KMacroCommand* command )
@@ -512,14 +512,14 @@ void PropertyImage::applySettings( DocumentItem* item, KMacroCommand* command )
ImageItem* img = static_cast<ImageItem*>(item);
EImageScaling scaling = eImage_Original;
double rot = 0.0;
- QPixmap pix;
+ TQPixmap pix;
if( radioImagePath->isChecked() )
{
if( !imgUrl->url().isEmpty() )
{
if( !pix.load( imgUrl->url() ) )
- KMessageBox::error( NULL, QString( i18n("Image format not supported for file: %1") ).arg( imgUrl->url() ) );
+ KMessageBox::error( NULL, TQString( i18n("Image format not supported for file: %1") ).tqarg( imgUrl->url() ) );
}
else
{
@@ -540,7 +540,7 @@ void PropertyImage::applySettings( DocumentItem* item, KMacroCommand* command )
rot = 270.0;
PictureCommand* pc = new PictureCommand( rot, checkMirrorH->isChecked(), checkMirrorV->isChecked(), scaling, img );
- pc->setExpression( radioImageExpression->isChecked() ? imgExpression->text() : QString::null );
+ pc->setExpression( radioImageExpression->isChecked() ? imgExpression->text() : TQString() );
pc->setPixmap( pix );
pc->execute();
command->addCommand( pc );
@@ -549,7 +549,7 @@ void PropertyImage::applySettings( DocumentItem* item, KMacroCommand* command )
void PropertyImage::initSettings( DocumentItem* item )
{
ImageItem* img = static_cast<ImageItem*>(item);
- QString expr = img->expression();
+ TQString expr = img->expression();
if( !expr.isEmpty() )
{
@@ -601,14 +601,14 @@ void PropertyImage::enableControls()
void PropertyImage::slotTokens()
{
TokenDialog tokendlg( m_token, this, "tokendlg" );
- if( tokendlg.exec() == QDialog::Accepted )
+ if( tokendlg.exec() == TQDialog::Accepted )
imgExpression->insert( tokendlg.token() );
}
-PropertyVisible::PropertyVisible( QWidget* parent )
- : PropertyWidget( parent )
+PropertyVisible::PropertyVisible( TQWidget* tqparent )
+ : PropertyWidget( tqparent )
{
- QLabel* label = new QLabel( i18n("Evaluate JavsScript code to define the visibility of this item:"), this );
+ TQLabel* label = new TQLabel( i18n("Evaluate JavsScript code to define the visibility of this item:"), this );
m_script = new KTextEdit( this );
grid->addWidget( label, 0, 0 );
diff --git a/kbarcode/propertywidget.h b/kbarcode/propertywidget.h
index bc2ea78..2d59ea4 100644
--- a/kbarcode/propertywidget.h
+++ b/kbarcode/propertywidget.h
@@ -18,7 +18,7 @@
#ifndef PROPERTYWIDGET_H
#define PROPERTYWIDGET_H
-#include <qwidget.h>
+#include <tqwidget.h>
#include "labelutils.h"
class BarcodeWidget;
@@ -30,15 +30,15 @@ class KDoubleNumInput;
class KMacroCommand;
class KTextEdit;
class MultiLineEditor;
-class QCheckBox;
-class QGridLayout;
-class QRadioButton;
+class TQCheckBox;
+class TQGridLayout;
+class TQRadioButton;
//NY23
class TextLineEditor;
//NY23
class TokenProvider;
-class QHBox;
+class TQHBox;
class KURLRequester;
class KLineEdit;
class KPushButton;
@@ -46,23 +46,25 @@ class KPushButton;
/**
@author Dominik Seichter
*/
-class PropertyWidget : public QWidget
+class PropertyWidget : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- PropertyWidget( QWidget* parent );
+ PropertyWidget( TQWidget* tqparent );
virtual void applySettings( DocumentItem* item, KMacroCommand* command ) = 0;
virtual void initSettings( DocumentItem* item ) = 0;
protected:
- QGridLayout* grid;
+ TQGridLayout* grid;
};
class PropertyBorder : public PropertyWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- PropertyBorder( QWidget* parent );
+ PropertyBorder( TQWidget* tqparent );
virtual void applySettings( DocumentItem* item, KMacroCommand* command );
virtual void initSettings( DocumentItem* item );
@@ -74,13 +76,14 @@ class PropertyBorder : public PropertyWidget {
KColorButton* buttonColor;
KComboBox* comboLine;
KIntNumInput* spinWidth;
- QCheckBox* checkBorder;
+ TQCheckBox* checkBorder;
};
class PropertyRotation : public PropertyWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- PropertyRotation( QWidget* parent );
+ PropertyRotation( TQWidget* tqparent );
virtual void applySettings( DocumentItem* item, KMacroCommand* command );
virtual void initSettings( DocumentItem* item );
@@ -91,8 +94,9 @@ class PropertyRotation : public PropertyWidget {
class PropertyFill : public PropertyWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- PropertyFill( QWidget* parent );
+ PropertyFill( TQWidget* tqparent );
virtual void applySettings( DocumentItem* item, KMacroCommand* command );
virtual void initSettings( DocumentItem* item );
@@ -103,8 +107,9 @@ class PropertyFill : public PropertyWidget {
class PropertyBarcode : public PropertyWidget, private LabelUtils {
Q_OBJECT
+ TQ_OBJECT
public:
- PropertyBarcode( TokenProvider* token, QWidget* parent );
+ PropertyBarcode( TokenProvider* token, TQWidget* tqparent );
virtual void applySettings( DocumentItem* item, KMacroCommand* command );
virtual void initSettings( DocumentItem* item );
@@ -119,8 +124,9 @@ class PropertyBarcode : public PropertyWidget, private LabelUtils {
class PropertyText : public PropertyWidget, private LabelUtils {
Q_OBJECT
+ TQ_OBJECT
public:
- PropertyText( TokenProvider* token, QWidget* parent );
+ PropertyText( TokenProvider* token, TQWidget* tqparent );
virtual void applySettings( DocumentItem* item, KMacroCommand* command );
virtual void initSettings( DocumentItem* item );
@@ -132,8 +138,9 @@ class PropertyText : public PropertyWidget, private LabelUtils {
//NY22
class PropertyTextLine : public PropertyWidget, private LabelUtils {
Q_OBJECT
+ TQ_OBJECT
public:
- PropertyTextLine( TokenProvider* token, QWidget* parent );
+ PropertyTextLine( TokenProvider* token, TQWidget* tqparent );
virtual void applySettings( DocumentItem* item, KMacroCommand* command );
virtual void initSettings( DocumentItem* item );
@@ -145,8 +152,9 @@ class PropertyTextLine : public PropertyWidget, private LabelUtils {
class PropertySize : public PropertyWidget, private LabelUtils {
Q_OBJECT
+ TQ_OBJECT
public:
- PropertySize( QWidget* parent );
+ PropertySize( TQWidget* tqparent );
virtual void applySettings( DocumentItem* item, KMacroCommand* command );
virtual void initSettings( DocumentItem* item );
@@ -155,7 +163,7 @@ class PropertySize : public PropertyWidget, private LabelUtils {
void enableControls();
private:
- QCheckBox* checkLock;
+ TQCheckBox* checkLock;
KDoubleNumInput* numTop;
KDoubleNumInput* numLeft;
KDoubleNumInput* numWidth;
@@ -164,8 +172,9 @@ class PropertySize : public PropertyWidget, private LabelUtils {
class PropertyImage : public PropertyWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- PropertyImage( TokenProvider* token, QWidget* parent );
+ PropertyImage( TokenProvider* token, TQWidget* tqparent );
virtual void applySettings( DocumentItem* item, KMacroCommand* command );
virtual void initSettings( DocumentItem* item );
@@ -177,28 +186,29 @@ class PropertyImage : public PropertyWidget {
private:
TokenProvider* m_token;
- QCheckBox* checkMirrorH;
- QCheckBox* checkMirrorV;
+ TQCheckBox* checkMirrorH;
+ TQCheckBox* checkMirrorV;
- QHBox* imgHBox;
+ TQHBox* imgHBox;
KComboBox* comboRotation;
KURLRequester* imgUrl;
KLineEdit* imgExpression;
KPushButton* buttonToken;
- QRadioButton* radioImagePath;
- QRadioButton* radioImageExpression;
+ TQRadioButton* radioImagePath;
+ TQRadioButton* radioImageExpression;
- QRadioButton* radioOriginal;
- QRadioButton* radioScaled;
- QRadioButton* radioZoomed;
+ TQRadioButton* radioOriginal;
+ TQRadioButton* radioScaled;
+ TQRadioButton* radioZoomed;
};
class PropertyVisible : public PropertyWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- PropertyVisible( QWidget* parent );
+ PropertyVisible( TQWidget* tqparent );
virtual void applySettings( DocumentItem* item, KMacroCommand* command );
virtual void initSettings( DocumentItem* item );
diff --git a/kbarcode/purepostscript.cpp b/kbarcode/purepostscript.cpp
index 0b543e6..e2f80f6 100644
--- a/kbarcode/purepostscript.cpp
+++ b/kbarcode/purepostscript.cpp
@@ -20,9 +20,9 @@
#include <stdlib.h>
-#include <qdom.h>
-#include <qfile.h>
-#include <qtextstream.h>
+#include <tqdom.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
#include <kstandarddirs.h>
#include <ktempfile.h>
@@ -31,7 +31,7 @@
#define BEGIN_TEMPLATE "--BEGIN TEMPLATE--"
#define END_TEMPLATE "--END TEMPLATE--"
-QString PurePostscriptBarcode::s_path = QString::null;
+TQString PurePostscriptBarcode::s_path = TQString();
PurePostscriptOptions::PurePostscriptOptions()
: BarkodeEngineOptions()
@@ -53,12 +53,12 @@ void PurePostscriptOptions::defaults()
m_check = false;
}
-void PurePostscriptOptions::load( const QDomElement* tag )
+void PurePostscriptOptions::load( const TQDomElement* tag )
{
m_check = (bool)tag->attribute( "pure.check", "0" ).toInt();
}
-void PurePostscriptOptions::save( QDomElement* tag )
+void PurePostscriptOptions::save( TQDomElement* tag )
{
tag->setAttribute( "pure.check", (int)m_check );
}
@@ -67,7 +67,7 @@ PurePostscriptBarcode::PurePostscriptBarcode()
: PixmapBarcode()
{
bool append = false;
- QString line;
+ TQString line;
if( s_path.isNull() )
{
@@ -75,20 +75,20 @@ PurePostscriptBarcode::PurePostscriptBarcode()
return;
}
- QFile pureFile( s_path );
+ TQFile pureFile( s_path );
if( pureFile.open( IO_ReadOnly ) )
{
while( pureFile.readLine( line, MAX_LINE_LENGTH ) != -1 )
{
if( append )
{
- if( line.contains( END_TEMPLATE ) )
+ if( line.tqcontains( END_TEMPLATE ) )
break;
m_program.append( line );
}
- if( !append && line.contains( BEGIN_TEMPLATE ) )
+ if( !append && line.tqcontains( BEGIN_TEMPLATE ) )
append = true;
}
pureFile.close();
@@ -105,14 +105,14 @@ void PurePostscriptBarcode::init()
{
// first look at the default location
const char* default_barcode = "/usr/share/libpostscriptbarcode/barcode.ps";
- if( QFile::exists( default_barcode ) )
+ if( TQFile::exists( default_barcode ) )
s_path = default_barcode;
else
s_path = locate( "data", "kbarcode/barcode.ps" );
}
- if( !QFile::exists( s_path ) )
- s_path = QString::null;
+ if( !TQFile::exists( s_path ) )
+ s_path = TQString();
}
#define START_TOKEN "% --"
@@ -124,13 +124,13 @@ void PurePostscriptBarcode::initInfo( TBarcodeInfoList* info )
{
PurePostscriptBarcode::init();
- QFile pureFile( s_path );
+ TQFile pureFile( s_path );
if( pureFile.open( IO_ReadOnly ) )
{
- QString encoder;
- QString description;
- QString example;
- QString line;
+ TQString encoder;
+ TQString description;
+ TQString example;
+ TQString line;
while( pureFile.readLine( line, MAX_LINE_LENGTH ) != -1 )
{
@@ -145,22 +145,22 @@ void PurePostscriptBarcode::initInfo( TBarcodeInfoList* info )
// remove all whitespaces on the line ending (and '-')
line = line.stripWhiteSpace();
- line = line.right( line.length() - QString( START_TOKEN ).length() );
+ line = line.right( line.length() - TQString( START_TOKEN ).length() );
if( line.startsWith( BEGIN_ENCODER ) )
{
- encoder = line.right( line.length() - QString( BEGIN_ENCODER ).length() );
+ encoder = line.right( line.length() - TQString( BEGIN_ENCODER ).length() );
if( encoder.endsWith( "--" ) )
encoder = encoder.left( encoder.length() - 2 );
}
else if( line.startsWith( DESCRIPTION ) )
- description = line.right( line.length() - QString( DESCRIPTION ).length() );
+ description = line.right( line.length() - TQString( DESCRIPTION ).length() );
else if( line.startsWith( EXAMPLE ) )
{
- example = line.right( line.length() - QString( EXAMPLE ).length() );
+ example = line.right( line.length() - TQString( EXAMPLE ).length() );
// we should have a complete encoder now.
- info->append( Barkode::createInfo( QString("ps_") + encoder, description, PURE_POSTSCRIPT, PUREADV | COLORED ) );
+ info->append( Barkode::createInfo( TQString("ps_") + encoder, description, PURE_POSTSCRIPT, PUREADV | COLORED ) );
}
}
}
@@ -173,11 +173,11 @@ bool PurePostscriptBarcode::hasPurePostscriptBarcode()
return !s_path.isNull();
}
-void PurePostscriptBarcode::createProgram( QString & prg )
+void PurePostscriptBarcode::createProgram( TQString & prg )
{
const PurePostscriptOptions* options = (dynamic_cast<const PurePostscriptOptions*>(barkode->engine()->options()));
- QString type = barkode->type().right( barkode->type().length() - 3 );
- QString opt;
+ TQString type = barkode->type().right( barkode->type().length() - 3 );
+ TQString opt;
opt.sprintf( "%s %s barcolor=%02X%02X%02X showbackground backgroundcolor=%02X%02X%02X textcolor=%02X%02X%02X",
barkode->textVisible() ? "includetext" : "",
@@ -189,27 +189,27 @@ void PurePostscriptBarcode::createProgram( QString & prg )
prg = "%!PS-Adobe-2.0 EPSF-2.0\n%%EndComments\n%%EndProlog\n";
prg += m_program;
- prg += QString("20 20 moveto\n(%1) (%2) %3 barcode\n")
- .arg( barkode->parsedValue() )
- .arg( opt ).arg( type );
+ prg += TQString("20 20 moveto\n(%1) (%2) %3 barcode\n")
+ .tqarg( barkode->parsedValue() )
+ .tqarg( opt ).tqarg( type );
}
-QRect PurePostscriptBarcode::bbox( const char* postscript, long postscript_size )
+TQRect PurePostscriptBarcode::bbox( const char* postscript, long postscript_size )
{
const char* gs_bbox = "gs -sDEVICE=bbox -sNOPAUSE -q %1 -c showpage quit 2>&1";
char* buffer = NULL;
long len = 0;
- QRect size;
+ TQRect size;
- KTempFile psfile( QString::null, ".ps" );
+ KTempFile psfile( TQString(), ".ps" );
psfile.file()->writeBlock( postscript, postscript_size );
psfile.file()->close();
- if( !readFromPipe( QString( gs_bbox ).arg( psfile.file()->name() ).latin1(), &buffer, &len ) || !len )
+ if( !readFromPipe( TQString( gs_bbox ).tqarg( psfile.file()->name() ).latin1(), &buffer, &len ) || !len )
{
psfile.unlink();
- return QRect( 0, 0, 0, 0 );
+ return TQRect( 0, 0, 0, 0 );
}
else
psfile.unlink();
@@ -222,7 +222,7 @@ QRect PurePostscriptBarcode::bbox( const char* postscript, long postscript_size
bool PurePostscriptBarcode::createPostscript( char** postscript, long* postscript_size )
{
- QString cmd;
+ TQString cmd;
if( m_program.isEmpty() )
return false;
diff --git a/kbarcode/purepostscript.h b/kbarcode/purepostscript.h
index 406fbc9..b6f56b0 100644
--- a/kbarcode/purepostscript.h
+++ b/kbarcode/purepostscript.h
@@ -22,7 +22,7 @@
#include "pixmapbarcode.h"
#include "barkode.h"
-#include <qcstring.h>
+#include <tqcstring.h>
class PurePostscriptOptions : public BarkodeEngineOptions {
public:
@@ -31,8 +31,8 @@ class PurePostscriptOptions : public BarkodeEngineOptions {
const BarkodeEngineOptions& operator=( const BarkodeEngineOptions & ps );
void defaults();
- void load( const QDomElement* tag );
- void save( QDomElement* tag );
+ void load( const TQDomElement* tag );
+ void save( TQDomElement* tag );
inline bool checksum() const { return m_check; }
inline void setChecksum( bool b ) { m_check = b; }
@@ -47,7 +47,7 @@ class PurePostscriptBarcode : public PixmapBarcode {
~PurePostscriptBarcode();
/** Initialize PurePostscriptBarcode and set the path to
- * the postscript program file or to QString::null if it cannot be found
+ * the postscript program file or to TQString() if it cannot be found
*/
static void init();
@@ -61,20 +61,20 @@ class PurePostscriptBarcode : public PixmapBarcode {
private:
virtual bool createPostscript( char** postscript, long* postscript_size );
- virtual QRect bbox( const char* postscript, long postscript_size );
+ virtual TQRect bbox( const char* postscript, long postscript_size );
/** Create a program which can be executed by ghostscript from
* m_program and the barcodes data.
* \param prg the program will be written to this string
*/
- void createProgram( QString & prg );
+ void createProgram( TQString & prg );
private:
PurePostscriptOptions m_options;
- QString m_program;
+ TQString m_program;
- static QString s_path;
+ static TQString s_path;
};
EEngine PurePostscriptBarcode::engine() const
diff --git a/kbarcode/rectitem.cpp b/kbarcode/rectitem.cpp
index 4fe2e84..40ce7fa 100644
--- a/kbarcode/rectitem.cpp
+++ b/kbarcode/rectitem.cpp
@@ -17,8 +17,8 @@
#include "rectitem.h"
-#include <qdom.h>
-#include <qpainter.h>
+#include <tqdom.h>
+#include <tqpainter.h>
RectItem::RectItem()
: DocumentItem()
@@ -26,16 +26,16 @@ RectItem::RectItem()
init();
}
-void RectItem::loadXML (QDomElement* element)
+void RectItem::loadXML (TQDomElement* element)
{
DocumentItem::loadXML( element );
- m_color = readXMLColor( element, "fill-color", Qt::white );
+ m_color = readXMLColor( element, "fill-color", TQt::white );
m_filled = element->attribute( "filled", "0" ).toInt();
m_circle = element->attribute( "circle", "0" ).toInt();
}
-void RectItem::saveXML (QDomElement* element)
+void RectItem::saveXML (TQDomElement* element)
{
DocumentItem::saveXML( element );
@@ -44,14 +44,14 @@ void RectItem::saveXML (QDomElement* element)
element->setAttribute( "circle", m_circle );
}
-void RectItem::draw (QPainter* painter)
+void RectItem::draw (TQPainter* painter)
{
if( m_circle )
{
if( m_filled )
{
painter->save();
- painter->setPen( QPen( Qt::NoPen ) );
+ painter->setPen( TQPen( TQt::NoPen ) );
painter->setBrush( m_color );
painter->drawEllipse( rect() );
painter->restore();
@@ -74,19 +74,19 @@ void RectItem::draw (QPainter* painter)
}
}
-void RectItem::drawZpl( QTextStream* stream )
+void RectItem::drawZpl( TQTextStream* stream )
{
// TODO: refactor later and respect millimeters
int thick = pen().width();
*stream << ZPLUtils::fieldOrigin( rect().x(), rect().y() );
if( m_circle )
- *stream << QString("~GE%1,%2,%3,B").arg( rect().width() ).arg( rect().height() ).arg( thick );
+ *stream << TQString("~GE%1,%2,%3,B").tqarg( rect().width() ).tqarg( rect().height() ).tqarg( thick );
else
- *stream << QString("~GB%1,%2,%3,B,0").arg( rect().width() ).arg( rect().height() ).arg( thick );
+ *stream << TQString("~GB%1,%2,%3,B,0").tqarg( rect().width() ).tqarg( rect().height() ).tqarg( thick );
}
-void RectItem::drawIpl( QTextStream* stream, IPLUtils* utils )
+void RectItem::drawIpl( TQTextStream* stream, IPLUtils* utils )
{
// TODO: refactor later and respect millimeters
int thick = pen().width();
@@ -97,42 +97,42 @@ void RectItem::drawIpl( QTextStream* stream, IPLUtils* utils )
{
int counter = utils->counter();
- QString s = QString("W%1;").arg( counter ); // field number
+ TQString s = TQString("W%1;").tqarg( counter ); // field number
s += utils->fieldOrigin( rect().x(), rect().y() );
- s += QString("l%1;").arg( rect().width() ); // box length
- s += QString("h%1;").arg( rect().height() ); // box height
- s += QString("w%1;").arg( thick );
+ s += TQString("l%1;").tqarg( rect().width() ); // box length
+ s += TQString("h%1;").tqarg( rect().height() ); // box height
+ s += TQString("w%1;").tqarg( thick );
*stream << utils->field( s );
}
}
-void RectItem::drawEPcl( QTextStream* stream )
+void RectItem::drawEPcl( TQTextStream* stream )
{
- QString s = QString("C %1").arg( rect().x()+1 );
- s += QString(" %1").arg( rect().y()+1 );
- s += QString(" %1").arg( rect().width() );
- s += QString(" %1").arg( rect().height() );
- s += QString(" %1 2").arg( pen().width() );
+ TQString s = TQString("C %1").tqarg( rect().x()+1 );
+ s += TQString(" %1").tqarg( rect().y()+1 );
+ s += TQString(" %1").tqarg( rect().width() );
+ s += TQString(" %1").tqarg( rect().height() );
+ s += TQString(" %1 2").tqarg( pen().width() );
*stream << EPCLUtils::field( s );
}
void RectItem::init()
{
- m_color = Qt::white;
+ m_color = TQt::white;
m_filled = true;
m_circle = false;
- setRect( QRect( 0, 0, 20, 20 ) );
+ setRect( TQRect( 0, 0, 20, 20 ) );
}
-void RectItem::setColor (const QColor & c)
+void RectItem::setColor (const TQColor & c)
{
m_color = c;
}
-QColor RectItem::color () const
+TQColor RectItem::color () const
{
return m_color;
}
diff --git a/kbarcode/rectitem.h b/kbarcode/rectitem.h
index c820db2..3686899 100644
--- a/kbarcode/rectitem.h
+++ b/kbarcode/rectitem.h
@@ -17,9 +17,9 @@
#ifndef RECTITEM_H
#define RECTITEM_H
-#include <qstring.h>
+#include <tqstring.h>
#include "documentitem.h"
-#include "qcolor.h"
+#include "tqcolor.h"
/**
* Class RectItem
@@ -34,8 +34,8 @@ public:
*
* @param c
*/
- void setColor (const QColor & c=Qt::black);
- QColor color () const;
+ void setColor (const TQColor & c=TQt::black);
+ TQColor color () const;
/**
@@ -52,12 +52,12 @@ public:
void setCircle (bool b=false);
bool circle () const;
- void loadXML (QDomElement* element);
- void saveXML (QDomElement* element);
- void draw (QPainter* painter);
- void drawZpl( QTextStream* stream );
- void drawIpl( QTextStream* stream, IPLUtils* utils );
- void drawEPcl( QTextStream* stream );
+ void loadXML (TQDomElement* element);
+ void saveXML (TQDomElement* element);
+ void draw (TQPainter* painter);
+ void drawZpl( TQTextStream* stream );
+ void drawIpl( TQTextStream* stream, IPLUtils* utils );
+ void drawEPcl( TQTextStream* stream );
private:
void init();
@@ -65,7 +65,7 @@ private:
private:
bool m_circle;
bool m_filled;
- QColor m_color;
+ TQColor m_color;
};
#endif //RECTITEM_H
diff --git a/kbarcode/rectsettingsdlg.cpp b/kbarcode/rectsettingsdlg.cpp
index 7cb112a..9f5fa45 100644
--- a/kbarcode/rectsettingsdlg.cpp
+++ b/kbarcode/rectsettingsdlg.cpp
@@ -17,12 +17,12 @@
#include "rectsettingsdlg.h"
-// Qt includes
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpainter.h>
-#include <qpen.h>
+// TQt includes
+#include <tqcheckbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqpainter.h>
+#include <tqpen.h>
// KDE includes
#include <kcolorbutton.h>
@@ -33,16 +33,16 @@
void fillLineCombo( KComboBox* box )
{
/* A small helper function to fill
- * a combobox with all by Qt
+ * a combobox with all by TQt
* supported pen styles.
*/
- QPainter p;
+ TQPainter p;
for( int i = 1; i < 6; i++ ) {
- QPixmap pixmap( 60, 20 );
- pixmap.fill( Qt::white );
+ TQPixmap pixmap( 60, 20 );
+ pixmap.fill( TQt::white );
p.begin( &pixmap );
- p.setPen( QPen( Qt::black, 3, (Qt::PenStyle)i ) );
+ p.setPen( TQPen( TQt::black, 3, (TQt::PenStyle)i ) );
p.drawLine( 5, 10, 55, 10 );
p.end();
@@ -50,13 +50,13 @@ void fillLineCombo( KComboBox* box )
}
}
-RectSettingsDlg::RectSettingsDlg(QWidget *parent, const char *name )
+RectSettingsDlg::RectSettingsDlg(TQWidget *tqparent, const char *name )
: KDialogBase( KDialogBase::Plain, i18n("Settings"),
- KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, parent,name)
+ KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, tqparent,name)
{
- QFrame* frame = plainPage();
- QGridLayout* grid = new QGridLayout( frame, 6, 6 );
- QSpacerItem* spacer = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ TQFrame* frame = plainPage();
+ TQGridLayout* grid = new TQGridLayout( frame, 6, 6 );
+ TQSpacerItem* spacer = new TQSpacerItem( 0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
buttonBorder = new KColorButton( frame );
@@ -68,20 +68,20 @@ RectSettingsDlg::RectSettingsDlg(QWidget *parent, const char *name )
comboLine = new KComboBox( false, frame );
fillLineCombo( comboLine );
- checkBorder = new QCheckBox( i18n("&Enable Border"), frame );
+ checkBorder = new TQCheckBox( i18n("&Enable Border"), frame );
- grid->addWidget( new QLabel( i18n("Fill Color:"), frame ), 0, 0 );
+ grid->addWidget( new TQLabel( i18n("Fill Color:"), frame ), 0, 0 );
grid->addWidget( buttonFill, 0, 1 );
grid->addItem( spacer, 1, 0 );
grid->addWidget( checkBorder, 2, 0 );
- grid->addWidget( new QLabel( i18n("Border Color:"), frame ), 3, 0 );
+ grid->addWidget( new TQLabel( i18n("Border Color:"), frame ), 3, 0 );
grid->addWidget( buttonBorder, 3, 1 );
- grid->addWidget( new QLabel( i18n("Border Width:"), frame ), 4, 0 );
+ grid->addWidget( new TQLabel( i18n("Border Width:"), frame ), 4, 0 );
grid->addWidget( spinWidth, 4, 1 );
- grid->addWidget( new QLabel( i18n("Line Style:"), frame ), 5, 0 );
+ grid->addWidget( new TQLabel( i18n("Line Style:"), frame ), 5, 0 );
grid->addWidget( comboLine, 5, 1 );
- connect( checkBorder, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
+ connect( checkBorder, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
}
RectSettingsDlg::~RectSettingsDlg()
@@ -95,12 +95,12 @@ void RectSettingsDlg::enableControls()
comboLine->setEnabled( checkBorder->isChecked() );
}
-void RectSettingsDlg::setBorderColor( const QColor & c )
+void RectSettingsDlg::setBorderColor( const TQColor & c )
{
buttonBorder->setColor( c );
}
-void RectSettingsDlg::setFillColor( const QColor & c )
+void RectSettingsDlg::setFillColor( const TQColor & c )
{
buttonFill->setColor( c );
}
@@ -121,12 +121,12 @@ void RectSettingsDlg::setPenStyle( int s )
enableControls();
}
-const QColor RectSettingsDlg::borderColor() const
+const TQColor RectSettingsDlg::borderColor() const
{
return buttonBorder->color();
}
-const QColor RectSettingsDlg::fillColor() const
+const TQColor RectSettingsDlg::fillColor() const
{
return buttonFill->color();
}
@@ -141,12 +141,12 @@ int RectSettingsDlg::penStyle() const
return checkBorder->isChecked() ? comboLine->currentItem() + 1 : 0;
}
-LineSettingsDlg::LineSettingsDlg(QWidget *parent, const char *name )
+LineSettingsDlg::LineSettingsDlg(TQWidget *tqparent, const char *name )
: KDialogBase( KDialogBase::Plain, i18n("Settings"),
- KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, parent,name)
+ KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, tqparent,name)
{
- QFrame* frame = plainPage();
- QGridLayout* grid = new QGridLayout( frame, 6, 6 );
+ TQFrame* frame = plainPage();
+ TQGridLayout* grid = new TQGridLayout( frame, 6, 6 );
buttonColor = new KColorButton( frame );
@@ -156,11 +156,11 @@ LineSettingsDlg::LineSettingsDlg(QWidget *parent, const char *name )
comboLine = new KComboBox( false, frame );
fillLineCombo( comboLine );
- grid->addWidget( new QLabel( i18n("Color:"), frame ), 0, 0 );
+ grid->addWidget( new TQLabel( i18n("Color:"), frame ), 0, 0 );
grid->addWidget( buttonColor, 0, 1 );
- grid->addWidget( new QLabel( i18n("Line Width:"), frame ), 1, 0 );
+ grid->addWidget( new TQLabel( i18n("Line Width:"), frame ), 1, 0 );
grid->addWidget( spinWidth, 1, 1 );
- grid->addWidget( new QLabel( i18n("Line Style:"), frame ), 2, 0 );
+ grid->addWidget( new TQLabel( i18n("Line Style:"), frame ), 2, 0 );
grid->addWidget( comboLine, 2, 1 );
}
@@ -168,12 +168,12 @@ LineSettingsDlg::~LineSettingsDlg()
{
}
-QPen LineSettingsDlg::pen() const
+TQPen LineSettingsDlg::pen() const
{
- return QPen( buttonColor->color(), spinWidth->value(), (Qt::PenStyle)(comboLine->currentItem() + 1) );
+ return TQPen( buttonColor->color(), spinWidth->value(), (TQt::PenStyle)(comboLine->currentItem() + 1) );
}
-void LineSettingsDlg::setPen( const QPen p )
+void LineSettingsDlg::setPen( const TQPen p )
{
buttonColor->setColor( p.color() );
spinWidth->setValue( p.width() );
diff --git a/kbarcode/rectsettingsdlg.h b/kbarcode/rectsettingsdlg.h
index 5bcd5f4..6a005b7 100644
--- a/kbarcode/rectsettingsdlg.h
+++ b/kbarcode/rectsettingsdlg.h
@@ -23,20 +23,21 @@
class KColorButton;
class KComboBox;
class KIntNumInput;
-class QCheckBox;
+class TQCheckBox;
class RectSettingsDlg : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
- RectSettingsDlg(QWidget *parent=0, const char *name=0);
+ RectSettingsDlg(TQWidget *tqparent=0, const char *name=0);
~RectSettingsDlg();
- void setBorderColor( const QColor & c );
- void setFillColor( const QColor & c );
+ void setBorderColor( const TQColor & c );
+ void setFillColor( const TQColor & c );
void setBorderWidth( int w );
void setPenStyle( int s );
- const QColor borderColor() const;
- const QColor fillColor() const;
+ const TQColor borderColor() const;
+ const TQColor fillColor() const;
int borderWidth() const;
int penStyle() const;
@@ -48,20 +49,21 @@ class RectSettingsDlg : public KDialogBase {
KColorButton* buttonFill;
KComboBox* comboLine;
- QCheckBox* checkBorder;
+ TQCheckBox* checkBorder;
KIntNumInput* spinWidth;
};
-class QPen;
+class TQPen;
class LineSettingsDlg : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
- LineSettingsDlg(QWidget *parent=0, const char *name=0);
+ LineSettingsDlg(TQWidget *tqparent=0, const char *name=0);
~LineSettingsDlg();
- void setPen( const QPen p );
- QPen pen() const;
+ void setPen( const TQPen p );
+ TQPen pen() const;
private:
KColorButton* buttonColor;
diff --git a/kbarcode/smalldialogs.cpp b/kbarcode/smalldialogs.cpp
index 232e2f0..45feabc 100644
--- a/kbarcode/smalldialogs.cpp
+++ b/kbarcode/smalldialogs.cpp
@@ -18,10 +18,10 @@
#include "smalldialogs.h"
#include "sqltables.h"
-// Qt includes
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qsqlcursor.h>
+// TQt includes
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqsqlcursor.h>
// KDE includes
#include <knuminput.h>
@@ -31,23 +31,23 @@
using namespace DSSmallDialogs;
-AddAllDialog::AddAllDialog(QWidget *parent, const char *name )
+AddAllDialog::AddAllDialog(TQWidget *tqparent, const char *name )
: KDialogBase( KDialogBase::Plain, i18n("Add Barcode_basic"),
- KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, parent,name)
+ KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, tqparent,name)
{
- QVBoxLayout* layout = new QVBoxLayout( plainPage(), 6, 6 );
+ TQVBoxLayout* tqlayout = new TQVBoxLayout( plainPage(), 6, 6 );
group = new KLineEdit( plainPage() );
number = new KIntNumInput( plainPage() );
number->setLabel( i18n( "Number of labels:" ) );
number->setRange( 1, 10000, 1, false );
- layout->addWidget( new QLabel( i18n("Group:"), plainPage() ) );
- layout->addWidget( group );
- layout->addWidget( number );
+ tqlayout->addWidget( new TQLabel( i18n("Group:"), plainPage() ) );
+ tqlayout->addWidget( group );
+ tqlayout->addWidget( number );
}
-QString AddAllDialog::groupName() const
+TQString AddAllDialog::groupName() const
{
return group->text();
}
@@ -57,16 +57,16 @@ int AddAllDialog::numberLabels() const
return number->value();
}
-AddItemsDialog::AddItemsDialog(QWidget *parent, const char *name )
+AddItemsDialog::AddItemsDialog(TQWidget *tqparent, const char *name )
: KDialogBase( KDialogBase::Plain, i18n("Add Items"),
- KDialogBase::User1 | KDialogBase::Close, KDialogBase::User1, parent,name)
+ KDialogBase::User1 | KDialogBase::Close, KDialogBase::User1, tqparent,name)
{
init();
}
-AddItemsDialog::AddItemsDialog( const QString & a, const QString & g, int c, QWidget* parent, const char* name )
+AddItemsDialog::AddItemsDialog( const TQString & a, const TQString & g, int c, TQWidget* tqparent, const char* name )
: KDialogBase( KDialogBase::Plain, i18n("Edit Item"),
- KDialogBase::Ok| KDialogBase::Close, KDialogBase::Ok, parent,name)
+ KDialogBase::Ok| KDialogBase::Close, KDialogBase::Ok, tqparent,name)
{
init();
article->setText( a );
@@ -76,10 +76,10 @@ AddItemsDialog::AddItemsDialog( const QString & a, const QString & g, int c, QWi
void AddItemsDialog::init()
{
- plainPage()->setFrameStyle( QFrame::GroupBoxPanel | QFrame::Sunken );
+ plainPage()->setFrameStyle( TQFrame::GroupBoxPanel | TQFrame::Sunken );
plainPage()->setLineWidth( 2 );
- QHBoxLayout* layout = new QHBoxLayout( plainPage(), 6, 6 );
+ TQHBoxLayout* tqlayout = new TQHBoxLayout( plainPage(), 6, 6 );
group = new KLineEdit( plainPage() );
article = new KLineEdit( plainPage() );
@@ -88,18 +88,18 @@ void AddItemsDialog::init()
number->setLabel( i18n( "Number of labels:" ), KNumInput::AlignLeft | KNumInput::AlignVCenter );
number->setRange( 1, 10000, 1, false );
- layout->addWidget( number );
- layout->addWidget( new QLabel( i18n("Article:" ), plainPage() ) );
- layout->addWidget( article );
- layout->addWidget( new QLabel( i18n("Group:"), plainPage() ) );
- layout->addWidget( group );
+ tqlayout->addWidget( number );
+ tqlayout->addWidget( new TQLabel( i18n("Article:" ), plainPage() ) );
+ tqlayout->addWidget( article );
+ tqlayout->addWidget( new TQLabel( i18n("Group:"), plainPage() ) );
+ tqlayout->addWidget( group );
setButtonText( KDialogBase::User1, i18n("&Add") );
setupSql();
- connect( SqlTables::getInstance(), SIGNAL( tablesChanged() ), this, SLOT( setupSql() ) );
- connect( SqlTables::getInstance(), SIGNAL( connectedSQL() ), this, SLOT( setupSql() ) );
+ connect( SqlTables::getInstance(), TQT_SIGNAL( tablesChanged() ), this, TQT_SLOT( setupSql() ) );
+ connect( SqlTables::getInstance(), TQT_SIGNAL( connectedSQL() ), this, TQT_SLOT( setupSql() ) );
}
void AddItemsDialog::slotUser1()
@@ -120,8 +120,8 @@ void AddItemsDialog::setupSql()
KCompletion* comp = article->completionObject();
comp->clear();
- QSqlQuery query( "select article_no from " TABLE_BASIC " order by article_no" );
- QStringList slist;
+ TQSqlQuery query( "select article_no from " TABLE_BASIC " order by article_no" );
+ TQStringList slist;
while ( query.next() )
slist.append( query.value(0).toString() );
@@ -138,12 +138,12 @@ int AddItemsDialog::count() const
return number->value();
}
-const QString AddItemsDialog::articleNo() const
+const TQString AddItemsDialog::articleNo() const
{
return article->text();
}
-const QString AddItemsDialog::groupName() const
+const TQString AddItemsDialog::groupName() const
{
return group->text();
}
diff --git a/kbarcode/smalldialogs.h b/kbarcode/smalldialogs.h
index 6687b64..228450c 100644
--- a/kbarcode/smalldialogs.h
+++ b/kbarcode/smalldialogs.h
@@ -18,7 +18,7 @@
#ifndef SMALLDIALOGS_H
#define SMALLDIALOGS_H
-#include <qwidget.h>
+#include <tqwidget.h>
#include <kdialogbase.h>
class KCompletion;
@@ -29,10 +29,11 @@ namespace DSSmallDialogs {
class AddAllDialog : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
- AddAllDialog(QWidget *parent=0, const char *name=0);
+ AddAllDialog(TQWidget *tqparent=0, const char *name=0);
- QString groupName() const;
+ TQString groupName() const;
int numberLabels() const;
protected:
@@ -42,18 +43,19 @@ namespace DSSmallDialogs {
class AddItemsDialog : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
- AddItemsDialog( QWidget* parent = 0, const char* name = 0 );
- AddItemsDialog( const QString & a, const QString & g, int c, QWidget* parent = 0, const char* name = 0 );
+ AddItemsDialog( TQWidget* tqparent = 0, const char* name = 0 );
+ AddItemsDialog( const TQString & a, const TQString & g, int c, TQWidget* tqparent = 0, const char* name = 0 );
void setGroupCompletion( KCompletion* c );
int count() const;
- const QString articleNo() const;
- const QString groupName() const;
+ const TQString articleNo() const;
+ const TQString groupName() const;
signals:
- void add( const QString & article, const QString & group, int count);
+ void add( const TQString & article, const TQString & group, int count);
private slots:
void setupSql();
diff --git a/kbarcode/sqltables.cpp b/kbarcode/sqltables.cpp
index 7852683..87fc8b3 100644
--- a/kbarcode/sqltables.cpp
+++ b/kbarcode/sqltables.cpp
@@ -18,15 +18,15 @@
#include "sqltables.h"
#include "definition.h"
-// Qt includes
-#include <qcheckbox.h>
-#include <qfile.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qmap.h>
-#include <qprogressdialog.h>
-#include <qsqldatabase.h>
+// TQt includes
+#include <tqcheckbox.h>
+#include <tqfile.h>
+#include <tqgroupbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqmap.h>
+#include <tqprogressdialog.h>
+#include <tqsqldatabase.h>
// KDE includes
#include <kapplication.h>
@@ -38,20 +38,20 @@
#include <kpushbutton.h>
#include <kstandarddirs.h>
-QMap<QString,SqlDescription*> drivers;
+TQMap<TQString,SqlDescription*> drivers;
class MySqlDescription : public SqlDescription {
public:
- virtual const QString initdb( QString ) const { return "mysql"; }
- virtual const QString autoIncrement() const { return "int(11) NOT NULL auto_increment"; }
- virtual const QString showColumns( const QString & table ) const { return "SHOW COLUMNS FROM " + table; }
+ virtual const TQString initdb( TQString ) const { return "mysql"; }
+ virtual const TQString autoIncrement() const { return "int(11) NOT NULL auto_increment"; }
+ virtual const TQString showColumns( const TQString & table ) const { return "SHOW COLUMNS FROM " + table; }
};
-class PostgreSQLDescription : public SqlDescription {
+class PostgreSTQLDescription : public SqlDescription {
public:
- virtual const QString initdb( QString ) const { return "template1"; }
- virtual const QString autoIncrement() const { return "serial NOT NULL"; }
- virtual const QString showColumns( const QString & table ) const {
+ virtual const TQString initdb( TQString ) const { return "template1"; }
+ virtual const TQString autoIncrement() const { return "serial NOT NULL"; }
+ virtual const TQString showColumns( const TQString & table ) const {
return "select a.attname, pg_catalog.format_type(a.atttypid, a.atttypmod), "
"a.attnotnull, a.atthasdef, a.attnum, substring(d.adsrc for 128) "
"from pg_catalog.pg_attribute a "
@@ -63,27 +63,27 @@ class PostgreSQLDescription : public SqlDescription {
};
/** should work for ODBC, too */
-class SQLiteDescription : public SqlDescription {
+class STQLiteDescription : public SqlDescription {
public:
- virtual const QString initdb( QString db = QString::null ) const { return db; }
- virtual const QString autoIncrement() const { return "serial NOT NULL"; }
- virtual const QString showColumns( const QString & table ) const { return "SHOW COLUMNS FROM " + table; }
+ virtual const TQString initdb( TQString db = TQString() ) const { return db; }
+ virtual const TQString autoIncrement() const { return "serial NOT NULL"; }
+ virtual const TQString showColumns( const TQString & table ) const { return "SHOW COLUMNS FROM " + table; }
};
-SqlTables::SqlTables( QObject* parent )
- : QObject( parent, "sqltables" )
+SqlTables::SqlTables( TQObject* tqparent )
+ : TQObject( tqparent, "sqltables" )
{
- drivers.insert( "QMYSQL3", new MySqlDescription() );
- drivers.insert( "QPSQL7", new PostgreSQLDescription() );
- /* The same driver plugin is used for QDBC and SQLite */
- drivers.insert( "QSQLITE", new SQLiteDescription() );
- drivers.insert( "QODBC3", new SQLiteDescription() );
+ drivers.insert( "TQMYSQL3", new MySqlDescription() );
+ drivers.insert( "TQPSQL7", new PostgreSTQLDescription() );
+ /* The same driver plugin is used for TQDBC and STQLite */
+ drivers.insert( "TQSQLITE", new STQLiteDescription() );
+ drivers.insert( "TQODBC3", new STQLiteDescription() );
db = NULL;
connected = false;
loadConfig();
- connect( kapp, SIGNAL( aboutToQuit() ), this, SLOT( saveConfig() ) );
+ connect( kapp, TQT_SIGNAL( aboutToQuit() ), this, TQT_SLOT( saveConfig() ) );
}
SqlTables::~SqlTables()
@@ -106,7 +106,7 @@ const SqlDescription* SqlTables::driver() const
}
bool SqlTables::connectMySQL()
{
- db = QSqlDatabase::addDatabase( sqldata.driver );
+ db = TQSqlDatabase::addDatabase( sqldata.driver );
db->setDatabaseName( sqldata.database );
db->setUserName( sqldata.username );
@@ -133,18 +133,18 @@ bool SqlTables::newTables()
return newTables( sqldata.username, sqldata.password, sqldata.hostname, sqldata.database, sqldata.driver );
}
-bool SqlTables::newTables( const QString & username, const QString & password, const QString & hostname, const QString & database, const QString & driver )
+bool SqlTables::newTables( const TQString & username, const TQString & password, const TQString & hostname, const TQString & database, const TQString & driver )
{
if( KMessageBox::warningContinueCancel( 0,
i18n("We are going to re-create the tables '") +
- QString( TABLE_BASIC "', '" TABLE_CUSTOMER "', '"
- TABLE_CUSTOMER_TEXT) +i18n("' and '") + QString(TABLE_LABEL_DEF "'")) == KMessageBox::Cancel )
+ TQString( TABLE_BASIC "', '" TABLE_CUSTOMER "', '"
+ TABLE_CUSTOMER_TEXT) +i18n("' and '") + TQString(TABLE_LABEL_DEF "'")) == KMessageBox::Cancel )
return false;
if( !drivers[driver] )
return false;
- QSqlDatabase*dbase = QSqlDatabase::addDatabase(driver, drivers[driver]->initdb( database ) );
+ TQSqlDatabase*dbase = TQSqlDatabase::addDatabase(driver, drivers[driver]->initdb( database ) );
dbase->setDatabaseName( drivers[driver]->initdb( database ) );
dbase->setUserName( username );
dbase->setPassword( password );
@@ -152,40 +152,40 @@ bool SqlTables::newTables( const QString & username, const QString & password, c
if(dbase->open()) {
- if (driver != "QSQLITE")
+ if (driver != "TQSQLITE")
{
bool found = false;
- QSqlQuery existing("SHOW DATABASES LIKE '" + database + "';");
+ TQSqlQuery existing("SHOW DATABASES LIKE '" + database + "';");
while( existing.next() )
found = true;
- QSqlQuery firstquery( NULL, dbase );
+ TQSqlQuery firstquery( NULL, dbase );
if( !found && !firstquery.exec("CREATE DATABASE " + database + ";")) {
if( KMessageBox::warningContinueCancel( 0, i18n("<qt>Can't create database ")+ database + i18n("<br>You can continue if the database exists already.</qt>")
+ firstquery.lastError().databaseText() ) == KMessageBox::Cancel ) {
dbase->close();
- QSqlDatabase::removeDatabase(drivers[driver]->initdb( database ));
+ TQSqlDatabase::removeDatabase(drivers[driver]->initdb( database ));
return false;
}
}
}
dbase->close();
- QSqlDatabase::removeDatabase(drivers[driver]->initdb( database ));
+ TQSqlDatabase::removeDatabase(drivers[driver]->initdb( database ));
// The database is created, now connect to the one specified by the user
- dbase = QSqlDatabase::addDatabase(driver, database );
+ dbase = TQSqlDatabase::addDatabase(driver, database );
dbase->setDatabaseName( database );
dbase->setUserName( username );
dbase->setPassword( password );
dbase->setHostName( hostname );
if(!dbase->open() || !dbase->isOpen()) {
KMessageBox::error( 0, i18n("KBarcode could not create the required database. Please create it manually.") + dbase->lastError().databaseText() );
- QSqlDatabase::removeDatabase( database );
+ TQSqlDatabase::removeDatabase( database );
return false;
}
- QSqlQuery query( NULL, dbase );
+ TQSqlQuery query( NULL, dbase );
// barcode_basic
query.exec("DROP TABLE " TABLE_BASIC );
@@ -260,11 +260,11 @@ bool SqlTables::newTables( const QString & username, const QString & password, c
");" );
dbase->close();
- QSqlDatabase::removeDatabase( database );
+ TQSqlDatabase::removeDatabase( database );
KMessageBox::information( 0, i18n("Created table ")+database+i18n(" successfully!") );
} else {
dbase->close();
- QSqlDatabase::removeDatabase(drivers[driver]->initdb( database ));
+ TQSqlDatabase::removeDatabase(drivers[driver]->initdb( database ));
KMessageBox::sorry( 0, i18n("Can't connect to database.") );
return false;
}
@@ -278,11 +278,11 @@ void SqlTables::importLabelDef()
KMessageBox::Cancel )
return;
- QSqlQuery query( QString::null, db );
+ TQSqlQuery query( TQString(), db );
exec( &query, "delete from " TABLE_LABEL_DEF );
- QString f = locateLocal( "data", "kbarcode/labeldefinitions.sql" );
- if( !QFile::exists( f ) ) {
+ TQString f = locateLocal( "data", "kbarcode/labeldefinitions.sql" );
+ if( !TQFile::exists( f ) ) {
KConfig* config = kapp->config();
config->setGroup( "Definitions" );
f = config->readEntry( "defpath", locate( "data", "kbarcode/labeldefinitions.sql" ) );
@@ -296,14 +296,14 @@ void SqlTables::importLabelDef()
void SqlTables::importExampleData()
{
if( KMessageBox::warningContinueCancel( 0,
- i18n("We are going to delete the complete tables: " ) + QString( TABLE_BASIC ", " TABLE_CUSTOMER ", " TABLE_CUSTOMER_TEXT ) ) ==
+ i18n("We are going to delete the complete tables: " ) + TQString( TABLE_BASIC ", " TABLE_CUSTOMER ", " TABLE_CUSTOMER_TEXT ) ) ==
KMessageBox::Cancel )
return;
importData( locate("appdata", "exampledata.sql"), db );
}
-void SqlTables::importData( const QString & filename, QSqlDatabase* db )
+void SqlTables::importData( const TQString & filename, TQSqlDatabase* db )
{
if( !db ) {
qDebug("Can't import data, dabase not open!");
@@ -316,12 +316,12 @@ void SqlTables::importData( const QString & filename, QSqlDatabase* db )
return;
}
- QFile data( filename);
- QProgressDialog* dlg = new QProgressDialog( i18n("SQL import progress:"), QString::null, data.size(), 0, "dlg", true );
+ TQFile data( filename);
+ TQProgressDialog* dlg = new TQProgressDialog( i18n("SQL import progress:"), TQString(), data.size(), 0, "dlg", true );
if( data.open( IO_ReadOnly ) ) {
- QString s;
- QSqlQuery query( QString::null, db );
+ TQString s;
+ TQSqlQuery query( TQString(), db );
while( data.readLine( s, 1024 ) != -1 )
if( !s.isEmpty() ) {
dlg->setProgress( dlg->progress() + s.length() );
@@ -334,7 +334,7 @@ void SqlTables::importData( const QString & filename, QSqlDatabase* db )
data.close();
}
-void SqlTables::exec( QSqlQuery* query, const QString & text )
+void SqlTables::exec( TQSqlQuery* query, const TQString & text )
{
if( !query->exec( text ) )
KMessageBox::sorry( 0, i18n("<qt>Can't execute command:<br><b>") + text + "</b><br></qt>" + query->lastError().databaseText(), "sqlexecerror" );
@@ -349,7 +349,7 @@ void SqlTables::loadConfig()
sqldata.password = config->readEntry("password", "" );
sqldata.hostname = config->readEntry("hostname", "localhost" );
sqldata.database = config->readEntry("database", "kbarcode" );
- sqldata.driver = config->readEntry("driver", "QMYSQL3" );
+ sqldata.driver = config->readEntry("driver", "TQMYSQL3" );
sqldata.autoconnect = config->readBoolEntry("autoconnect", false );
}
@@ -376,23 +376,23 @@ void SqlTables::updateTables()
* as they have already been created with the most
* recent database structures.
*/
- if( sqldata.driver != "QMYSQL3" )
+ if( sqldata.driver != "TQMYSQL3" )
return;
bool changed = false;
// check for field0 - field9 (1.4.0)
- QStringList fields;
+ TQStringList fields;
for( unsigned int i = 0; i < 10; i++ )
- fields.append( QString("field%1").arg( i ) );
+ fields.append( TQString("field%1").tqarg( i ) );
- QSqlQuery query("SHOW FIELDS FROM " TABLE_BASIC );
+ TQSqlQuery query("SHOW FIELDS FROM " TABLE_BASIC );
while ( query.next() )
if( fields.grep( query.value( 0 ).toString(), false ).count() ) {
fields.remove( query.value( 0 ).toString() );
}
if( fields.count() ) {
- QSqlQuery q;
+ TQSqlQuery q;
for( unsigned int i = 0; i < 10; i++ )
q.exec("ALTER TABLE " TABLE_BASIC " ADD " + fields[i] + " varchar(50)");
@@ -401,7 +401,7 @@ void SqlTables::updateTables()
}
// change barcode_no from varchar to TEXT (1.5.0)
- QSqlQuery query2("SHOW FIELDS FROM " TABLE_BASIC );
+ TQSqlQuery query2("SHOW FIELDS FROM " TABLE_BASIC );
while( query2.next() )
if( query2.value( 0 ).toString() == "barcode_no" && query2.value(1) == "varchar(50)" ) {
query2.exec( "ALTER TABLE " TABLE_BASIC " CHANGE barcode_no barcode_no TEXT" );
@@ -409,7 +409,7 @@ void SqlTables::updateTables()
}
// change barcode_no from varchar to TEXT (1.5.0)
- QSqlQuery query3("SHOW FIELDS FROM " TABLE_CUSTOMER_TEXT );
+ TQSqlQuery query3("SHOW FIELDS FROM " TABLE_CUSTOMER_TEXT );
while( query3.next() )
if( query3.value( 0 ).toString() == "barcode_no" && query3.value(1) == "varchar(50)" ) {
query3.exec( "ALTER TABLE " TABLE_CUSTOMER_TEXT " CHANGE barcode_no barcode_no TEXT" );
@@ -417,13 +417,13 @@ void SqlTables::updateTables()
}
// change NUMERIC DEFAULT TO NUMERIC(10,4) (1.6.1)
- QStringList update;
+ TQStringList update;
update << "gap_top" << "gap_left" << "height" << "width" << "gap_v" << "gap_h";
- QSqlQuery query4("SHOW FIELDS FROM " TABLE_LABEL_DEF );
+ TQSqlQuery query4("SHOW FIELDS FROM " TABLE_LABEL_DEF );
while( query4.next() )
- if( update.contains( query4.value( 0 ).toString() ) && query4.value(1).toString() == "decimal(10,0)" ) {
- QSqlQuery q;
- q.exec( QString("ALTER TABLE " TABLE_LABEL_DEF " CHANGE ") +
+ if( update.tqcontains( query4.value( 0 ).toString() ) && query4.value(1).toString() == "decimal(10,0)" ) {
+ TQSqlQuery q;
+ q.exec( TQString("ALTER TABLE " TABLE_LABEL_DEF " CHANGE ") +
query4.value( 0 ).toString() + " " + query4.value( 0 ).toString() + " NUMERIC(10,4)" );
changed = true;
}
@@ -433,9 +433,9 @@ void SqlTables::updateTables()
"KBarcode updated them without any loss of data." ) );
}
-bool SqlTables::testSettings( const QString & username, const QString & password, const QString & hostname, const QString & database, const QString & driver )
+bool SqlTables::testSettings( const TQString & username, const TQString & password, const TQString & hostname, const TQString & database, const TQString & driver )
{
- QSqlDatabase* db = QSqlDatabase::addDatabase( driver );
+ TQSqlDatabase* db = TQSqlDatabase::addDatabase( driver );
if( !drivers[driver] )
return false;
@@ -446,17 +446,17 @@ bool SqlTables::testSettings( const QString & username, const QString & password
if( !db->open() )
{
- QSqlDatabase::removeDatabase( database );
+ TQSqlDatabase::removeDatabase( database );
}
else
{
KMessageBox::information( 0, i18n("Connected successfully to your database") );
db->close();
- QSqlDatabase::removeDatabase( database );
+ TQSqlDatabase::removeDatabase( database );
return true;
}
- db = QSqlDatabase::addDatabase( driver );
+ db = TQSqlDatabase::addDatabase( driver );
db->setDatabaseName( drivers[driver]->initdb( database ) );
@@ -467,37 +467,37 @@ bool SqlTables::testSettings( const QString & username, const QString & password
if( !db->open() ) {
KMessageBox::error( 0, i18n("<qt>Connection failed:<br>") + database + "<br>" +
db->lastError().databaseText() + "</qt>" );
- QSqlDatabase::removeDatabase(drivers[driver]->initdb( database ));
+ TQSqlDatabase::removeDatabase(drivers[driver]->initdb( database ));
return false;
} else {
KMessageBox::information( 0, i18n("Connected successfully to your database") );
db->close();
- QSqlDatabase::removeDatabase(drivers[driver]->initdb( database ));
+ TQSqlDatabase::removeDatabase(drivers[driver]->initdb( database ));
return true;
}
}
-const QString SqlTables::getBarcodeMaxLength( const QString & name )
+const TQString SqlTables::getBarcodeMaxLength( const TQString & name )
{
if( SqlTables::isConnected() )
{
- QSqlQuery query("select uid, (length(barcode_no)) as LEN from " TABLE_BASIC
+ TQSqlQuery query("select uid, (length(barcode_no)) as LEN from " TABLE_BASIC
" where encoding_type = '" + name +"' ORDER by LEN DESC LIMIT 1" );
while( query.next() ) {
- QSqlQuery queryuid("select barcode_no from barcode_basic where uid = '"
+ TQSqlQuery queryuid("select barcode_no from barcode_basic where uid = '"
+ query.value( 0 ).toString() + "'" );
while( queryuid.next() )
if(!queryuid.value( 0 ).toString().isEmpty())
return queryuid.value( 0 ).toString();
}
- QSqlQuery query1("select uid, (length(barcode_no)) as LEN from " TABLE_CUSTOMER_TEXT
+ TQSqlQuery query1("select uid, (length(barcode_no)) as LEN from " TABLE_CUSTOMER_TEXT
" where encoding_type = '" + name +"' ORDER by LEN DESC LIMIT 1" );
while( query1.next() ) {
- QSqlQuery queryuid("select barcode_no from customer_text where uid = '"
+ TQSqlQuery queryuid("select barcode_no from customer_text where uid = '"
+ query1.value( 0 ).toString() + "'" );
while( queryuid.next() )
if(!queryuid.value( 0 ).toString().isEmpty())
@@ -508,29 +508,29 @@ const QString SqlTables::getBarcodeMaxLength( const QString & name )
return "1234567";
}
-SqlWidget::SqlWidget( bool showlabel, QWidget* parent, const char* name )
- : QWidget( parent, name )
+SqlWidget::SqlWidget( bool showlabel, TQWidget* tqparent, const char* name )
+ : TQWidget( tqparent, name )
{
- QVBoxLayout* layout = new QVBoxLayout( this );
+ TQVBoxLayout* tqlayout = new TQVBoxLayout( this );
- QGroupBox* groupDatabase = new QGroupBox( this );
+ TQGroupBox* groupDatabase = new TQGroupBox( this );
groupDatabase->setTitle( i18n( "Database Settings" ) );
groupDatabase->setColumnLayout(0, Qt::Vertical );
- groupDatabase->layout()->setSpacing( 6 );
- groupDatabase->layout()->setMargin( 11 );
- QVBoxLayout* groupDatabaseLayout = new QVBoxLayout( groupDatabase->layout() );
- groupDatabaseLayout->setAlignment( Qt::AlignTop );
+ groupDatabase->tqlayout()->setSpacing( 6 );
+ groupDatabase->tqlayout()->setMargin( 11 );
+ TQVBoxLayout* groupDatabaseLayout = new TQVBoxLayout( groupDatabase->tqlayout() );
+ groupDatabaseLayout->tqsetAlignment( TQt::AlignTop );
- QGridLayout* grid = new QGridLayout( 2, 2 );
+ TQGridLayout* grid = new TQGridLayout( 2, 2 );
- QLabel* label = new QLabel( groupDatabase );
+ TQLabel* label = new TQLabel( groupDatabase );
label->setText( i18n("Username :") );
grid->addWidget( label, 0, 0 );
m_username = new KLineEdit( groupDatabase );
grid->addWidget( m_username, 0, 1 );
- label = new QLabel( groupDatabase );
+ label = new TQLabel( groupDatabase );
label->setText( i18n("Password :") );
grid->addWidget( label, 1, 0 );
@@ -538,27 +538,27 @@ SqlWidget::SqlWidget( bool showlabel, QWidget* parent, const char* name )
m_password->setEchoMode( KLineEdit::Password );
grid->addWidget( m_password, 1, 1 );
- label = new QLabel( groupDatabase );
+ label = new TQLabel( groupDatabase );
label->setText( i18n("Database :") );
grid->addWidget( label, 2, 0 );
m_database = new KLineEdit( "kbarcode", groupDatabase );
grid->addWidget( m_database, 2, 1 );
- label = new QLabel( groupDatabase );
+ label = new TQLabel( groupDatabase );
label->setText( i18n("Host :") );
grid->addWidget( label, 3, 0 );
m_hostname = new KLineEdit( "localhost", groupDatabase );
grid->addWidget( m_hostname, 3, 1 );
- label = new QLabel( groupDatabase );
+ label = new TQLabel( groupDatabase );
label->setText( i18n("Driver :") );
grid->addWidget( label, 4, 0 );
m_driver = new KComboBox( false, groupDatabase );
- QStringList drList = QSqlDatabase::drivers();
- QStringList::Iterator it = drList.begin();
+ TQStringList drList = TQSqlDatabase::drivers();
+ TQStringList::Iterator it = drList.begin();
while( it != drList.end() ) {
m_driver->insertItem( *it );
++it;
@@ -566,7 +566,7 @@ SqlWidget::SqlWidget( bool showlabel, QWidget* parent, const char* name )
grid->addWidget( m_driver, 4, 1 );
groupDatabaseLayout->addLayout( grid );
- m_autoconnect = new QCheckBox( i18n("&Autoconnect on program start"), groupDatabase );
+ m_autoconnect = new TQCheckBox( i18n("&Autoconnect on program start"), groupDatabase );
groupDatabaseLayout->addWidget( m_autoconnect );
buttonTest = new KPushButton( groupDatabase, "buttonTest" );
@@ -574,11 +574,11 @@ SqlWidget::SqlWidget( bool showlabel, QWidget* parent, const char* name )
groupDatabaseLayout->addWidget( buttonTest );
if( showlabel )
- groupDatabaseLayout->addWidget( new QLabel( i18n("<b>You have to test your database settings before you can procede.</b>"), groupDatabase ) );
+ groupDatabaseLayout->addWidget( new TQLabel( i18n("<b>You have to test your database settings before you can procede.</b>"), groupDatabase ) );
- layout->add( groupDatabase );
+ tqlayout->add( groupDatabase );
- connect( buttonTest, SIGNAL( clicked() ), this, SLOT( testSettings() ) );
+ connect( buttonTest, TQT_SIGNAL( clicked() ), this, TQT_SLOT( testSettings() ) );
const mysqldata & sqldata = SqlTables::getInstance()->getData();
m_username->setText( sqldata.username );
@@ -615,27 +615,27 @@ void SqlWidget::testSettings()
m_driver->currentText() ) );
}
-const QString SqlWidget::username() const
+const TQString SqlWidget::username() const
{
return m_username->text();
}
-const QString SqlWidget::driver() const
+const TQString SqlWidget::driver() const
{
return m_driver->currentText();
}
-const QString SqlWidget::database() const
+const TQString SqlWidget::database() const
{
return m_database->text();
}
-const QString SqlWidget::hostname() const
+const TQString SqlWidget::hostname() const
{
return m_hostname->text();
}
-const QString SqlWidget::password() const
+const TQString SqlWidget::password() const
{
return m_password->text();
}
diff --git a/kbarcode/sqltables.h b/kbarcode/sqltables.h
index d78fd21..ba4029c 100644
--- a/kbarcode/sqltables.h
+++ b/kbarcode/sqltables.h
@@ -15,12 +15,12 @@
* *
***************************************************************************/
-#ifndef SQLTABLES_H
-#define SQLTABLES_H
+#ifndef STQLTABLES_H
+#define STQLTABLES_H
-#include <qobject.h>
-#include <qwidget.h>
-#include <qstring.h>
+#include <tqobject.h>
+#include <tqwidget.h>
+#include <tqstring.h>
/* Change these values to match your environment: */
@@ -30,24 +30,19 @@
#define TABLE_BASIC "barcode_basic"
/* -------- */
-// a macro to support QString::replace( QString, QString )
+// a macro to support TQString::tqreplace( TQString, TQString )
// also on QT 3.0.x
-#if QT_VERSION <= 0x030100
- #include <qregexp.h>
- #define DSREPLACE( x ) QRegExp( x )
-#else
- #define DSREPLACE( x ) x
-#endif
+#define DSREPLACE( x ) x
// Holds all information
// necessary for connecting
// to a database
typedef struct mysqldata {
- QString username;
- QString password;
- QString hostname; // localhost
- QString database; // kbarcode
- QString driver; // QMYSQL3
+ TQString username;
+ TQString password;
+ TQString hostname; // localhost
+ TQString database; // kbarcode
+ TQString driver; // TQMYSQL3
bool autoconnect;
void operator=( const mysqldata & rhs ) {
@@ -72,19 +67,19 @@ class SqlDescription {
/** return the name of the database we can always
* use to connect to this database.
*/
- virtual const QString initdb( QString ) const = 0;
+ virtual const TQString initdb( TQString ) const = 0;
/** return the auto_increment or serial command used for this db.
*/
- virtual const QString autoIncrement() const = 0;
+ virtual const TQString autoIncrement() const = 0;
/** return the command to show all fields of table for this db.
*/
- virtual const QString showColumns( const QString & table ) const = 0;
+ virtual const TQString showColumns( const TQString & table ) const = 0;
};
-class QSqlDatabase;
-class QSqlQuery;
+class TQSqlDatabase;
+class TQSqlQuery;
/**
* This class is used to access a database, create it and save its settings to the
* application configuration file. Also the labeldefinitions and exmplate data
@@ -93,8 +88,9 @@ class QSqlQuery;
* @short This singleton is used to access a database in KBarcode.
* @author Dominik Seichter
*/
-class SqlTables : public QObject {
+class SqlTables : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
/** get a mysqldata object which contains the current database settings.
* this object is for all sql databases, not only for mysql. The name is just a
@@ -127,7 +123,7 @@ class SqlTables : public QObject {
const SqlDescription* driver() const;
public slots:
- const QString getBarcodeMaxLength( const QString & name );
+ const TQString getBarcodeMaxLength( const TQString & name );
void loadConfig();
void saveConfig();
@@ -139,34 +135,34 @@ class SqlTables : public QObject {
bool connectMySQL();
bool newTables();
- bool newTables( const QString & username, const QString & password, const QString & hostname, const QString & database, const QString & driver );
+ bool newTables( const TQString & username, const TQString & password, const TQString & hostname, const TQString & database, const TQString & driver );
void importLabelDef();
void importExampleData();
- void importData( const QString & filename, QSqlDatabase* db );
- bool testSettings( const QString & username, const QString & password, const QString & hostname, const QString & database, const QString & driver );
+ void importData( const TQString & filename, TQSqlDatabase* db );
+ bool testSettings( const TQString & username, const TQString & password, const TQString & hostname, const TQString & database, const TQString & driver );
- inline QSqlDatabase* database() const;
+ inline TQSqlDatabase* database() const;
signals:
void tablesChanged();
void connectedSQL();
private:
- SqlTables( QObject* parent = 0 );
+ SqlTables( TQObject* tqparent = 0 );
~SqlTables();
- void exec( QSqlQuery* query, const QString & text );
+ void exec( TQSqlQuery* query, const TQString & text );
void updateTables();
bool connected;
- QSqlDatabase* db;
+ TQSqlDatabase* db;
mysqldata sqldata;
static SqlTables* instance;
};
-inline QSqlDatabase* SqlTables::database() const
+inline TQSqlDatabase* SqlTables::database() const
{
return db;
}
@@ -174,7 +170,7 @@ inline QSqlDatabase* SqlTables::database() const
class KComboBox;
class KLineEdit;
class KPushButton;
-class QCheckBox;
+class TQCheckBox;
/** A widget for configuring a SQL connection.
* It has child widgets for entering data like the
* user name, database name, host name, password
@@ -183,17 +179,18 @@ class QCheckBox;
*
* @author Dominik Seichter
*/
-class SqlWidget : public QWidget {
+class SqlWidget : public TQWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- SqlWidget( bool showlabel, QWidget* parent = 0, const char* name = 0 );
+ SqlWidget( bool showlabel, TQWidget* tqparent = 0, const char* name = 0 );
~SqlWidget();
- const QString username() const;
- const QString driver() const;
- const QString database() const;
- const QString hostname() const;
- const QString password() const;
+ const TQString username() const;
+ const TQString driver() const;
+ const TQString database() const;
+ const TQString hostname() const;
+ const TQString password() const;
bool autoconnect() const;
int driverCount() const;
@@ -214,7 +211,7 @@ class SqlWidget : public QWidget {
KLineEdit* m_hostname;
KLineEdit* m_password;
- QCheckBox* m_autoconnect;
+ TQCheckBox* m_autoconnect;
KPushButton* buttonTest;
};
diff --git a/kbarcode/tbarcode2.cpp b/kbarcode/tbarcode2.cpp
index a07ff41..22ae500 100644
--- a/kbarcode/tbarcode2.cpp
+++ b/kbarcode/tbarcode2.cpp
@@ -20,8 +20,8 @@
#include <stdlib.h>
-#include <qdom.h>
-#include <qfile.h>
+#include <tqdom.h>
+#include <tqfile.h>
#include <kprocess.h>
#include <ktempfile.h>
@@ -41,7 +41,7 @@ void TBarcodeOptions::defaults()
m_height = 20;
}
-void TBarcodeOptions::load( const QDomElement* tag )
+void TBarcodeOptions::load( const TQDomElement* tag )
{
this->setModuleWidth( tag->attribute( "tbarcode.modulewidth", "0.353" ).toDouble() );
this->setEscape( tag->attribute( "tbarcode.escape", "0" ).toInt() );
@@ -51,7 +51,7 @@ void TBarcodeOptions::load( const QDomElement* tag )
this->setHeight( tag->attribute( "tbarcode.height", "0" ).toInt() );
}
-void TBarcodeOptions::save( QDomElement* tag )
+void TBarcodeOptions::save( TQDomElement* tag )
{
tag->setAttribute( "tbarcode.modulewidth", this->moduleWidth() );
tag->setAttribute( "tbarcode.escape", this->escape() );
@@ -100,7 +100,7 @@ const TBarcode2 & TBarcode2::operator=( const BarkodeEngine & rhs )
bool TBarcode2::createPostscript( char** postscript, long* postscript_size )
{
- QString cmd;
+ TQString cmd;
const char* text;
const TBarcodeOptions* tbarcode = (dynamic_cast<TBarcodeOptions*>(barkode->engine()->options()));
@@ -129,22 +129,22 @@ bool TBarcode2::createPostscript( char** postscript, long* postscript_size )
return true;
}
-QRect TBarcode2::bbox( const char* postscript, long postscript_size )
+TQRect TBarcode2::bbox( const char* postscript, long postscript_size )
{
const char* gs_bbox = "gs -sDEVICE=bbox -sNOPAUSE -q %1 -c showpage quit 2>&1";
char* buffer = NULL;
long len = 0;
- QRect size;
+ TQRect size;
- KTempFile psfile( QString::null, ".ps" );
+ KTempFile psfile( TQString(), ".ps" );
psfile.file()->writeBlock( postscript, postscript_size );
psfile.file()->close();
- if( !readFromPipe( QString( gs_bbox ).arg( psfile.file()->name() ).latin1(), &buffer, &len ) || !len )
+ if( !readFromPipe( TQString( gs_bbox ).tqarg( psfile.file()->name() ).latin1(), &buffer, &len ) || !len )
{
psfile.unlink();
- return QRect( 0, 0, 0, 0 );
+ return TQRect( 0, 0, 0, 0 );
}
else
psfile.unlink();
diff --git a/kbarcode/tbarcode2.h b/kbarcode/tbarcode2.h
index 30b70d9..fdd55d8 100644
--- a/kbarcode/tbarcode2.h
+++ b/kbarcode/tbarcode2.h
@@ -20,7 +20,7 @@
#include "pixmapbarcode.h"
-class QDomElement;
+class TQDomElement;
/** A small class which contains all the options
* which can be configured for tbarcode
@@ -32,8 +32,8 @@ class TBarcodeOptions : public BarkodeEngineOptions {
const TBarcodeOptions& operator=( const BarkodeEngineOptions& rhs );
void defaults();
- void load( const QDomElement* tag );
- void save( QDomElement* tag );
+ void load( const TQDomElement* tag );
+ void save( TQDomElement* tag );
inline bool escape() const { return m_escape; }
inline bool above() const { return m_above; }
@@ -70,7 +70,7 @@ class TBarcode2 : public PixmapBarcode {
private:
virtual bool createPostscript( char** postscript, long* postscript_size );
- virtual QRect bbox( const char* postscript, long postscript_size );
+ virtual TQRect bbox( const char* postscript, long postscript_size );
private:
TBarcodeOptions m_options;
diff --git a/kbarcode/tcanvasitem.cpp b/kbarcode/tcanvasitem.cpp
index f770a63..39a9b98 100644
--- a/kbarcode/tcanvasitem.cpp
+++ b/kbarcode/tcanvasitem.cpp
@@ -20,11 +20,11 @@
#include "mycanvasview.h"
#include "imageitem.h"
-#include <qpainter.h>
+#include <tqpainter.h>
#include <labelutils.h>
TCanvasItem::TCanvasItem( MyCanvasView* cv )
- : QCanvasRectangle( cv->canvas() ),
+ : TQCanvasRectangle( cv->canvas() ),
ReferenceCounted()
{
m_view = cv;
@@ -40,7 +40,7 @@ TCanvasItem::~TCanvasItem()
void TCanvasItem::setZ( double z )
{
- QCanvasRectangle::setZ( z );
+ TQCanvasRectangle::setZ( z );
if( m_item )
m_item->setZ( (int)z );
@@ -48,7 +48,7 @@ void TCanvasItem::setZ( double z )
void TCanvasItem::setSize( int width, int height )
{
- QCanvasRectangle::setSize( width, height );
+ TQCanvasRectangle::setSize( width, height );
if( m_item )
{
@@ -69,13 +69,13 @@ void TCanvasItem::setSizeMM( int w, int h )
if( m_item )
{
m_item->setSizeMM( w, h );
- QCanvasRectangle::setSize( m_item->boundingRect().width(), m_item->boundingRect().height() );
+ TQCanvasRectangle::setSize( m_item->boundingRect().width(), m_item->boundingRect().height() );
}
}
void TCanvasItem::moveBy( double dx, double dy )
{
- QCanvasRectangle::moveBy( dx, dy );
+ TQCanvasRectangle::moveBy( dx, dy );
if( m_item )
{
@@ -94,25 +94,25 @@ void TCanvasItem::moveMM( int x, int y )
if( m_item )
{
LabelUtils l;
- // the QCanvasRectangle::move is done before the real move
+ // the TQCanvasRectangle::move is done before the real move
// as we get dancing TCanvasItems on the screen otherwise
- QCanvasRectangle::move( l.mmToPixel( x / 1000.0, m_view, LabelUtils::DpiX ) + m_view->getTranslation().x(),
- l.mmToPixel( y / 1000.0, m_view, LabelUtils::DpiY ) + m_view->getTranslation().y() );
+ TQCanvasRectangle::move( l.mmToPixel( x / 1000.0, TQT_TQPAINTDEVICE(m_view), LabelUtils::DpiX ) + m_view->getTranslation().x(),
+ l.mmToPixel( y / 1000.0, TQT_TQPAINTDEVICE(m_view), LabelUtils::DpiY ) + m_view->getTranslation().y() );
m_item->moveMM( x, y );
}
}
-void TCanvasItem::drawShape (QPainter & painter)
+void TCanvasItem::drawShape (TQPainter & painter)
{
painter.save();
if( m_item )
{
if( z() != (int)m_item->z() )
- QCanvasRectangle::setZ( m_item->z() );
+ TQCanvasRectangle::setZ( m_item->z() );
painter.save();
- painter.setClipRect( boundingRect(), QPainter::CoordPainter );
+ painter.setClipRect( boundingRect(), TQPainter::CoordPainter );
painter.translate( m_view->getTranslation().x(), m_view->getTranslation().y() );
m_item->draw( &painter );
painter.restore();
@@ -120,7 +120,7 @@ void TCanvasItem::drawShape (QPainter & painter)
// draw edges
if( isSelected() ) {
- const QPixmap* spot = SpotProvider::getInstance()->spot();
+ const TQPixmap* spot = SpotProvider::getInstance()->spot();
painter.translate( x(), y() );
// top left
@@ -161,8 +161,8 @@ void TCanvasItem::setItem (DocumentItem* item)
m_item->setCanvasItem( this );
this->setZ( m_item->z() );
- QCanvasRectangle::move( m_item->boundingRect().x() + m_view->getTranslation().x(), m_item->boundingRect().y() + m_view->getTranslation().y() );
- QCanvasRectangle::setSize( m_item->boundingRect().width(), m_item->boundingRect().height() );
+ TQCanvasRectangle::move( m_item->boundingRect().x() + m_view->getTranslation().x(), m_item->boundingRect().y() + m_view->getTranslation().y() );
+ TQCanvasRectangle::setSize( m_item->boundingRect().width(), m_item->boundingRect().height() );
update();
}
}
@@ -174,7 +174,7 @@ DocumentItem* TCanvasItem::item () const
void TCanvasItem::update()
{
- QCanvasRectangle::update();
+ TQCanvasRectangle::update();
}
int TCanvasItem::rtti() const
@@ -197,7 +197,7 @@ void TCanvasItem::show()
if (!isVisible())
{
this->addRef();
- ((QCanvasItem*) this)->show();
+ ((TQCanvasItem*) this)->show();
}
}
@@ -214,7 +214,7 @@ void TCanvasItem::hide()
{
if (isVisible())
{
- ((QCanvasItem*) this)->hide();
+ ((TQCanvasItem*) this)->hide();
this->remRef();
}
}
diff --git a/kbarcode/tcanvasitem.h b/kbarcode/tcanvasitem.h
index 7493fa8..811c1be 100644
--- a/kbarcode/tcanvasitem.h
+++ b/kbarcode/tcanvasitem.h
@@ -1,8 +1,8 @@
#ifndef TCANVASITEM_H
#define TCANVASITEM_H
-#include <qstring.h>
-#include <qcanvas.h>
+#include <tqstring.h>
+#include <tqcanvas.h>
#include "documentitem.h"
#include "referencecounted.h"
@@ -10,13 +10,13 @@
class MyCanvasView;
/**
* Class TCanvasItem
- * Represents a DocumentItem on a QCanvas.
+ * Represents a DocumentItem on a TQCanvas.
* This class is also responsible for drawing
* the drag marks provided by SpotProvider.
*
* The class is also ReferenceCounted!!!
*/
-class TCanvasItem : public QCanvasRectangle, public ReferenceCounted {
+class TCanvasItem : public TQCanvasRectangle, public ReferenceCounted {
public:
TCanvasItem ( MyCanvasView* cv );
@@ -47,7 +47,7 @@ protected:
*
* @param painter
*/
- void drawShape ( QPainter & p );
+ void drawShape ( TQPainter & p );
private:
DocumentItem* m_item;
diff --git a/kbarcode/tec.cpp b/kbarcode/tec.cpp
index 174806e..b4b53ff 100644
--- a/kbarcode/tec.cpp
+++ b/kbarcode/tec.cpp
@@ -22,16 +22,16 @@
#include <unistd.h>
// QT includes
-#include <qclipboard.h>
-#include <qcursor.h>
-#include <qgroupbox.h>
-#include <qhbox.h>
-#include <qlayout.h>
-#include <qpainter.h>
-#include <qpaintdevicemetrics.h>
-#include <qprogressdialog.h>
-#include <qsqlcursor.h>
-#include <qvalidator.h>
+#include <tqclipboard.h>
+#include <tqcursor.h>
+#include <tqgroupbox.h>
+#include <tqhbox.h>
+#include <tqlayout.h>
+#include <tqpainter.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqprogressdialog.h>
+#include <tqsqlcursor.h>
+#include <tqvalidator.h>
// KDE includes
#include <kapplication.h>
@@ -51,10 +51,10 @@
#define MAXDATASIZE 32550
-QString tec452(const QString &url, int count, const QString &art, const QString &group, const QString &id)
+TQString tec452(const TQString &url, int count, const TQString &art, const TQString &group, const TQString &id)
{
- QString filename;
- QString result;
+ TQString filename;
+ TQString result;
int countBar=0;
int countText=0;
@@ -65,42 +65,42 @@ QString tec452(const QString &url, int count, const QString &art, const QString
filename = url;
//setCaption( filename, false );
- QFile f( filename );
+ TQFile f( filename );
if ( !f.open( IO_ReadOnly ) )
return false;
//clearLabel();
- QDomDocument doc( "KBarcodeLabel" );
+ TQDomDocument doc( "KBarcodeLabel" );
if ( !doc.setContent( &f ) ) {
f.close();
return false;
}
f.close();
- QDomNode n = doc.documentElement().firstChild();
+ TQDomNode n = doc.documentElement().firstChild();
// this should not be neccessary,
// but <label><id> needs to be processed first
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if( !e.isNull() )
// label has to be the first xml element!
if( e.tagName() == "label" ) {
- QDomNode n = e.firstChild();
+ TQDomNode n = e.firstChild();
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if( !e.isNull() )
if( e.tagName() == "id" ) {
- result += QString("{D%1,").arg( convZeros((e.attribute( "height" ).toInt() + e.attribute( "gap_v" ).toInt())*10,4)); // Altura + Gap vertical
- result += QString("%1,").arg( convZeros(e.attribute( "width" ).toInt()*10,4) ); // Anchura
- result += QString("%1|}\n").arg( convZeros(e.attribute( "height" ).toInt()*10,4) ); // Altura
- result += QString("{C|}\n"); // Clear buffer
- result += QString("{U2;0130|}\n"); // BackFeed
- result += QString("{D%1,").arg( convZeros((e.attribute( "height" ).toInt() + e.attribute( "gap_v" ).toInt())*10,4)); // Altura + Gap vertical
- result += QString("%1,").arg( convZeros(e.attribute( "width" ).toInt()*10,4) ); // Anchura
- result += QString("%1|}\n").arg( convZeros(e.attribute( "height" ).toInt()*10,4) ); // Altura
- result += QString("{AX;+000,+000,+00|}\n"); // Position Fine adjust
- result += QString("{AY;+04,1|}\n"); // Print density fine adjust
+ result += TQString("{D%1,").tqarg( convZeros((e.attribute( "height" ).toInt() + e.attribute( "gap_v" ).toInt())*10,4)); // Altura + Gap vertical
+ result += TQString("%1,").tqarg( convZeros(e.attribute( "width" ).toInt()*10,4) ); // Anchura
+ result += TQString("%1|}\n").tqarg( convZeros(e.attribute( "height" ).toInt()*10,4) ); // Altura
+ result += TQString("{C|}\n"); // Clear buffer
+ result += TQString("{U2;0130|}\n"); // BackFeed
+ result += TQString("{D%1,").tqarg( convZeros((e.attribute( "height" ).toInt() + e.attribute( "gap_v" ).toInt())*10,4)); // Altura + Gap vertical
+ result += TQString("%1,").tqarg( convZeros(e.attribute( "width" ).toInt()*10,4) ); // Anchura
+ result += TQString("%1|}\n").tqarg( convZeros(e.attribute( "height" ).toInt()*10,4) ); // Altura
+ result += TQString("{AX;+000,+000,+00|}\n"); // Position Fine adjust
+ result += TQString("{AY;+04,1|}\n"); // Print density fine adjust
}
@@ -112,7 +112,7 @@ QString tec452(const QString &url, int count, const QString &art, const QString
n = doc.documentElement().firstChild();
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if( !e.isNull() )
if( e.tagName() == "barcode" ) {
@@ -122,110 +122,110 @@ QString tec452(const QString &url, int count, const QString &art, const QString
if ( e.attribute( "type" ) == "b55" ) result += pdf417(e, countBar);
- QString data;
- QDomNode n = e.firstChild();
+ TQString data;
+ TQDomNode n = e.firstChild();
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if( !e.isNull() )
if( e.tagName() == "value" ) data = e.text();
n = n.nextSibling();
}
- result += QString("{RB%1;").arg( convZeros(countBar, 2) ); // count de RB
- result += QString("%1|}\n").arg( data ); // Data + fin
+ result += TQString("{RB%1;").tqarg( convZeros(countBar, 2) ); // count de RB
+ result += TQString("%1|}\n").tqarg( data ); // Data + fin
countBar++;
} else if( e.tagName() == "textfield" ) {
- result += QString("{PC%1;").arg( convZeros(countText, 3) ); // count
- result += QString("%1,").arg( posConv(e.attribute( "x_mm"), 4 ) ); // X position
- result += QString("%1,").arg( posConv(e.attribute( "y_mm"), 4 ) ); // Y position
- result += QString("%1,").arg( "10" );
- result += QString("%1,").arg( "15" );
- result += QString("%1,").arg( "J" );
- result += QString("%1,").arg( "00" );
- result += QString("%1|}\n").arg( "B" );
-
- QString etext;
- QDomNode n = e.firstChild();
+ result += TQString("{PC%1;").tqarg( convZeros(countText, 3) ); // count
+ result += TQString("%1,").tqarg( posConv(e.attribute( "x_mm"), 4 ) ); // X position
+ result += TQString("%1,").tqarg( posConv(e.attribute( "y_mm"), 4 ) ); // Y position
+ result += TQString("%1,").tqarg( "10" );
+ result += TQString("%1,").tqarg( "15" );
+ result += TQString("%1,").tqarg( "J" );
+ result += TQString("%1,").tqarg( "00" );
+ result += TQString("%1|}\n").tqarg( "B" );
+
+ TQString etext;
+ TQDomNode n = e.firstChild();
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if( !e.isNull() )
if( e.tagName() == "text" )
etext = e.text();
n = n.nextSibling();
}
- result += QString("{RC%1;").arg( convZeros(countText, 3) ); // count de RB
+ result += TQString("{RC%1;").tqarg( convZeros(countText, 3) ); // count de RB
etext=getData(etext, art, group, id );
- result += QString("%1|}\n").arg( etext ); // Data + fin
+ result += TQString("%1|}\n").tqarg( etext ); // Data + fin
countText++;
}
else if( e.tagName() == "rect" ) {
if (e.attribute("colorr")=="0" and e.attribute("colorg")=="0" and e.attribute("colorb")=="0") {
- result += QString("{XR;"); // XR
- result += QString("%1,").arg( posConv(e.attribute( "x_mm"), 4 ) ); // X position
- result += QString("%1,").arg( posConv(e.attribute( "y_mm"), 4 ) ); // Y position
- result += QString("%1,").arg( convZeros(posConv(e.attribute( "x_mm"), 4 ).toInt()+posConv(e.attribute( "width_mm"),4 ).toInt(),4)); // X position
- result += QString("%1,").arg( convZeros(posConv(e.attribute( "y_mm"), 4 ).toInt()+posConv(e.attribute( "height_mm"),4 ).toInt(),4)); // Y position
- result += QString("A"); // Type of Clear
- result += QString("|}\n"); // FIN
- result += QString("{XR;"); // XR
- result += QString("%1,").arg( posConv(e.attribute( "x_mm"), 4 ) ); // X position
- result += QString("%1,").arg( posConv(e.attribute( "y_mm"), 4 ) ); // Y position
- result += QString("%1,").arg( convZeros(posConv(e.attribute( "x_mm"), 4 ).toInt()+posConv(e.attribute( "width_mm"),4 ).toInt(),4)); // X position
- result += QString("%1,").arg( convZeros(posConv(e.attribute( "y_mm"), 4 ).toInt()+posConv(e.attribute( "height_mm"),4 ).toInt(),4)); // Y position
- result += QString("B"); // Type of Clear
- result += QString("|}\n"); // FIN
+ result += TQString("{XR;"); // XR
+ result += TQString("%1,").tqarg( posConv(e.attribute( "x_mm"), 4 ) ); // X position
+ result += TQString("%1,").tqarg( posConv(e.attribute( "y_mm"), 4 ) ); // Y position
+ result += TQString("%1,").tqarg( convZeros(posConv(e.attribute( "x_mm"), 4 ).toInt()+posConv(e.attribute( "width_mm"),4 ).toInt(),4)); // X position
+ result += TQString("%1,").tqarg( convZeros(posConv(e.attribute( "y_mm"), 4 ).toInt()+posConv(e.attribute( "height_mm"),4 ).toInt(),4)); // Y position
+ result += TQString("A"); // Type of Clear
+ result += TQString("|}\n"); // FIN
+ result += TQString("{XR;"); // XR
+ result += TQString("%1,").tqarg( posConv(e.attribute( "x_mm"), 4 ) ); // X position
+ result += TQString("%1,").tqarg( posConv(e.attribute( "y_mm"), 4 ) ); // Y position
+ result += TQString("%1,").tqarg( convZeros(posConv(e.attribute( "x_mm"), 4 ).toInt()+posConv(e.attribute( "width_mm"),4 ).toInt(),4)); // X position
+ result += TQString("%1,").tqarg( convZeros(posConv(e.attribute( "y_mm"), 4 ).toInt()+posConv(e.attribute( "height_mm"),4 ).toInt(),4)); // Y position
+ result += TQString("B"); // Type of Clear
+ result += TQString("|}\n"); // FIN
}
else {
- result += QString("{LC;"); // LC
- result += QString("%1,").arg( posConv(e.attribute( "x_mm"), 4 ) ); // X position
- result += QString("%1,").arg( posConv(e.attribute( "y_mm"), 4 ) ); // Y position
- result += QString("%1,").arg( convZeros(posConv(e.attribute( "x_mm"), 4 ).toInt()+posConv(e.attribute( "width_mm"),4 ).toInt(),4)); // X position
- result += QString("%1,").arg( convZeros(posConv(e.attribute( "y_mm"), 4 ).toInt()+posConv(e.attribute( "height_mm"),4 ).toInt(),4)); // Y position
- result += QString("1,"); // Type of line 0=line 1=Rectangulo 2=Jagged line 3=Rectangle with jagged lines
- result += QString("%1").arg(lineWidth(e)); // No. of line width dots 1-9
- //result += QString("999"); // Radius of rounded corners of a rectangle
- result += QString("|}\n"); // FIN
+ result += TQString("{LC;"); // LC
+ result += TQString("%1,").tqarg( posConv(e.attribute( "x_mm"), 4 ) ); // X position
+ result += TQString("%1,").tqarg( posConv(e.attribute( "y_mm"), 4 ) ); // Y position
+ result += TQString("%1,").tqarg( convZeros(posConv(e.attribute( "x_mm"), 4 ).toInt()+posConv(e.attribute( "width_mm"),4 ).toInt(),4)); // X position
+ result += TQString("%1,").tqarg( convZeros(posConv(e.attribute( "y_mm"), 4 ).toInt()+posConv(e.attribute( "height_mm"),4 ).toInt(),4)); // Y position
+ result += TQString("1,"); // Type of line 0=line 1=Rectangulo 2=Jagged line 3=Rectangle with jagged lines
+ result += TQString("%1").tqarg(lineWidth(e)); // No. of line width dots 1-9
+ //result += TQString("999"); // Radius of rounded corners of a rectangle
+ result += TQString("|}\n"); // FIN
}
}
else if( e.tagName() == "line" ) {
- result += QString("{LC;"); // LC
- result += QString("%1,").arg( posConv(e.attribute( "x_mm"), 4 ) ); // X position
- result += QString("%1,").arg( posConv(e.attribute( "y_mm"), 4 ) ); // Y position
- result += QString("%1,").arg( convZeros(posConv(e.attribute( "x_mm"), 4 ).toInt()+posConv(e.attribute( "width_mm"),4 ).toInt(),4)); // X position
- result += QString("%1,").arg( convZeros(posConv(e.attribute( "y_mm"), 4 ).toInt()+posConv(e.attribute( "height_mm"),4 ).toInt(),4)); // Y position
- result += QString("0,"); // Type of line 0=line 1=Rectangulo 2=Jagged line 3=Rectangle with jagged lines
- result += QString("%1").arg(lineWidth(e)); // No. of line width dots 1-9
- //result += QString("999"); // Radius of rounded corners of a rectangle
- result += QString("|}\n"); // FIN
+ result += TQString("{LC;"); // LC
+ result += TQString("%1,").tqarg( posConv(e.attribute( "x_mm"), 4 ) ); // X position
+ result += TQString("%1,").tqarg( posConv(e.attribute( "y_mm"), 4 ) ); // Y position
+ result += TQString("%1,").tqarg( convZeros(posConv(e.attribute( "x_mm"), 4 ).toInt()+posConv(e.attribute( "width_mm"),4 ).toInt(),4)); // X position
+ result += TQString("%1,").tqarg( convZeros(posConv(e.attribute( "y_mm"), 4 ).toInt()+posConv(e.attribute( "height_mm"),4 ).toInt(),4)); // Y position
+ result += TQString("0,"); // Type of line 0=line 1=Rectangulo 2=Jagged line 3=Rectangle with jagged lines
+ result += TQString("%1").tqarg(lineWidth(e)); // No. of line width dots 1-9
+ //result += TQString("999"); // Radius of rounded corners of a rectangle
+ result += TQString("|}\n"); // FIN
}
n = n.nextSibling();
}
- result += QString("{U1;0130|}\n"); // ForwardFeed
- result += QString("{XS;I,%1,0000C2000|}\n").arg(convZeros(count,4)); // Issue Command
+ result += TQString("{U1;0130|}\n"); // ForwardFeed
+ result += TQString("{XS;I,%1,0000C2000|}\n").tqarg(convZeros(count,4)); // Issue Command
return result;
}
-QString convZeros( int count, int zeros )
+TQString convZeros( int count, int zeros )
{
-QString str= QString("%1").arg(count);
+TQString str= TQString("%1").tqarg(count);
int l=strlen(str); //get the string length
-for(;l<zeros;l++) str = QString("0") + str;
+for(;l<zeros;l++) str = TQString("0") + str;
return str;
}
-QString posConv( QString str, int zeros )
+TQString posConv( TQString str, int zeros )
{
-int point=str.find(".",0);
-QString dec= QString("%1").arg(str.mid(point+1,1));
+int point=str.tqfind(".",0);
+TQString dec= TQString("%1").tqarg(str.mid(point+1,1));
str = str.mid(0,point);
-str = QString("%1%2").arg(str).arg(dec);
+str = TQString("%1%2").tqarg(str).tqarg(dec);
return convZeros (str.toInt(), zeros);
}
@@ -237,30 +237,30 @@ else return 0;
}
-QString code39 (const QDomElement &e, int countBar) {
-
-QString result;
- result += QString("{XB%1;").arg( convZeros(countBar, 2) ); // count
- result += QString("%1").arg( posConv(e.attribute( "x_mm"), 4 ) ); // X position
- result += QString(",%1").arg( posConv(e.attribute( "y_mm"), 4 ) ); // Y position
- result += QString(",%1").arg( barcodeType( e.attribute( "type") ) ); // Type of bar code
- result += QString(",%1").arg( withChecksum(e) ); // Type of check digit
- result += QString(",%1").arg( "03" ); // Narrow bar width
- result += QString(",%1").arg( "03" ); // Narrow space width
- result += QString(",%1").arg( "06" ); // Wide bar width
- result += QString(",%1").arg( "06" ); // Wide space width
- result += QString(",%1").arg( "03" ); // Character to Character space width
- result += QString(",%1").arg( rotation(e.attribute( "rotation", "0" ).toInt())); // Rotation angel of barcode
- result += QString(",%1").arg( "0063" ); // height of barcode
- result += QString(",+%1").arg( sequence(e) ); // Increment / Decrement
- result += QString(",%1").arg( e.attribute( "text", "1" ).toInt() ); // Selection of print or non print of numerals under bars
- result += QString(",00"); //Number of Zeros to be suppressed
- result += QString("|}\n"); // FIN
+TQString code39 (const TQDomElement &e, int countBar) {
+
+TQString result;
+ result += TQString("{XB%1;").tqarg( convZeros(countBar, 2) ); // count
+ result += TQString("%1").tqarg( posConv(e.attribute( "x_mm"), 4 ) ); // X position
+ result += TQString(",%1").tqarg( posConv(e.attribute( "y_mm"), 4 ) ); // Y position
+ result += TQString(",%1").tqarg( barcodeType( e.attribute( "type") ) ); // Type of bar code
+ result += TQString(",%1").tqarg( withChecksum(e) ); // Type of check digit
+ result += TQString(",%1").tqarg( "03" ); // Narrow bar width
+ result += TQString(",%1").tqarg( "03" ); // Narrow space width
+ result += TQString(",%1").tqarg( "06" ); // Wide bar width
+ result += TQString(",%1").tqarg( "06" ); // Wide space width
+ result += TQString(",%1").tqarg( "03" ); // Character to Character space width
+ result += TQString(",%1").tqarg( rotation(e.attribute( "rotation", "0" ).toInt())); // Rotation angel of barcode
+ result += TQString(",%1").tqarg( "0063" ); // height of barcode
+ result += TQString(",+%1").tqarg( sequence(e) ); // Increment / Decrement
+ result += TQString(",%1").tqarg( e.attribute( "text", "1" ).toInt() ); // Selection of print or non print of numerals under bars
+ result += TQString(",00"); //Number of Zeros to be suppressed
+ result += TQString("|}\n"); // FIN
return result;
}
-QString barcodeType(const QString &type){
+TQString barcodeType(const TQString &type){
if (type == "i25") return "2";
if (type == "i25 -c") return "2";
if (type == "msi") return "1";
@@ -294,7 +294,7 @@ return "0";
}
-QString withChecksum( const QDomElement &e) {
+TQString withChecksum( const TQDomElement &e) {
if (e.attribute("type")=="code39 -c") return "1";
if (e.attribute("type")=="code39") return "3";
if (e.attribute("type")=="ean") return "3";
@@ -364,37 +364,37 @@ return "0";
}
-QString sequence(const QDomElement &e){
+TQString sequence(const TQDomElement &e){
return convZeros(e.attribute("sequencestep" ,"0").toInt() ,10);
}
-QString code128 (const QDomElement &e, int countBar) {
-
-QString result;
- result += QString("{XB%1;").arg( convZeros(countBar, 2) ); // count
- result += QString("%1").arg( posConv(e.attribute( "x_mm"), 4 ) ); // X position
- result += QString(",%1").arg( posConv(e.attribute( "y_mm"), 4 ) ); // Y position
- result += QString(",%1").arg( barcodeType( e.attribute( "type") ) ); // Type of bar code
- result += QString(",%1").arg( withChecksum(e) ); // Type of check digit
- result += QString(",%1").arg( "03" ); // 1 module width
- result += QString(",%1").arg( rotation(e.attribute( "rotation", "0" ).toInt())); // Rotation angel of barcode
- result += QString(",%1").arg( "0063" ); // height of barcode
- result += QString(",+%1").arg( sequence(e) ); // Increment / Decrement
- result += QString(",000"); // Length of th WPC guard bar
- result += QString(",%1").arg( e.attribute( "text", "1" ).toInt() ); // Selection of print or non print of numerals under bars
- result += QString(",00"); //Number of Zeros to be suppressed
- result += QString("|}\n"); // FIN
+TQString code128 (const TQDomElement &e, int countBar) {
+
+TQString result;
+ result += TQString("{XB%1;").tqarg( convZeros(countBar, 2) ); // count
+ result += TQString("%1").tqarg( posConv(e.attribute( "x_mm"), 4 ) ); // X position
+ result += TQString(",%1").tqarg( posConv(e.attribute( "y_mm"), 4 ) ); // Y position
+ result += TQString(",%1").tqarg( barcodeType( e.attribute( "type") ) ); // Type of bar code
+ result += TQString(",%1").tqarg( withChecksum(e) ); // Type of check digit
+ result += TQString(",%1").tqarg( "03" ); // 1 module width
+ result += TQString(",%1").tqarg( rotation(e.attribute( "rotation", "0" ).toInt())); // Rotation angel of barcode
+ result += TQString(",%1").tqarg( "0063" ); // height of barcode
+ result += TQString(",+%1").tqarg( sequence(e) ); // Increment / Decrement
+ result += TQString(",000"); // Length of th WPC guard bar
+ result += TQString(",%1").tqarg( e.attribute( "text", "1" ).toInt() ); // Selection of print or non print of numerals under bars
+ result += TQString(",00"); //Number of Zeros to be suppressed
+ result += TQString("|}\n"); // FIN
return result;
}
#if 0
-QString serialWatch(){
+TQString serialWatch(){
int fd, res, exit=1;
struct termios oldtio,newtio;
char buf[MAXDATASIZE];
-QString result,temp;
+TQString result,temp;
//fd = open("/dev/ttyUSB0", O_RDWR | O_NOCTTY );
@@ -407,7 +407,7 @@ newtio.c_iflag = IGNPAR; // | ICRNL;
newtio.c_oflag = 0;
newtio.c_lflag =0;// ICANON;
newtio.c_cc[VINTR] = 0; /* Ctrl-c */
-newtio.c_cc[VQUIT] = 0; /* Ctrl-\ */
+newtio.c_cc[VTQUIT] = 0; /* Ctrl-\ */
newtio.c_cc[VERASE] = 0; /* del */
newtio.c_cc[VKILL] = 0; /* @ */
newtio.c_cc[VEOF] = 4; /* Ctrl-d */
@@ -434,12 +434,12 @@ while (res ==-1 ){
//sleep(10);
res=read(fd,buf,MAXDATASIZE);
}
-temp = QString(buf);
+temp = TQString(buf);
//qDebug ("serial: "+temp+"\n");
// LF = = 10
// CR = \r = 13
-if (temp.find(QString("\r"),0,1)==-1) result+= temp;
+if (temp.tqfind(TQString("\r"),0,1)==-1) result+= temp;
else {
result+= temp;
exit=0;
@@ -454,24 +454,24 @@ return result;
-QString pdf417 (const QDomElement &e, int countBar) {
+TQString pdf417 (const TQDomElement &e, int countBar) {
-QString result;
- result += QString("{XB%1;").arg( convZeros(countBar, 2) ); // count
- result += QString("%1").arg( posConv(e.attribute( "x_mm"), 4 ) ); // X position
- result += QString(",%1").arg( posConv(e.attribute( "y_mm"), 4 ) ); // Y position
- result += QString(",P"); // Type of bar code ALWAYS PDF417
- result += QString(",%1").arg( withChecksum(e) ); // Type of check digit
- result += QString(",%1").arg( "03" ); // Module Width
- result += QString(",%1").arg( convZeros(e.attribute("pdf417.col").toInt(),2 )); // Number of columns
- result += QString(",%1").arg( rotation(e.attribute( "rotation", "0" ).toInt())); // Rotation angel of barcode
- result += QString(",%1").arg( "0063" ); // height of barcode
- result += QString("|}\n"); // FIN
+TQString result;
+ result += TQString("{XB%1;").tqarg( convZeros(countBar, 2) ); // count
+ result += TQString("%1").tqarg( posConv(e.attribute( "x_mm"), 4 ) ); // X position
+ result += TQString(",%1").tqarg( posConv(e.attribute( "y_mm"), 4 ) ); // Y position
+ result += TQString(",P"); // Type of bar code ALWAYS PDF417
+ result += TQString(",%1").tqarg( withChecksum(e) ); // Type of check digit
+ result += TQString(",%1").tqarg( "03" ); // Module Width
+ result += TQString(",%1").tqarg( convZeros(e.attribute("pdf417.col").toInt(),2 )); // Number of columns
+ result += TQString(",%1").tqarg( rotation(e.attribute( "rotation", "0" ).toInt())); // Rotation angel of barcode
+ result += TQString(",%1").tqarg( "0063" ); // height of barcode
+ result += TQString("|}\n"); // FIN
return result;
}
-QString getData(const QString &etext, const QString &art, const QString &group, const QString &id){
+TQString getData(const TQString &etext, const TQString &art, const TQString &group, const TQString &id){
TokenProvider token( NULL );
token.setArticleNo( art );
token.setGroup( group );
@@ -486,141 +486,141 @@ QString getData(const QString &etext, const QString &art, const QString &group,
return token.parse( etext );
/*
-QString temp;
-
-
-if (etext.contains("[serial_watch]") ) etext.replace( "[serial_watch]" , serialWatch() );
-if (etext.contains("[customer_no]") ) etext.replace( "[customer_no]" , id );
-if (etext.contains("[customer_name]") ) etext.replace( "[customer_name]" , name );
-if (etext.contains("[group]") ) etext.replace( "[group]" , group );
-if (etext.contains("[article_no]") ) etext.replace( "[article_no]" , art );
-if (etext.contains("[line1]") ) {
- QSqlQuery query("SELECT line1 FROM customer_text where customer_no='" + id + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[line1]" , temp );
- }
-if (etext.contains("[line0]") ) {
- QSqlQuery query("SELECT line0 FROM customer_text where customer_no='" + id + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[line0]" , temp );
- }
-if (etext.contains("[line2]") ) {
- QSqlQuery query("SELECT line2 FROM customer_text where customer_no='" + id + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[line2]" , temp );
- }
-if (etext.contains("[line3]") ) {
- QSqlQuery query("SELECT line3 FROM customer_text where customer_no='" + id + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[line3]" , temp );
- }
-if (etext.contains("[line4]") ) {
- QSqlQuery query("SELECT line4 FROM customer_text where customer_no='" + id + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[line4]" , temp );
- }
-if (etext.contains("[line5]") ) {
- QSqlQuery query("SELECT line5 FROM customer_text where customer_no='" + id + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[line5]" , temp );
- }
-if (etext.contains("[line6]") ) {
- QSqlQuery query("SELECT line6 FROM customer_text where customer_no='" + id + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[line6]" , temp );
- }
-if (etext.contains("[line7]") ) {
- QSqlQuery query("SELECT line7 FROM customer_text where customer_no='" + id + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[line7]" , temp );
- }
-if (etext.contains("[line8]") ) {
- QSqlQuery query("SELECT line8 FROM customer_text where customer_no='" + id + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[line8]" , temp );
- }
-if (etext.contains("[line9]") ) {
- QSqlQuery query("SELECT line9 FROM customer_text where customer_no='" + id + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[line9]" , temp );
- }
-if (etext.contains("[field0]") ) {
- QSqlQuery query("SELECT field0 FROM barcode_basic where article_no='" + art + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[field0]" , temp );
- }
-if (etext.contains("[field1]") ) {
- QSqlQuery query("SELECT field1 FROM barcode_basic where article_no='" + art + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[field1]" , temp );
- }
-if (etext.contains("[field2]") ) {
- QSqlQuery query("SELECT field2 FROM barcode_basic where article_no='" + art + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[field2]" , temp );
- }
-if (etext.contains("[field3]") ) {
- QSqlQuery query("SELECT field3 FROM barcode_basic where article_no='" + art + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[field3]" , temp );
- }
-if (etext.contains("[field4]") ) {
- QSqlQuery query("SELECT field4 FROM barcode_basic where article_no='" + art + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[field4]" , temp );
- }
-if (etext.contains("[field5]") ) {
- QSqlQuery query("SELECT field5 FROM barcode_basic where article_no='" + art + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[field5]" , temp );
- }
-if (etext.contains("[field6]") ) {
- QSqlQuery query("SELECT field6 FROM barcode_basic where article_no='" + art + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[field6]" , temp );
- }
-if (etext.contains("[field7]") ) {
- QSqlQuery query("SELECT field7 FROM barcode_basic where article_no='" + art + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[field7]" , temp );
- }
-if (etext.contains("[field8]") ) {
- QSqlQuery query("SELECT field8 FROM barcode_basic where article_no='" + art + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[field8]" , temp );
- }
-if (etext.contains("[field9]") ) {
- QSqlQuery query("SELECT field9 FROM barcode_basic where article_no='" + art + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[field9]" , temp );
- }
-if (etext.contains("[article_desc]") ) {
- QSqlQuery query("SELECT article_desc FROM barcode_basic where article_no='" + art + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[article_desc]" , temp );
- }
-if (etext.contains("[barcode_no]") ) {
- QSqlQuery query("SELECT barcode_no FROM barcode_basic where article_no='" + art + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[barcode_no]" , temp );
- }
-if (etext.contains("[field9]") ) {
- QSqlQuery query("SELECT field9 FROM barcode_basic where article_no='" + art + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[field9]" , temp );
- }
-if (etext.contains("[article_no_customer]") ) {
- QSqlQuery query("SELECT article_no_customer FROM customer_text where customer_no='" + id + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace( "[article_no_customer]" , temp );
- }
-if (etext.contains("[barcode_no_customer]") ){
- QSqlQuery query("SELECT barcode_no FROM customer_text where customer_no='" + id + "'" );
- while( query.next() ) temp = QString (query.value( 0 ).toString());
- etext.replace("[barcode_no_customer]" , temp );
- }
-if (etext.contains("[date]") ) etext.replace( "[date]" ,QDateTime::currentDateTime().toString( KBarcodeSettings::getDateFormat() ));
-if (etext.contains("[time]") ) etext.replace( "[time]" ,QTime::currentTime().toString());
+TQString temp;
+
+
+if (etext.tqcontains("[serial_watch]") ) etext.tqreplace( "[serial_watch]" , serialWatch() );
+if (etext.tqcontains("[customer_no]") ) etext.tqreplace( "[customer_no]" , id );
+if (etext.tqcontains("[customer_name]") ) etext.tqreplace( "[customer_name]" , name );
+if (etext.tqcontains("[group]") ) etext.tqreplace( "[group]" , group );
+if (etext.tqcontains("[article_no]") ) etext.tqreplace( "[article_no]" , art );
+if (etext.tqcontains("[line1]") ) {
+ TQSqlQuery query("SELECT line1 FROM customer_text where customer_no='" + id + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[line1]" , temp );
+ }
+if (etext.tqcontains("[line0]") ) {
+ TQSqlQuery query("SELECT line0 FROM customer_text where customer_no='" + id + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[line0]" , temp );
+ }
+if (etext.tqcontains("[line2]") ) {
+ TQSqlQuery query("SELECT line2 FROM customer_text where customer_no='" + id + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[line2]" , temp );
+ }
+if (etext.tqcontains("[line3]") ) {
+ TQSqlQuery query("SELECT line3 FROM customer_text where customer_no='" + id + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[line3]" , temp );
+ }
+if (etext.tqcontains("[line4]") ) {
+ TQSqlQuery query("SELECT line4 FROM customer_text where customer_no='" + id + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[line4]" , temp );
+ }
+if (etext.tqcontains("[line5]") ) {
+ TQSqlQuery query("SELECT line5 FROM customer_text where customer_no='" + id + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[line5]" , temp );
+ }
+if (etext.tqcontains("[line6]") ) {
+ TQSqlQuery query("SELECT line6 FROM customer_text where customer_no='" + id + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[line6]" , temp );
+ }
+if (etext.tqcontains("[line7]") ) {
+ TQSqlQuery query("SELECT line7 FROM customer_text where customer_no='" + id + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[line7]" , temp );
+ }
+if (etext.tqcontains("[line8]") ) {
+ TQSqlQuery query("SELECT line8 FROM customer_text where customer_no='" + id + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[line8]" , temp );
+ }
+if (etext.tqcontains("[line9]") ) {
+ TQSqlQuery query("SELECT line9 FROM customer_text where customer_no='" + id + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[line9]" , temp );
+ }
+if (etext.tqcontains("[field0]") ) {
+ TQSqlQuery query("SELECT field0 FROM barcode_basic where article_no='" + art + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[field0]" , temp );
+ }
+if (etext.tqcontains("[field1]") ) {
+ TQSqlQuery query("SELECT field1 FROM barcode_basic where article_no='" + art + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[field1]" , temp );
+ }
+if (etext.tqcontains("[field2]") ) {
+ TQSqlQuery query("SELECT field2 FROM barcode_basic where article_no='" + art + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[field2]" , temp );
+ }
+if (etext.tqcontains("[field3]") ) {
+ TQSqlQuery query("SELECT field3 FROM barcode_basic where article_no='" + art + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[field3]" , temp );
+ }
+if (etext.tqcontains("[field4]") ) {
+ TQSqlQuery query("SELECT field4 FROM barcode_basic where article_no='" + art + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[field4]" , temp );
+ }
+if (etext.tqcontains("[field5]") ) {
+ TQSqlQuery query("SELECT field5 FROM barcode_basic where article_no='" + art + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[field5]" , temp );
+ }
+if (etext.tqcontains("[field6]") ) {
+ TQSqlQuery query("SELECT field6 FROM barcode_basic where article_no='" + art + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[field6]" , temp );
+ }
+if (etext.tqcontains("[field7]") ) {
+ TQSqlQuery query("SELECT field7 FROM barcode_basic where article_no='" + art + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[field7]" , temp );
+ }
+if (etext.tqcontains("[field8]") ) {
+ TQSqlQuery query("SELECT field8 FROM barcode_basic where article_no='" + art + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[field8]" , temp );
+ }
+if (etext.tqcontains("[field9]") ) {
+ TQSqlQuery query("SELECT field9 FROM barcode_basic where article_no='" + art + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[field9]" , temp );
+ }
+if (etext.tqcontains("[article_desc]") ) {
+ TQSqlQuery query("SELECT article_desc FROM barcode_basic where article_no='" + art + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[article_desc]" , temp );
+ }
+if (etext.tqcontains("[barcode_no]") ) {
+ TQSqlQuery query("SELECT barcode_no FROM barcode_basic where article_no='" + art + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[barcode_no]" , temp );
+ }
+if (etext.tqcontains("[field9]") ) {
+ TQSqlQuery query("SELECT field9 FROM barcode_basic where article_no='" + art + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[field9]" , temp );
+ }
+if (etext.tqcontains("[article_no_customer]") ) {
+ TQSqlQuery query("SELECT article_no_customer FROM customer_text where customer_no='" + id + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace( "[article_no_customer]" , temp );
+ }
+if (etext.tqcontains("[barcode_no_customer]") ){
+ TQSqlQuery query("SELECT barcode_no FROM customer_text where customer_no='" + id + "'" );
+ while( query.next() ) temp = TQString (query.value( 0 ).toString());
+ etext.tqreplace("[barcode_no_customer]" , temp );
+ }
+if (etext.tqcontains("[date]") ) etext.tqreplace( "[date]" ,TQDateTime::tqcurrentDateTime().toString( KBarcodeSettings::getDateFormat() ));
+if (etext.tqcontains("[time]") ) etext.tqreplace( "[time]" ,TQTime::currentTime().toString());
return etext;*/
}
@@ -628,31 +628,31 @@ return etext;*/
-QString lineWidth(const QDomElement &e){
-QString result;
+TQString lineWidth(const TQDomElement &e){
+TQString result;
int width = e.attribute("line-width").toInt();
if (width > 0 and width < 10) return result.setNum(width);
else return "9"; //Max width supported
}
-QString image (const QString &file){
+TQString image (const TQString &file){
int fd, res;
char buf[1];
-QString result;
+TQString result;
fd = open(file, O_RDONLY);
if (fd <0) return "Port Error.";
res=read(fd,buf,1);
while (res == 1){
-result += QString(buf);
+result += TQString(buf);
res=read(fd,buf,1);
}
return result;
}
-QString getImage( const QString &id){
-QString file;
-QSqlQuery query("SELECT line9 FROM customer_text where customer_no='" + id + "'" );
-while( query.next() ) file = QString (query.value( 0 ).toString());
+TQString getImage( const TQString &id){
+TQString file;
+TQSqlQuery query("SELECT line9 FROM customer_text where customer_no='" + id + "'" );
+while( query.next() ) file = TQString (query.value( 0 ).toString());
return image(file);
}
diff --git a/kbarcode/tec.h b/kbarcode/tec.h
index 46dc15a..73de630 100644
--- a/kbarcode/tec.h
+++ b/kbarcode/tec.h
@@ -22,16 +22,16 @@
#include <stdio.h>
// QT includes
-#include <qclipboard.h>
-#include <qcursor.h>
-#include <qgroupbox.h>
-#include <qhbox.h>
-#include <qlayout.h>
-#include <qpainter.h>
-#include <qpaintdevicemetrics.h>
-#include <qprogressdialog.h>
-#include <qsqlcursor.h>
-#include <qvalidator.h>
+#include <tqclipboard.h>
+#include <tqcursor.h>
+#include <tqgroupbox.h>
+#include <tqhbox.h>
+#include <tqlayout.h>
+#include <tqpainter.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqprogressdialog.h>
+#include <tqsqlcursor.h>
+#include <tqvalidator.h>
// KDE includes
#include <kapplication.h>
@@ -49,21 +49,21 @@
#include <kprinter.h>
#include <kurlrequester.h>
-QString tec452(const QString &file, int count, const QString &art, const QString &group, const QString &id);
-QString convZeros( int count, int zeros );
-QString posConv( QString str, int zeros );
+TQString tec452(const TQString &file, int count, const TQString &art, const TQString &group, const TQString &id);
+TQString convZeros( int count, int zeros );
+TQString posConv( TQString str, int zeros );
int rotation (int valor);
-QString code39 (const QDomElement &e, int countBar);
-QString code128 (const QDomElement &e, int countBar);
-QString barcodeType(const QString &type);
-QString withChecksum(const QDomElement &e);
-QString sequence(const QDomElement &e);
-QString serialWatch();
-QString pdf417 (const QDomElement &e, int countBar);
-QString getData(const QString &etext, const QString &art, const QString &group, const QString &id);
-QString lineWidth(const QDomElement &e);
-QString image (const QString &file);
-QString getImage(const QString &id);
+TQString code39 (const TQDomElement &e, int countBar);
+TQString code128 (const TQDomElement &e, int countBar);
+TQString barcodeType(const TQString &type);
+TQString withChecksum(const TQDomElement &e);
+TQString sequence(const TQDomElement &e);
+TQString serialWatch();
+TQString pdf417 (const TQDomElement &e, int countBar);
+TQString getData(const TQString &etext, const TQString &art, const TQString &group, const TQString &id);
+TQString lineWidth(const TQDomElement &e);
+TQString image (const TQString &file);
+TQString getImage(const TQString &id);
#endif
diff --git a/kbarcode/textitem.cpp b/kbarcode/textitem.cpp
index ab1e4cc..16578e3 100644
--- a/kbarcode/textitem.cpp
+++ b/kbarcode/textitem.cpp
@@ -23,15 +23,15 @@
// we need sin and cos
#include <math.h>
-#include <qapplication.h>
-#include <qdom.h>
-#include <qpaintdevicemetrics.h>
-#include <qpainter.h>
-#include <qpicture.h>
-#include <qsimplerichtext.h>
+#include <tqapplication.h>
+#include <tqdom.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqpainter.h>
+#include <tqpicture.h>
+#include <tqsimplerichtext.h>
#include <kapplication.h>
-#include <qwmatrix.h>
+#include <tqwmatrix.h>
TextItem::TextItem()
: DocumentItem()
@@ -41,28 +41,28 @@ TextItem::TextItem()
void TextItem::init()
{
- m_text = QString::null;
+ m_text = TQString();
m_rotation = 0.0;
setBorder( false );
- setRect( QRect( 0, 0, 100, 100 ) );
+ setRect( TQRect( 0, 0, 100, 100 ) );
}
-void TextItem::draw(QPainter* painter)
+void TextItem::draw(TQPainter* painter)
{
bool autosize = false;
- const QString t = tokenProvider() ? tokenProvider()->parse( m_text ) : m_text;
+ const TQString t = tokenProvider() ? tokenProvider()->parse( m_text ) : m_text;
if( t != m_text )
autosize = true;
- QPaintDeviceMetrics metrics( DocumentItem::paintDevice() );
+ TQPaintDeviceMetrics metrics( DocumentItem::paintDevice() );
- double scalex = (double)metrics.logicalDpiX() / (double)QPaintDevice::x11AppDpiX();
- double scaley = (double)metrics.logicalDpiY() / (double)QPaintDevice::x11AppDpiY();
+ double scalex = (double)metrics.logicalDpiX() / (double)TQPaintDevice::x11AppDpiX();
+ double scaley = (double)metrics.logicalDpiY() / (double)TQPaintDevice::x11AppDpiY();
- QColorGroup cg;
- QSimpleRichText srt( t, painter->font() );
+ TQColorGroup cg;
+ TQSimpleRichText srt( t, painter->font() );
/*
int width = (rect().width() < (int)((double)srt.widthUsed()*scalex) && autosize) ? srt.widthUsed() : rect().width();
@@ -85,30 +85,30 @@ void TextItem::draw(QPainter* painter)
break;
case 90:
painter->translate( rect().x() + w, rect().y() );
- qSwap( w, h );
+ tqSwap( w, h );
break;
case 180:
painter->translate( rect().x() + w, rect().y() + h );
break;
case 270:
painter->translate( rect().x(), rect().y() + h );
- qSwap( w, h );
+ tqSwap( w, h );
break;
};
painter->rotate( m_rotation );
- if( !TextItem::IsQtTextRenderingBroken() )
+ if( !TextItem::IsTQtTextRenderingBroken() )
{
- painter->setPen( Qt::black );
+ painter->setPen( TQt::black );
srt.setWidth( painter, w );
- srt.draw( painter, 0, 0, QRect( 0, 0, w, h ), cg );
+ srt.draw( painter, 0, 0, TQRect( 0, 0, w, h ), cg );
}
else
{
- QRect r( 0, 0, width, height );
- QPicture picture;
- QPainter p( &picture );
+ TQRect r( 0, 0, width, height );
+ TQPicture picture;
+ TQPainter p( &picture );
LabelUtils::renderString( &p, t, r, scalex, scaley );
p.end();
painter->drawPicture( 0, 0, picture );
@@ -119,35 +119,35 @@ void TextItem::draw(QPainter* painter)
DocumentItem::drawBorder( painter );
}
-void TextItem::drawZpl( QTextStream* stream )
+void TextItem::drawZpl( TQTextStream* stream )
{
// simply remove all html tags....
- QString data = m_text.replace( QRegExp("<[^>]*>"), "" );
+ TQString data = m_text.tqreplace( TQRegExp("<[^>]*>"), "" );
*stream << ZPLUtils::fieldOrigin( rect().x(), rect().y() );
- *stream << ZPLUtils::font( QFont() ); // todo: select a valid font
+ *stream << ZPLUtils::font( TQFont() ); // todo: select a valid font
}
-void TextItem::drawIpl( QTextStream* stream, IPLUtils* utils )
+void TextItem::drawIpl( TQTextStream* stream, IPLUtils* utils )
{
int counter = utils->counter();
// simply remove all html tags....
- QString data = m_text.replace( QRegExp("<[^>]*>"), "" );
+ TQString data = m_text.tqreplace( TQRegExp("<[^>]*>"), "" );
- QString s = QString("H%1;").arg( counter ); // field number
+ TQString s = TQString("H%1;").tqarg( counter ); // field number
s += utils->fieldOrigin( rect().x(), rect().y() );
- s += QString("c%1;").arg( 2 ); // font
- s += QString("h%1;").arg( 2 ); // vertical magnification ("height")
- s += QString("w%1;").arg( 2 ); // horicontyl magnification ("width")
- s += QString("d0,%1;").arg( data.length() ); // max length of data !
+ s += TQString("c%1;").tqarg( 2 ); // font
+ s += TQString("h%1;").tqarg( 2 ); // vertical magnification ("height")
+ s += TQString("w%1;").tqarg( 2 ); // horicontyl magnification ("width")
+ s += TQString("d0,%1;").tqarg( data.length() ); // max length of data !
*stream << utils->field( s );
utils->addValue( data );
}
-void TextItem::drawEPcl( QTextStream* stream )
+void TextItem::drawEPcl( TQTextStream* stream )
{
// TODO: parse text field HTML
@@ -155,28 +155,28 @@ void TextItem::drawEPcl( QTextStream* stream )
//
// break string into lines
- QString t = m_text.replace( QRegExp("<[^>]*>"), "" );
+ TQString t = m_text.tqreplace( TQRegExp("<[^>]*>"), "" );
// @DOM:
// TODO:
// provide an API which simplifies wordwrapping for
// barcode printers
- QStringList lines = QStringList::split( "\n", t );
+ TQStringList lines = TQStringList::split( "\n", t );
- QStringList::Iterator line = lines.begin();
+ TQStringList::Iterator line = lines.begin();
for( int i=0; line != lines.end(); ++line, ++i ){
- QString s = QString("T %1").arg( rect().x() + 1 );
- s += QString(" %1 0 0 0 50 1").arg( rect().y()+50+1 + i*52 );
- s += QString(" %1").arg( *line );
+ TQString s = TQString("T %1").tqarg( rect().x() + 1 );
+ s += TQString(" %1 0 0 0 50 1").tqarg( rect().y()+50+1 + i*52 );
+ s += TQString(" %1").tqarg( *line );
*stream << EPCLUtils::field( s );
}
}
-void TextItem::loadXML (QDomElement* element)
+void TextItem::loadXML (TQDomElement* element)
{
- QDomNode n = element->firstChild();
+ TQDomNode n = element->firstChild();
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if( !e.isNull() )
if( e.tagName() == "text" )
{
@@ -190,9 +190,9 @@ void TextItem::loadXML (QDomElement* element)
DocumentItem::loadXML( element );
}
-void TextItem::saveXML (QDomElement* element)
+void TextItem::saveXML (TQDomElement* element)
{
- QDomElement texttag = element->ownerDocument().createElement( "text" );
+ TQDomElement texttag = element->ownerDocument().createElement( "text" );
texttag.appendChild( element->ownerDocument().createTextNode( text() ) );
element->appendChild( texttag );
element->setAttribute( "rotation", m_rotation );
@@ -200,12 +200,12 @@ void TextItem::saveXML (QDomElement* element)
DocumentItem::saveXML( element );
}
-QString TextItem::text () const
+TQString TextItem::text () const
{
return m_text;
}
-void TextItem::setText (const QString & text)
+void TextItem::setText (const TQString & text)
{
m_text = text;
}
@@ -213,12 +213,12 @@ void TextItem::setText (const QString & text)
bool TextItem::s_qt_broken_init = false;
bool TextItem::s_qt_broken = false;
-bool TextItem::IsQtTextRenderingBroken()
+bool TextItem::IsTQtTextRenderingBroken()
{
if( !s_qt_broken_init )
{
- QString version( qVersion() );
-// qDebug( "Detected Qt Version: %s", version.latin1() );
+ TQString version( qVersion() );
+// qDebug( "Detected TQt Version: %s", version.latin1() );
int major = version.section( ".", 0, 0 ).toInt();
int minor = version.section( ".", 1, 1 ).toInt();
int bugfix = version.section( ".", 2, 2 ).toInt();
@@ -241,7 +241,7 @@ bool TextItem::IsQtTextRenderingBroken()
s_qt_broken = true;
if( s_qt_broken )
- qDebug("Qt's text redering is broken - using KBarcode fix.");
+ qDebug("TQt's text redering is broken - using KBarcode fix.");
s_qt_broken_init = true;
return s_qt_broken;
diff --git a/kbarcode/textitem.h b/kbarcode/textitem.h
index cec5d46..9c0b5a2 100644
--- a/kbarcode/textitem.h
+++ b/kbarcode/textitem.h
@@ -17,36 +17,36 @@
#ifndef TEXTITEM_H
#define TEXTITEM_H
-#include <qstring.h>
+#include <tqstring.h>
#include "documentitem.h"
class LabelEditor;
/**
* Class TextItem
- * Formated rich text (drawn using either DSRichText or QSimpleRichText - once it is bug free) on screen or printer.
+ * Formated rich text (drawn using either DSRichText or TQSimpleRichText - once it is bug free) on screen or printer.
*/
class TextItem : public DocumentItem {
public:
TextItem ();
- void draw (QPainter* painter);
- void drawZpl( QTextStream* stream );
- void drawIpl( QTextStream* stream, IPLUtils* utils );
- void drawEPcl( QTextStream* stream );
+ void draw (TQPainter* painter);
+ void drawZpl( TQTextStream* stream );
+ void drawIpl( TQTextStream* stream, IPLUtils* utils );
+ void drawEPcl( TQTextStream* stream );
int rtti () const { return eRtti_Text; }
- void loadXML (QDomElement* element);
- void saveXML (QDomElement* element);
+ void loadXML (TQDomElement* element);
+ void saveXML (TQDomElement* element);
- void setText (const QString & text);
- QString text () const;
+ void setText (const TQString & text);
+ TQString text () const;
inline void setRotation( double rot ) { m_rotation = rot; }
inline double rotation() const { return m_rotation; }
- static bool IsQtTextRenderingBroken();
+ static bool IsTQtTextRenderingBroken();
private:
void init();
@@ -55,7 +55,7 @@ private:
static bool s_qt_broken_init;
double m_rotation;
- QString m_text;
+ TQString m_text;
};
#endif //TEXTITEM_H
diff --git a/kbarcode/textlineedit.cpp b/kbarcode/textlineedit.cpp
index 9a6965b..e9b4142 100644
--- a/kbarcode/textlineedit.cpp
+++ b/kbarcode/textlineedit.cpp
@@ -20,44 +20,36 @@
#include <kfiledialog.h>
#include <klocale.h>
#include <kspell.h>
-#if QT_VERSION >= 0x030100
- #include <klineedit.h>
-#else
- #include <qlineedit.h>
-#endif
+#include <klineedit.h>
#include <ktoolbar.h>
#include <kcombobox.h>
-// Qt includes
-#include <qdockarea.h>
-#include <qregexp.h>
-#include <qlabel.h>
-#include <qlayout.h>
+// TQt includes
+#include <tqdockarea.h>
+#include <tqregexp.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
-TextLineEditor::TextLineEditor( TokenProvider* token, QWidget *parent, const char *name )
- : QWidget( parent, name ), m_token( token )
+TextLineEditor::TextLineEditor( TokenProvider* token, TQWidget *tqparent, const char *name )
+ : TQWidget( tqparent, name ), m_token( token )
{
- QVBoxLayout* layout = new QVBoxLayout( this, 6, 6 );
+ TQVBoxLayout* tqlayout = new TQVBoxLayout( this, 6, 6 );
-#if QT_VERSION >= 0x030100
editor = new KLineEdit( this );
-#else
- editor = new QLineEdit( this );
-#endif
editor->setFocus();
- QDockArea* area = new QDockArea( Qt::Horizontal, QDockArea::Normal, this );
+ TQDockArea* area = new TQDockArea( Qt::Horizontal, TQDockArea::Normal, this );
toolBar = new KToolBar( area );
tool2Bar = new KToolBar( area );
tool3Bar = new KToolBar( area );
setupActions();
- layout->addWidget( area );
- layout->addWidget( editor );
+ tqlayout->addWidget( area );
+ tqlayout->addWidget( editor );
@@ -76,26 +68,26 @@ void TextLineEditor::setupActions()
ac = new KActionCollection( this );
- KAction *action_undo = KStdAction::undo( editor, SLOT( undo() ), ac );
+ KAction *action_undo = KStdAction::undo( TQT_TQOBJECT(editor), TQT_SLOT( undo() ), ac );
action_undo->setEnabled( false );
- connect( editor, SIGNAL( undoAvailable(bool) ), action_undo, SLOT( setEnabled(bool) ) );
+ connect( editor, TQT_SIGNAL( undoAvailable(bool) ), action_undo, TQT_SLOT( setEnabled(bool) ) );
- KAction *action_redo = KStdAction::redo( editor, SLOT( redo() ), ac );
+ KAction *action_redo = KStdAction::redo( TQT_TQOBJECT(editor), TQT_SLOT( redo() ), ac );
action_redo->setEnabled( false );
- connect( editor, SIGNAL( redoAvailable(bool) ), action_redo, SLOT( setEnabled(bool) ) );
+ connect( editor, TQT_SIGNAL( redoAvailable(bool) ), action_redo, TQT_SLOT( setEnabled(bool) ) );
- KAction *action_cut = KStdAction::cut( editor, SLOT( cut() ), ac );
+ KAction *action_cut = KStdAction::cut( TQT_TQOBJECT(editor), TQT_SLOT( cut() ), ac );
action_cut->setEnabled( false );
- connect( editor, SIGNAL( copyAvailable(bool) ), action_cut, SLOT( setEnabled(bool) ) );
+ connect( editor, TQT_SIGNAL( copyAvailable(bool) ), action_cut, TQT_SLOT( setEnabled(bool) ) );
- KAction *action_copy = KStdAction::copy( editor, SLOT( copy() ), ac );
+ KAction *action_copy = KStdAction::copy( TQT_TQOBJECT(editor), TQT_SLOT( copy() ), ac );
action_copy->setEnabled( false );
- connect( editor, SIGNAL( copyAvailable(bool) ), action_copy, SLOT( setEnabled(bool) ) );
+ connect( editor, TQT_SIGNAL( copyAvailable(bool) ), action_copy, TQT_SLOT( setEnabled(bool) ) );
- KAction* action_paste = KStdAction::paste( editor, SLOT( paste() ), ac );
+ KAction* action_paste = KStdAction::paste( TQT_TQOBJECT(editor), TQT_SLOT( paste() ), ac );
- KAction* textDataAct = new KAction( i18n("Insert &Data Field"), "contents", 0, this, SLOT( insertNewField() ), ac, "text_data_act");
+ KAction* textDataAct = new KAction( i18n("Insert &Data Field"), "contents", 0, TQT_TQOBJECT(this), TQT_SLOT( insertNewField() ), ac, "text_data_act");
action_undo->plug( toolBar );
action_redo->plug( toolBar );
@@ -105,7 +97,7 @@ void TextLineEditor::setupActions()
action_paste->plug( toolBar );
- QStringList fuentes;
+ TQStringList fuentes;
fuentes += "Tiems Roman (Medium) 8 point";
fuentes += "Tiems Roman (Medium) 10 point";
fuentes += "Tiems Roman (Bold) 10 point";
@@ -130,17 +122,17 @@ void TextLineEditor::setupActions()
textDataAct->plug( tool2Bar );
action_font_type = new KComboBox(tool2Bar,"font_type") ;
- connect( action_font_type, SIGNAL( activated(int) ), this, SLOT( setFontType(int) ) );
+ connect( action_font_type, TQT_SIGNAL( activated(int) ), TQT_TQOBJECT(this), TQT_SLOT( setFontType(int) ) );
action_font_type->insertStringList(fuentes) ;
- QLabel* labelv = new QLabel( i18n("&Mag. Vert.:"), tool3Bar );
+ TQLabel* labelv = new TQLabel( i18n("&Mag. Vert.:"), tool3Bar );
mag_vert = new KIntNumInput( tool3Bar,"magvert" );
- QLabel* labelh = new QLabel( i18n("&Mag. Hor.:"), tool3Bar );
+ TQLabel* labelh = new TQLabel( i18n("&Mag. Hor.:"), tool3Bar );
mag_hor = new KIntNumInput( tool3Bar,"maghor" );
- connect( mag_vert, SIGNAL( activated(int) ), this, SLOT( setVerMag(int) ) );
- connect( mag_hor, SIGNAL( activated(int) ), this, SLOT( setHorMag(int) ) );
+ connect( mag_vert, TQT_SIGNAL( activated(int) ), TQT_TQOBJECT(this), TQT_SLOT( setVerMag(int) ) );
+ connect( mag_hor, TQT_SIGNAL( activated(int) ), TQT_TQOBJECT(this), TQT_SLOT( setHorMag(int) ) );
mag_vert->setRange( 1, 9, 1, false );
mag_hor->setRange( 1, 9, 1, false );
@@ -155,12 +147,12 @@ void TextLineEditor::setupActions()
}
-QString TextLineEditor::text()
+TQString TextLineEditor::text()
{
return editor->text();
}
-void TextLineEditor::setText( const QString & t )
+void TextLineEditor::setText( const TQString & t )
{
editor->setText( t );
}
@@ -175,7 +167,7 @@ void TextLineEditor::updateActions()
void TextLineEditor::insertNewField()
{
TokenDialog dlg( m_token, this, "dlg" );
- if( dlg.exec() == QDialog::Accepted )
+ if( dlg.exec() == TQDialog::Accepted )
editor->insert( dlg.token() ) ;
}
diff --git a/kbarcode/textlineedit.h b/kbarcode/textlineedit.h
index 80b0eee..9dca741 100644
--- a/kbarcode/textlineedit.h
+++ b/kbarcode/textlineedit.h
@@ -13,7 +13,7 @@
#ifndef TECLINEEDITDLG_H
#define TECLINEEDITDLG_H
-#include <qwidget.h>
+#include <tqwidget.h>
#include <knuminput.h>
class KActionCollection;
@@ -26,22 +26,19 @@ class KSpellConfig;
class KComboBox;
class TokenProvider;
-#if QT_VERSION >= 0x030100
- class KLineEdit;
-#else
- class QLineEdit;
-#endif
+class KLineEdit;
-class TextLineEditor : public QWidget {
+class TextLineEditor : public TQWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- TextLineEditor( TokenProvider* token, QWidget *parent=0, const char *name=0);
+ TextLineEditor( TokenProvider* token, TQWidget *tqparent=0, const char *name=0);
~TextLineEditor();
- QString text();
+ TQString text();
KIntNumInput* mag_vert;
KIntNumInput* mag_hor;
- void setText( const QString & t );
+ void setText( const TQString & t );
void setFontType(int index);
int getFontType();
int getHorMag();
@@ -58,12 +55,8 @@ class TextLineEditor : public QWidget {
protected:
TokenProvider* m_token;
-#if QT_VERSION >= 0x030100
KLineEdit* editor;
-#else
- QLineEdit* editor;
-#endif
-
+
KActionCollection* ac;
KComboBox *action_font_type ;
diff --git a/kbarcode/textlineitem.cpp b/kbarcode/textlineitem.cpp
index 2dbfef9..c87bbf1 100644
--- a/kbarcode/textlineitem.cpp
+++ b/kbarcode/textlineitem.cpp
@@ -19,11 +19,11 @@
#include "labelutils.h"
#include "tokenprovider.h"
-#include <qapplication.h>
-#include <qdom.h>
-#include <qpaintdevicemetrics.h>
-#include <qpainter.h>
-#include <qsimplerichtext.h>
+#include <tqapplication.h>
+#include <tqdom.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqpainter.h>
+#include <tqsimplerichtext.h>
#include <kapplication.h>
@@ -35,7 +35,7 @@ TextLineItem::TextLineItem ()
void TextLineItem::init()
{
- m_text = QString::null;
+ m_text = TQString();
m_font = 0;
m_rotate = 0;
m_mag_vert = 1;
@@ -43,35 +43,35 @@ void TextLineItem::init()
setBorder( false );
- setRect( QRect( 0, 0, 100, 20 ) );
+ setRect( TQRect( 0, 0, 100, 20 ) );
}
/**
*
* @param painter
*/
-void TextLineItem::draw(QPainter* painter)
+void TextLineItem::draw(TQPainter* painter)
{
- QString text = tokenProvider() ? tokenProvider()->parse( m_text ) : m_text;
- QColorGroup cg;
- QSimpleRichText srt( text, painter->font() );
- QPaintDeviceMetrics metrics( DocumentItem::paintDevice() );
+ TQString text = tokenProvider() ? tokenProvider()->parse( m_text ) : m_text;
+ TQColorGroup cg;
+ TQSimpleRichText srt( text, painter->font() );
+ TQPaintDeviceMetrics metrics( DocumentItem::paintDevice() );
- double scalex = (double)metrics.logicalDpiX() / (double)QPaintDevice::x11AppDpiX();
- double scaley = (double)metrics.logicalDpiY() / (double)QPaintDevice::x11AppDpiY();
+ double scalex = (double)metrics.logicalDpiX() / (double)TQPaintDevice::x11AppDpiX();
+ double scaley = (double)metrics.logicalDpiY() / (double)TQPaintDevice::x11AppDpiY();
int width = (rect().width() > 0) ? (int)((double)rect().width() / scalex) : srt.widthUsed();
int height = (rect().height() > 0) ? (int)((double)rect().height() / scaley): srt.height();
- QRect r( (int)((double)rect().x() / scalex ), (int)((double)rect().y() / scaley), width, height );
+ TQRect r( (int)((double)rect().x() / scalex ), (int)((double)rect().y() / scaley), width, height );
srt.setWidth( painter, width );
painter->save();
- if( !TextLineItem::IsQtTextRenderingBroken() )
+ if( !TextLineItem::IsTQtTextRenderingBroken() )
{
painter->scale( scalex, scaley );
- painter->setPen( Qt::black );
+ painter->setPen( TQt::black );
srt.draw( painter, (int)((double)rect().x() / scalex ), (int)((double)rect().y() / scaley), r, cg );
}
else
@@ -84,35 +84,35 @@ void TextLineItem::draw(QPainter* painter)
DocumentItem::drawBorder( painter );
}
-void TextLineItem::drawZpl( QTextStream* stream )
+void TextLineItem::drawZpl( TQTextStream* stream )
{
// simply remove all html tags....
- QString data = m_text.replace( QRegExp("<[^>]*>"), "" );
+ TQString data = m_text.tqreplace( TQRegExp("<[^>]*>"), "" );
*stream << ZPLUtils::fieldOrigin( rect().x(), rect().y() );
- *stream << ZPLUtils::font( QFont() ); // todo: select a valid font
+ *stream << ZPLUtils::font( TQFont() ); // todo: select a valid font
}
-void TextLineItem::drawIpl( QTextStream* stream, IPLUtils* utils )
+void TextLineItem::drawIpl( TQTextStream* stream, IPLUtils* utils )
{
int counter = utils->counter();
// simply remove all html tags....
- QString data = m_text.replace( QRegExp("<[^>]*>"), "" );
+ TQString data = m_text.tqreplace( TQRegExp("<[^>]*>"), "" );
- QString s = QString("H%1;").arg( counter ); // field number
+ TQString s = TQString("H%1;").tqarg( counter ); // field number
s += utils->fieldOrigin( rect().x(), rect().y() );
- s += QString("c%1;").arg( 2 ); // font
- s += QString("h%1;").arg( 2 ); // vertical magnification ("height")
- s += QString("w%1;").arg( 2 ); // horicontyl magnification ("width")
- s += QString("d0,%1;").arg( data.length() ); // max length of data !
+ s += TQString("c%1;").tqarg( 2 ); // font
+ s += TQString("h%1;").tqarg( 2 ); // vertical magnification ("height")
+ s += TQString("w%1;").tqarg( 2 ); // horicontyl magnification ("width")
+ s += TQString("d0,%1;").tqarg( data.length() ); // max length of data !
*stream << utils->field( s );
utils->addValue( data );
}
-void TextLineItem::drawEPcl( QTextStream* stream )
+void TextLineItem::drawEPcl( TQTextStream* stream )
{
// TODO: parse text field HTML
@@ -120,27 +120,27 @@ void TextLineItem::drawEPcl( QTextStream* stream )
//
// break string into lines
- QString t = m_text.replace( QRegExp("<[^>]*>"), "" );
+ TQString t = m_text.tqreplace( TQRegExp("<[^>]*>"), "" );
// @DOM:
// TODO:
// provide an API which simplifies wordwrapping for
// barcode printers
- QStringList lines = QStringList::split( "\n", t );
+ TQStringList lines = TQStringList::split( "\n", t );
- QStringList::Iterator line = lines.begin();
+ TQStringList::Iterator line = lines.begin();
for( int i=0; line != lines.end(); ++line, ++i ){
- QString s = QString("T %1").arg( rect().x() + 1 );
- s += QString(" %1 0 0 0 50 1").arg( rect().y()+50+1 + i*52 );
- s += QString(" %1").arg( *line );
+ TQString s = TQString("T %1").tqarg( rect().x() + 1 );
+ s += TQString(" %1 0 0 0 50 1").tqarg( rect().y()+50+1 + i*52 );
+ s += TQString(" %1").tqarg( *line );
*stream << EPCLUtils::field( s );
}
}
-void TextLineItem::loadXML (QDomElement* element)
+void TextLineItem::loadXML (TQDomElement* element)
{
- QDomNode n = element->firstChild();
+ TQDomNode n = element->firstChild();
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if( !e.isNull() )
if( e.tagName() == "text" )
{
@@ -156,10 +156,10 @@ void TextLineItem::loadXML (QDomElement* element)
DocumentItem::loadXML( element);
}
-void TextLineItem::saveXML (QDomElement* element)
+void TextLineItem::saveXML (TQDomElement* element)
{
- QDomElement texttag = element->ownerDocument().createElement( "text" );
+ TQDomElement texttag = element->ownerDocument().createElement( "text" );
texttag.appendChild( element->ownerDocument().createTextNode( text() ) );
element->appendChild( texttag );
element->setAttribute( "font", m_font );
@@ -168,12 +168,12 @@ void TextLineItem::saveXML (QDomElement* element)
DocumentItem::saveXML( element);
}
-QString TextLineItem::text () const
+TQString TextLineItem::text () const
{
return m_text;
}
-void TextLineItem::setText (const QString & text)
+void TextLineItem::setText (const TQString & text)
{
m_text = text;
}
@@ -211,11 +211,11 @@ int TextLineItem::getMagHor () const
bool TextLineItem::s_qt_broken_init = false;
bool TextLineItem::s_qt_broken = false;
-bool TextLineItem::IsQtTextRenderingBroken()
+bool TextLineItem::IsTQtTextRenderingBroken()
{
if( !s_qt_broken_init )
{
- QString version( qVersion() );
+ TQString version( qVersion() );
int major = version.section( ".", 0, 0 ).toInt();
int minor = version.section( ".", 1, 1 ).toInt();
int bugfix = version.section( ".", 2, 2 ).toInt();
diff --git a/kbarcode/textlineitem.h b/kbarcode/textlineitem.h
index 9c74e3d..2b86486 100644
--- a/kbarcode/textlineitem.h
+++ b/kbarcode/textlineitem.h
@@ -17,36 +17,36 @@
#ifndef TEXTLINEITEM_H
#define TEXTLINEITEM_H
-#include <qstring.h>
+#include <tqstring.h>
#include "documentitem.h"
/**
* Class TextLineItem
- * plain text (drawn using either DSRichText or QSimpleRichText - once it is bug free) on screen or printer.
+ * plain text (drawn using either DSRichText or TQSimpleRichText - once it is bug free) on screen or printer.
*/
class TextLineItem : public DocumentItem {
public:
TextLineItem ();
- void draw (QPainter* painter);
- void drawZpl( QTextStream* stream );
- void drawIpl( QTextStream* stream, IPLUtils* utils );
- void drawEPcl( QTextStream* stream );
+ void draw (TQPainter* painter);
+ void drawZpl( TQTextStream* stream );
+ void drawIpl( TQTextStream* stream, IPLUtils* utils );
+ void drawEPcl( TQTextStream* stream );
int rtti () const { return eRtti_TextLine; }
- void loadXML (QDomElement* element);
- void saveXML (QDomElement* element);
+ void loadXML (TQDomElement* element);
+ void saveXML (TQDomElement* element);
- void setText (const QString & text);
+ void setText (const TQString & text);
void setFont (int index);
int getFont () const;
void setMagHor (int count);
int getMagHor () const;
int getMagVert () const;
void setMagVert (int count);
- QString text () const;
+ TQString text () const;
- static bool IsQtTextRenderingBroken();
+ static bool IsTQtTextRenderingBroken();
private:
void init();
@@ -54,7 +54,7 @@ private:
static bool s_qt_broken;
static bool s_qt_broken_init;
- QString m_text;
+ TQString m_text;
int m_font;
int m_rotate;
int m_mag_vert;
diff --git a/kbarcode/tokendialog.cpp b/kbarcode/tokendialog.cpp
index 7b4238a..e9e36eb 100644
--- a/kbarcode/tokendialog.cpp
+++ b/kbarcode/tokendialog.cpp
@@ -25,22 +25,22 @@
#include <klistview.h>
#include <klocale.h>
-#include <qhbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qsplitter.h>
-#include <qtooltip.h>
-#include <qvaluelist.h>
-#include <qvbox.h>
-#include <qvbuttongroup.h>
-#include <qwidgetstack.h>
-#include <qradiobutton.h>
+#include <tqhbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqsplitter.h>
+#include <tqtooltip.h>
+#include <tqvaluelist.h>
+#include <tqvbox.h>
+#include <tqvbuttongroup.h>
+#include <tqwidgetstack.h>
+#include <tqradiobutton.h>
#include <kcombobox.h>
-#include <qtextbrowser.h>
+#include <tqtextbrowser.h>
#include <kpushbutton.h>
-TokenDialog::TokenDialog(TokenProvider* token ,QWidget *parent, const char *name)
- : KWizard( parent, name ), m_token( token )
+TokenDialog::TokenDialog(TokenProvider* token ,TQWidget *tqparent, const char *name)
+ : KWizard( tqparent, name ), m_token( token )
{
m_custom_tokens = m_token->listUserVars();
@@ -62,10 +62,10 @@ TokenDialog::TokenDialog(TokenProvider* token ,QWidget *parent, const char *name
void TokenDialog::setupPage1()
{
- QVButtonGroup* page = new QVButtonGroup( i18n("What do you want to insert?") );
+ TQVButtonGroup* page = new TQVButtonGroup( i18n("What do you want to insert?") );
- radioFixed = new QRadioButton( i18n("Insert a &fixed data field"), page );
- radioCustom = new QRadioButton( i18n("Insert a &custom SQL query, variable or JavaScript function"), page );
+ radioFixed = new TQRadioButton( i18n("Insert a &fixed data field"), page );
+ radioCustom = new TQRadioButton( i18n("Insert a &custom SQL query, variable or JavaScript function"), page );
radioFixed->setChecked( true );
@@ -74,28 +74,28 @@ void TokenDialog::setupPage1()
void TokenDialog::setupPage2()
{
- page2 = new QWidgetStack();
+ page2 = new TQWidgetStack(0);
addPage( page2, i18n("Step 2 of 3") );
}
void TokenDialog::setupPage3()
{
- page3 = new QWidgetStack();
+ page3 = new TQWidgetStack(0);
addPage( page3, i18n("Step 3 of 3") );
}
void TokenDialog::setupStackPage1()
{
- stackPage1 = new QVBox();
+ stackPage1 = new TQVBox();
- QVButtonGroup* group = new QVButtonGroup( i18n("What do you want to insert?"), stackPage1 );
- radioAll = new QRadioButton( i18n("&Select from a list of all tokens"), group );
- radioLabel = new QRadioButton( i18n("Insert printing &informations"), group );
- radioSQL = new QRadioButton( i18n("&Insert a database field"), group );
- radioDate = new QRadioButton( i18n("Insert a &date/time function"), group );
- radioAddress = new QRadioButton( i18n("Insert an &addressbook field"), group );
+ TQVButtonGroup* group = new TQVButtonGroup( i18n("What do you want to insert?"), stackPage1 );
+ radioAll = new TQRadioButton( i18n("&Select from a list of all tokens"), group );
+ radioLabel = new TQRadioButton( i18n("Insert printing &informations"), group );
+ radioSQL = new TQRadioButton( i18n("&Insert a database field"), group );
+ radioDate = new TQRadioButton( i18n("Insert a &date/time function"), group );
+ radioAddress = new TQRadioButton( i18n("Insert an &addressbook field"), group );
radioAll->setChecked( true );
@@ -104,55 +104,55 @@ void TokenDialog::setupStackPage1()
void TokenDialog::setupStackPage2()
{
- stackPage2 = new QVBox();
+ stackPage2 = new TQVBox();
- QVButtonGroup* group = new QVButtonGroup( i18n("What do you want to insert?"), stackPage2 );
+ TQVButtonGroup* group = new TQVButtonGroup( i18n("What do you want to insert?"), stackPage2 );
- radioVariable = new QRadioButton( i18n("Insert a custom &variable"), group );
- radioSQLQuery = new QRadioButton( i18n("Insert a &SQL query"), group );
- radioJavaScript = new QRadioButton( i18n("Insert a &JavaScript function"), group );
+ radioVariable = new TQRadioButton( i18n("Insert a custom &variable"), group );
+ radioSTQLQuery = new TQRadioButton( i18n("Insert a &SQL query"), group );
+ radioJavaScript = new TQRadioButton( i18n("Insert a &JavaScript function"), group );
radioVariable->setChecked( true );
- connect( radioVariable, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioSQLQuery, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioJavaScript, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
+ connect( radioVariable, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioSTQLQuery, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioJavaScript, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
page2->addWidget( stackPage2 );
}
void TokenDialog::setupStack2Page1()
{
- stack2Page1 = new QWidget();
+ stack2Page1 = new TQWidget();
- QVBoxLayout* layout = new QVBoxLayout( stack2Page1 );
- QSplitter* splitter = new QSplitter( stack2Page1 );
- layout->addWidget( splitter );
+ TQVBoxLayout* tqlayout = new TQVBoxLayout( stack2Page1 );
+ TQSplitter* splitter = new TQSplitter( stack2Page1 );
+ tqlayout->addWidget( splitter );
- QVBox* left = new QVBox( splitter );
- QVBox* right = new QVBox( splitter );
+ TQVBox* left = new TQVBox( splitter );
+ TQVBox* right = new TQVBox( splitter );
- QLabel* label = new QLabel( i18n("&Category:"), left );
+ TQLabel* label = new TQLabel( i18n("&Category:"), left );
category = new KListBox( left );
label->setBuddy( category );
- label = new QLabel( i18n("&Token:"), right );
+ label = new TQLabel( i18n("&Token:"), right );
allList = new KListView( right );
allList->addColumn( i18n("Token"), 0 );
allList->addColumn( i18n("Description"), 1 );
- allList->setColumnWidthMode( 0, QListView::Maximum );
- allList->setColumnWidthMode( 1, QListView::Maximum );
+ allList->setColumnWidthMode( 0, TQListView::Maximum );
+ allList->setColumnWidthMode( 1, TQListView::Maximum );
label->setBuddy( allList );
- label = new QLabel( i18n("&Custom Expression to be inserted in the token."), right );
+ label = new TQLabel( i18n("&Custom Expression to be inserted in the token."), right );
lineEdit = new KLineEdit( right );
lineEdit->setEnabled( false );
label->setBuddy( lineEdit );
- QToolTip::add( lineEdit, i18n("<qt>Certain tokens, like for exaple the sqlquery token need arguments. "
+ TQToolTip::add( lineEdit, i18n("<qt>Certain tokens, like for exaple the sqlquery token need arguments. "
"In the case of the sqlquery token, the sure has to enter a sql query in "
"this text field.</qt>" ) );
- QValueList<int> sizes;
+ TQValueList<int> sizes;
int w = (width() / 4);
sizes << w << w * 3;
@@ -160,8 +160,8 @@ void TokenDialog::setupStack2Page1()
right->setStretchFactor( allList, 2 );
splitter->setSizes( sizes );
- connect( category, SIGNAL( executed( QListBoxItem* ) ), this, SLOT( categoryChanged( QListBoxItem* ) ) );
- connect( allList, SIGNAL( clicked( QListViewItem* ) ), this, SLOT( itemChanged( QListViewItem* ) ) );
+ connect( category, TQT_SIGNAL( executed( TQListBoxItem* ) ), this, TQT_SLOT( categoryChanged( TQListBoxItem* ) ) );
+ connect( allList, TQT_SIGNAL( clicked( TQListViewItem* ) ), this, TQT_SLOT( itemChanged( TQListViewItem* ) ) );
initAll();
@@ -170,28 +170,28 @@ void TokenDialog::setupStack2Page1()
void TokenDialog::setupStack2Page2()
{
- stack2Page2 = new QVBox();
+ stack2Page2 = new TQVBox();
labelList = new KListView( stack2Page2 );
labelList->addColumn( i18n("Token"), 0 );
labelList->addColumn( i18n("Description"), 1 );
- labelList->setColumnWidthMode( 0, QListView::Maximum );
- labelList->setColumnWidthMode( 1, QListView::Maximum );
+ labelList->setColumnWidthMode( 0, TQListView::Maximum );
+ labelList->setColumnWidthMode( 1, TQListView::Maximum );
- connect( labelList, SIGNAL( selectionChanged() ), this, SLOT( enableControls() ) );
- connect( labelList, SIGNAL( doubleClicked( QListViewItem *, const QPoint &, int ) ), this, SLOT( accept() ) );
+ connect( labelList, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( enableControls() ) );
+ connect( labelList, TQT_SIGNAL( doubleClicked( TQListViewItem *, const TQPoint &, int ) ), this, TQT_SLOT( accept() ) );
page3->addWidget( stack2Page2 );
}
void TokenDialog::setupStack2Page3()
{
- stack2Page3 = new QVButtonGroup();
+ stack2Page3 = new TQVButtonGroup();
- radioVariableNew = new QRadioButton( i18n("&Create a new custom variable"), stack2Page3 );
+ radioVariableNew = new TQRadioButton( i18n("&Create a new custom variable"), stack2Page3 );
editVariable = new KLineEdit( stack2Page3 );
- radioVariableExisting = new QRadioButton( i18n("&Insert an existing custom variable"), stack2Page3 );
+ radioVariableExisting = new TQRadioButton( i18n("&Insert an existing custom variable"), stack2Page3 );
listVariable = new KListBox( stack2Page3 );
radioVariableNew->setChecked( true );
@@ -202,50 +202,50 @@ void TokenDialog::setupStack2Page3()
if( !listVariable->count() )
radioVariableExisting->setEnabled( false );
- connect( radioVariableNew, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioVariableExisting, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( editVariable, SIGNAL( textChanged( const QString & ) ), this, SLOT( enableControls() ) );
- connect( listVariable, SIGNAL( highlighted( int ) ), this, SLOT( enableControls() ) );
- connect( listVariable, SIGNAL( doubleClicked( QListBoxItem*, const QPoint & ) ), this, SLOT( accept() ) );
+ connect( radioVariableNew, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioVariableExisting, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( editVariable, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( enableControls() ) );
+ connect( listVariable, TQT_SIGNAL( highlighted( int ) ), this, TQT_SLOT( enableControls() ) );
+ connect( listVariable, TQT_SIGNAL( doubleClicked( TQListBoxItem*, const TQPoint & ) ), this, TQT_SLOT( accept() ) );
page3->addWidget( stack2Page3 );
}
void TokenDialog::setupStack2Page4()
{
- stack2Page4 = new QVBox();
+ stack2Page4 = new TQVBox();
if( !SqlTables::isConnected() )
- new QLabel( i18n("<qt><b>No SQL connection found!</b><br>You can build a query, "
+ new TQLabel( i18n("<qt><b>No SQL connection found!</b><br>You can build a query, "
"but you will not be able to execute or test it right now.<br></qt>"), stack2Page4 );
- QHBox* hbox = new QHBox( stack2Page4 );
+ TQHBox* hbox = new TQHBox( stack2Page4 );
- QLabel* label = new QLabel( i18n("&SQL Query:"), hbox );
+ TQLabel* label = new TQLabel( i18n("&SQL Query:"), hbox );
editQuery = new KLineEdit( hbox );
buttonQuery = new KPushButton( i18n("&Test"), hbox );
label->setBuddy( editQuery );
hbox->setStretchFactor( editQuery, 2 );
- new QLabel( i18n("Query test results:"), stack2Page4 );
- textQueryResults = new QTextBrowser( stack2Page4 );
+ new TQLabel( i18n("Query test results:"), stack2Page4 );
+ textQueryResults = new TQTextBrowser( stack2Page4 );
textQueryResults->setReadOnly( true );
- connect( buttonQuery, SIGNAL( clicked() ), this, SLOT( testQuery() ) );
- connect( editQuery, SIGNAL( textChanged( const QString & ) ), this, SLOT( enableControls() ) );
+ connect( buttonQuery, TQT_SIGNAL( clicked() ), this, TQT_SLOT( testQuery() ) );
+ connect( editQuery, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( enableControls() ) );
page3->addWidget( stack2Page4 );
}
void TokenDialog::setupStack2Page5()
{
- stack2Page5 = new QVBox();
+ stack2Page5 = new TQVBox();
editJavaScript = new DSTextEdit( stack2Page5 );
editJavaScript->setText( i18n("/* Place your JavaScript code into this text field. */\n") );
- connect( editJavaScript, SIGNAL( textChanged() ), SLOT( enableControls() ) );
+ connect( editJavaScript, TQT_SIGNAL( textChanged() ), TQT_SLOT( enableControls() ) );
page3->addWidget( stack2Page5 );
}
@@ -265,24 +265,24 @@ void TokenDialog::accept()
else if( radioVariableExisting->isChecked() )
m_result = listVariable->currentText();
}
- else if( radioSQLQuery->isChecked() )
- m_result = QString( "sqlquery:%2").arg( editQuery->text() );
+ else if( radioSTQLQuery->isChecked() )
+ m_result = TQString( "sqlquery:%2").tqarg( editQuery->text() );
else if( radioJavaScript->isChecked() )
- m_result = QString( "js:%2").arg( editJavaScript->text() );
+ m_result = TQString( "js:%2").tqarg( editJavaScript->text() );
m_result = "[" + m_result + "]";
}
else
{
- QListViewItem* item = ( radioAll->isChecked() ? allList->selectedItem() : labelList->selectedItem() );
+ TQListViewItem* item = ( radioAll->isChecked() ? allList->selectedItem() : labelList->selectedItem() );
if( item )
{
for( unsigned int i = 0; i < m_tokens.count(); i++ )
- if( QString( "[%1]").arg( m_tokens[i].token ) == item->text( 0 ) )
+ if( TQString( "[%1]").tqarg( m_tokens[i].token ) == item->text( 0 ) )
{
if( m_tokens[i].appendix )
- m_result = QString( "[%1%2]").arg( m_tokens[i].token ).arg( lineEdit->text() );
+ m_result = TQString( "[%1%2]").tqarg( m_tokens[i].token ).tqarg( lineEdit->text() );
else
m_result = item->text( 0 );
break;
@@ -293,7 +293,7 @@ void TokenDialog::accept()
KWizard::accept();
}
-void TokenDialog::showPage( QWidget* w )
+void TokenDialog::showPage( TQWidget* w )
{
if( w == page3 )
{
@@ -301,7 +301,7 @@ void TokenDialog::showPage( QWidget* w )
{
if( radioVariable->isChecked() )
page3->raiseWidget( stack2Page3 );
- else if( radioSQLQuery->isChecked() )
+ else if( radioSTQLQuery->isChecked() )
page3->raiseWidget( stack2Page4 );
else if( radioJavaScript->isChecked() )
{
@@ -334,7 +334,7 @@ void TokenDialog::showPage( QWidget* w )
void TokenDialog::initAll()
{
unsigned int i, z;
- QValueList<tCategories>* categories = TokenProvider::getTokens();
+ TQValueList<tCategories>* categories = TokenProvider::getTokens();
category->insertItem( i18n("All") );
@@ -347,7 +347,7 @@ void TokenDialog::initAll()
if( m_token )
{
- QStringList custom_tokens = m_token->listUserVars();
+ TQStringList custom_tokens = m_token->listUserVars();
for( i = 0; i < custom_tokens.count(); i++ )
m_tokens.append( tToken( custom_tokens[i], i18n("Variable defined by the user for this label.") ) );
}
@@ -372,13 +372,13 @@ void TokenDialog::initStackPage2()
else
return;
- QValueList<tCategories>* categories = TokenProvider::getTokens();
+ TQValueList<tCategories>* categories = TokenProvider::getTokens();
for( int i = 0; i < (int)categories->count(); i++ )
{
if( (*categories)[i].category == cat )
{
for( unsigned int z = 0; z < (*categories)[i].tokens.count(); z++ )
- labelList->insertItem( new KListViewItem( labelList, QString( "[%1]").arg( (*categories)[i].tokens[z].token ),
+ labelList->insertItem( new KListViewItem( labelList, TQString( "[%1]").tqarg( (*categories)[i].tokens[z].token ),
(*categories)[i].tokens[z].description ) );
break;
@@ -386,17 +386,17 @@ void TokenDialog::initStackPage2()
}
}
-void TokenDialog::categoryChanged( QListBoxItem* item )
+void TokenDialog::categoryChanged( TQListBoxItem* item )
{
unsigned int i;
- QValueList<tCategories>* categories = TokenProvider::getTokens();
+ TQValueList<tCategories>* categories = TokenProvider::getTokens();
allList->clear();
lineEdit->setEnabled( false );
if( item->prev() == 0 )
{
for( i = 0; i < m_tokens.count(); i++ )
- allList->insertItem( new KListViewItem( allList, QString( "[%1]").arg( m_tokens[i].token ),
+ allList->insertItem( new KListViewItem( allList, TQString( "[%1]").tqarg( m_tokens[i].token ),
m_tokens[i].description ) );
}
else
@@ -406,7 +406,7 @@ void TokenDialog::categoryChanged( QListBoxItem* item )
if( TokenProvider::captionForCategory( (TokenProvider::ECategories)(*categories)[i].category ) == item->text() )
{
for( unsigned int z = 0; z < (*categories)[i].tokens.count(); z++ )
- allList->insertItem( new KListViewItem( allList, QString( "[%1]").arg( (*categories)[i].tokens[z].token ),
+ allList->insertItem( new KListViewItem( allList, TQString( "[%1]").tqarg( (*categories)[i].tokens[z].token ),
(*categories)[i].tokens[z].description ) );
break;
@@ -416,16 +416,16 @@ void TokenDialog::categoryChanged( QListBoxItem* item )
// TODO: comparing by a user visible string cries for bugs!!!
if( item->text() == i18n("Custom Values") )
for( i=0;i<m_custom_tokens.count();i++ )
- allList->insertItem( new KListViewItem( allList, QString( "[%1]").arg( m_custom_tokens[i] ),
+ allList->insertItem( new KListViewItem( allList, TQString( "[%1]").tqarg( m_custom_tokens[i] ),
i18n("Variable defined by the user for this label.") ) );
}
}
-void TokenDialog::itemChanged( QListViewItem* item )
+void TokenDialog::itemChanged( TQListViewItem* item )
{
for( unsigned int i = 0; i < m_tokens.count(); i++ )
{
- if( QString( "[%1]").arg( m_tokens[i].token ) == item->text( 0 ) )
+ if( TQString( "[%1]").tqarg( m_tokens[i].token ) == item->text( 0 ) )
{
lineEdit->setEnabled( m_tokens[i].appendix );
if( m_tokens[i].appendix )
@@ -448,8 +448,8 @@ void TokenDialog::enableControls()
listVariable->isEnabled() && listVariable->currentItem() != -1 )
setFinishEnabled( page3, true );
- buttonQuery->setEnabled( radioSQLQuery->isChecked() && !editQuery->text().isEmpty() && SqlTables::isConnected() );
- if( radioSQLQuery->isChecked() && !editQuery->text().isEmpty() )
+ buttonQuery->setEnabled( radioSTQLQuery->isChecked() && !editQuery->text().isEmpty() && SqlTables::isConnected() );
+ if( radioSTQLQuery->isChecked() && !editQuery->text().isEmpty() )
setFinishEnabled( page3, true );
if( radioJavaScript->isChecked() && !editJavaScript->text().isEmpty() )
@@ -467,7 +467,7 @@ void TokenDialog::enableControls()
void TokenDialog::testQuery()
{
- QString ret = "[sqlquery:" + editQuery->text() + "]";
+ TQString ret = "[sqlquery:" + editQuery->text() + "]";
if( m_token )
ret = m_token->parse( ret );
textQueryResults->setText( ret );
diff --git a/kbarcode/tokendialog.h b/kbarcode/tokendialog.h
index 5907008..e86d5cc 100644
--- a/kbarcode/tokendialog.h
+++ b/kbarcode/tokendialog.h
@@ -24,31 +24,32 @@
class KListBox;
class KListView;
-class QListBoxItem;
-class QListViewItem;
+class TQListBoxItem;
+class TQListViewItem;
class KLineEdit;
class TokenProvider;
-class QRadioButton;
-class QWidgetStack;
-class QHBox;
+class TQRadioButton;
+class TQWidgetStack;
+class TQHBox;
class KComboBox;
-class QTextBrowser;
+class TQTextBrowser;
class KPushButton;
class DSTextEdit;
class TokenDialog : public KWizard {
Q_OBJECT
+ TQ_OBJECT
public:
- TokenDialog( TokenProvider* token, QWidget *parent = 0, const char *name = 0 );
+ TokenDialog( TokenProvider* token, TQWidget *tqparent = 0, const char *name = 0 );
- inline const QString & token() const { return m_result; }
+ inline const TQString & token() const { return m_result; }
private slots:
- void categoryChanged( QListBoxItem* item );
- void itemChanged( QListViewItem* item );
+ void categoryChanged( TQListBoxItem* item );
+ void itemChanged( TQListViewItem* item );
private:
void initAll();
@@ -73,50 +74,50 @@ class TokenDialog : public KWizard {
protected:
void accept();
- void showPage( QWidget* w );
+ void showPage( TQWidget* w );
private:
- QStringList m_custom_tokens;
-
- QRadioButton* radioAll;
- QRadioButton* radioLabel;
- QRadioButton* radioSQL;
- QRadioButton* radioDate;
- QRadioButton* radioFixed;
- QRadioButton* radioCustom;
- QRadioButton* radioAddress;
-
- QRadioButton* radioSQLQuery;
- QRadioButton* radioVariable;
- QRadioButton* radioJavaScript;
-
- QRadioButton* radioVariableNew;
- QRadioButton* radioVariableExisting;
+ TQStringList m_custom_tokens;
+
+ TQRadioButton* radioAll;
+ TQRadioButton* radioLabel;
+ TQRadioButton* radioSQL;
+ TQRadioButton* radioDate;
+ TQRadioButton* radioFixed;
+ TQRadioButton* radioCustom;
+ TQRadioButton* radioAddress;
+
+ TQRadioButton* radioSTQLQuery;
+ TQRadioButton* radioVariable;
+ TQRadioButton* radioJavaScript;
+
+ TQRadioButton* radioVariableNew;
+ TQRadioButton* radioVariableExisting;
KLineEdit* editVariable;
KListBox* listVariable;
KLineEdit* editQuery;
- QTextBrowser* textQueryResults;
+ TQTextBrowser* textQueryResults;
KPushButton* buttonQuery;
DSTextEdit* editJavaScript;
- QString m_result;
+ TQString m_result;
- QWidgetStack* page2;
- QWidgetStack* page3;
+ TQWidgetStack* page2;
+ TQWidgetStack* page3;
- QWidget* stackPage1;
- QWidget* stackPage2;
+ TQWidget* stackPage1;
+ TQWidget* stackPage2;
- QWidget* stack2Page1;
- QWidget* stack2Page2;
- QWidget* stack2Page3;
- QWidget* stack2Page4;
- QWidget* stack2Page5;
+ TQWidget* stack2Page1;
+ TQWidget* stack2Page2;
+ TQWidget* stack2Page3;
+ TQWidget* stack2Page4;
+ TQWidget* stack2Page5;
- QValueList<tToken> m_tokens;
+ TQValueList<tToken> m_tokens;
TokenProvider* m_token;
KListBox* category;
diff --git a/kbarcode/tokenprovider.cpp b/kbarcode/tokenprovider.cpp
index 98ebfee..f782503 100644
--- a/kbarcode/tokenprovider.cpp
+++ b/kbarcode/tokenprovider.cpp
@@ -23,12 +23,12 @@
#include "textitem.h"
#include "textlineitem.h"
-// Qt includes
-#include <qdatetime.h>
-#include <qpaintdevicemetrics.h>
-#include <qsqlquery.h>
-#include <qregexp.h>
-#include <qvaluelist.h>
+// TQt includes
+#include <tqdatetime.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqsqlquery.h>
+#include <tqregexp.h>
+#include <tqvaluelist.h>
#include <time.h>
#include <klocale.h>
@@ -145,7 +145,7 @@ const char* TOK_ADDRESS_ROLE = "address_role";
const char* TOK_ADDRESS_NOTE = "address_note";
const char* TOK_ADDRESS_ORGANIZATION = "address_organization";
-TokenProvider::TokenProvider( QPaintDevice* paintdevice )
+TokenProvider::TokenProvider( TQPaintDevice* paintdevice )
: m_printer( paintdevice )
{
m_index = 0;
@@ -160,7 +160,7 @@ TokenProvider::TokenProvider( QPaintDevice* paintdevice )
row = col = 0;
- article_no = barcode_no = customer_no = encoding_type_name = group = label_name = QString::null;
+ article_no = barcode_no = customer_no = encoding_type_name = group = label_name = TQString();
date_reg_exp.setPattern("date:(%[a-zA-Z])");
@@ -177,8 +177,8 @@ TokenProvider::~TokenProvider()
{
}
-QValueList<tCategories> TokenProvider::s_categories;
-QMap<TokenProvider::ECategories,QString> TokenProvider::s_captions;
+TQValueList<tCategories> TokenProvider::s_categories;
+TQMap<TokenProvider::ECategories,TQString> TokenProvider::s_captions;
#ifdef NO_KJS_EMBED
KJS::Interpreter* TokenProvider::s_interpreter = NULL;
#else
@@ -194,7 +194,7 @@ bool TokenProvider::hasJavaScript()
#endif // USE_JAVASCRIPT
}
-QValueList<tCategories>* TokenProvider::getTokens()
+TQValueList<tCategories>* TokenProvider::getTokens()
{
TokenProvider::init();
return &s_categories;
@@ -211,20 +211,20 @@ void TokenProvider::init()
s_captions[CAT_ADDRESS] = i18n("Addressbook");
tCategories category;
- category.tokens.append( tToken( TOK_ARTICLE_NO_CUSTOMER, QString::null ) );
- category.tokens.append( tToken( TOK_BARCODE_NO_CUSTOMER, QString::null ) );
+ category.tokens.append( tToken( TOK_ARTICLE_NO_CUSTOMER, TQString() ) );
+ category.tokens.append( tToken( TOK_BARCODE_NO_CUSTOMER, TQString() ) );
category.tokens.append( tToken( TOK_ARTICLE_DESC, i18n("Article description from barcode_basic") ) );
category.tokens.append( tToken( TOK_ARTICLE_NO, i18n("Article number from barcode_basic") ) );
for( int i = 0; i < NUM_FIELDS; i++ )
- category.tokens.append( tToken( QString( TOK_LINE ).arg( i ),
- QString( TOK_LINE ).arg( i ) + " from customer_text" ) );
+ category.tokens.append( tToken( TQString( TOK_LINE ).tqarg( i ),
+ TQString( TOK_LINE ).tqarg( i ) + " from customer_text" ) );
for( int i = 0; i < NUM_FIELDS; i++ )
- category.tokens.append( tToken( QString( TOK_FIELD ).arg( i ),
- QString( TOK_FIELD ).arg( i ) + " from barcode_basic" ) );
+ category.tokens.append( tToken( TQString( TOK_FIELD ).tqarg( i ),
+ TQString( TOK_FIELD ).tqarg( i ) + " from barcode_basic" ) );
category.tokens.append( tToken( TOK_CUSTOMER_NO, i18n("customer number of the current customer") ) );
category.tokens.append( tToken( TOK_CUSTOEMR_NAME, i18n("name of the current customer") ) );
category.tokens.append( tToken( TOK_BARCODE_NO, i18n("Barcode number from barcode_basic") ) );
- category.tokens.append( tToken( TOK_BARCODE_NO_BASIC, QString::null ) );
+ category.tokens.append( tToken( TOK_BARCODE_NO_BASIC, TQString() ) );
category.tokens.append( tToken( TOK_GROUP, i18n("group of the current article") ) );
category.tokens.append( tToken( TOK_ENCODING_TYPE, i18n("Barcode encoding type from barcode_basic") ) );
category.tokens.append( tToken( TOK_ENCODING_TYPE_NAME, i18n("User readable barcode encoding type from barcode_basic") ) );
@@ -333,7 +333,7 @@ void TokenProvider::init()
}
-void TokenProvider::findBrackets( QString & text, QString (TokenProvider::*parserfunction)( const QString & ) )
+void TokenProvider::findBrackets( TQString & text, TQString (TokenProvider::*parserfunction)( const TQString & ) )
{
/*
* looks for a statement in brackets [ ]
@@ -341,17 +341,17 @@ void TokenProvider::findBrackets( QString & text, QString (TokenProvider::*parse
*/
int num, pos = -1, a;
- QString token;
+ TQString token;
- if( text.contains("]", FALSE) <= 0 || text.isEmpty() )
+ if( text.tqcontains("]", FALSE) <= 0 || text.isEmpty() )
return;
- num = text.contains("[", FALSE);
+ num = text.tqcontains("[", FALSE);
if(num <= 0 )
return;
- pos = text.findRev("[", pos);
- a = text.find("]", pos );
+ pos = text.tqfindRev("[", pos);
+ a = text.tqfind("]", pos );
if( a < 0 && pos >= 0 )
return;
@@ -385,26 +385,26 @@ void TokenProvider::findBrackets( QString & text, QString (TokenProvider::*parse
findBrackets( text, parserfunction );
}
-QString TokenProvider::parse( const QString & text )
+TQString TokenProvider::parse( const TQString & text )
{
- QString t = QString( text );
+ TQString t = TQString( text );
findBrackets( t, &TokenProvider::process );
return t;
}
-QStringList TokenProvider::listUserVars()
+TQStringList TokenProvider::listUserVars()
{
unsigned int i;
DocumentItem* item;
- QStringList lst;
- QString t;
+ TQStringList lst;
+ TQString t;
m_findUserVarsList = &lst;
for( i=0;i<m_document_items.count();i++ )
{
item = m_document_items.at(i);
- t = QString::null;
+ t = TQString();
if( item->rtti() == eRtti_Barcode )
t = ((BarcodeItem*)item)->value();
else if( item->rtti() == eRtti_Text )
@@ -422,9 +422,9 @@ QStringList TokenProvider::listUserVars()
return lst;
}
-QString TokenProvider::processUserVars( const QString & t )
+TQString TokenProvider::processUserVars( const TQString & t )
{
- QStringList::Iterator it;
+ TQStringList::Iterator it;
bool found = false;
if( m_findUserVarsList )
@@ -447,10 +447,10 @@ QString TokenProvider::processUserVars( const QString & t )
return t;
}
-QString TokenProvider::process( const QString & t )
+TQString TokenProvider::process( const TQString & t )
{
- QString ret = QString::null;
- QString addr;
+ TQString ret = TQString();
+ TQString addr;
int i;
// process all token that require an sql connection
@@ -460,7 +460,7 @@ QString TokenProvider::process( const QString & t )
{
for( i = 0; i < NUM_FIELDS; i++ )
{
- const QString c = QString( TOK_LINE ).arg( i );
+ const TQString c = TQString( TOK_LINE ).tqarg( i );
if( t == c )
ret = query( "SELECT " + c + " FROM " + TABLE_CUSTOMER_TEXT + " WHERE article_no='" + article_no +
"' AND customer_no='" + customer_no + "'");
@@ -468,34 +468,34 @@ QString TokenProvider::process( const QString & t )
for( i = 0; i < NUM_FIELDS; i++ )
{
- const QString c = QString( TOK_FIELD ).arg( i );
+ const TQString c = TQString( TOK_FIELD ).tqarg( i );
if( t == c )
ret = query("SELECT " + c + " FROM " + TABLE_BASIC + " WHERE article_no='" + article_no + "'");
}
if( t == TOK_ARTICLE_NO_CUSTOMER )
- ret = query( QString("SELECT article_no_customer FROM ") + TABLE_CUSTOMER_TEXT + " WHERE article_no='" +
+ ret = query( TQString("SELECT article_no_customer FROM ") + TABLE_CUSTOMER_TEXT + " WHERE article_no='" +
article_no + "' AND customer_no='" + customer_no + "'");
if( t == TOK_BARCODE_NO_CUSTOMER )
- ret = query( QString("SELECT barcode_no FROM ") + TABLE_CUSTOMER_TEXT + " WHERE article_no='" +
+ ret = query( TQString("SELECT barcode_no FROM ") + TABLE_CUSTOMER_TEXT + " WHERE article_no='" +
article_no + "' AND customer_no='" + customer_no + "'");
if( t == TOK_ARTICLE_DESC )
- ret = query( QString("SELECT article_desc FROM ") + TABLE_BASIC + " WHERE article_no='" + article_no + "'");
+ ret = query( TQString("SELECT article_desc FROM ") + TABLE_BASIC + " WHERE article_no='" + article_no + "'");
if( t == TOK_BARCODE_NO )
- ret = query( QString("SELECT barcode_no FROM ") + TABLE_BASIC + " WHERE article_no='" + article_no + "'");
+ ret = query( TQString("SELECT barcode_no FROM ") + TABLE_BASIC + " WHERE article_no='" + article_no + "'");
if( t == TOK_ARTICLE_NO )
ret = article_no;
}
if( !customer_no.isEmpty() && t == TOK_CUSTOEMR_NAME )
- ret = query( QString("SELECT customer_name FROM ") + TABLE_CUSTOMER + " WHERE customer_no='" + customer_no + "'");
+ ret = query( TQString("SELECT customer_name FROM ") + TABLE_CUSTOMER + " WHERE customer_no='" + customer_no + "'");
- const QString sqlq = TOK_SQL;
+ const TQString sqlq = TOK_SQL;
if( t.startsWith( sqlq ) )
ret = query( t.right( t.length() - sqlq.length() ) );
}
@@ -516,7 +516,7 @@ QString TokenProvider::process( const QString & t )
ret = label_name;
if( t == TOK_DATE )
- ret = QDateTime::currentDateTime().toString( KBarcodeSettings::getDateFormat() );
+ ret = TQDateTime::tqcurrentDateTime().toString( KBarcodeSettings::getDateFormat() );
if( date_reg_exp.search(t,0) != -1 )
{
@@ -527,38 +527,38 @@ QString TokenProvider::process( const QString & t )
label_time = time(&label_time) ;
localtime_r(&label_time,&label_time_struct) ;
- strftime(temp_time_str,sizeof temp_time_str - 1, date_reg_exp.cap(1).ascii(),&label_time_struct);
+ strftime(temp_time_str,sizeof temp_time_str - 1, TQString(date_reg_exp.cap(1)).ascii(),&label_time_struct);
ret = temp_time_str;
}
if( t == TOK_INDEX )
{
m_contains_update = true;
- ret = QString::number( m_index + 1 );
+ ret = TQString::number( m_index + 1 );
}
if( t == TOK_ROW )
{
m_contains_update = true;
- ret = QString::number( row + 1 );
+ ret = TQString::number( row + 1 );
}
if( t == TOK_COL )
{
m_contains_update = true;
- ret = QString::number( col + 1 );
+ ret = TQString::number( col + 1 );
}
if( t == TOK_PAGE )
{
m_contains_update = true;
- ret = QString::number( m_page + 1 );
+ ret = TQString::number( m_page + 1 );
}
if( m_printer && t == TOK_RESOLUTION )
{
- QPaintDeviceMetrics metrics( m_printer );
- ret = QString( "%1dpi" ).arg( metrics.logicalDpiY() );
+ TQPaintDeviceMetrics metrics( m_printer );
+ ret = TQString( "%1dpi" ).tqarg( metrics.logicalDpiY() );
}
if( !m_serial.isEmpty() && t == TOK_SERIAL )
@@ -573,15 +573,15 @@ QString TokenProvider::process( const QString & t )
ret = addr;
// let's parse java script code
- const QString js = TOK_JS;
+ const TQString js = TOK_JS;
if( t.startsWith( js ) )
ret = jsParse( t.right( t.length() - js.length() ) );
// everything starting with a $ is a user defined variable
if( !m_uservardata.isEmpty() )
{
- QString tok = t.right( t.length() - 1 );
- if( m_uservardata.contains( tok ) )
+ TQString tok = t.right( t.length() - 1 );
+ if( m_uservardata.tqcontains( tok ) )
{
ret = m_uservardata[tok];
if( ret.isNull() )
@@ -592,9 +592,9 @@ QString TokenProvider::process( const QString & t )
return ret;
}
-QString TokenProvider::processAddresses( const QString & t )
+TQString TokenProvider::processAddresses( const TQString & t )
{
- QString ret = QString::null;
+ TQString ret = TQString();
bool found = false;
if( !m_address || !t.startsWith( "address" ) )
@@ -811,23 +811,23 @@ QString TokenProvider::processAddresses( const QString & t )
return ret;
}
-QString TokenProvider::query( const QString & query )
+TQString TokenProvider::query( const TQString & query )
{
if( !query.isEmpty() )
{
- QSqlQuery q( query );
+ TQSqlQuery q( query );
while( q.next() )
return q.value( 0 ).toString();
- return QString::null;
+ return TQString();
}
else
return i18n("ERROR: Empty SQL Query");
}
-QString TokenProvider::jsParse( const QString & script )
+TQString TokenProvider::jsParse( const TQString & script )
{
- QString ret = QString::null;
+ TQString ret = TQString();
ret = "ERROR: No JavaScript interpreter present!";
@@ -871,7 +871,7 @@ QString TokenProvider::jsParse( const QString & script )
return ret;
}
-bool TokenProvider::jsParseToBool( const QString & script )
+bool TokenProvider::jsParseToBool( const TQString & script )
{
#ifdef USE_JAVASCRIPT
// Maybe we need no Completion object for KJSEmbed
@@ -886,24 +886,24 @@ bool TokenProvider::jsParseToBool( const QString & script )
return false;
}
-const QString TokenProvider::createSerial()
+const TQString TokenProvider::createSerial()
{
unsigned long tmp;
- QString s = QString::null;
+ TQString s = TQString();
// Split string into prenum, number and postnum parts
- QRegExp splitit("(\\D*)(\\d+)(.*)");
+ TQRegExp splitit("(\\D*)(\\d+)(.*)");
int pos = splitit.search(m_serial);
// Is there anything to increment ?
if (pos > -1) {
- QString prenum = splitit.cap(1);
+ TQString prenum = splitit.cap(1);
tmp = splitit.cap(2).toULong();
- QString postnum = splitit.cap(3);
+ TQString postnum = splitit.cap(3);
tmp += (m_increment*m_index);
- QString tmpstr;
+ TQString tmpstr;
tmpstr.setNum(splitit.cap(2).length());
- QString formatstring = "%0" + tmpstr + "lu";
+ TQString formatstring = "%0" + tmpstr + "lu";
s = prenum + tmpstr.sprintf(formatstring, tmp) + postnum;
m_update = true;
@@ -912,25 +912,25 @@ const QString TokenProvider::createSerial()
return s;
}
-QString TokenProvider::unescapeText( const QString & t )
+TQString TokenProvider::unescapeText( const TQString & t )
{
- QString tmp = t;
- tmp = tmp.replace( DSREPLACE( "&lt;" ), "<" );
- tmp = tmp.replace( DSREPLACE( "&gt;" ), ">" );
- tmp = tmp.replace( DSREPLACE( "&amp;" ), "&" );
- tmp = tmp.replace( DSREPLACE( "&quot;" ), "\"" );
+ TQString tmp = t;
+ tmp = tmp.tqreplace( DSREPLACE( "&lt;" ), "<" );
+ tmp = tmp.tqreplace( DSREPLACE( "&gt;" ), ">" );
+ tmp = tmp.tqreplace( DSREPLACE( "&amp;" ), "&" );
+ tmp = tmp.tqreplace( DSREPLACE( "&quot;" ), "\"" );
return tmp;
}
-QString TokenProvider::escapeText( const QString & t )
+TQString TokenProvider::escapeText( const TQString & t )
{
- QString tmp = t;
- tmp = tmp.replace( DSREPLACE( "<" ), "&lt;" );
- tmp = tmp.replace( DSREPLACE( ">" ), "&gt;" );
- tmp = tmp.replace( DSREPLACE( "&" ), "&amp;" );
- tmp = tmp.replace( DSREPLACE( "\"" ), "&quot;" );
- tmp = tmp.replace( DSREPLACE( "\n" ), "<br />" );
+ TQString tmp = t;
+ tmp = tmp.tqreplace( DSREPLACE( "<" ), "&lt;" );
+ tmp = tmp.tqreplace( DSREPLACE( ">" ), "&gt;" );
+ tmp = tmp.tqreplace( DSREPLACE( "&" ), "&amp;" );
+ tmp = tmp.tqreplace( DSREPLACE( "\"" ), "&quot;" );
+ tmp = tmp.tqreplace( DSREPLACE( "\n" ), "<br />" );
return tmp;
}
diff --git a/kbarcode/tokenprovider.h b/kbarcode/tokenprovider.h
index ac7e57f..566fbb3 100644
--- a/kbarcode/tokenprovider.h
+++ b/kbarcode/tokenprovider.h
@@ -23,8 +23,8 @@
// use KJS instead of
#define NO_KJS_EMBED
-#include <qstring.h>
-#include <qregexp.h>
+#include <tqstring.h>
+#include <tqregexp.h>
#include <time.h>
#include "documentitem.h"
@@ -37,7 +37,7 @@ class tToken {
public:
tToken() {};
- tToken( const QString & t, const QString & d, bool a = false )
+ tToken( const TQString & t, const TQString & d, bool a = false )
{
token = t;
description = d;
@@ -51,14 +51,14 @@ class tToken {
appendix = rhs.appendix;
}
- QString token;
- QString description;
+ TQString token;
+ TQString description;
bool appendix;
};
struct tCategories {
int category;
- QValueList<tToken> tokens;
+ TQValueList<tToken> tokens;
};
@@ -72,7 +72,7 @@ namespace KJS {
}
#endif // NO_KJS_EMBED
-class QPaintDevice;
+class TQPaintDevice;
/** This class handles the replacement of tokens like [date] or [article_no].
*
@@ -82,12 +82,12 @@ class TokenProvider {
public:
enum ECategories { CAT_DATABASE, CAT_LABEL, CAT_CUSTOM, CAT_DATE, CAT_ADDRESS };
- TokenProvider( QPaintDevice* paintdevice );
+ TokenProvider( TQPaintDevice* paintdevice );
virtual ~TokenProvider();
static bool hasJavaScript();
- static QValueList<tCategories>* getTokens();
+ static TQValueList<tCategories>* getTokens();
/**
* Get a caption which can be displayed to the user from
@@ -97,7 +97,7 @@ class TokenProvider {
*
* @returns a translated caption which can be displayed to the user
*/
- static const QString captionForCategory( ECategories e ) {
+ static const TQString captionForCategory( ECategories e ) {
return s_captions[e];
}
@@ -108,25 +108,25 @@ class TokenProvider {
inline void setIndex( unsigned int index ) { m_index = index; m_update = true; }
inline void setPage( unsigned int page ) { m_page = page; m_update = true; }
- inline void setArticleNo( const QString & t ) { article_no = t; m_update = true; }
- inline void setBarcodeNo( const QString & t ) { barcode_no = t; m_update = true; }
- inline void setCustomerNo( const QString & t ) { customer_no = t; m_update = true; }
- inline void setEncodingTypeName( const QString & t ) { encoding_type_name = t; m_update = true; }
- inline void setGroup( const QString & t ) { group = t; m_update = true; }
- inline void setLabelName( const QString & t ) { label_name = t; m_update = true; }
+ inline void setArticleNo( const TQString & t ) { article_no = t; m_update = true; }
+ inline void setBarcodeNo( const TQString & t ) { barcode_no = t; m_update = true; }
+ inline void setCustomerNo( const TQString & t ) { customer_no = t; m_update = true; }
+ inline void setEncodingTypeName( const TQString & t ) { encoding_type_name = t; m_update = true; }
+ inline void setGroup( const TQString & t ) { group = t; m_update = true; }
+ inline void setLabelName( const TQString & t ) { label_name = t; m_update = true; }
inline void setCol( unsigned int c ) { col = c; m_update = true; }
inline void setRow( unsigned int r ) { row = r; m_update = true; }
- inline void setSerial( const QString &t, unsigned int inc ) { m_serial = t; m_increment = inc; m_update = true; m_contains_update = true;}
+ inline void setSerial( const TQString &t, unsigned int inc ) { m_serial = t; m_increment = inc; m_update = true; m_contains_update = true;}
inline void setAddressee( KABC::Addressee* pAddressee ) { m_address = pAddressee; }
inline int index() const { return m_index; }
inline unsigned int page() const { return m_page; }
- inline const QString & articleNo() const { return article_no; }
- inline const QString & barcodeNo() const { return barcode_no; }
- inline const QString & serial() const { return m_serial; }
+ inline const TQString & articleNo() const { return article_no; }
+ inline const TQString & barcodeNo() const { return barcode_no; }
+ inline const TQString & serial() const { return m_serial; }
- inline void setPaintDevice( QPaintDevice* paint ) { m_printer = paint; }
- inline QPaintDevice* paintDevice() const { return m_printer; }
+ inline void setPaintDevice( TQPaintDevice* paint ) { m_printer = paint; }
+ inline TQPaintDevice* paintDevice() const { return m_printer; }
/**
* parse the given java script code and return its result
@@ -134,21 +134,21 @@ class TokenProvider {
* or an error message
* @p script javascript code to execute
*/
- QString jsParse( const QString & script );
+ TQString jsParse( const TQString & script );
/**
* parse the given java script code and return its result
* @returns true or false
* @p script javascript code to execute
*/
- bool jsParseToBool( const QString & script );
+ bool jsParseToBool( const TQString & script );
/**
* parse the given text for tokens and return a
* string with all tokens replaced correctly.
- * @param text QString look in this text for tokens to replace
+ * @param text TQString look in this text for tokens to tqreplace
*/
- QString parse( const QString & text );
+ TQString parse( const TQString & text );
/**
@@ -162,44 +162,44 @@ class TokenProvider {
* A user defined variable is something like [$MyVar1]. Variable
* names are case insensitive.
*/
- QStringList listUserVars();
+ TQStringList listUserVars();
- inline void setUserVars( const QMap<QString,QString> & data );
+ inline void setUserVars( const TQMap<TQString,TQString> & data );
private:
static void init();
- const QString createSerial();
+ const TQString createSerial();
- QString escapeText( const QString & t );
- QString unescapeText( const QString & t );
+ TQString escapeText( const TQString & t );
+ TQString unescapeText( const TQString & t );
/** A helper function called from parse
* which returns the value for every known
* token @p text.
*/
- QString process( const QString & text );
+ TQString process( const TQString & text );
/** A helper function called from parse
* which returns the value for every known
* token @p t.
*/
- QString processAddresses( const QString & t );
+ TQString processAddresses( const TQString & t );
/** a helper function needed by listUserVars.
* which adds all user defined variables to
* m_findUserVars.
*/
- QString processUserVars( const QString & t );
+ TQString processUserVars( const TQString & t );
- void findBrackets( QString & text, QString (TokenProvider::*parserfunction)( const QString & ) );
+ void findBrackets( TQString & text, TQString (TokenProvider::*parserfunction)( const TQString & ) );
/**
* run a SQL Query and return it result
- * @param query QString the SQL command to execute
+ * @param query TQString the SQL command to execute
*/
- QString query( const QString & query );
+ TQString query( const TQString & query );
unsigned int m_index;
unsigned int m_page;
@@ -207,28 +207,28 @@ class TokenProvider {
DocumentItemList m_document_items;
- QMap<QString,QString> m_uservardata;
+ TQMap<TQString,TQString> m_uservardata;
- QString article_no;
- QString barcode_no;
- QString customer_no;
- QString encoding_type_name;
- QString group;
- QString label_name;
- QString m_serial;
+ TQString article_no;
+ TQString barcode_no;
+ TQString customer_no;
+ TQString encoding_type_name;
+ TQString group;
+ TQString label_name;
+ TQString m_serial;
unsigned int row;
unsigned int col;
bool m_update;
bool m_contains_update;
- QPaintDevice* m_printer;
- QRegExp date_reg_exp ;
+ TQPaintDevice* m_printer;
+ TQRegExp date_reg_exp ;
KABC::Addressee* m_address;
- QStringList* m_findUserVarsList;
- static QValueList<tCategories> s_categories;
- static QMap<ECategories, QString> s_captions;
+ TQStringList* m_findUserVarsList;
+ static TQValueList<tCategories> s_categories;
+ static TQMap<ECategories, TQString> s_captions;
#ifdef NO_KJS_EMBED
static KJS::Interpreter* s_interpreter;
@@ -242,7 +242,7 @@ inline void TokenProvider::setCurrentDocumentItems( const DocumentItemList & lis
m_document_items = list;
}
-inline void TokenProvider::setUserVars( const QMap<QString,QString> & data )
+inline void TokenProvider::setUserVars( const TQMap<TQString,TQString> & data )
{
m_uservardata = data;
}
diff --git a/kbarcode/xmlutils.cpp b/kbarcode/xmlutils.cpp
index 64b5c36..7dc548c 100644
--- a/kbarcode/xmlutils.cpp
+++ b/kbarcode/xmlutils.cpp
@@ -28,8 +28,8 @@
#include "textitem.h"
#include "textlineitem.h"
-// Qt includes
-#include <qdom.h>
+// TQt includes
+#include <tqdom.h>
// KDE includes
#include <kapplication.h>
@@ -65,22 +65,22 @@ XMLUtils::~XMLUtils()
{
}
-QMap<QString,QString> XMLUtils::legacy;
+TQMap<TQString,TQString> XMLUtils::legacy;
-void XMLUtils::readXMLHeader( QDomDocument* doc, QString & description, bool & kbarcode18, Definition** def )
+void XMLUtils::readXMLHeader( TQDomDocument* doc, TQString & description, bool & kbarcode18, Definition** def )
{
- QDomNode n = doc->documentElement().firstChild();
+ TQDomNode n = doc->documentElement().firstChild();
// this should not be neccessary,
// but <label><id> needs to be processed first
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if( !e.isNull() )
// label has to be the first xml element!
if( e.tagName() == "label" ) {
kbarcode18 = (e.attribute( "fileformat-version", "1" ).toInt() == 1);
- QDomNode n = e.firstChild();
+ TQDomNode n = e.firstChild();
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if( !e.isNull() )
if( e.tagName() == "description" )
description = e.text();
@@ -97,37 +97,37 @@ void XMLUtils::readXMLHeader( QDomDocument* doc, QString & description, bool & k
}
}
-void XMLUtils::writeXMLHeader( QDomNode* root, const QString & description, Definition* def )
+void XMLUtils::writeXMLHeader( TQDomNode* root, const TQString & description, Definition* def )
{
- QDomElement data = root->ownerDocument().createElement( "label" );
+ TQDomElement data = root->ownerDocument().createElement( "label" );
/** kbarcode <= 1.8.x = fileformat-version = 1 */
/** kbarcode >= 1.9.0 = fileformat-version = 2 */
data.setAttribute( "fileformat-version", "2" );
if( !description.isEmpty() ) {
- QDomElement labeldescription = root->ownerDocument().createElement( "description" );
+ TQDomElement labeldescription = root->ownerDocument().createElement( "description" );
labeldescription.appendChild( root->ownerDocument().createTextNode( description ) );
data.appendChild( labeldescription );
}
- QDomElement labelid = root->ownerDocument().createElement( "id" );
+ TQDomElement labelid = root->ownerDocument().createElement( "id" );
writeDefinition( &labelid, def );
- labelid.appendChild( root->ownerDocument().createTextNode( QString( "%1" ).arg(def->getId()) ) );
+ labelid.appendChild( root->ownerDocument().createTextNode( TQString( "%1" ).tqarg(def->getId()) ) );
data.appendChild( labelid );
root->appendChild( data );
}
-void XMLUtils::readDocumentItems( DocumentItemList* list, QDomDocument* doc, TokenProvider* token, bool kbarcode18 )
+void XMLUtils::readDocumentItems( DocumentItemList* list, TQDomDocument* doc, TokenProvider* token, bool kbarcode18 )
{
- QDomNode n = doc->documentElement().firstChild();
+ TQDomNode n = doc->documentElement().firstChild();
list->setAutoDelete( false );
if( kbarcode18 )
{
// legacy loading
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if( !e.isNull() )
if( e.tagName() == "barcode" ) {
BarcodeItem* bcode = new BarcodeItem();
@@ -141,13 +141,13 @@ void XMLUtils::readDocumentItems( DocumentItemList* list, QDomDocument* doc, Tok
TextItem* t = new TextItem();
t->setTokenProvider( token );
- QRect r = readXMLRect( &e );
+ TQRect r = readXMLRect( &e );
t->setBoundingRect( r );
t->setZ( e.attribute( "z", "0" ).toInt() );
- QDomNode n = e.firstChild();
+ TQDomNode n = e.firstChild();
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if( !e.isNull() )
if( e.tagName() == "text" )
{
@@ -161,10 +161,10 @@ void XMLUtils::readDocumentItems( DocumentItemList* list, QDomDocument* doc, Tok
} else if( e.tagName() == "picture" ) {
ImageItem* r = new ImageItem();
- QRect rect = readXMLRect( &e );
+ TQRect rect = readXMLRect( &e );
r->setBoundingRect( rect );
- QPixmap pix;
+ TQPixmap pix;
pix.loadFromData( e.text().utf8(), "XPM" );
r->setPixmap( pix );
r->setRotation( e.attribute("rotation", "0.0" ).toDouble() );
@@ -173,25 +173,25 @@ void XMLUtils::readDocumentItems( DocumentItemList* list, QDomDocument* doc, Tok
} else if( e.tagName() == "rect" ) {
RectItem* r = new RectItem();
- QRect rect = readXMLRect( &e );
+ TQRect rect = readXMLRect( &e );
r->setBoundingRect( rect );
r->setZ( e.attribute( "z", "0" ).toInt() );
r->setCircle( e.attribute( "circle", "0" ).toInt() );
- r->setPen( QPen(readXMLColor( &e, "bordercolor", Qt::black ),e.attribute( "borderwidth", "1" ).toInt(),(Qt::PenStyle)e.attribute( "borderstyle", "1" ).toInt() ));
- r->setColor( readXMLColor( &e, "color", Qt::black ) );
+ r->setPen( TQPen(readXMLColor( &e, "bordercolor", TQt::black ),e.attribute( "borderwidth", "1" ).toInt(),(TQt::PenStyle)e.attribute( "borderstyle", "1" ).toInt() ));
+ r->setColor( readXMLColor( &e, "color", TQt::black ) );
list->append( r );
} else if( e.tagName() == "line" ) {
#warning "TODO: test legacy loading of lines"
LineItem* cl = new LineItem();
int x = e.attribute( "x1", "0" ).toInt();
int y = e.attribute( "y1", "0" ).toInt();
- cl->setBoundingRect( QRect( x, y, e.attribute( "x2", "0" ).toInt(), e.attribute( "y2", "0" ).toInt() ) );
+ cl->setBoundingRect( TQRect( x, y, e.attribute( "x2", "0" ).toInt(), e.attribute( "y2", "0" ).toInt() ) );
cl->setZ( e.attribute( "z", "0" ).toInt() );
- cl->setPen( QPen( readXMLColor( &e, "color", Qt::black ),
- e.attribute( "width", "0" ).toInt(), (QPen::PenStyle)e.attribute( "style", "0" ).toInt() ) );
+ cl->setPen( TQPen( readXMLColor( &e, "color", TQt::black ),
+ e.attribute( "width", "0" ).toInt(), (TQPen::PenStyle)e.attribute( "style", "0" ).toInt() ) );
list->append( cl );
}
n = n.nextSibling();
@@ -200,7 +200,7 @@ void XMLUtils::readDocumentItems( DocumentItemList* list, QDomDocument* doc, Tok
else
{
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if( !e.isNull() )
{
DocumentItem* item = NULL;
@@ -213,12 +213,12 @@ void XMLUtils::readDocumentItems( DocumentItemList* list, QDomDocument* doc, Tok
}
-void XMLUtils::writeXMLDocumentItem( QDomElement* root, DocumentItem** item )
+void XMLUtils::writeXMLDocumentItem( TQDomElement* root, DocumentItem** item )
{
if( !item )
return;
- QDomElement tag;
+ TQDomElement tag;
if( (*item)->rtti() == eRtti_Barcode )
tag = root->ownerDocument().createElement( "barcode" );
else if( (*item)->rtti() == eRtti_Image )
@@ -241,7 +241,7 @@ void XMLUtils::writeXMLDocumentItem( QDomElement* root, DocumentItem** item )
}
}
-bool XMLUtils::readXMLDocumentItem( QDomElement* tag, DocumentItem** item, TokenProvider* token )
+bool XMLUtils::readXMLDocumentItem( TQDomElement* tag, DocumentItem** item, TokenProvider* token )
{
if( !item )
return false;
@@ -266,28 +266,28 @@ bool XMLUtils::readXMLDocumentItem( QDomElement* tag, DocumentItem** item, Token
return true;
}
-void XMLUtils::writeXMLColor( QDomElement* tag, const QString & prefix, QColor c ) const
+void XMLUtils::writeXMLColor( TQDomElement* tag, const TQString & prefix, TQColor c ) const
{
tag->setAttribute( prefix + "r", c.red() );
tag->setAttribute( prefix + "g", c.green() );
tag->setAttribute( prefix + "b", c.blue() );
}
-QColor XMLUtils::readXMLColor( QDomElement* tag, const QString & prefix, QColor c )
+TQColor XMLUtils::readXMLColor( TQDomElement* tag, const TQString & prefix, TQColor c )
{
int r = c.red();
int g = c.green();
int b = c.blue();
- r = tag->attribute( prefix + "r", QString("%1").arg( r ) ).toInt();
- g = tag->attribute( prefix + "g", QString("%1").arg( g ) ).toInt();
- b = tag->attribute( prefix + "b", QString("%1").arg( b ) ).toInt();
+ r = tag->attribute( prefix + "r", TQString("%1").tqarg( r ) ).toInt();
+ g = tag->attribute( prefix + "g", TQString("%1").tqarg( g ) ).toInt();
+ b = tag->attribute( prefix + "b", TQString("%1").tqarg( b ) ).toInt();
- return QColor( r, g, b);
+ return TQColor( r, g, b);
}
/*
-void XMLUtils::writeXMLRect( QDomElement* tag, QRect r, QPoint ptOrigin ) const
+void XMLUtils::writeXMLRect( TQDomElement* tag, TQRect r, TQPoint ptOrigin ) const
{
r.moveBy( -ptOrigin.x(), -ptOrigin.y() );
@@ -303,9 +303,9 @@ void XMLUtils::writeXMLRect( QDomElement* tag, QRect r, QPoint ptOrigin ) const
tag->setAttribute( "height_mm", l.pixelToMm( r.height(), KApplication::desktop(), LabelUtils::DpiY ) );
}*/
-QRect XMLUtils::readXMLRect( QDomElement* tag )
+TQRect XMLUtils::readXMLRect( TQDomElement* tag )
{
- QRect r;
+ TQRect r;
int x = tag->attribute( "x", "0" ).toInt();
int y = tag->attribute( "y", "0" ).toInt();
@@ -316,7 +316,7 @@ QRect XMLUtils::readXMLRect( QDomElement* tag )
return r;
}
-void XMLUtils::writeDefinition( QDomElement* tag, Definition* d ) const
+void XMLUtils::writeDefinition( TQDomElement* tag, Definition* d ) const
{
tag->setAttribute("producer", d->getProducer());
tag->setAttribute("type", d->getType());
@@ -331,11 +331,11 @@ void XMLUtils::writeDefinition( QDomElement* tag, Definition* d ) const
tag->setAttribute("num_h", d->getMeasurements().numH());
}
-Definition* XMLUtils::readDefinition( QDomElement* tag )
+Definition* XMLUtils::readDefinition( TQDomElement* tag )
{
int label_def_id = tag->text().toInt();
- QString producer = tag->attribute("producer", "" );
- QString type = tag->attribute("type", "" );
+ TQString producer = tag->attribute("producer", "" );
+ TQString type = tag->attribute("type", "" );
// The label was written by KBarcode <= 1.2.0
Definition* d = new Definition( label_def_id );
@@ -358,8 +358,8 @@ Definition* XMLUtils::readDefinition( QDomElement* tag )
!(type.isEmpty() && producer.isEmpty() ) ) {
int id = label_def_id;
- QStringList p = Definition::getProducers();
- if( !p.contains( producer ) ) {
+ TQStringList p = Definition::getProducers();
+ if( !p.tqcontains( producer ) ) {
for( unsigned int i = 0; i < p.count(); i++ ) {
id = Definition::getClosest( p[i], type );
if( id >= 0 )
@@ -392,7 +392,7 @@ Definition* XMLUtils::readDefinition( QDomElement* tag )
return d;
}
-void XMLUtils::writeBarcode( QDomElement* tag, const Barkode* data, bool cache ) const
+void XMLUtils::writeBarcode( TQDomElement* tag, const Barkode* data, bool cache ) const
{
if( !cache ) {
/*
@@ -439,13 +439,13 @@ void XMLUtils::writeBarcode( QDomElement* tag, const Barkode* data, bool cache )
}
*/
- QDomElement texttag = tag->ownerDocument().createElement( "value" );
+ TQDomElement texttag = tag->ownerDocument().createElement( "value" );
texttag.appendChild( tag->ownerDocument().createTextNode( data->value() ) );
tag->appendChild( texttag );
}
-void XMLUtils::readBarcode( QDomElement* tag, Barkode* bcode )
+void XMLUtils::readBarcode( TQDomElement* tag, Barkode* bcode )
{
if( tag->tagName() == "barcode" ) {
bcode->setQuietZone( tag->attribute("margin", "10" ).toInt() );
@@ -457,7 +457,7 @@ void XMLUtils::readBarcode( QDomElement* tag, Barkode* bcode )
/*
* check for encoding types saved by kbarcode <= 1.2.0
*/
- if( legacy.contains( bcode->type() ) )
+ if( legacy.tqcontains( bcode->type() ) )
bcode->setType( legacy[bcode->type()] );
bcode->setTextVisible( tag->attribute("text", "0" ).toInt() );
@@ -476,9 +476,9 @@ void XMLUtils::readBarcode( QDomElement* tag, Barkode* bcode )
bcode->setSequenceStart( tag->attribute( "sequencestart", "0" ).toInt() );
}
- QDomNode n = tag->firstChild();
+ TQDomNode n = tag->firstChild();
while( !n.isNull() ) {
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if( !e.isNull() )
if( e.tagName() == "value" )
bcode->setValue( e.text() );
diff --git a/kbarcode/xmlutils.h b/kbarcode/xmlutils.h
index 3cd6b5c..4851baa 100644
--- a/kbarcode/xmlutils.h
+++ b/kbarcode/xmlutils.h
@@ -18,8 +18,8 @@
#ifndef XMLUTILS_H
#define XMLUTILS_H
-#include <qmap.h>
-#include <qsortedlist.h>
+#include <tqmap.h>
+#include <tqsortedlist.h>
class DocumentItem;
class BarcodeItem;
@@ -27,14 +27,14 @@ class Barkode;
class Definition;
class TokenProvider;
class MyCanvasView;
-class QColor;
-class QDomDocument;
-class QDomElement;
-class QDomNode;
-class QRect;
-class QString;
-class QWidget;
-typedef QSortedList<DocumentItem> DocumentItemList;
+class TQColor;
+class TQDomDocument;
+class TQDomElement;
+class TQDomNode;
+class TQRect;
+class TQString;
+class TQWidget;
+typedef TQSortedList<DocumentItem> DocumentItemList;
/** This class provides helper function for saving and reading to XML files.
*
@@ -45,28 +45,28 @@ class XMLUtils {
XMLUtils();
~XMLUtils();
- void readXMLHeader( QDomDocument* doc, QString & description, bool & kbarcode18, Definition** def );
- void writeXMLHeader( QDomNode* root, const QString & description, Definition* def );
+ void readXMLHeader( TQDomDocument* doc, TQString & description, bool & kbarcode18, Definition** def );
+ void writeXMLHeader( TQDomNode* root, const TQString & description, Definition* def );
- void readDocumentItems( DocumentItemList* list, QDomDocument* doc, TokenProvider* token, bool kbarcode18 );
+ void readDocumentItems( DocumentItemList* list, TQDomDocument* doc, TokenProvider* token, bool kbarcode18 );
- void writeXMLDocumentItem( QDomElement* root, DocumentItem** item );
- bool readXMLDocumentItem( QDomElement* tag, DocumentItem** item, TokenProvider* token );
+ void writeXMLDocumentItem( TQDomElement* root, DocumentItem** item );
+ bool readXMLDocumentItem( TQDomElement* tag, DocumentItem** item, TokenProvider* token );
- void writeXMLColor( QDomElement* tag, const QString & prefix, QColor c ) const;
- QColor readXMLColor( QDomElement* tag, const QString & prefix, QColor c );
+ void writeXMLColor( TQDomElement* tag, const TQString & prefix, TQColor c ) const;
+ TQColor readXMLColor( TQDomElement* tag, const TQString & prefix, TQColor c );
- //void writeXMLRect( QDomElement* tag, QRect r, QPoint ptOrigin ) const;
- QRect readXMLRect( QDomElement* tag );
+ //void writeXMLRect( TQDomElement* tag, TQRect r, TQPoint ptOrigin ) const;
+ TQRect readXMLRect( TQDomElement* tag );
- void writeDefinition( QDomElement* tag, Definition* d ) const;
- Definition* readDefinition( QDomElement* tag );
+ void writeDefinition( TQDomElement* tag, Definition* d ) const;
+ Definition* readDefinition( TQDomElement* tag );
- void writeBarcode( QDomElement* tag, const Barkode* data, bool cache = false ) const;
- void readBarcode( QDomElement* tag, Barkode* bcode );
+ void writeBarcode( TQDomElement* tag, const Barkode* data, bool cache = false ) const;
+ void readBarcode( TQDomElement* tag, Barkode* bcode );
private:
- static QMap<QString,QString> legacy;
+ static TQMap<TQString,TQString> legacy;
};
#endif
diff --git a/kbarcode/zplutils.cpp b/kbarcode/zplutils.cpp
index d2a8e5d..239959a 100644
--- a/kbarcode/zplutils.cpp
+++ b/kbarcode/zplutils.cpp
@@ -17,14 +17,14 @@
#include "zplutils.h"
-// Qt includes
-#include <qbuffer.h>
-#include <qcstring.h>
-#include <qimage.h>
-#include <qpaintdevicemetrics.h>
-#include <qregexp.h>
-#include <qstring.h>
-#include <qtextstream.h>
+// TQt includes
+#include <tqbuffer.h>
+#include <tqcstring.h>
+#include <tqimage.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqregexp.h>
+#include <tqstring.h>
+#include <tqtextstream.h>
// font table for IPL, thanks to Erich Kitzmueller
struct { int size; int c; int h; int w; } iplfonttable[] = {
@@ -42,7 +42,7 @@ struct { int size; int c; int h; int w; } iplfonttable[] = {
};
BarcodePrinterDevice::BarcodePrinterDevice( double dpix, double dpiy )
- : QPaintDevice( 0 )
+ : TQPaintDevice( 0 )
{
m_resolution_x = dpix;
m_resolution_y = dpiy;
@@ -52,30 +52,30 @@ int BarcodePrinterDevice::metric( int e ) const
{
int val = 0;
switch ( e ) {
- case QPaintDeviceMetrics::PdmPhysicalDpiX:
+ case TQPaintDeviceMetrics::PdmPhysicalDpiX:
val = (int)m_resolution_y;
break;
- case QPaintDeviceMetrics::PdmPhysicalDpiY:
+ case TQPaintDeviceMetrics::PdmPhysicalDpiY:
val = (int)m_resolution_x;
break;
- case QPaintDeviceMetrics::PdmDpiX:
+ case TQPaintDeviceMetrics::PdmDpiX:
val = (int)m_resolution_x;
break;
- case QPaintDeviceMetrics::PdmDpiY:
+ case TQPaintDeviceMetrics::PdmDpiY:
val = (int)m_resolution_y;
break;
- case QPaintDeviceMetrics::PdmNumColors:
+ case TQPaintDeviceMetrics::PdmNumColors:
val = 2; // black and white
break;
- case QPaintDeviceMetrics::PdmDepth:
+ case TQPaintDeviceMetrics::PdmDepth:
val = 1; // black and white
break;
- case QPaintDeviceMetrics::PdmWidth:
- case QPaintDeviceMetrics::PdmHeight:
- case QPaintDeviceMetrics::PdmWidthMM:
- case QPaintDeviceMetrics::PdmHeightMM:
+ case TQPaintDeviceMetrics::PdmWidth:
+ case TQPaintDeviceMetrics::PdmHeight:
+ case TQPaintDeviceMetrics::PdmWidthMM:
+ case TQPaintDeviceMetrics::PdmHeightMM:
default:
break;
}
@@ -83,16 +83,16 @@ int BarcodePrinterDevice::metric( int e ) const
return val;
}
-QMap<QString,QString> ZPLUtils::encodings;
+TQMap<TQString,TQString> ZPLUtils::encodings;
-QString ZPLUtils::footer()
+TQString ZPLUtils::footer()
{
return "^XZ\n";
}
-QString ZPLUtils::header()
+TQString ZPLUtils::header()
{
- QString zpl = QString::null;
+ TQString zpl = TQString();
zpl += "^FXLabel created by KBarcode www.kbarcode.net\n";
zpl += "^XA\n"; // Label start
@@ -102,7 +102,7 @@ QString ZPLUtils::header()
return zpl;
}
-QString ZPLUtils::encoding( const QString & encoding )
+TQString ZPLUtils::encoding( const TQString & encoding )
{
if( !encodings.count() )
fillEncodings();
@@ -110,28 +110,28 @@ QString ZPLUtils::encoding( const QString & encoding )
return encodings[encoding];
}
-QString ZPLUtils::fieldData( const QString & data )
+TQString ZPLUtils::fieldData( const TQString & data )
{
- QString zpl = QString::null;
+ TQString zpl = TQString();
zpl += "^FD" + data + "^FS\n"; // field data
return zpl;
}
-QString ZPLUtils::fieldOrigin( int x, int y )
+TQString ZPLUtils::fieldOrigin( int x, int y )
{
- QString zpl = QString::null;
+ TQString zpl = TQString();
- zpl = QString("^FO%1,%2\n").arg( x ).arg( y ); // field origin
+ zpl = TQString("^FO%1,%2\n").tqarg( x ).tqarg( y ); // field origin
return zpl;
}
-QString ZPLUtils::font( const QFont & )
+TQString ZPLUtils::font( const TQFont & )
{
- QString zpl = QString::null;
- QString fontname = "D";
+ TQString zpl = TQString();
+ TQString fontname = "D";
// valid fonts:
// A - H, GS
/*
@@ -213,9 +213,9 @@ IPLUtils::IPLUtils()
m_counter = 0;
}
-QMap<QString,QString> IPLUtils::encodings;
+TQMap<TQString,TQString> IPLUtils::encodings;
-void IPLUtils::addValue( const QString & v )
+void IPLUtils::addValue( const TQString & v )
{
m_values.append( v );
}
@@ -225,7 +225,7 @@ int IPLUtils::counter()
return m_counter++;
}
-QString IPLUtils::encoding( const QString & type )
+TQString IPLUtils::encoding( const TQString & type )
{
if( !encodings.count() )
fillEncodings();
@@ -233,22 +233,22 @@ QString IPLUtils::encoding( const QString & type )
return encodings[type];
}
-QString IPLUtils::field( const QString & data )
+TQString IPLUtils::field( const TQString & data )
{
- QString ipl = "<STX>";
+ TQString ipl = "<STX>";
ipl += data;
ipl += "<ETX>\n";
return ipl;
}
-QString IPLUtils::fieldOrigin( int x, int y )
+TQString IPLUtils::fieldOrigin( int x, int y )
{
- return QString("o%1,%2;f0;").arg( x ).arg( y ); // field origin
+ return TQString("o%1,%2;f0;").tqarg( x ).tqarg( y ); // field origin
}
-QString IPLUtils::footer()
+TQString IPLUtils::footer()
{
- QString ipl = QString::null;
+ TQString ipl = TQString();
// set the printer to print mode
ipl += field( "R" );
@@ -256,7 +256,7 @@ QString IPLUtils::footer()
ipl += field( "<ESC>E3<CAN>" ); // choose format number 3
for( unsigned int i = 0; i < m_values.count(); i++ )
- ipl += field( m_values[i] + ( i != m_values.count() - 1 ? "<CR>" : QString::null ) );
+ ipl += field( m_values[i] + ( i != m_values.count() - 1 ? "<CR>" : TQString() ) );
// end actual data
ipl += field( "<ETB>" );
@@ -264,9 +264,9 @@ QString IPLUtils::footer()
return ipl;
}
-QString IPLUtils::header()
+TQString IPLUtils::header()
{
- QString ipl = QString::null;
+ TQString ipl = TQString();
// start form definition:
// ---
@@ -339,11 +339,11 @@ void IPLUtils::fillEncodings()
/***************************************************************************/
-QMap<QString,QString> EPCLUtils::encodings;
+TQMap<TQString,TQString> EPCLUtils::encodings;
-QString EPCLUtils::footer()
+TQString EPCLUtils::footer()
{
- QString pcl = QString::null;
+ TQString pcl = TQString();
// print color buffers
pcl += EPCLUtils::field( "IS 0" ); // Yellow
@@ -357,9 +357,9 @@ QString EPCLUtils::footer()
return pcl;
}
-QString EPCLUtils::header()
+TQString EPCLUtils::header()
{
- QString pcl = QString::null;
+ TQString pcl = TQString();
// start form definition:
// ---
@@ -375,13 +375,13 @@ QString EPCLUtils::header()
return pcl;
}
-QString EPCLUtils::field( const QString & data )
+TQString EPCLUtils::field( const TQString & data )
{
- QString pcl = "\033" + data + "\r\n";
+ TQString pcl = "\033" + data + "\r\n";
return pcl;
}
-QString EPCLUtils::encoding( const QString & type )
+TQString EPCLUtils::encoding( const TQString & type )
{
if( !encodings.count() )
fillEncodings();
diff --git a/kbarcode/zplutils.h b/kbarcode/zplutils.h
index 14365bb..1c5e0b6 100644
--- a/kbarcode/zplutils.h
+++ b/kbarcode/zplutils.h
@@ -18,18 +18,18 @@
#ifndef ZPLUTILS_H
#define ZPLUTILS_H
-#include <qpaintdevice.h>
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qmap.h>
+#include <tqpaintdevice.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqmap.h>
-class QColor;
-class QFont;
-class QImage;
-class QSize;
-class QTextStream;
+class TQColor;
+class TQFont;
+class TQImage;
+class TQSize;
+class TQTextStream;
-class BarcodePrinterDevice : public QPaintDevice {
+class BarcodePrinterDevice : public TQPaintDevice {
public:
BarcodePrinterDevice( double dpix, double dpiy );
@@ -52,19 +52,19 @@ class BarcodePrinterDevice : public QPaintDevice {
*/
class ZPLUtils {
public:
- static QString footer();
- static QString header();
+ static TQString footer();
+ static TQString header();
- static QString encoding( const QString & encoding );
- static QString fieldData( const QString & data );
- static QString fieldOrigin( int x, int y );
- static QString font( const QFont & font );
+ static TQString encoding( const TQString & encoding );
+ static TQString fieldData( const TQString & data );
+ static TQString fieldOrigin( int x, int y );
+ static TQString font( const TQFont & font );
private:
static void fillEncodings();
protected:
- static QMap<QString,QString> encodings;
+ static TQMap<TQString,TQString> encodings;
};
/**
@@ -80,20 +80,20 @@ class IPLUtils {
public:
IPLUtils();
- void addValue( const QString & v );
+ void addValue( const TQString & v );
int counter();
- QString encoding( const QString & type );
- QString footer();
- QString header();
+ TQString encoding( const TQString & type );
+ TQString footer();
+ TQString header();
- QString field( const QString & data );
- QString fieldOrigin( int x, int y );
+ TQString field( const TQString & data );
+ TQString fieldOrigin( int x, int y );
private:
int m_counter;
- QStringList m_values;
- static QMap<QString,QString> encodings;
+ TQStringList m_values;
+ static TQMap<TQString,TQString> encodings;
/** fill the map to match kbarcode encoding types with IPL types */
void fillEncodings();
@@ -111,26 +111,26 @@ class IPLUtils {
class EPCLUtils {
public:
- static QString encoding( const QString & type );
- static QString footer();
- static QString header();
+ static TQString encoding( const TQString & type );
+ static TQString footer();
+ static TQString header();
- static QString field( const QString & data );
+ static TQString field( const TQString & data );
- EPCLUtils( QTextStream* stream, QPaintDevice* source );
+ EPCLUtils( TQTextStream* stream, TQPaintDevice* source );
- void setTextField( int x, int y, int width, int height, const QString & text );
- void setBarcode( int x, int y, int h, const QString & value, const QString & type );
- void setRect( int x, int y, const QSize size, bool circle, int width );
- void setImage( int x, int y, const QImage* image );
+ void setTextField( int x, int y, int width, int height, const TQString & text );
+ void setBarcode( int x, int y, int h, const TQString & value, const TQString & type );
+ void setRect( int x, int y, const TQSize size, bool circle, int width );
+ void setImage( int x, int y, const TQImage* image );
void close();
private:
static void fillEncodings();
- static QMap<QString,QString> encodings;
+ static TQMap<TQString,TQString> encodings;
- inline void setField( const QString & data );
+ inline void setField( const TQString & data );
void fillImageBuffer( void );
};