Home > Blockchain >  Qt QML QQuick Application Print Dialog needs a pointer to parent widget
Qt QML QQuick Application Print Dialog needs a pointer to parent widget

Time:12-11

Opening a QPrintDialog needs a pointer to parent widget but:
I have a QQuickApplication that is based on QGuiApplication that is QCoreApplication extend for non Widget apps.
My app window cannot be interpreted as a Widget. so is there any way?
I wonder why there is no QML type of this facility!

Thanks in advance

CodePudding user response:

Note that the signature is

QPrintDialog(QPrinter *printer, QWidget *parent = nullptr);

indicating that the parent argument is optional. So

QPrintDialog myPrintDialog(myPrinter);

is totally fine.

  • Related