Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Suggestion for capturing screen in full screen mode.
Qt 6.12 LTS is out! See what's new in the release blog

Suggestion for capturing screen in full screen mode.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 769 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.
  • R Offline
    R Offline
    rakhijain
    wrote on last edited by
    #1

    We need the suggestion for capturing screen in full screen mode.

    Following are the requirement we are trying to achieve :

    1. Application shall be in full screen mode – with no title bar. As it is full screen mode Windows task bar shall be not directly accessible.

    2. We need to capture the full screen mode screen as screenshot in one of the directory.
      We are using following code but actual screen is not captured. Instead, it captures white screen.

      QScreen *screen = QGuiApplication::primaryScreen();
              QPixmap pixMap = screen->grabWindow(0, 0,0,1920,1080);
      
      qDebug() << "Writing image to " << filename;
      
      QImage snapshot = pixMap.toImage();
      snapshot.save(“C:\\test, nullptr, 100);
      

    In Maximized mode it is working.

    Any pointers for the same will be great help.

    1 Reply Last reply
    0
    • fcarneyF Offline
      fcarneyF Offline
      fcarney
      wrote on last edited by
      #2

      http://doc.qt.io/qt-5/qscreen.html#grabWindow
      Using a magic number of 0 for the WID is probably not a good idea. I would use the QWidget::winId function to get the ID.

      Is this a QWidget? You could use grab from that to get a pixmap as well.

      C++ is a perfectly valid school of magic.

      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
      • Unsolved