Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.8.5, 5.1.0
-
Windows
-
9927c1a2bbb372d0e557c58062e4ecda7a644aa1. (Qt 5.2RC)
Description
Opening QPrintDialog with CurrentPage range default doesn't work on Windows at all. Other ranges works fine. Looking in to qprintdialog_win.cpp we can see that CurrentPage implementation is totally missing. Is there some special reason for that?
Here is one kind of patch code that fixed the missing feature:
Qt4: src\gui\dialogs\qprintdialog_win.cpp:123
Qt5: qtbase\src\printsupport\dialogs\qprintdialog_win.cpp:118
else if (pdlg->printRange() == QPrintDialog::CurrentPage && pdlg->isOptionEnabled(QPrintDialog::PrintCurrentPage)) pd->Flags |= PD_CURRENTPAGE;
PrintCurrentPage option can be checked like above or maybe patch should enabled option if currentPage range is set? Otherwise CurrentPage is set but disabled.
Test code:
#include <QApplication> #include <QPrintDialog> #include <QPrinter> int main(int argc, char *argv[]) { QApplication a(argc, argv); QPrinter printer; QPrintDialog printDialog(&printer); printDialog.setOption(QAbstractPrintDialog::PrintCurrentPage, true); printDialog.setPrintRange(QAbstractPrintDialog::CurrentPage); printDialog.exec(); return a.exec(); }
Someone could make decision with this and add to release.