QPrinter does not show my printer



  • 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?



  • 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.



  • add to pro
    QTPLUGIN += windowsprintersupport
    ...
    profit



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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.