PDA

View Full Version : How to hide these two "properties" and "find printer..." push button in the Printer d



cyberpunker1
30th March 2017, 04:43
The QT's QPrintDialog class does not provide interface to control these two push button .

I read the Qt5PrintSupport lib source , can't find the dialog design based on the windows platform while the linux vesion may be could .

Is there any method ? Thanks

high_flyer
1st April 2017, 22:13
Putting aside that it is a very odd requirement (why would you want to not allow the user to find a printer?), I think modifying Qt code is a bad idea as it wont scale to future versions - even if you did find the right place for it.
In addition, for Mac and Windows the native dialogs are used so you can't change them directly anyhow.
I think your best bet is to implement the dialog your self, it should be rather easy to build a UI on top of the QPrinter utility classes:
QPrintEngine QPrinter QPrinterInfo QPrintPreviewDialog QPrintPreviewWidget.