Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED]What Module do I need to include in the .pro file to be able to use QPrinter and QPrintDialog?
Qt 6.11 is out! See what's new in the release blog

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

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 6.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • musimbateM Offline
    musimbateM Offline
    musimbate
    wrote on last edited by
    #1

    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 +=
    main.cpp
    licensewizard.cpp

    HEADERS +=
    licensewizard.h

    RESOURCES +=
    licensewizard.qrc
    @

    Any help?

    Why join the navy if you can be a pirate?-Steve Jobs

    1 Reply Last reply
    0
    • musimbateM Offline
      musimbateM Offline
      musimbate
      wrote on last edited by
      #2

      Found it :I added
      @
      QT += printsupport
      @

      QPrinter was moved into qtprintsupport module in Qt5.

      Just in case somebody runs into the same problem.

      Why join the navy if you can be a pirate?-Steve Jobs

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andy65007
        wrote on last edited by
        #3

        thx, i got this error too

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved