Fix QLineEdit not showing clear button on macOS
Restore code path returning the resource pixmap for platforms that do not have themes in QCommonStyle. Amends change b657496a0ba326af0688e9935069139c002849cf. Task-number: QTBUG-54425 Change-Id: I764408622b825b86afbe7ccf37e1498d3efb3850 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
This commit is contained in:
parent
c376e3fbf0
commit
25db59d772
@ -5194,6 +5194,13 @@ static QPixmap cachedPixmapFromXPM(const char * const *xpm)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef QT_NO_IMAGEFORMAT_PNG
|
||||||
|
static inline QString clearText16IconPath()
|
||||||
|
{
|
||||||
|
return QStringLiteral(":/qt-project.org/styles/commonstyle/images/cleartext-16.png");
|
||||||
|
}
|
||||||
|
#endif // !QT_NO_IMAGEFORMAT_PNG
|
||||||
|
|
||||||
static QIcon clearTextIcon(bool rtl)
|
static QIcon clearTextIcon(bool rtl)
|
||||||
{
|
{
|
||||||
const QString directionalThemeName = rtl
|
const QString directionalThemeName = rtl
|
||||||
@ -5206,7 +5213,7 @@ static QIcon clearTextIcon(bool rtl)
|
|||||||
|
|
||||||
QIcon icon;
|
QIcon icon;
|
||||||
#ifndef QT_NO_IMAGEFORMAT_PNG
|
#ifndef QT_NO_IMAGEFORMAT_PNG
|
||||||
QPixmap clearText16(QStringLiteral(":/qt-project.org/styles/commonstyle/images/cleartext-16.png"));
|
QPixmap clearText16(clearText16IconPath());
|
||||||
Q_ASSERT(!clearText16.size().isEmpty());
|
Q_ASSERT(!clearText16.size().isEmpty());
|
||||||
icon.addPixmap(clearText16);
|
icon.addPixmap(clearText16);
|
||||||
QPixmap clearText32(QStringLiteral(":/qt-project.org/styles/commonstyle/images/cleartext-32.png"));
|
QPixmap clearText32(QStringLiteral(":/qt-project.org/styles/commonstyle/images/cleartext-32.png"));
|
||||||
@ -5521,6 +5528,8 @@ QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *opti
|
|||||||
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-volume-16.png"));
|
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-volume-16.png"));
|
||||||
case SP_MediaVolumeMuted:
|
case SP_MediaVolumeMuted:
|
||||||
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-volume-muted-16.png"));
|
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-volume-muted-16.png"));
|
||||||
|
case SP_LineEditClearButton:
|
||||||
|
return QPixmap(clearText16IconPath());
|
||||||
#endif // QT_NO_IMAGEFORMAT_PNG
|
#endif // QT_NO_IMAGEFORMAT_PNG
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user