diff options
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index ae674534e3..a4335e1f2d 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -5842,7 +5842,10 @@ QPixmap QWidgetEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint * pixmapOffset -= effectRect.topLeft(); - QPixmap pixmap(effectRect.size()); + const qreal dpr = context->painter->device()->devicePixelRatio(); + QPixmap pixmap(effectRect.size() * dpr); + pixmap.setDevicePixelRatio(dpr); + pixmap.fill(Qt::transparent); m_widget->render(&pixmap, pixmapOffset, QRegion(), QWidget::DrawChildren); return pixmap; @@ -9362,7 +9365,8 @@ void QWidget::tabletEvent(QTabletEvent *event) call the base class implementation if you do not act upon the key. The default implementation closes popup widgets if the user - presses Esc. Otherwise the event is ignored, so that the widget's + presses the key sequence for QKeySequence::Cancel (typically the + Escape key). Otherwise the event is ignored, so that the widget's parent can interpret it. Note that QKeyEvent starts with isAccepted() == true, so you do not @@ -9375,7 +9379,7 @@ void QWidget::tabletEvent(QTabletEvent *event) void QWidget::keyPressEvent(QKeyEvent *event) { - if ((windowType() == Qt::Popup) && event->key() == Qt::Key_Escape) { + if ((windowType() == Qt::Popup) && event->matches(QKeySequence::Cancel)) { event->accept(); close(); } else { |