summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/widgets/widgets/qlineedit_p.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp
index 7c5ba79cb6..e1c7a4e280 100644
--- a/src/widgets/widgets/qlineedit_p.cpp
+++ b/src/widgets/widgets/qlineedit_p.cpp
@@ -533,6 +533,17 @@ QWidget *QLineEditPrivate::addAction(QAction *newAction, QAction *before, QLineE
return nullptr;
#endif
}
+
+ // QTBUG-59957: clear button should be the leftmost action.
+ if (!before && !(flags & SideWidgetClearButton) && position == QLineEdit::TrailingPosition) {
+ for (const SideWidgetEntry &e : trailingSideWidgets) {
+ if (e.flags & SideWidgetClearButton) {
+ before = e.action;
+ break;
+ }
+ }
+ }
+
// If there is a 'before' action, it takes preference
// There's a bug in GHS compiler that causes internal error on the following code.