mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
Port to non-deprecated QLabel::pixmap()
Quoting from:
714409b23c
```
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
This commit is contained in:
parent
a403df91b7
commit
de69336178
|
@ -81,9 +81,16 @@ void DolphinFileMetaDataWidget::setPreview(const QPixmap& pixmap)
|
||||||
|
|
||||||
QPixmap DolphinFileMetaDataWidget::preview() const
|
QPixmap DolphinFileMetaDataWidget::preview() const
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
||||||
if (m_preview->pixmap()) {
|
if (m_preview->pixmap()) {
|
||||||
return *m_preview->pixmap();
|
return *m_preview->pixmap();
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
if (!m_preview->pixmap(Qt::ReturnByValue).isNull()) {
|
||||||
|
return m_preview->pixmap(Qt::ReturnByValue);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return QPixmap();
|
return QPixmap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue