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. What is the preferred way to perform PrintScreen with Qt ?
QtWS25 Last Chance

What is the preferred way to perform PrintScreen with Qt ?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 774 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.
  • A Offline
    A Offline
    aabc
    wrote on last edited by
    #1

    What is the preferred way to perform PrintScreen with Qt ?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      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
      0
      • A Offline
        A Offline
        aabc
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          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
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved