Important: Please read the Qt Code of Conduct -

[SOLVED]What Module do I need to include in the .pro file to be able to use QPrinter and QPrintDialog?

  • I am trying to run the License Wizard Example that is located in this directory of the Qt SDK install: dialogs/licensewizard/licensewizard.cpp.

    The compiler is complaining with the following output:
    C:\Users\d\Desktop\pima qt\LicenseWizardExample\licensewizard.cpp:42: error: QPrinter: No such file or directory.

    I suspect that it is a module that i have not added to my .pro file so it is not finding the class.Here is my .pro file.

    Project created by QtCreator 2013-02-09T12:36:14


    QT += core gui

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = LicenseWizardExample
    TEMPLATE = app

    SOURCES +=

    HEADERS +=


    Any help?

  • Found it :I added
    QT += printsupport

    QPrinter was moved into qtprintsupport module in Qt5.

    Just in case somebody runs into the same problem.

  • thx, i got this error too

Log in to reply