[Uml-devel] KDE/kdesdk/umbrello/umbrello
Ralf Habacker
ralf.habacker at gmail.com
Tue Nov 29 17:28:23 UTC 2011
SVN commit 1266451 by habacker:
Patch from Ralf Habacker: For each printing a new QPrinter instance is used, which makes it impossible to reuse changed printer settings. This is fixed now
M +6 -6 uml.cpp
M +1 -1 uml.h
--- trunk/KDE/kdesdk/umbrello/umbrello/uml.cpp #1266450:1266451
@@ -138,6 +138,8 @@
m_doc = new UMLDoc();
m_doc->init();
m_hasBegunMacro = false;
+ m_printer = new QPrinter;
+ m_printer->setFullPage(true);
readOptionState();
initActions();
@@ -192,6 +194,7 @@
delete m_copyTimer;
delete m_refactoringAssist;
delete m_pUndoStack;
+ delete m_printer;
}
/**
@@ -1268,12 +1271,9 @@
*/
void UMLApp::slotPrintPreview()
{
- QPrinter printer;
- printer.setFullPage(true);
-
slotStatusMsg(i18n("Print Preview..."));
- QPrintPreviewDialog *preview = new QPrintPreviewDialog(&printer,this);
+ QPrintPreviewDialog *preview = new QPrintPreviewDialog(m_printer,this);
connect(preview, SIGNAL(paintRequested(QPrinter *)), this, SLOT(slotPrintPreviewPaintRequested(QPrinter *)));
preview->exec();
}
@@ -1300,11 +1300,11 @@
DiagramPrintPage * selectPage = new DiagramPrintPage(0, m_doc);
QPrintDialog *printDialog =
- KdePrint::createPrintDialog(&printer, QList<QWidget*>() << selectPage, this);
+ KdePrint::createPrintDialog(m_printer, QList<QWidget*>() << selectPage, this);
printDialog->setWindowTitle(i18n("Print %1", m_doc->url().prettyUrl()));
if (printDialog->exec()) {
- m_doc->print(&printer, selectPage);
+ m_doc->print(m_printer, selectPage);
}
delete printDialog;
resetStatusMsg();
--- trunk/KDE/kdesdk/umbrello/umbrello/uml.h #1266450:1266451
@@ -414,7 +414,7 @@
StatusBarToolButton* m_pZoomFullSBTB;
QSlider* m_pZoomSlider;
QLabel* m_statusBarMessage;
-
+ QPrinter *m_printer;
/**
* The running XHTML documentation generator. Null when no generation is running.
*/
More information about the umbrello-devel
mailing list