diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2013-04-08 10:08:19 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-09 14:56:32 +0200 |
commit | 0e9ea64edcdb451ffcfbf055174354e6c8f2df88 (patch) | |
tree | a64115cd160ae1c4b3aa455547617ed347f6e5d7 /src/widgets/styles/qcommonstyle.cpp | |
parent | 12d8264a24664965de5c8443ffbb013bbeee8b1f (diff) |
Add Style hint for Clear buttons within QLineEdit.
Initial-patch-by: Kevin.Ottens@kdab.com
Change-Id: I4893923d5015535eb6d934636d6b5925088d7be8
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Diffstat (limited to 'src/widgets/styles/qcommonstyle.cpp')
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index c6edbee67d..e601110c3e 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -5289,6 +5289,13 @@ QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *opti } } break; + case SP_LineEditClearButton: { + QString themeName = rtl ? QStringLiteral("edit-clear-locationbar-ltr") : QStringLiteral("edit-clear-locationbar-rtl"); + if (!QIcon::hasThemeIcon(themeName)) + themeName = QStringLiteral("edit-clear"); + pixmap = QIcon::fromTheme(themeName).pixmap(16); + } + break; default: break; } @@ -5417,6 +5424,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(QStringLiteral(":/qt-project.org/styles/commonstyle/images/cleartext-16.png")); #endif // QT_NO_IMAGEFORMAT_PNG default: break; |