diff options
author | Lukáš Lalinský <lalinsky@gmail.com> | 2009-07-10 11:42:25 +0200 |
---|---|---|
committer | Lukáš Lalinský <lalinsky@gmail.com> | 2009-07-10 11:42:25 +0200 |
commit | 90f574f945d1efc5864f2c337bb24070793a24a4 (patch) | |
tree | 8de7e4089f583d6070c30ba2f0fa81c450e8f591 /src | |
parent | 3fd2b2342f7fe84d5e9338473293819d663941c3 (diff) | |
download | dbmodel-90f574f945d1efc5864f2c337bb24070793a24a4.tar.xz |
Page setup
Diffstat (limited to 'src')
-rw-r--r-- | src/mainwindow.cpp | 16 | ||||
-rw-r--r-- | src/mainwindow.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 1eb136e..451e94a 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -28,6 +28,7 @@ #include <QPrinter> #include <QPrintDialog> #include <QPrintPreviewDialog> +#include <QPageSetupDialog> #include <QMessageBox> #include <QDebug> #include <QDockWidget> @@ -59,6 +60,7 @@ public: QAction *printAction; QAction *printPreviewAction; + QAction *pageSetupAction; QActionGroup *notationActionGroup; QMenu *notationMenu; @@ -226,6 +228,10 @@ MainWindow::setupActions() m_actionExportPNG->setText(tr("E&xport...")); connect(m_actionExportPNG, SIGNAL(triggered(bool)), SLOT(exportDocument())); + d->pageSetupAction = new QAction(this); + d->pageSetupAction->setText(tr("Page Set&up...")); + connect(d->pageSetupAction, SIGNAL(triggered(bool)), SLOT(pageSetup())); + d->printAction = new QAction(this); d->printAction->setText(tr("&Print...")); d->printAction->setIcon(loadIcon("document-print")); @@ -398,6 +404,7 @@ MainWindow::setupMenuBar() menu->addAction(m_actionExportPNG); menu->addSeparator(); + menu->addAction(d->pageSetupAction); menu->addAction(d->printPreviewAction); menu->addAction(d->printAction); m_actionRecentFilesSeparator = menu->addSeparator(); @@ -535,6 +542,7 @@ MainWindow::print() void MainWindow::printPreview() { + initPrinter(); QPrintPreviewDialog printPreviewDialog(d->printer, this); connect(&printPreviewDialog, SIGNAL(paintRequested(QPrinter*)), SLOT(printPreview(QPrinter*))); @@ -551,6 +559,14 @@ MainWindow::printPreview(QPrinter *printer) } void +MainWindow::pageSetup() +{ + initPrinter(); + QPageSetupDialog pageSetupDialog(d->printer, this); + pageSetupDialog.exec(); +} + +void MainWindow::newModel(DiagramDocument *newModel) { if (!newModel) { diff --git a/src/mainwindow.h b/src/mainwindow.h index 7a77b8e..a1b7723 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -56,6 +56,7 @@ public slots: bool saveAs(); void exportDocument(); void print(); + void pageSetup(); void printPreview(); void printPreview(QPrinter *); void setViewScale(const QString &scale); |