Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    QPrinter does not show my printer

    General and Desktop
    4
    5
    2029
    Loading More Posts
    • 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.
    • T
      Trino last edited by

      Hello,

      The QPrinter class does not show my printer. Instead, it says "Print to file (PDF)" instead of the printername.
      Also, I can not change/select a printer.

      I use the following code:

      @ QPrinter print(QPrinter::HighResolution);

      print.setOutputFormat(QPrinter::NativeFormat);
      print.setPageSize(QPrinter::A4);
      print.setOrientation(QPrinter::Landscape);
      print.setCreator(PROGRAM_NAME);

      QPrintDialog printerdialog(&print, this);
      printerdialog.setWindowTitle("Print");

      if(printerdialog.exec()==QDialog::Accepted)
      {
      etc.
      @

      I'm using openSUSE 12.2 with KDE. CUPS is installed, also the development files for CUPS.
      I configured Qt with the option "-cups". The output of ./configure stated that CUPS is enabled.
      Cups management on my pc works. Printing with other applications (Kate, LinbreOffice, Gimp) works fine.

      Any idea's?

      1 Reply Last reply Reply Quote 0
      • T
        Trino last edited by

        I found the cause, it's a bug in Qt 5.0.1 that occurs only when you build the static libs of Qt.

        So, building Qt static, breaks QPrinter.

        1 Reply Last reply Reply Quote 0
        • N
          needle00 last edited by

          add to pro
          QTPLUGIN += windowsprintersupport
          ...
          profit

          1 Reply Last reply Reply Quote 0
          • H
            Hareen Laks last edited by

            Hi Trinco, please edit the title as solved. :)

            1 Reply Last reply Reply Quote 0
            • P
              piterwalton Banned last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • First post
                Last post