summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qcommonstyle.cpp11
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm2
-rw-r--r--src/widgets/styles/qstyle.cpp2
3 files changed, 12 insertions, 3 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 6b9e5577a4..36975c5877 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -5248,6 +5248,13 @@ static QPixmap cachedPixmapFromXPM(const char * const *xpm)
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)
{
const QString directionalThemeName = rtl
@@ -5260,7 +5267,7 @@ static QIcon clearTextIcon(bool rtl)
QIcon icon;
#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());
icon.addPixmap(clearText16);
QPixmap clearText32(QStringLiteral(":/qt-project.org/styles/commonstyle/images/cleartext-32.png"));
@@ -5575,6 +5582,8 @@ QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *opti
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-volume-16.png"));
case SP_MediaVolumeMuted:
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
default:
break;
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 56531b10de..d28bd644c6 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -2933,7 +2933,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
QImage img;
QSize pixmapSize = opt->rect.size();
- if (pixmapSize.isValid()) {
+ if (!pixmapSize.isEmpty()) {
QPixmap pix(pixmapSize);
pix.fill(QColor(fillR, fillG, fillB));
QPainter pix_paint(&pix);
diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp
index d72a898ee9..93bc00f662 100644
--- a/src/widgets/styles/qstyle.cpp
+++ b/src/widgets/styles/qstyle.cpp
@@ -733,7 +733,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\value State_None Indicates that the widget does not have a state.
\value State_Active Indicates that the widget is active.
- \value State_AutoRaise Used to indicate if auto-raise appearance should be usd on a tool button.
+ \value State_AutoRaise Used to indicate if auto-raise appearance should be used on a tool button.
\value State_Children Used to indicate if an item view branch has children.
\value State_DownArrow Used to indicate if a down arrow should be visible on the widget.
\value State_Editing Used to indicate if an editor is opened on the widget.