Important: Please read the Qt Code of Conduct -

Build for iPhone simulator error for QPrinter and QPrintDialog

  • Is there a flag or define somewhere I need to set?

    The .pro file has:
    QT += printsupport

    The .h has the following includes:
    #include <QtPrintSupport>
    #include <QPrinter>
    #include <QPrintDialog>

    Compile Issues:
    /Users/PSI/Projects/Qt-Mobile/OT2Go/qCPP/clsUserRecord.cpp:1049: error: unknown type name 'QPrinter'
    QPrinter *printer = new QPrinter(QPrinter::HighResolution);
    unknown type name QPrinter

    Compile error messag:
    ** BUILD FAILED **

    The following build commands failed:
    CompileC /Users/PSI/Projects/Qt-Mobile/OT2Go/qCPP/clsUserRecord.cpp normal i386 c++
    (1 failure)
    make[1]: *** [iphonesimulator-debug] Error 65
    make: *** [debug-iphonesimulator] Error 2
    10:24:51: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project qMarks (kit: iphonesimulator-clang Qt 5.3 for iOS-1)
    When executing step "Make"

  • Lifetime Qt Champion


    I'm not sure that printing support is available on iOS (I may be wrong though)

  • Thx for the reply.

    Wonder why that would be? Lots of wireless printers..not like there needs to be a hard-wire connection.

    I guess I will try the QPdfWriter class...

Log in to reply