Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-34538

"Pick Screen Color" button in QColorDialog doesn't scan screen colors outside the dialog boundaries in Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.4.1
    • 5.2.0 Beta1
    • None
    • Tested in Windows 7 and Windows XP
    • 38a3158d2fe32dc55c6b6286fac58f782571294a

    Description

      The "Pick Screen Color" button in QColorDialog permits scanning the colors of the entire screen to pick one of them. In Linux it works OK, but in Windows it only scans the area of the dialog itself and therefore it becomes rather useless.

      Clarification: Picking a color outside the dialog works, but the color is not updated while moving the cursor on Windows.

      I'm the author of that button, but I don't have any Windows development machine to make the changes and test them.

      The error probably lies in this method:

      QColor QColorDialogPrivate::grabScreenColor(const QPoint &p)
      {
      const QDesktopWidget *desktop = QApplication::desktop();
      const QPixmap pixmap = QGuiApplication::screens().at(desktop->screenNumber())>grabWindow(desktop>winId(),
      p.x(), p.y(), 1, 1);

      QImage i = pixmap.toImage();
      return i.pixel(0, 0);
      }

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-34538
          # Subject Branch Project Status CR V

          Activity

            People

              iamsergio Sergio Martins
              dgilo David Gil
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes