Skip to content

Commit

Permalink
Don't grab QWhatsThis background on Windows
Browse files Browse the repository at this point in the history
The workaround also is no longer needed on Windows so it can be removed
completely.

This patch amends 6a28b39.

Task-number: QTBUG-113556
Pick-to: 6.5
Change-Id: I69155e54da26acd49faf72816d1439fb3e322de9
Reviewed-by: Wladimir Leuschner <[email protected]>
Reviewed-by: Volker Hilsheimer <[email protected]>
  • Loading branch information
owolff authored and vohi committed May 16, 2023
1 parent 3cee2f1 commit 47e63d4
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/widgets/kernel/qwhatsthis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ class QWhatsThat : public QWidget
static QWhatsThat *instance;

protected:
#if defined(Q_OS_WIN)
void showEvent(QShowEvent *e) override;
#endif
void mousePressEvent(QMouseEvent*) override;
void mouseReleaseEvent(QMouseEvent*) override;
void mouseMoveEvent(QMouseEvent*) override;
Expand All @@ -125,9 +122,6 @@ class QWhatsThat : public QWidget
QString text;
QTextDocument* doc;
QString anchor;
#if defined(Q_OS_WIN)
QPixmap background;
#endif
};

QWhatsThat *QWhatsThat::instance = nullptr;
Expand Down Expand Up @@ -201,13 +195,6 @@ QWhatsThat::~QWhatsThat()
delete doc;
}

#if defined(Q_OS_WIN)
void QWhatsThat::showEvent(QShowEvent *)
{
background = QGuiApplication::primaryScreen()->grabWindow(0, x(), y(), width(), height());
}
#endif

void QWhatsThat::mousePressEvent(QMouseEvent* e)
{
pressed = true;
Expand Down Expand Up @@ -267,10 +254,6 @@ void QWhatsThat::paintEvent(QPaintEvent*)
if (drawShadow)
r.adjust(0, 0, -shadowWidth, -shadowWidth);
QPainter p(this);
#if defined(Q_OS_WIN)
// Needed due to supposed lack of support for NoSystemBackground on Windows
p.drawPixmap(0, 0, background);
#endif
p.setPen(QPen(palette().toolTipText(), 0));
p.setBrush(palette().toolTipBase());
p.drawRect(r);
Expand Down

0 comments on commit 47e63d4

Please sign in to comment.