summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qlineedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/widgets/qlineedit.cpp')
-rw-r--r--src/widgets/widgets/qlineedit.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index e5e832ab98..0a35bae200 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -437,6 +437,7 @@ bool QLineEdit::hasFrame() const
\since 5.2
*/
+#if QT_CONFIG(action)
/*!
\overload
@@ -466,7 +467,7 @@ QAction *QLineEdit::addAction(const QIcon &icon, ActionPosition position)
addAction(result, position);
return result;
}
-
+#endif // QT_CONFIG(action)
/*!
\property QLineEdit::clearButtonEnabled
\brief Whether the line edit displays a clear button when it is not empty.
@@ -483,6 +484,7 @@ static const char clearButtonActionNameC[] = "_q_qlineeditclearaction";
void QLineEdit::setClearButtonEnabled(bool enable)
{
+#if QT_CONFIG(action)
Q_D(QLineEdit);
if (enable == isClearButtonEnabled())
return;
@@ -497,11 +499,16 @@ void QLineEdit::setClearButtonEnabled(bool enable)
d->removeAction(clearAction);
delete clearAction;
}
+#endif // QT_CONFIG(action)
}
bool QLineEdit::isClearButtonEnabled() const
{
+#if QT_CONFIG(action)
return findChild<QAction *>(QLatin1String(clearButtonActionNameC));
+#else
+ return false;
+#endif
}
void QLineEdit::setFrame(bool enable)
@@ -737,10 +744,10 @@ void QLineEdit::setCursorPosition(int pos)
d->control->setCursorPosition(pos);
}
+// ### What should this do if the point is outside of contentsRect? Currently returns 0.
/*!
Returns the cursor position under the point \a pos.
*/
-// ### What should this do if the point is outside of contentsRect? Currently returns 0.
int QLineEdit::cursorPositionAt(const QPoint &pos)
{
Q_D(QLineEdit);
@@ -1432,8 +1439,10 @@ bool QLineEdit::event(QEvent * e)
|| style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected, &opt, this))
d->setCursorVisible(true);
}
+#if QT_CONFIG(action)
} else if (e->type() == QEvent::ActionRemoved) {
d->removeAction(static_cast<QActionEvent *>(e)->action());
+#endif
} else if (e->type() == QEvent::Resize) {
d->positionSideWidgets();
}