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. QPrinter does not show my printer
Forum Updated to NodeBB v4.3 + New Features

QPrinter does not show my printer

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 2.4k 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.
  • T Offline
    T Offline
    Trino
    wrote on last edited by
    #1

    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
    0
    • T Offline
      T Offline
      Trino
      wrote on last edited by
      #2

      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
      0
      • N Offline
        N Offline
        needle00
        wrote on last edited by
        #3

        add to pro
        QTPLUGIN += windowsprintersupport
        ...
        profit

        1 Reply Last reply
        0
        • H Offline
          H Offline
          Hareen Laks
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • P Offline
            P Offline
            piterwalton
            Banned
            wrote on last edited by
            #5
            This post is deleted!
            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