diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-07-04 15:44:12 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2023-07-05 01:25:54 +0200 |
commit | 5f9ab113e32fb6ba81eab58acd9f99186af80534 (patch) | |
tree | 2e5229b5e140b4dc601e5eeaf2cc95e2d6efdfc3 | |
parent | 19bfe3e0b111827d6afc9e3602839f3dd0ad37dc (diff) |
QWidgetTextControl: share setActionIcon() with QLineEdit
... unbreaking -unity-build-batch-size 103.
Task-number: QTBUG-115031
Pick-to: 6.6 6.5
Change-Id: I004163000a422b05ee0c882f065286c043d58206
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r-- | src/widgets/widgets/qlineedit.cpp | 7 | ||||
-rw-r--r-- | src/widgets/widgets/qwidgettextcontrol.cpp | 2 | ||||
-rw-r--r-- | src/widgets/widgets/qwidgettextcontrol_p.h | 5 |
3 files changed, 6 insertions, 8 deletions
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index a193e6d576..9615221889 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -2183,13 +2183,6 @@ void QLineEdit::contextMenuEvent(QContextMenuEvent *event) } } -static inline void setActionIcon(QAction *action, const QString &name) -{ - const QIcon icon = QIcon::fromTheme(name); - if (!icon.isNull()) - action->setIcon(icon); -} - /*! This function creates the standard context menu which is shown when the user clicks on the line edit with the right mouse button. It is called from the default contextMenuEvent() handler. diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index 41add4349e..6b21cca9cc 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -2304,7 +2304,7 @@ void QWidgetTextControlPrivate::editFocusEvent(QEvent *e) #endif #ifndef QT_NO_CONTEXTMENU -static inline void setActionIcon(QAction *action, const QString &name) +void setActionIcon(QAction *action, const QString &name) { const QIcon icon = QIcon::fromTheme(name); if (!icon.isNull()) diff --git a/src/widgets/widgets/qwidgettextcontrol_p.h b/src/widgets/widgets/qwidgettextcontrol_p.h index 67812dda57..9df4c0c810 100644 --- a/src/widgets/widgets/qwidgettextcontrol_p.h +++ b/src/widgets/widgets/qwidgettextcontrol_p.h @@ -276,6 +276,11 @@ private: mutable QTextDocumentFragment fragment; }; +#ifndef QT_NO_CONTEXTMENU +// also used by QLineEdit +void setActionIcon(QAction *action, const QString &name); +#endif // QT_NO_CONTEXTMENU + QT_END_NAMESPACE #endif // QWidgetTextControl_H |