Qt Forum

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

    Update: Forum Guidelines & Code of Conduct

    Unsolved Get Screenshot on MacOS

    General and Desktop
    2
    2
    259
    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.
    • UndeadBlow
      UndeadBlow last edited by UndeadBlow

      Hello.
      I need to get screenshot of specific window on MaxOS.
      With Windows it looks like:

      HWND h = FindWindow(NULL, TEXT("title"));
      if (h != NULL) {
        QPixmap pix = QPixmap::grabWindow((WId)(h));
        qDebug() << pix.size();
        ui->label->setPixmap(pix);
      }
      

      But is the same task possible on MacOS?

      beecksche 1 Reply Last reply Reply Quote 0
      • beecksche
        beecksche @UndeadBlow last edited by

        Hi @UndeadBlow,
        maybe this helps: http://doc.qt.io/qt-5/qtwidgets-desktop-screenshot-example.html

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