Results 1 to 4 of 4

Thread: Printing from QtQuick.Controls

  1. #1
    Join Date
    Jun 2013
    Location
    Dresden - Germany
    Posts
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default Printing from QtQuick.Controls

    Hello,

    I came up with the idea to work with QtQuick Controls, because I know QML very well from Nokia and Jolla app dvelopment and like to work with latest standards.

    But now I've seen there is no print dialog and also no way to render() QtQuick elements. So my question is: how to reorganise some data and print it? I had just the idea to add all the QWidgets stuff, transfer the data in one/some Widgets and print them in a classic way.

    Anyone with a better solution?

    AlphaX2

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Printing from QtQuick.Controls

    Yes, there is no print dialog yet for QtQuick.Controls.

    For now you have to call a method or slot on an exposed C++ object and let it handle the widget based dialog.

    Not sure why you would want to render controls onto a printer though, you wouldn't do that with widget's either.

    Cheers,
    _

  3. #3
    Join Date
    Apr 2011
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Printing from QtQuick.Controls

    Well I would like to print some hires QtQuick output to a printer, because QtQuick can do some nice rendering in an easy way. QtWebkit has gone away (Qt-5.6) and QWebengine is all asynchronous, so you never know, when the rendering is finished (only the DOM loading, which happens some undefined time before the rendering finishes).

    Rendering QtQuick at a custom resolution into something invisible, which can render itself into a QPainter or can give me a QImage would be great!

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Printing from QtQuick.Controls

    You could try using a QQuickWidget to load the scene and using its render() method to draw into a painter.
    Or QQuickWindow::grabWindow() to get an image of the window's content.
    Or QQuickWindow::setRenderTarget() to render into a frame buffer object and converting that to an image.

    Cheers,
    _

Similar Threads

  1. Replies: 3
    Last Post: 6th March 2014, 11:09
  2. MenuBar QML QtQuick.Controls 1.0
    By TheIndependentAquarius in forum Qt Quick
    Replies: 2
    Last Post: 24th December 2013, 12:12
  3. Replies: 0
    Last Post: 29th April 2013, 12:47
  4. QtQuick 2.1
    By shadowroot in forum Qt Quick
    Replies: 1
    Last Post: 6th April 2013, 09:44
  5. Hiding controls changes spacing of other controls
    By MrGarbage in forum Qt Programming
    Replies: 1
    Last Post: 18th December 2007, 21:47

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.