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
v3.5.13-sru
tpearson 12 years ago
parent 2f888b1578
commit c4189d200e

@ -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();

@ -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 );
};

@ -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 );
}

@ -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;

@ -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"

@ -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

@ -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 )

@ -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

</
@ -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() );
}