diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-12-03 00:37:29 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-12-03 18:46:52 +0900 |
commit | d9f688ddbd88ddbac7dec1ab360d43b74edd022c (patch) | |
tree | a8eefbc9d7e37fdd4ac90e73cc69b464e7ba692b | |
parent | 9503185fc6f36b949e32376e43a1df4ef7bfff18 (diff) | |
download | kbarcode-d9f688ddbd88ddbac7dec1ab360d43b74edd022c.tar.gz kbarcode-d9f688ddbd88ddbac7dec1ab360d43b74edd022c.zip |
Replaced various '#define' with actual strings - part 5
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r-- | kbarcode/barcodedialog.cpp | 6 | ||||
-rw-r--r-- | kbarcode/batchprinter.cpp | 18 | ||||
-rw-r--r-- | kbarcode/batchwizard.cpp | 4 | ||||
-rw-r--r-- | kbarcode/csvfile.cpp | 4 | ||||
-rw-r--r-- | kbarcode/documentitem.cpp | 2 | ||||
-rw-r--r-- | kbarcode/label.cpp | 4 | ||||
-rw-r--r-- | kbarcode/labeleditor.cpp | 10 | ||||
-rw-r--r-- | kbarcode/labelutils.cpp | 4 | ||||
-rw-r--r-- | kbarcode/mycanvasview.cpp | 22 | ||||
-rw-r--r-- | kbarcode/pixmapbarcode.cpp | 2 | ||||
-rw-r--r-- | kbarcode/previewdialog.cpp | 6 | ||||
-rw-r--r-- | kbarcode/tcanvasitem.cpp | 4 |
12 files changed, 43 insertions, 43 deletions
diff --git a/kbarcode/barcodedialog.cpp b/kbarcode/barcodedialog.cpp index cff4777..b63f267 100644 --- a/kbarcode/barcodedialog.cpp +++ b/kbarcode/barcodedialog.cpp @@ -50,7 +50,7 @@ BarCodeDialog::BarCodeDialog( TQWidget* parent, const char* name ) Layout6 = new TQVBoxLayout( 0, 0, 6, "Layout2"); widget = new BarcodeWidget( this, "widget" ); - m_token = new TokenProvider( TQT_TQPAINTDEVICE(TDEApplication::desktop()) ); + m_token = new TokenProvider( TDEApplication::desktop() ); widget->setTokenProvider( m_token ); buttonGenerate = new KPushButton( this, "buttonGenerate" ); @@ -120,7 +120,7 @@ void BarCodeDialog::generate() Barkode d; widget->getData( d ); d.setTokenProvider( m_token ); - d.update( TQT_TQPAINTDEVICE(TDEApplication::desktop()) ); + d.update( TDEApplication::desktop() ); barcode->setPixmap( d.pixmap() ); @@ -149,7 +149,7 @@ void BarCodeDialog::save() bc.setTokenProvider( m_token ); - bc.update( TQT_TQPAINTDEVICE(TDEApplication::desktop()) ); + bc.update( TDEApplication::desktop() ); if(!bc.pixmap().save( path, extension.utf8(), 0 )) KMessageBox::error( this, i18n("An error occurred during saving the image") ); diff --git a/kbarcode/batchprinter.cpp b/kbarcode/batchprinter.cpp index 2188112..076af62 100644 --- a/kbarcode/batchprinter.cpp +++ b/kbarcode/batchprinter.cpp @@ -70,7 +70,7 @@ BatchPrinter::BatchPrinter( const TQString & path, TQWidget* p ) m_cur_data_count = 0; - m_paintDevice = TQT_TQPAINTDEVICE(p); + m_paintDevice = p; } BatchPrinter::BatchPrinter( const TQString & path, int format, TQWidget* _parent ) @@ -84,7 +84,7 @@ BatchPrinter::BatchPrinter( const TQString & path, int format, TQWidget* _parent m_cur_data_count = 0; - m_paintDevice = TQT_TQPAINTDEVICE(_parent); + m_paintDevice = _parent; } BatchPrinter::~BatchPrinter() @@ -133,7 +133,7 @@ void BatchPrinter::startPrintData( TQProgressDialog* progress ) for( unsigned int i = 0; i < m_data->count(); i++ ) { - Label l( def, TQT_TQIODEVICE(buffer), m_name, printer, m_customer, + Label l( def, buffer, m_name, printer, m_customer, (*m_data)[i].article_no, (*m_data)[i].group ); l.setSerial( m_serial, m_increment ); @@ -245,19 +245,19 @@ Label* BatchPrinter::initLabel( int* number ) if( m_vardata ) { - l = new Label( def, TQT_TQIODEVICE(buffer), m_name, m_paintDevice ); + l = new Label( def, buffer, m_name, m_paintDevice ); l->setUserVars( (*m_vardata)[m_cur_data_count] ); } else if( m_data ) { - l = new Label( def, TQT_TQIODEVICE(buffer), m_name, m_paintDevice, m_customer, + l = new Label( def, 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, TQT_TQIODEVICE(buffer), m_name, m_paintDevice ); + l = new Label( def, buffer, m_name, m_paintDevice ); l->setAddressee( &((*m_addrdata)[m_cur_data_count]) ); } @@ -278,7 +278,7 @@ void BatchPrinter::startImages() Measurements measure = def->getMeasurements(); Label* l = NULL; painter = new TQPainter(); - TQPixmap pixmap( (int)measure.width( TQT_TQPAINTDEVICE(parent) ), (int)measure.height( TQT_TQPAINTDEVICE(parent) ) ); + TQPixmap pixmap( (int)measure.width( parent ), (int)measure.height( parent ) ); while( (l = initLabel( &number ) ) != NULL ) { for( int i = 0; i < number; i++ ) @@ -424,8 +424,8 @@ void BatchPrinter::drawBorders() if( PrinterSettings::getInstance()->getData()->border ) { painter->setPen( TQPen( TQt::black, 1 ) ); painter->drawRect( (int)curw, (int)curh, - (int)m_measure.width( TQT_TQPAINTDEVICE(painter->device()) ), - (int)m_measure.height( TQT_TQPAINTDEVICE(painter->device()) ) ); + (int)m_measure.width( painter->device() ), + (int)m_measure.height( painter->device() ) ); } } diff --git a/kbarcode/batchwizard.cpp b/kbarcode/batchwizard.cpp index c128e36..e5fc395 100644 --- a/kbarcode/batchwizard.cpp +++ b/kbarcode/batchwizard.cpp @@ -199,7 +199,7 @@ void BatchWizard::setupPage4() void BatchWizard::setupPage5() { - TokenProvider serial( TQT_TQPAINTDEVICE(this) ); + TokenProvider serial( this ); page5 = new TQVBox( this, "page5" ); @@ -1000,7 +1000,7 @@ void BatchWizard::fillVarList() XMLUtils util; DocumentItemList list; - TokenProvider token( TQT_TQPAINTDEVICE(this) ); + TokenProvider token( this ); Definition* def = NULL; TQString description; diff --git a/kbarcode/csvfile.cpp b/kbarcode/csvfile.cpp index 960b4dd..5d138d8 100644 --- a/kbarcode/csvfile.cpp +++ b/kbarcode/csvfile.cpp @@ -35,7 +35,7 @@ CSVFile::CSVFile( const TQString & filename ) m_file.open( IO_ReadOnly ); if( m_file.isOpen() ) - m_stream.setDevice( TQT_TQIODEVICE(&m_file) ); + m_stream.setDevice( &m_file ); } CSVFile::CSVFile( TQBuffer & buf ) @@ -50,7 +50,7 @@ CSVFile::CSVFile( TQBuffer & buf ) buf.open( IO_ReadOnly ); if( buf.isOpen() ) - m_stream.setDevice( TQT_TQIODEVICE(&buf) ); + m_stream.setDevice( &buf ); } CSVFile::~CSVFile() diff --git a/kbarcode/documentitem.cpp b/kbarcode/documentitem.cpp index d98400f..ba0f034 100644 --- a/kbarcode/documentitem.cpp +++ b/kbarcode/documentitem.cpp @@ -37,7 +37,7 @@ void DocumentItem::init() { m_canvasitem = NULL; m_token = NULL; - m_device = TQT_TQPAINTDEVICE(TDEApplication::desktop()); + m_device = TDEApplication::desktop(); m_z = 0; m_border = true; diff --git a/kbarcode/label.cpp b/kbarcode/label.cpp index 9102740..552a969 100644 --- a/kbarcode/label.cpp +++ b/kbarcode/label.cpp @@ -158,8 +158,8 @@ void Label::InitBarcodes() void Label::draw( TQPainter* painter, int x, int y ) { - TQSize label( (int)d->getMeasurements().width( TQT_TQPAINTDEVICE(painter->device()) ), - (int)d->getMeasurements().height( TQT_TQPAINTDEVICE(painter->device()) ) ); + TQSize label( (int)d->getMeasurements().width( painter->device() ), + (int)d->getMeasurements().height( painter->device() ) ); InitBarcodes(); diff --git a/kbarcode/labeleditor.cpp b/kbarcode/labeleditor.cpp index 41f58d5..09d5ac1 100644 --- a/kbarcode/labeleditor.cpp +++ b/kbarcode/labeleditor.cpp @@ -131,7 +131,7 @@ LabelEditor::LabelEditor( TQWidget *parent, TQString _filename, const char *name description = TQString(); d = new Definition(); - m_token = new TokenProvider( TQT_TQPAINTDEVICE(TDEApplication::desktop()) ); + m_token = new TokenProvider( TDEApplication::desktop() ); statusBar()->insertItem( "", STATUS_ID_TEMPLATE, 0, true ); statusBar()->insertItem( "", STATUS_ID_SIZE, 0, true ); @@ -303,7 +303,7 @@ bool LabelEditor::save( TQString name ) if ( !f.open( IO_WriteOnly ) ) return false; - save( TQT_TQIODEVICE(&f) ); + save( &f ); m_token->setLabelName( filename.right( filename.length() - filename.findRev( "/" ) - 1 ) ); // maybe we should redraw all items on the canvas now. @@ -798,7 +798,7 @@ void LabelEditor::batchPrint( BatchPrinter* batch, int copies, int mode ) if( !buffer.open( IO_WriteOnly ) ) return; - save( TQT_TQIODEVICE(&buffer) ); + save( &buffer ); batch->setBuffer( &buffer ); batch->setSerial( TQString(), 1 ); @@ -944,10 +944,10 @@ void LabelEditor::preview() if( !buffer.open( IO_WriteOnly ) ) return; - save( TQT_TQIODEVICE(&buffer) ); + save( &buffer ); // No need to delete pd as it has WDestructiveClose set! - PreviewDialog* pd = new PreviewDialog( TQT_TQIODEVICE(&buffer), d, fileName(), this ); + PreviewDialog* pd = new PreviewDialog( &buffer, d, fileName(), this ); pd->exec(); } diff --git a/kbarcode/labelutils.cpp b/kbarcode/labelutils.cpp index 73f5a3b..0e3c542 100644 --- a/kbarcode/labelutils.cpp +++ b/kbarcode/labelutils.cpp @@ -43,7 +43,7 @@ LabelUtils::~LabelUtils() double LabelUtils::pixelToMm( double pixel, const TQPaintDevice* device, int mode ) { - TQPaintDeviceMetrics pdm( device ? device : TQT_TQPAINTDEVICE(TDEApplication::desktop()) ); + TQPaintDeviceMetrics pdm( device ? device : TDEApplication::desktop() ); if( mode == DpiX ) return (pixel * CONVERSION_FACTOR) / (double)pdm.logicalDpiX(); else @@ -58,7 +58,7 @@ double LabelUtils::mmToPixel( double mm, const TQPaintDevice* 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). - TQPaintDeviceMetrics pdm( device ? device : TQT_TQPAINTDEVICE(TDEApplication::desktop()) ); + TQPaintDeviceMetrics pdm( device ? device : TDEApplication::desktop() ); // tqDebug("DpiX=%i", pdm.logicalDpiX()); // tqDebug("DpiY=%i", pdm.logicalDpiY()); diff --git a/kbarcode/mycanvasview.cpp b/kbarcode/mycanvasview.cpp index 9dfdce6..8d46096 100644 --- a/kbarcode/mycanvasview.cpp +++ b/kbarcode/mycanvasview.cpp @@ -147,8 +147,8 @@ void MyCanvasView::contentsMouseMoveEvent(TQMouseEvent* e) if( statusbar ) { LabelUtils l; - int x = (int)l.pixelToMm( e->x(), TQT_TQPAINTDEVICE(this), LabelUtils::DpiX ); - int y = (int)l.pixelToMm( e->y(), TQT_TQPAINTDEVICE(this), LabelUtils::DpiY ); + int x = (int)l.pixelToMm( e->x(), this, LabelUtils::DpiX ); + int y = (int)l.pixelToMm( e->y(), this, LabelUtils::DpiY ); statusbar->changeItem( i18n("Position: ") + TQString( "%1%2 x %3%4" ).arg( x ) .arg( Measurements::system() ).arg( y ).arg( Measurements::system()), mouseid ); @@ -179,8 +179,8 @@ void MyCanvasView::contentsMouseMoveEvent(TQMouseEvent* e) LabelUtils l; 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 ); + 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 ); // Move the item MoveCommand* mv = new MoveCommand( pmm.x() - moving->item()->rectMM().x(), @@ -197,8 +197,8 @@ void MyCanvasView::contentsMouseMoveEvent(TQMouseEvent* e) LabelUtils l; 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 ); + 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 ); TQRect rmm = moving->item()->rectMM(); ResizeCommand* mv = new ResizeCommand( moving, shift_pressed ); @@ -399,7 +399,7 @@ void MyCanvasView::updateRuler() rulerv->setGeometry( 0, 20, 20, height() - 20 ); if( def ) { - canv->setRect( TQRect( translation.x(), translation.y(), (int)def->getMeasurements().width( TQT_TQPAINTDEVICE(this) ), (int)def->getMeasurements().height( TQT_TQPAINTDEVICE(this) )) ); + canv->setRect( TQRect( translation.x(), translation.y(), (int)def->getMeasurements().width( this ), (int)def->getMeasurements().height( this )) ); rulerv->setMaxValue( height() ); rulerh->setMaxValue( width() ); @@ -443,16 +443,16 @@ void MyCanvasView::reposition() * and multiply with the new one. * As a result we have the correct width. */ - int x = int((width() - (def->getMeasurements().width( TQT_TQPAINTDEVICE(this) )) ) / 2); - int y = int((height() - (def->getMeasurements().height( TQT_TQPAINTDEVICE(this) )) ) / 2); + int x = int((width() - (def->getMeasurements().width( this )) ) / 2); + int y = int((height() - (def->getMeasurements().height( 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( 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) ); + 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) ); canvas()->resize( w, h ); diff --git a/kbarcode/pixmapbarcode.cpp b/kbarcode/pixmapbarcode.cpp index 785441b..2b682c0 100644 --- a/kbarcode/pixmapbarcode.cpp +++ b/kbarcode/pixmapbarcode.cpp @@ -114,7 +114,7 @@ void PixmapBarcode::update( const TQPaintDevice* device ) void PixmapBarcode::drawBarcode( TQPainter & painter, int x, int y ) { if( p.isNull() ) - createBarcode( &p, TQT_TQPAINTDEVICE(painter.device()) ); + createBarcode( &p, painter.device() ); if( p.isNull() ) // still no barcode.... { diff --git a/kbarcode/previewdialog.cpp b/kbarcode/previewdialog.cpp index 7183520..4acfcb7 100644 --- a/kbarcode/previewdialog.cpp +++ b/kbarcode/previewdialog.cpp @@ -113,7 +113,7 @@ PreviewDialog::PreviewDialog( TQIODevice* device, Definition* d, TQString filena preview = new TQLabel( sv->viewport() ); sv->addChild( preview ); - TQPixmap pix( (int)d->getMeasurements().width( TQT_TQPAINTDEVICE(this) ), (int)d->getMeasurements().height( TQT_TQPAINTDEVICE(this) ) ); + TQPixmap pix( (int)d->getMeasurements().width( this ), (int)d->getMeasurements().height( this ) ); pix.fill( TQt::white ); preview->setPixmap( pix ); @@ -182,12 +182,12 @@ void PreviewDialog::selectAddress() void PreviewDialog::updatechanges() { - TQPixmap pix( (int)def->getMeasurements().width( TQT_TQPAINTDEVICE(this) ), (int)def->getMeasurements().height( TQT_TQPAINTDEVICE(this) ) ); + TQPixmap pix( (int)def->getMeasurements().width( this ), (int)def->getMeasurements().height( this ) ); pix.fill( TQt::white ); TQPainter painter( &pix ); - Label* l = new Label( def, file, m_filename, TQT_TQPAINTDEVICE(TDEApplication::desktop()), + Label* l = new Label( def, file, m_filename, TDEApplication::desktop(), customerId->currentText(), articleId->text(), groupName->text() ); l->setIndex( spinIndex->value() - 1 ); l->setSerial( serialStart->text(), serialInc->value() ); diff --git a/kbarcode/tcanvasitem.cpp b/kbarcode/tcanvasitem.cpp index 39a9b98..8259be2 100644 --- a/kbarcode/tcanvasitem.cpp +++ b/kbarcode/tcanvasitem.cpp @@ -96,8 +96,8 @@ void TCanvasItem::moveMM( int x, int y ) LabelUtils l; // the TQCanvasRectangle::move is done before the real move // as we get dancing TCanvasItems on the screen otherwise - 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() ); + TQCanvasRectangle::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() ); m_item->moveMM( x, y ); } } |