pre-calculate print preview factors

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-09-30 19:16:44 +03:00
parent 598e73bd34
commit cf904d5c64
3 changed files with 15 additions and 15 deletions

View file

@ -221,9 +221,9 @@ void QPrintPreviewDialogPrivate::init(QPrinter *_printer)
LineEdit *zoomEditor = new LineEdit;
zoomEditor->setValidator(new ZoomFactorValidator(1, 1000, 1, zoomEditor));
zoomFactor->setLineEdit(zoomEditor);
static const short factorsX2[] = { 25, 50, 100, 200, 250, 300, 400, 800, 1600 };
for (int i = 0; i < int(sizeof(factorsX2) / sizeof(factorsX2[0])); ++i)
zoomFactor->addItem(QPrintPreviewDialog::tr("%1%").arg(factorsX2[i] / 2.0));
static const qreal factorsTbl[] = { 12.5, 25.0, 50.0, 100.0, 125.0, 150.0, 200.0, 400.0, 800.0 };
for (int i = 0; i < int(sizeof(factorsTbl) / sizeof(factorsTbl[0])); ++i)
zoomFactor->addItem(QPrintPreviewDialog::tr("%1%").arg(factorsTbl[i]));
QObject::connect(zoomFactor->lineEdit(), SIGNAL(editingFinished()),
q, SLOT(_q_zoomFactorChanged()));
QObject::connect(zoomFactor, SIGNAL(currentIndexChanged(int)),

View file

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-09-17 02:15+0300\n"
"POT-Creation-Date: 2021-09-30 19:38+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -174,20 +174,20 @@ msgstr ""
msgid "No program defined"
msgstr ""
#: src/core/io/qprocess_unix.cpp:349
#: src/core/io/qprocess_unix.cpp:335
msgid "Could not open input redirection for reading"
msgstr ""
#: src/core/io/qprocess_unix.cpp:361
#: src/core/io/qprocess_unix.cpp:347
msgid "Could not open output redirection for writing"
msgstr ""
#: src/core/io/qprocess_unix.cpp:564
#: src/core/io/qprocess_unix.cpp:550
msgid "Resource error (fork failure): %1"
msgstr ""
#: src/core/io/qprocess_unix.cpp:801 src/core/io/qprocess_unix.cpp:849
#: src/core/io/qprocess_unix.cpp:919 src/core/io/qprocess_unix.cpp:981
#: src/core/io/qprocess_unix.cpp:788 src/core/io/qprocess_unix.cpp:836
#: src/core/io/qprocess_unix.cpp:906 src/core/io/qprocess_unix.cpp:968
msgid "Process operation timed out"
msgstr ""
@ -2173,7 +2173,7 @@ msgstr ""
msgid "Step &down"
msgstr ""
#: src/gui/kernel/qwidget.cpp:5080
#: src/gui/kernel/qwidget.cpp:5072
msgid "*"
msgstr ""
@ -4814,20 +4814,20 @@ msgstr ""
msgid "Operation on socket is not supported"
msgstr ""
#: src/network/socket/qlocalserver_unix.cpp:191
#: src/network/socket/qlocalserver_unix.cpp:187
msgid "%1: Permission denied"
msgstr ""
#: src/network/socket/qlocalserver_unix.cpp:199
#: src/network/socket/qlocalserver_unix.cpp:195
#: src/network/socket/qlocalserver.cpp:202
msgid "%1: Name error"
msgstr ""
#: src/network/socket/qlocalserver_unix.cpp:203
#: src/network/socket/qlocalserver_unix.cpp:199
msgid "%1: Address in use"
msgstr ""
#: src/network/socket/qlocalserver_unix.cpp:208
#: src/network/socket/qlocalserver_unix.cpp:204
#: src/network/socket/qlocalsocket_unix.cpp:141
msgid "%1: Unknown error %2"
msgstr ""

View file

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-09-17 02:15+0300\n"
"POT-Creation-Date: 2021-09-30 19:38+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"