diff options
| author | Elvis Angelaccio <[email protected]> | 2020-10-14 23:46:40 +0200 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2020-10-15 01:22:00 +0200 |
| commit | de6933617868df265f4a6534c764d8b9f7a0825c (patch) | |
| tree | bcf19f0a88173fbb17474922293e70bce951133c | |
| parent | a403df91b7a4f794f95604a28a56644d4c06ab58 (diff) | |
Port to non-deprecated QLabel::pixmap()
Quoting from:
https://github.com/qt/qtbase/commit/714409b23ce5ec33e56adce5ba1966aad67c3b34
```
The QLabel changes to the pixmap/picture getters provide the following
migration path:
QPixmap *ppix = l->pixmap(); // up to 5.15, warns in 5.15
QPixmap pval = l->pixmap(Qt::ReturnByValue); // new in 5.15, works in 6
QPixmap pixmap = l->pixmap(); // from Qt 6 on
```
Since we can't require 5.15 yet in dolphin, the port is done only when
building with Qt >= 5.15
| -rw-r--r-- | src/views/tooltips/dolphinfilemetadatawidget.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/views/tooltips/dolphinfilemetadatawidget.cpp b/src/views/tooltips/dolphinfilemetadatawidget.cpp index fdbf19ccd..b147135bf 100644 --- a/src/views/tooltips/dolphinfilemetadatawidget.cpp +++ b/src/views/tooltips/dolphinfilemetadatawidget.cpp @@ -81,9 +81,16 @@ void DolphinFileMetaDataWidget::setPreview(const QPixmap& pixmap) QPixmap DolphinFileMetaDataWidget::preview() const { +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) if (m_preview->pixmap()) { return *m_preview->pixmap(); } +#else + if (!m_preview->pixmap(Qt::ReturnByValue).isNull()) { + return m_preview->pixmap(Qt::ReturnByValue); + } +#endif + return QPixmap(); } |
