diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index a193e6d5767..96152218898 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 41add4349ee..6b21cca9cca 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 67812dda57e..9df4c0c8101 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