[Marble-commits] KDE/kdeedu/marble/src
Jens-Michael Hoffmann
jensmh at gmx.de
Mon Jan 11 07:26:21 CET 2010
SVN commit 1072846 by jmhoffmann:
krazy fix: use QPointer when showing modal dialogs via exec(), as discussed in http://www.kdedevelopers.org/node/3919
M +7 -4 marble_part.cpp
--- trunk/KDE/kdeedu/marble/src/marble_part.cpp #1072845:1072846
@@ -16,6 +16,7 @@
// Qt
#include <QtCore/QDir>
+#include <QtCore/QPointer>
#include <QtCore/QStringList>
#include <QtCore/QTimer>
#include <QtGui/QClipboard>
@@ -252,15 +253,17 @@
#endif
}
+// QPointer is used because of issues described in http://www.kdedevelopers.org/node/3919
void MarblePart::printPreview()
{
#ifndef QT_NO_PRINTER
QPrinter printer( QPrinter::HighResolution );
- QPrintPreviewDialog preview( &printer, widget() );
- preview.setWindowFlags ( Qt::Window );
- connect( &preview, SIGNAL( paintRequested( QPrinter * ) ), SLOT( paintPrintPreview( QPrinter * ) ) );
- preview.exec();
+ QPointer<QPrintPreviewDialog> preview = new QPrintPreviewDialog( &printer, widget() );
+ preview->setWindowFlags( Qt::Window );
+ connect( preview, SIGNAL( paintRequested( QPrinter * ) ), SLOT( paintPrintPreview( QPrinter * ) ) );
+ preview->exec();
+ delete preview;
#endif
}
More information about the Marble-commits
mailing list