Results 1 to 2 of 2

Thread: Qt5 Printing

  1. #1
    Join Date
    Jan 2009
    Location
    Midlands UK
    Posts
    62
    Thanks
    6
    Thanked 9 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt5 Printing

    Hi all,

    I'm porting over a number of working programs from Qt4 to Qt5 and got myself stuck with a printing problem.

    I've changed
    #include <QPrinter>
    to
    #include <QtPrintSupport/QPrinter>

    but the compiler is still throwing a lot of "undefined references to _imp___ZNK8QPrinter..." type errors.

    eg for
    printer.setOrientation(QPrinter::Landscape) ;
    I get
    undefined reference to `_imp___ZN8QPrinter14setOrientationENS_11Orientati onE'

    Is there another #include header needed in Qt5 from what would normally work in Qt5 ?
    If the solution is not simple can anybody point me to a simple Qt5 printing example ?


    Regards
    SteveH

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Qt5 Printing

    How about
    qmake Code:
    1. QT += printsupport
    To copy to clipboard, switch view to plain text mode 
    in the pro file?

  3. The following 3 users say thank you to Lykurg for this useful post:

    GrahamB (10th December 2016), K4ELO (22nd October 2013), SteveH (11th February 2013)

Similar Threads

  1. Printing Qt
    By IsoArska in forum Qt Programming
    Replies: 1
    Last Post: 16th January 2010, 12:10
  2. Qwt Printing
    By giusepped in forum Qwt
    Replies: 3
    Last Post: 12th December 2008, 08:25
  3. Printing to PDF
    By vermarajeev in forum Qt Programming
    Replies: 8
    Last Post: 11th December 2006, 03:25
  4. Re: Printing in Qt
    By Jimmy2775 in forum Newbie
    Replies: 3
    Last Post: 12th July 2006, 23:00
  5. Qt Printing on .ps
    By vratojr in forum Qt Programming
    Replies: 3
    Last Post: 18th February 2006, 23:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.