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>
This commit is contained in:
Marc Mutz 2023-07-04 15:44:12 +02:00
parent 19bfe3e0b1
commit 5f9ab113e3
3 changed files with 6 additions and 8 deletions

View File

@ -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.

View File

@ -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())

View File

@ -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