Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Print QML elements

Print QML elements

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 2.6k Views
  • 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.
  • M Offline
    M Offline
    merajc
    wrote on last edited by
    #1

    Hello

    I am generating a ListModel from a table in my database for my QML UI, and I print it out (physically and PDF) with QTextDocument by placing all values in an HTML table and then calling the print function of the QTextDocument. This works perfectly.

    I wanted to print out the bar and pie charts I make in QML, based on the ListModel, but I'm not sure how I'd bring the QML element to a QPainter or anything that allows me to print it out.

    Please do advise.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mbrasser
      wrote on last edited by
      #2

      Are you using QtQuick 1.x? If so, I'd recommend looking at "QGraphicsView::render()":http://doc.qt.nokia.com/4.7-snapshot/qgraphicsview.html#render as one possible solution. Calling the "paint()":http://doc.qt.nokia.com/4.7-snapshot/qgraphicsitem.html#paint function of the item directly might also be an option.

      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