#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"));
}
MLabelDialog::~MLabelDialog(){}
-QPointF MLabelDialog::labelOffset(int n,QPaintDevice*){}
+QPointF MLabelDialog::labelOffset(int n){}
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;
QList<QCheckBox*>checks;
QList<QList<bool> >checked;
- QString printername;
+ QPrinter* printer;
int numlabels;
};
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