QSpinBox: remove deprecated signal valueChanged(const QString &)
Task-number: QTBUG-81845 Change-Id: I91148cac553f63b44968337ccc121e7376ee4465 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>bb10
parent
9cc8949cc6
commit
e59094cb86
|
|
@ -81,7 +81,7 @@ Sender::Sender(QWidget *parent)
|
|||
buttonBox->addButton(startButton, QDialogButtonBox::ActionRole);
|
||||
buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
|
||||
|
||||
connect(ttlSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), this, &Sender::ttlChanged);
|
||||
connect(ttlSpinBox, &QSpinBox::valueChanged, this, &Sender::ttlChanged);
|
||||
connect(startButton, &QPushButton::clicked, this, &Sender::startSending);
|
||||
connect(quitButton, &QPushButton::clicked, this, &Sender::close);
|
||||
connect(&timer, &QTimer::timeout, this, &Sender::sendDatagram);
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ MainWindow::MainWindow()
|
|||
|
||||
connect(slider, &QAbstractSlider::valueChanged, glwidget, &GLWidget::setScaling);
|
||||
connect(transparent, &QCheckBox::toggled, glwidget, &GLWidget::setTransparent);
|
||||
connect(updateInterval, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
connect(updateInterval, &QSpinBox::valueChanged,
|
||||
this, &MainWindow::updateIntervalChanged);
|
||||
connect(timerBased, &QCheckBox::toggled, this, &MainWindow::timerUsageChanged);
|
||||
connect(timerBased, &QCheckBox::toggled, updateInterval, &QWidget::setEnabled);
|
||||
|
|
|
|||
|
|
@ -69,11 +69,11 @@ Window::Window(QWidget *parent)
|
|||
this, &Window::curveChanged);
|
||||
connect(m_ui.buttonGroup, &QButtonGroup::buttonClicked,
|
||||
this, &Window::pathChanged);
|
||||
connect(m_ui.periodSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
|
||||
connect(m_ui.periodSpinBox, &QDoubleSpinBox::valueChanged,
|
||||
this, &Window::periodChanged);
|
||||
connect(m_ui.amplitudeSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
|
||||
connect(m_ui.amplitudeSpinBox, &QDoubleSpinBox::valueChanged,
|
||||
this, &Window::amplitudeChanged);
|
||||
connect(m_ui.overshootSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
|
||||
connect(m_ui.overshootSpinBox, &QDoubleSpinBox::valueChanged,
|
||||
this, &Window::overshootChanged);
|
||||
createCurveIcons();
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ Screenshot::Screenshot()
|
|||
delaySpinBox->setSuffix(tr(" s"));
|
||||
delaySpinBox->setMaximum(60);
|
||||
|
||||
connect(delaySpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
connect(delaySpinBox, &QSpinBox::valueChanged,
|
||||
this, &Screenshot::updateCheckBox);
|
||||
|
||||
hideThisWindowCheckBox = new QCheckBox(tr("Hide This Window"), optionsGroupBox);
|
||||
|
|
|
|||
|
|
@ -116,9 +116,9 @@ MainWindow::MainWindow()
|
|||
connect(quitAction, &QAction::triggered, qApp, &QCoreApplication::quit);
|
||||
connect(aboutAction, &QAction::triggered, this, &MainWindow::showAboutBox);
|
||||
//! [4]
|
||||
connect(pixelSizeSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
connect(pixelSizeSpinBox, &QSpinBox::valueChanged,
|
||||
delegate, &PixelDelegate::setPixelSize);
|
||||
connect(pixelSizeSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
connect(pixelSizeSpinBox, &QSpinBox::valueChanged,
|
||||
this, &MainWindow::updateView);
|
||||
//! [4]
|
||||
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ Window::Window()
|
|||
//! [8]
|
||||
connect(shapeComboBox, &QComboBox::activated,
|
||||
this, &Window::shapeChanged);
|
||||
connect(penWidthSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
connect(penWidthSpinBox, &QSpinBox::valueChanged,
|
||||
this, &Window::penChanged);
|
||||
connect(penStyleComboBox, &QComboBox::activated,
|
||||
this, &Window::penChanged);
|
||||
|
|
|
|||
|
|
@ -204,9 +204,9 @@ Window::Window()
|
|||
this, &Window::penColorChanged);
|
||||
|
||||
for (RenderArea *area : qAsConst(renderAreas)) {
|
||||
connect(penWidthSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
connect(penWidthSpinBox, &QSpinBox::valueChanged,
|
||||
area, &RenderArea::setPenWidth);
|
||||
connect(rotationAngleSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
connect(rotationAngleSpinBox, &QSpinBox::valueChanged,
|
||||
area, &RenderArea::setRotationAngle);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ MainWindow::MainWindow()
|
|||
this, &MainWindow::setMonth);
|
||||
connect(yearEdit, &QDateTimeEdit::dateChanged,
|
||||
this, &MainWindow::setYear);
|
||||
connect(fontSizeSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
connect(fontSizeSpinBox, &QSpinBox::valueChanged,
|
||||
this, &MainWindow::setFontSize);
|
||||
//! [3]
|
||||
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
this, &MainWindow::changeMode);
|
||||
connect(caseCombo, &QComboBox::activated,
|
||||
this, &MainWindow::changeCase);
|
||||
connect(maxVisibleSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
connect(maxVisibleSpinBox, &QSpinBox::valueChanged,
|
||||
this, &MainWindow::changeMaxVisible);
|
||||
//! [2]
|
||||
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ RegularExpressionDialog::RegularExpressionDialog(QWidget *parent)
|
|||
connect(optimizeOnFirstUsageOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
|
||||
connect(dontAutomaticallyOptimizeOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
|
||||
|
||||
connect(offsetSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
connect(offsetSpinBox, &QSpinBox::valueChanged,
|
||||
this, &RegularExpressionDialog::refresh);
|
||||
|
||||
connect(matchTypeComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
connect(actionAbout, &QAction::triggered, this, &MainWindow::about);
|
||||
connect(actionAboutQt, &QAction::triggered, this, &MainWindow::aboutQt);
|
||||
|
||||
connect(undoLimit, QOverload<int>::of(&QSpinBox::valueChanged), this, &MainWindow::updateActions);
|
||||
connect(undoLimit, &QSpinBox::valueChanged, this, &MainWindow::updateActions);
|
||||
connect(documentTabs, &QTabWidget::currentChanged, this, &MainWindow::updateActions);
|
||||
|
||||
actionOpen->setShortcut(QString("Ctrl+O"));
|
||||
|
|
|
|||
|
|
@ -401,7 +401,7 @@ QWidget *MainWindow::createIconSizeGroupBox()
|
|||
//! [26]
|
||||
|
||||
//! [27]
|
||||
connect(otherSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
connect(otherSpinBox, &QSpinBox::valueChanged,
|
||||
this, &MainWindow::triggerChangeSize);
|
||||
|
||||
QHBoxLayout *otherSizeLayout = new QHBoxLayout;
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ MoviePlayer::MoviePlayer(QWidget *parent)
|
|||
connect(movie, &QMovie::stateChanged, this, &MoviePlayer::updateButtons);
|
||||
connect(fitCheckBox, &QCheckBox::clicked, this, &MoviePlayer::fitToWindow);
|
||||
connect(frameSlider, &QSlider::valueChanged, this, &MoviePlayer::goToFrame);
|
||||
connect(speedSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
connect(speedSpinBox, &QSpinBox::valueChanged,
|
||||
movie, &QMovie::setSpeed);
|
||||
|
||||
mainLayout = new QVBoxLayout;
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ Window::Window(QWidget *parent)
|
|||
verticalSliders, &SlidersGroup::setValue);
|
||||
connect(verticalSliders, &SlidersGroup::valueChanged,
|
||||
valueSpinBox, &QSpinBox::setValue);
|
||||
connect(valueSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
connect(valueSpinBox, &QSpinBox::valueChanged,
|
||||
horizontalSliders, &SlidersGroup::setValue);
|
||||
|
||||
QHBoxLayout *layout = new QHBoxLayout;
|
||||
|
|
@ -129,13 +129,13 @@ void Window::createControls(const QString &title)
|
|||
connect(orientationCombo, &QComboBox::activated,
|
||||
//! [7] //! [8]
|
||||
stackedWidget, &QStackedWidget::setCurrentIndex);
|
||||
connect(minimumSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
connect(minimumSpinBox, &QSpinBox::valueChanged,
|
||||
horizontalSliders, &SlidersGroup::setMinimum);
|
||||
connect(minimumSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
connect(minimumSpinBox, &QSpinBox::valueChanged,
|
||||
verticalSliders, &SlidersGroup::setMinimum);
|
||||
connect(maximumSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
connect(maximumSpinBox, &QSpinBox::valueChanged,
|
||||
horizontalSliders, &SlidersGroup::setMaximum);
|
||||
connect(maximumSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
connect(maximumSpinBox, &QSpinBox::valueChanged,
|
||||
verticalSliders, &SlidersGroup::setMaximum);
|
||||
connect(invertedAppearance, &QCheckBox::toggled,
|
||||
horizontalSliders, &SlidersGroup::invertAppearance);
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ void Window::createDoubleSpinBoxes()
|
|||
priceSpinBox->setPrefix("$");
|
||||
priceSpinBox->setValue(99.99);
|
||||
|
||||
connect(precisionSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
connect(precisionSpinBox, &QSpinBox::valueChanged,
|
||||
//! [17]
|
||||
this, &Window::changePrecision);
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ ValidatorWidget::ValidatorWidget(QWidget *parent)
|
|||
this, &ValidatorWidget::updateDoubleValidator);
|
||||
connect(doubleMinVal, &QDoubleSpinBox::editingFinished,
|
||||
this, &ValidatorWidget::updateDoubleValidator);
|
||||
connect(doubleDecimals, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
connect(doubleDecimals, &QSpinBox::valueChanged,
|
||||
this, &ValidatorWidget::updateDoubleValidator);
|
||||
connect(doubleFormat, &QComboBox::activated,
|
||||
this, &ValidatorWidget::updateDoubleValidator);
|
||||
|
|
|
|||
|
|
@ -277,13 +277,13 @@ QPageSetupWidget::QPageSetupWidget(QWidget *parent)
|
|||
connect(m_ui.unitCombo, &QComboBox::activated, this, &QPageSetupWidget::unitChanged);
|
||||
|
||||
connect(m_ui.pageSizeCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &QPageSetupWidget::pageSizeChanged);
|
||||
connect(m_ui.pageWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &QPageSetupWidget::pageSizeChanged);
|
||||
connect(m_ui.pageHeight, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &QPageSetupWidget::pageSizeChanged);
|
||||
connect(m_ui.pageWidth, &QDoubleSpinBox::valueChanged, this, &QPageSetupWidget::pageSizeChanged);
|
||||
connect(m_ui.pageHeight, &QDoubleSpinBox::valueChanged, this, &QPageSetupWidget::pageSizeChanged);
|
||||
|
||||
connect(m_ui.leftMargin, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &QPageSetupWidget::leftMarginChanged);
|
||||
connect(m_ui.topMargin, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &QPageSetupWidget::topMarginChanged);
|
||||
connect(m_ui.rightMargin, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &QPageSetupWidget::rightMarginChanged);
|
||||
connect(m_ui.bottomMargin, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &QPageSetupWidget::bottomMarginChanged);
|
||||
connect(m_ui.leftMargin, &QDoubleSpinBox::valueChanged, this, &QPageSetupWidget::leftMarginChanged);
|
||||
connect(m_ui.topMargin, &QDoubleSpinBox::valueChanged, this, &QPageSetupWidget::topMarginChanged);
|
||||
connect(m_ui.rightMargin, &QDoubleSpinBox::valueChanged, this, &QPageSetupWidget::rightMarginChanged);
|
||||
connect(m_ui.bottomMargin, &QDoubleSpinBox::valueChanged, this, &QPageSetupWidget::bottomMarginChanged);
|
||||
|
||||
connect(m_ui.portrait, &QRadioButton::clicked, this, &QPageSetupWidget::pageOrientationChanged);
|
||||
connect(m_ui.landscape, &QRadioButton::clicked, this, &QPageSetupWidget::pageOrientationChanged);
|
||||
|
|
|
|||
|
|
@ -254,7 +254,6 @@ QAccessibleSpinBox::QAccessibleSpinBox(QWidget *w)
|
|||
{
|
||||
Q_ASSERT(spinBox());
|
||||
addControllingSignal(QLatin1String("valueChanged(int)"));
|
||||
addControllingSignal(QLatin1String("valueChanged(QString)"));
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
@ -272,7 +271,6 @@ QAccessibleDoubleSpinBox::QAccessibleDoubleSpinBox(QWidget *widget)
|
|||
{
|
||||
Q_ASSERT(qobject_cast<QDoubleSpinBox *>(widget));
|
||||
addControllingSignal(QLatin1String("valueChanged(double)"));
|
||||
addControllingSignal(QLatin1String("valueChanged(QString)"));
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -191,17 +191,6 @@ public:
|
|||
The new text is passed in \a text with prefix() and suffix().
|
||||
*/
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 14)
|
||||
/*!
|
||||
\fn void QSpinBox::valueChanged(const QString &text)
|
||||
|
||||
\overload
|
||||
\obsolete Use textChanged(QString) instead
|
||||
|
||||
The new value is passed in \a text with prefix() and suffix().
|
||||
*/
|
||||
#endif
|
||||
|
||||
/*!
|
||||
Constructs a spin box with 0 as minimum value and 99 as maximum value, a
|
||||
step value of 1. The value is initially set to 0. It is parented to \a
|
||||
|
|
@ -663,17 +652,6 @@ void QSpinBox::fixup(QString &input) const
|
|||
The new text is passed in \a text with prefix() and suffix().
|
||||
*/
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 14)
|
||||
/*!
|
||||
\fn void QDoubleSpinBox::valueChanged(const QString &text);
|
||||
|
||||
\overload
|
||||
\obsolete Use textChanged(QString) instead
|
||||
|
||||
The new value is passed in \a text with prefix() and suffix().
|
||||
*/
|
||||
#endif
|
||||
|
||||
/*!
|
||||
Constructs a spin box with 0.0 as minimum value and 99.99 as maximum value,
|
||||
a step value of 1.0 and a precision of 2 decimal places. The value is
|
||||
|
|
@ -1095,12 +1073,6 @@ void QSpinBoxPrivate::emitSignals(EmitPolicy ep, const QVariant &old)
|
|||
if (ep != NeverEmit) {
|
||||
pendingEmit = false;
|
||||
if (ep == AlwaysEmit || value != old) {
|
||||
#if QT_DEPRECATED_SINCE(5, 14)
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_DEPRECATED
|
||||
emit q->valueChanged(edit->displayText());
|
||||
QT_WARNING_POP
|
||||
#endif
|
||||
emit q->textChanged(edit->displayText());
|
||||
emit q->valueChanged(value.toInt());
|
||||
}
|
||||
|
|
@ -1252,12 +1224,6 @@ void QDoubleSpinBoxPrivate::emitSignals(EmitPolicy ep, const QVariant &old)
|
|||
if (ep != NeverEmit) {
|
||||
pendingEmit = false;
|
||||
if (ep == AlwaysEmit || value != old) {
|
||||
#if QT_DEPRECATED_SINCE(5, 14)
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_DEPRECATED
|
||||
emit q->valueChanged(edit->displayText());
|
||||
QT_WARNING_POP
|
||||
#endif
|
||||
emit q->textChanged(edit->displayText());
|
||||
emit q->valueChanged(value.toDouble());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,10 +107,6 @@ public Q_SLOTS:
|
|||
Q_SIGNALS:
|
||||
void valueChanged(int);
|
||||
void textChanged(const QString &);
|
||||
#if QT_DEPRECATED_SINCE(5, 14)
|
||||
QT_DEPRECATED_X("Use textChanged(QString) instead")
|
||||
void valueChanged(const QString &);
|
||||
#endif
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(QSpinBox)
|
||||
|
|
@ -173,10 +169,6 @@ public Q_SLOTS:
|
|||
Q_SIGNALS:
|
||||
void valueChanged(double);
|
||||
void textChanged(const QString &);
|
||||
#if QT_DEPRECATED_SINCE(5, 14)
|
||||
QT_DEPRECATED_X("Use textChanged(QString) instead")
|
||||
void valueChanged(const QString &);
|
||||
#endif
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(QDoubleSpinBox)
|
||||
|
|
|
|||
|
|
@ -419,7 +419,7 @@ void tst_QDoubleSpinBox::setTracking()
|
|||
spin.setDecimals(decimals);
|
||||
spin.show();
|
||||
|
||||
connect(&spin, SIGNAL(valueChanged(QString)), this, SLOT(valueChangedHelper(QString)));
|
||||
connect(&spin, SIGNAL(textChanged(QString)), this, SLOT(valueChangedHelper(QString)));
|
||||
|
||||
keys.simulate(&spin);
|
||||
QCOMPARE(actualTexts, texts);
|
||||
|
|
@ -1774,7 +1774,7 @@ void tst_QDoubleSpinBox::stepModifierPressAndHold()
|
|||
stepModifierStyle->stepModifier = static_cast<Qt::KeyboardModifier>(stepModifier);
|
||||
spin.setStyle(stepModifierStyle.data());
|
||||
|
||||
QSignalSpy spy(&spin, QOverload<double>::of(&DoubleSpinBox::valueChanged));
|
||||
QSignalSpy spy(&spin, &DoubleSpinBox::valueChanged);
|
||||
|
||||
spin.show();
|
||||
QVERIFY(QTest::qWaitForWindowExposed(&spin));
|
||||
|
|
|
|||
|
|
@ -1830,9 +1830,9 @@ void tst_QSpinBox::stepModifierPressAndHold()
|
|||
stepModifierStyle->stepModifier = static_cast<Qt::KeyboardModifier>(stepModifier);
|
||||
spin.setStyle(stepModifierStyle.data());
|
||||
|
||||
QSignalSpy spy(&spin, QOverload<int>::of(&SpinBox::valueChanged));
|
||||
QSignalSpy spy(&spin, &SpinBox::valueChanged);
|
||||
// TODO: remove debug output when QTBUG-69492 is fixed
|
||||
connect(&spin, QOverload<int>::of(&SpinBox::valueChanged), [=]() {
|
||||
connect(&spin, &SpinBox::valueChanged, [=]() {
|
||||
qDebug() << QTime::currentTime() << "valueChanged emitted";
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue