I am working on an application that uses the Qt library on Windows.
I want the user to be able to configure the printer where the application should print. So my main menu will contain the following entries:
- Printer Setup...: should show a dialog where the user can select and configure the printer
- Print...: perform the actual print
In other, non-Qt, applications I used the Windows function PrintDlg with the flag PD_PRINTSETUP. This showed the following dialog, which is exactly what I want:
However, the Qt function QPrintDialog uses the more recent PrintDlgEx function, which looks like this:
This dialog seems to be intended for actual printing. Not for setting and configuring the printer.
- It shows a Print button instead of simply OK.
- It contains a 'Page Range' group box, which isn't really useful when setting up the printer configuration.
The QPageSetupDialog isn't really useful in my case either. It looks like this: So this only makes it useful for setting the page size, the orientation and the margins.
Is there a clean way in Qt to get a decent printer configuration dialog?
If I can't find a clean way, I need to revert to the native Windows PrintDlg function, which means patching or duplicating the code in the Qt source qprintdialog_win.cpp.