diff options
author | Katja Marttila <katja.marttila@qt.io> | 2021-10-26 08:50:07 +0300 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2022-03-21 17:08:39 +0200 |
commit | 6ec6ac70d98195bb41a5ed60e47984bc640066fc (patch) | |
tree | 28e937e933a18479a9d114aa989d20d5083f7aaa /src/libs/installer/aspectratiolabel.h | |
parent | a47cad8ed9e7e0c5ecd4a67c9603332d72228a7c (diff) |
Add click option for product image
Product image can now be clicked. It opens either url in Web browser or
if file reference is given, then it will be opened with the suitable
application.
Task-number: QTIFW-2361
Change-Id: I59ed1355e90c23c8d0a5124779725825ca1ee2c8
Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'src/libs/installer/aspectratiolabel.h')
-rw-r--r-- | src/libs/installer/aspectratiolabel.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libs/installer/aspectratiolabel.h b/src/libs/installer/aspectratiolabel.h index 82ce0ebbd..5ce9593fa 100644 --- a/src/libs/installer/aspectratiolabel.h +++ b/src/libs/installer/aspectratiolabel.h @@ -48,14 +48,20 @@ public: QSize sizeHint() const override; public slots: - void setPixmap (const QPixmap &pixmap); + void setPixmapAndUrl (const QPixmap &pixmap, const QString &url = QString()); void resizeEvent(QResizeEvent *event) override; +protected: + void mousePressEvent(QMouseEvent* event) override; + bool event(QEvent *e) override; + private: QPixmap scaledPixmap() const; private: QPixmap m_pixmap; + QString m_clickableUrl; + bool m_discardMousePress; }; } // namespace QInstaller |