Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

QcPenPrinter: no need to allocate QPrintDialog on heap

  • Loading branch information...
commit 9e6e6daaa0196a4e4a6d94404174987f30972174 1 parent 91a2cdb
Jonatan Liljedahl lijon authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 QtCollider/widgets/QcPenPrinter.h
9 QtCollider/widgets/QcPenPrinter.h
View
@@ -59,20 +59,19 @@ class QcPenPrinter : public QObject
private Q_SLOTS:
void show() {
- QPrintDialog *dialog = new QPrintDialog(&printer);
+ QPrintDialog dialog(&printer);
- dialog->setWindowTitle( QString("Print Document") );
- dialog->setOptions (
+ dialog.setWindowTitle( QString("Print Document") );
+ dialog.setOptions (
QAbstractPrintDialog::PrintToFile |
QAbstractPrintDialog::PrintPageRange |
QAbstractPrintDialog::PrintShowPageSize
);
- if (dialog->exec() != QDialog::Accepted) {
+ if (dialog.exec() != QDialog::Accepted) {
Q_EMIT( cancel() );
} else {
Q_EMIT( ok() );
}
- delete dialog;
}
void print() {
Please sign in to comment.
Something went wrong with that request. Please try again.