diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp index f988bc7a19..27bc9e9099 100644 --- a/src/widgets/widgets/qabstractspinbox.cpp +++ b/src/widgets/widgets/qabstractspinbox.cpp @@ -692,14 +692,14 @@ void QAbstractSpinBox::setLineEdit(QLineEdit *lineEdit) d->edit->setAcceptDrops(false); if (d->type != QMetaType::UnknownType) { - connect(d->edit, SIGNAL(textChanged(QString)), - this, SLOT(_q_editorTextChanged(QString))); - connect(d->edit, SIGNAL(cursorPositionChanged(int,int)), - this, SLOT(_q_editorCursorPositionChanged(int,int))); - connect(d->edit, SIGNAL(cursorPositionChanged(int,int)), - this, SLOT(updateMicroFocus())); - connect(d->edit->d_func()->control, SIGNAL(updateMicroFocus()), - this, SLOT(updateMicroFocus())); + QObjectPrivate::connect(d->edit, &QLineEdit::textChanged, + d, &QAbstractSpinBoxPrivate::editorTextChanged); + QObjectPrivate::connect(d->edit, &QLineEdit::cursorPositionChanged, + d, &QAbstractSpinBoxPrivate::editorCursorPositionChanged); + connect(d->edit, &QLineEdit::cursorPositionChanged, + this, [this]() { updateMicroFocus(); }); + connect(d->edit->d_func()->control, &QWidgetLineControl::updateMicroFocus, + this, [this]() { updateMicroFocus(); }); } d->updateEditFieldGeometry(); d->edit->setContextMenuPolicy(Qt::NoContextMenu); @@ -1511,7 +1511,7 @@ void QAbstractSpinBoxPrivate::emitSignals(EmitPolicy, const QVariant &) signal. */ -void QAbstractSpinBoxPrivate::_q_editorTextChanged(const QString &t) +void QAbstractSpinBoxPrivate::editorTextChanged(const QString &t) { Q_Q(QAbstractSpinBox); @@ -1541,7 +1541,7 @@ void QAbstractSpinBoxPrivate::_q_editorTextChanged(const QString &t) the different sections etc. */ -void QAbstractSpinBoxPrivate::_q_editorCursorPositionChanged(int oldpos, int newpos) +void QAbstractSpinBoxPrivate::editorCursorPositionChanged(int oldpos, int newpos) { if (!edit->hasSelectedText() && !ignoreCursorPositionChanged && !specialValue()) { ignoreCursorPositionChanged = true; diff --git a/src/widgets/widgets/qabstractspinbox.h b/src/widgets/widgets/qabstractspinbox.h index 6707db45c8..91d3dcb8fc 100644 --- a/src/widgets/widgets/qabstractspinbox.h +++ b/src/widgets/widgets/qabstractspinbox.h @@ -136,9 +136,6 @@ protected: QAbstractSpinBox(QAbstractSpinBoxPrivate &dd, QWidget *parent = nullptr); private: - Q_PRIVATE_SLOT(d_func(), void _q_editorTextChanged(const QString &)) - Q_PRIVATE_SLOT(d_func(), void _q_editorCursorPositionChanged(int, int)) - Q_DECLARE_PRIVATE(QAbstractSpinBox) Q_DISABLE_COPY(QAbstractSpinBox) friend class QAccessibleAbstractSpinBox; diff --git a/src/widgets/widgets/qabstractspinbox_p.h b/src/widgets/widgets/qabstractspinbox_p.h index efc23586cf..4252a01423 100644 --- a/src/widgets/widgets/qabstractspinbox_p.h +++ b/src/widgets/widgets/qabstractspinbox_p.h @@ -74,8 +74,8 @@ public: virtual QString textFromValue(const QVariant &n) const; virtual QVariant valueFromText(const QString &input) const; - void _q_editorTextChanged(const QString &); - virtual void _q_editorCursorPositionChanged(int oldpos, int newpos); + void editorTextChanged(const QString &); + virtual void editorCursorPositionChanged(int oldpos, int newpos); virtual QStyle::SubControl newHoverControl(const QPoint &pos); bool updateHoverControl(const QPoint &pos); diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp index ffcaf0c226..dfeee394f1 100644 --- a/src/widgets/widgets/qdatetimeedit.cpp +++ b/src/widgets/widgets/qdatetimeedit.cpp @@ -948,7 +948,7 @@ void QDateTimeEdit::setDisplayFormat(const QString &format) d->value = d->value.toDate().startOfDay(d->timeZone); } d->updateEdit(); - d->_q_editorCursorPositionChanged(-1, 0); + d->editorCursorPositionChanged(-1, 0); } } @@ -2296,7 +2296,7 @@ void QDateTimeEditPrivate::emitSignals(EmitPolicy ep, const QVariant &old) \internal */ -void QDateTimeEditPrivate::_q_editorCursorPositionChanged(int oldpos, int newpos) +void QDateTimeEditPrivate::editorCursorPositionChanged(int oldpos, int newpos) { if (ignoreCursorPositionChanged || specialValue()) return; @@ -2354,7 +2354,7 @@ void QDateTimeEditPrivate::_q_editorCursorPositionChanged(int oldpos, int newpos currentSectionIndex = s; Q_ASSERT_X(currentSectionIndex < sectionNodes.size(), - "QDateTimeEditPrivate::_q_editorCursorPositionChanged()", + "QDateTimeEditPrivate::editorCursorPositionChanged()", qPrintable(QString::fromLatin1("Internal error (%1 %2)"). arg(currentSectionIndex). arg(sectionNodes.size()))); diff --git a/src/widgets/widgets/qdatetimeedit_p.h b/src/widgets/widgets/qdatetimeedit_p.h index 21be760fd0..215ee75bfe 100644 --- a/src/widgets/widgets/qdatetimeedit_p.h +++ b/src/widgets/widgets/qdatetimeedit_p.h @@ -50,7 +50,7 @@ public: void emitSignals(EmitPolicy ep, const QVariant &old) override; QString textFromValue(const QVariant &f) const override; QVariant valueFromText(const QString &f) const override; - void _q_editorCursorPositionChanged(int oldpos, int newpos) override; + void editorCursorPositionChanged(int oldpos, int newpos) override; void interpret(EmitPolicy ep) override; void clearCache() const override; QStyle::SubControl newHoverControl(const QPoint &pos) override;