From ef68988794211777e37a4b20d7143e4a31ce78c5 Mon Sep 17 00:00:00 2001 From: konrad Date: Tue, 25 Mar 2008 21:27:32 +0000 Subject: [PATCH] use printer object in label dialog git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@143 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- src/labeldlg.cpp | 6 +++--- src/labeldlg.h | 7 ++++--- src/orderwin.cpp | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/labeldlg.cpp b/src/labeldlg.cpp index a97dc20..13bc6dc 100644 --- a/src/labeldlg.cpp +++ b/src/labeldlg.cpp @@ -25,10 +25,10 @@ #define ROWS 20 #define COLS 20 -MLabelDialog::MLabelDialog(QWidget*par,QString pn,int nl) +MLabelDialog::MLabelDialog(QWidget*par,QPrinter* pn,int nl) :QDialog(par) { - printername=pn; + printer=pn; numlabels=nl; setWindowTitle(tr("Label Printing Setup")); @@ -88,4 +88,4 @@ MLabelDialog::MLabelDialog(QWidget*par,QString pn,int nl) } MLabelDialog::~MLabelDialog(){} -QPointF MLabelDialog::labelOffset(int n,QPaintDevice*){} +QPointF MLabelDialog::labelOffset(int n){} diff --git a/src/labeldlg.h b/src/labeldlg.h index e734362..48113b5 100644 --- a/src/labeldlg.h +++ b/src/labeldlg.h @@ -21,24 +21,25 @@ class QPaintDevice; class QCheckBox; class QComboBox; class QLineEdit; +class QPrinter; class MLabelDialog:public QDialog { Q_OBJECT public: /**creates a label dialog*/ - MLabelDialog(QWidget*parent,QString printername,int numlabels); + MLabelDialog(QWidget*parent,QPrinter*printer,int numlabels); /**deletes the label dialog and stores its current settings*/ ~MLabelDialog(); /**returns the offset of label number n; relative to the coordinate system of the given paint device*/ - QPointF labelOffset(int n,QPaintDevice*); + QPointF labelOffset(int n); private: QLineEdit *offx,*offy,*sizex,*sizey; QComboBox *metric,*page; QListchecks; QList >checked; - QString printername; + QPrinter* printer; int numlabels; }; diff --git a/src/orderwin.cpp b/src/orderwin.cpp index bab6c8d..3b0232f 100644 --- a/src/orderwin.cpp +++ b/src/orderwin.cpp @@ -173,7 +173,7 @@ void MOrderWindow::printTickets(QList tickets) QPrintDialog pd(&printer,this); if(pd.exec()!=QDialog::Accepted)return; //TODO: insert label arrangement - MLabelDialog ld(this,printer.printerName(),tickets.size()); + MLabelDialog ld(this,&printer,tickets.size()); if(ld.exec()!=QDialog::Accepted) return; //TODO: fix to use correct template -- 1.7.2.5