summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktop-widgets/printdialog.cpp1
-rw-r--r--desktop-widgets/printoptions.cpp4
-rw-r--r--desktop-widgets/printoptions.h1
-rw-r--r--desktop-widgets/printoptions.ui30
4 files changed, 35 insertions, 1 deletions
diff --git a/desktop-widgets/printdialog.cpp b/desktop-widgets/printdialog.cpp
index f0c8f4df8..339914b6a 100644
--- a/desktop-widgets/printdialog.cpp
+++ b/desktop-widgets/printdialog.cpp
@@ -171,6 +171,7 @@ void PrintDialog::createPrinterObj()
// create a new printer object
if (!printer) {
qprinter = new QPrinter();
+ qprinter->setResolution(printOptions.resolution);
qprinter->setOrientation((QPrinter::Orientation)printOptions.landscape);
printer = new Printer(qprinter, &printOptions, &templateOptions, Printer::PRINT);
}
diff --git a/desktop-widgets/printoptions.cpp b/desktop-widgets/printoptions.cpp
index 0d9ae0a40..fbd03c127 100644
--- a/desktop-widgets/printoptions.cpp
+++ b/desktop-widgets/printoptions.cpp
@@ -44,7 +44,9 @@ void PrintOptions::setup()
connect(ui.printInColor, SIGNAL(clicked(bool)), this, SLOT(printInColorClicked(bool)));
connect(ui.printSelected, SIGNAL(clicked(bool)), this, SLOT(printSelectedClicked(bool)));
-
+ connect(ui.resolution, QOverload<int>::of(&QSpinBox::valueChanged), [this](int value) {
+ printOptions->resolution = value;
+ });
hasSetupSlots = true;
}
diff --git a/desktop-widgets/printoptions.h b/desktop-widgets/printoptions.h
index 0290f1a3e..35fb824fe 100644
--- a/desktop-widgets/printoptions.h
+++ b/desktop-widgets/printoptions.h
@@ -15,6 +15,7 @@ struct print_options {
bool print_selected;
bool color_selected;
bool landscape;
+ int resolution;
};
struct template_options {
diff --git a/desktop-widgets/printoptions.ui b/desktop-widgets/printoptions.ui
index 1c2523d39..f12236552 100644
--- a/desktop-widgets/printoptions.ui
+++ b/desktop-widgets/printoptions.ui
@@ -93,6 +93,36 @@
</property>
</widget>
</item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QSpinBox" name="resolution">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximum">
+ <number>4000</number>
+ </property>
+ <property name="singleStep">
+ <number>10</number>
+ </property>
+ <property name="value">
+ <number>600</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>DPI resolution</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
</item>