diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2016-01-07 19:33:58 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-01-08 08:04:58 -0800 |
commit | 19dee335e457433e9a3f215e35a60e282a383a11 (patch) | |
tree | 2b4586bff6d4f9d344fb88a83e74ed64a6f71c50 /desktop-widgets/printdialog.h | |
parent | 25aa80846b84c0b3cd3e0b0256a046e1e92fb1db (diff) | |
download | subsurface-19dee335e457433e9a3f215e35a60e282a383a11.tar.gz |
Lazy Initialize QPrinter
it was taking 3 - 4 secs here to open the print dialog,
first I tought it was a bug in our side, but it looks like
it's a Qt bug, and by lazy initializing it we don't actually
solve this, since it will still take 3 - 4 secs for the printer
to start, but the dialog will appear much quicker.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/printdialog.h')
-rw-r--r-- | desktop-widgets/printdialog.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/desktop-widgets/printdialog.h b/desktop-widgets/printdialog.h index a00c4c5d9..c615744e8 100644 --- a/desktop-widgets/printdialog.h +++ b/desktop-widgets/printdialog.h @@ -18,12 +18,13 @@ class PrintDialog : public QDialog { public: explicit PrintDialog(QWidget *parent = 0, Qt::WindowFlags f = 0); + virtual ~PrintDialog(); private: PrintOptions *optionsWidget; QProgressBar *progressBar; Printer *printer; - QPrinter qprinter; + QPrinter *qprinter; struct print_options printOptions; struct template_options templateOptions; @@ -33,6 +34,7 @@ slots: void previewClicked(); void printClicked(); void onPaintRequested(QPrinter *); + void createPrinterObj(); }; #endif #endif // PRINTDIALOG_H |