summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qlineedit_p.cpp
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2017-01-25 13:23:08 +0100
committerPaul Olav Tvete <paul.tvete@qt.io>2017-01-25 14:38:23 +0000
commit033fa96b6c89cc1be5cb2365e68bd1b01f91aad7 (patch)
tree193f5e4eecaffd5d14274065682d98732941a933 /src/widgets/widgets/qlineedit_p.cpp
parentb0b726f8c7d8b17853962262fefd6e0b56de2b92 (diff)
Fix build with -no-feature-toolbutton
Change-Id: I16495548fa3ed24409883fadab08ddb8545efd0d 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.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp
index 7da1d911ee..9947d63279 100644
--- a/src/widgets/widgets/qlineedit_p.cpp
+++ b/src/widgets/widgets/qlineedit_p.cpp
@@ -313,6 +313,8 @@ void QLineEditPrivate::drag()
#endif // QT_NO_DRAGANDDROP
+
+#if QT_CONFIG(toolbutton)
QLineEditIconButton::QLineEditIconButton(QWidget *parent)
: QToolButton(parent)
, m_opacity(0)
@@ -390,6 +392,7 @@ void QLineEditIconButton::updateCursor()
setCursor(qFuzzyCompare(m_opacity, qreal(1.0)) || !parentWidget() ? QCursor(Qt::ArrowCursor) : parentWidget()->cursor());
#endif
}
+#endif // QT_CONFIG(toolbutton)
void QLineEditPrivate::_q_textChanged(const QString &text)
{
@@ -397,7 +400,7 @@ void QLineEditPrivate::_q_textChanged(const QString &text)
const int newTextSize = text.size();
if (!newTextSize || !lastTextSize) {
lastTextSize = newTextSize;
-#ifndef QT_NO_ANIMATION
+#if QT_CONFIG(animation) && QT_CONFIG(toolbutton)
const bool fadeIn = newTextSize > 0;
for (const SideWidgetEntry &e : leadingSideWidgets) {
if (e.flags & SideWidgetFadeInWithText)
@@ -507,6 +510,7 @@ QWidget *QLineEditPrivate::addAction(QAction *newAction, QAction *before, QLineE
flags |= SideWidgetCreatedByWidgetAction;
}
if (!w) {
+#if QT_CONFIG(toolbutton)
QLineEditIconButton *toolButton = new QLineEditIconButton(q);
toolButton->setIcon(newAction->icon());
toolButton->setOpacity(lastTextSize > 0 || !(flags & SideWidgetFadeInWithText) ? 1 : 0);
@@ -514,6 +518,9 @@ QWidget *QLineEditPrivate::addAction(QAction *newAction, QAction *before, QLineE
QObject::connect(toolButton, SIGNAL(clicked()), q, SLOT(_q_clearButtonClicked()));
toolButton->setDefaultAction(newAction);
w = toolButton;
+#else
+ return nullptr;
+#endif
}
// If there is a 'before' action, it takes preference
PositionIndexPair positionIndex = before ? findSideWidget(before) : PositionIndexPair(position, -1);