summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qlineedit_p.cpp
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2017-02-16 15:17:15 +0100
committerStephan Binner <stephan.binner@basyskom.com>2017-03-01 09:01:14 +0000
commite97d6fd52cacc1aa0903512d6571c1aa7b30ae92 (patch)
treeb5ef09f89a3c042f65170d2631c06a9fa4c00369 /src/widgets/widgets/qlineedit_p.cpp
parent782e1caa9f562ad7ea00241e91ce94ad464323b8 (diff)
Build fix for -no-feature-action
Change-Id: I62291af347dca7c1bb4a53d2cb698e4f1a38743d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/widgets/widgets/qlineedit_p.cpp')
-rw-r--r--src/widgets/widgets/qlineedit_p.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp
index 13f18f66d2..791fba49aa 100644
--- a/src/widgets/widgets/qlineedit_p.cpp
+++ b/src/widgets/widgets/qlineedit_p.cpp
@@ -448,12 +448,14 @@ QIcon QLineEditPrivate::clearButtonIcon() const
void QLineEditPrivate::setClearButtonEnabled(bool enabled)
{
+#if QT_CONFIG(action)
for (const SideWidgetEntry &e : trailingSideWidgets) {
if (e.flags & SideWidgetClearButton) {
e.action->setEnabled(enabled);
break;
}
}
+#endif
}
void QLineEditPrivate::positionSideWidgets()
@@ -467,14 +469,18 @@ void QLineEditPrivate::positionSideWidgets()
QSize(p.widgetWidth, p.widgetHeight));
for (const SideWidgetEntry &e : leftSideWidgetList()) {
e.widget->setGeometry(widgetGeometry);
+#if QT_CONFIG(action)
if (e.action->isVisible())
widgetGeometry.moveLeft(widgetGeometry.left() + delta);
+#endif
}
widgetGeometry.moveLeft(contentRect.width() - p.widgetWidth - p.margin);
for (const SideWidgetEntry &e : rightSideWidgetList()) {
e.widget->setGeometry(widgetGeometry);
+#if QT_CONFIG(action)
if (e.action->isVisible())
widgetGeometry.moveLeft(widgetGeometry.left() - delta);
+#endif
}
}
}
@@ -508,10 +514,12 @@ QWidget *QLineEditPrivate::addAction(QAction *newAction, QAction *before, QLineE
QWidget *w = 0;
// Store flags about QWidgetAction here since removeAction() may be called from ~QAction,
// in which a qobject_cast<> no longer works.
+#if QT_CONFIG(action)
if (QWidgetAction *widgetAction = qobject_cast<QWidgetAction *>(newAction)) {
if ((w = widgetAction->requestWidget(q)))
flags |= SideWidgetCreatedByWidgetAction;
}
+#endif
if (!w) {
#if QT_CONFIG(toolbutton)
QLineEditIconButton *toolButton = new QLineEditIconButton(q);
@@ -538,6 +546,7 @@ QWidget *QLineEditPrivate::addAction(QAction *newAction, QAction *before, QLineE
void QLineEditPrivate::removeAction(QAction *action)
{
+#if QT_CONFIG(action)
Q_Q(QLineEdit);
const PositionIndexPair positionIndex = findSideWidget(action);
if (positionIndex.second == -1)
@@ -553,6 +562,7 @@ void QLineEditPrivate::removeAction(QAction *action)
if (!hasSideWidgets()) // Last widget, remove connection
QObject::disconnect(q, SIGNAL(textChanged(QString)), q, SLOT(_q_textChanged(QString)));
q->update();
+#endif // QT_CONFIG(action)
}
static bool isSideWidgetVisible(const QLineEditPrivate::SideWidgetEntry &e)