diff options
author | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2022-04-20 13:50:17 +0300 |
---|---|---|
committer | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2022-04-21 06:18:30 +0000 |
commit | a24b9567929f5f38cefea77c6f2d05d7a54d7986 (patch) | |
tree | 997982578c46c4432a7be36273ea048b96f3b105 /src/libs/installer/aspectratiolabel.h | |
parent | f983a4f2f447b27e233211814884b8d0d6bfc126 (diff) |
AspectRatioLabel: prevent setting non-scaled pixmaps
The function signature for setting a pixmap for the label changed
from 'setPixmap(const QPixmap &pixmap)' to
'setPixmapAndUrl(const QPixmap &pixmap, const QString &url)' when
we enabled support for click URLs.
Redefine (again) the base class QLabel::setPixmap() slot to make
it harder for callers to set non-scaled pixmaps accidentally. This
is still a bit bad however as it is possible to get different
client-visible results by calling the method with a base class
pointer.
Task-number: QTIFW-2612
Change-Id: Ic79b3d71ffd5baf2108768ad3b867ddbcb33833b
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs/installer/aspectratiolabel.h')
-rw-r--r-- | src/libs/installer/aspectratiolabel.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libs/installer/aspectratiolabel.h b/src/libs/installer/aspectratiolabel.h index 5ce9593fa..bbe54d3a1 100644 --- a/src/libs/installer/aspectratiolabel.h +++ b/src/libs/installer/aspectratiolabel.h @@ -48,7 +48,8 @@ public: QSize sizeHint() const override; public slots: - void setPixmapAndUrl (const QPixmap &pixmap, const QString &url = QString()); + void setPixmap(const QPixmap &pixmap); + void setPixmapAndUrl (const QPixmap &pixmap, const QString &url); void resizeEvent(QResizeEvent *event) override; protected: |