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. How to turn a QTableView to a pdf
Qt 6.11 is out! See what's new in the release blog

How to turn a QTableView to a pdf

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 7.2k 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.
  • K Offline
    K Offline
    karim24
    wrote on last edited by
    #1

    hi,
    lets say i added QTableView named table
    in the designer ,so how do i turn it to a pdf
    i know that there is QPianter involved
    but i just can't figure out how to do it

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      You write code to paint the data from the model underlying the table view to a QPrinter set to output PDF. How you access the data and format it is entirely up to you. Alternatively you can print an image of the widget on screen (a very different thing to the data in the table).
      "Printing with Qt (Qt4)":http://qt-project.org/doc/qt-4.8/printing.html
      "Qt Print Support (Qt5)":http://qt-project.org/doc/qt-5.1/qtprintsupport/qtprintsupport-index.html

      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