diff options
Diffstat (limited to 'src/widgets/widgets/qlineedit_p.cpp')
-rw-r--r-- | src/widgets/widgets/qlineedit_p.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp index 5b352f5554..6a8af53c97 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -56,6 +56,7 @@ #endif #include <qpainter.h> #include <qpropertyanimation.h> +#include <qstylehints.h> #include <qvalidator.h> QT_BEGIN_NAMESPACE @@ -232,6 +233,13 @@ void QLineEditPrivate::init(const QString& txt) q->setAcceptDrops(true); q->setAttribute(Qt::WA_MacShowFocusRect); + + initMouseYThreshold(); +} + +void QLineEditPrivate::initMouseYThreshold() +{ + mouseYThreshold = QGuiApplication::styleHints()->mouseQuickSelectionThreshold(); } QRect QLineEditPrivate::adjustedContentsRect() const @@ -330,13 +338,13 @@ QLineEditIconButton::QLineEditIconButton(QWidget *parent) QLineEditPrivate *QLineEditIconButton::lineEditPrivate() const { QLineEdit *le = qobject_cast<QLineEdit *>(parentWidget()); - return le ? static_cast<QLineEditPrivate *>(qt_widget_private(le)) : Q_NULLPTR; + return le ? static_cast<QLineEditPrivate *>(qt_widget_private(le)) : nullptr; } void QLineEditIconButton::paintEvent(QPaintEvent *) { QPainter painter(this); - QWindow *window = Q_NULLPTR; + QWindow *window = nullptr; if (const QWidget *nativeParent = nativeParentWidget()) window = nativeParent->windowHandle(); // Note isDown should really use the active state but in most styles |