Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    What is the preferred way to perform PrintScreen with Qt ?

    General and Desktop
    2
    4
    608
    Loading More Posts
    • 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.
    • A
      aabc last edited by

      What is the preferred way to perform PrintScreen with Qt ?

      1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        If you just need to print a widget, you can use "QWidget::render()":http://doc.qt.io/qt-5/qwidget.html#render together with "QPrinter":http://doc.qt.io/qt-5/qprinter.html.

        For screen shots of the whole screen, you need to use native APIs.

        (Z(:^

        1 Reply Last reply Reply Quote 0
        • A
          aabc last edited by

          Thanks sierdzio.
          And If I want to take a screenshot of a single window ?

          1 Reply Last reply Reply Quote 0
          • sierdzio
            sierdzio Moderators last edited by

            If it is a window from your app (Qt-based), and it inherits from QWidget, then my previous posts answers it. And if you mean a screen shot of any window - again, this is OS-specific. Not even OS, it depends on the windowing system.

            (Z(:^

            1 Reply Last reply Reply Quote 0
            • First post
              Last post