forked from qt-creator/qt-creator
Drop Qt5: Qml lib / QmlDesigner: Get rid of QOverload
Add a context object into some lambdas. Change-Id: I16ee7a0c061483e4d90c9e015852c41a4f3cde90 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -120,7 +120,7 @@ void QmlDebugConnectionManager::connectToTcpServer()
|
|||||||
void QmlDebugConnectionManager::startLocalServer()
|
void QmlDebugConnectionManager::startLocalServer()
|
||||||
{
|
{
|
||||||
stopConnectionTimer();
|
stopConnectionTimer();
|
||||||
connect(&m_connectionTimer, &QTimer::timeout, this, [this]() {
|
connect(&m_connectionTimer, &QTimer::timeout, this, [this] {
|
||||||
QTC_ASSERT(!isConnected(), return);
|
QTC_ASSERT(!isConnected(), return);
|
||||||
|
|
||||||
// We leave the server running as some application might currently be trying to
|
// We leave the server running as some application might currently be trying to
|
||||||
|
@@ -73,7 +73,7 @@ ContextPaneTextWidget::ContextPaneTextWidget(QWidget *parent) :
|
|||||||
connect(parentContextWidget->colorDialog(), &CustomColorDialog::rejected,
|
connect(parentContextWidget->colorDialog(), &CustomColorDialog::rejected,
|
||||||
this, &ContextPaneTextWidget::onColorDialogCancled);
|
this, &ContextPaneTextWidget::onColorDialogCancled);
|
||||||
|
|
||||||
connect(ui->fontSizeSpinBox, QOverload<int>::of(&QmlEditorWidgets::FontSizeSpinBox::valueChanged),
|
connect(ui->fontSizeSpinBox, &QmlEditorWidgets::FontSizeSpinBox::valueChanged,
|
||||||
this, &ContextPaneTextWidget::onFontSizeChanged);
|
this, &ContextPaneTextWidget::onFontSizeChanged);
|
||||||
connect(ui->fontSizeSpinBox, &QmlEditorWidgets::FontSizeSpinBox::formatChanged,
|
connect(ui->fontSizeSpinBox, &QmlEditorWidgets::FontSizeSpinBox::formatChanged,
|
||||||
this, &ContextPaneTextWidget::onFontFormatChanged);
|
this, &ContextPaneTextWidget::onFontFormatChanged);
|
||||||
@@ -103,7 +103,7 @@ ContextPaneTextWidget::ContextPaneTextWidget(QWidget *parent) :
|
|||||||
connect(ui->bottomAlignmentButton, &QToolButton::toggled,
|
connect(ui->bottomAlignmentButton, &QToolButton::toggled,
|
||||||
this, &ContextPaneTextWidget::onVerticalAlignmentChanged);
|
this, &ContextPaneTextWidget::onVerticalAlignmentChanged);
|
||||||
|
|
||||||
connect(ui->styleComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
connect(ui->styleComboBox, &QComboBox::currentIndexChanged,
|
||||||
this, &ContextPaneTextWidget::onStyleComboBoxChanged);
|
this, &ContextPaneTextWidget::onStyleComboBoxChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -112,13 +112,13 @@ CustomColorDialog::CustomColorDialog(QWidget *parent) : QFrame(parent )
|
|||||||
resize(sizeHint());
|
resize(sizeHint());
|
||||||
|
|
||||||
connect(m_colorBox, &ColorBox::colorChanged, this, &CustomColorDialog::onColorBoxChanged);
|
connect(m_colorBox, &ColorBox::colorChanged, this, &CustomColorDialog::onColorBoxChanged);
|
||||||
connect(m_alphaSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
|
connect(m_alphaSpinBox, &QDoubleSpinBox::valueChanged,
|
||||||
this, &CustomColorDialog::spinBoxChanged);
|
this, &CustomColorDialog::spinBoxChanged);
|
||||||
connect(m_rSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
|
connect(m_rSpinBox, &QDoubleSpinBox::valueChanged,
|
||||||
this, &CustomColorDialog::spinBoxChanged);
|
this, &CustomColorDialog::spinBoxChanged);
|
||||||
connect(m_gSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
|
connect(m_gSpinBox, &QDoubleSpinBox::valueChanged,
|
||||||
this, &CustomColorDialog::spinBoxChanged);
|
this, &CustomColorDialog::spinBoxChanged);
|
||||||
connect(m_bSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
|
connect(m_bSpinBox, &QDoubleSpinBox::valueChanged,
|
||||||
this, &CustomColorDialog::spinBoxChanged);
|
this, &CustomColorDialog::spinBoxChanged);
|
||||||
connect(m_hueControl, &HueControl::hueChanged, this, &CustomColorDialog::onHueChanged);
|
connect(m_hueControl, &HueControl::hueChanged, this, &CustomColorDialog::onHueChanged);
|
||||||
|
|
||||||
|
@@ -132,17 +132,17 @@ EasingContextPane::EasingContextPane(QWidget *parent) :
|
|||||||
|
|
||||||
connect(m_simulation, &EasingSimulation::finished, this, &EasingContextPane::switchToGraph);
|
connect(m_simulation, &EasingSimulation::finished, this, &EasingContextPane::switchToGraph);
|
||||||
connect(ui->playButton, &QPushButton::clicked, this, &EasingContextPane::playClicked);
|
connect(ui->playButton, &QPushButton::clicked, this, &EasingContextPane::playClicked);
|
||||||
connect(ui->overshootSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
|
connect(ui->overshootSpinBox, &QDoubleSpinBox::valueChanged,
|
||||||
this, &EasingContextPane::overshootChanged);
|
this, &EasingContextPane::overshootChanged);
|
||||||
connect(ui->periodSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
|
connect(ui->periodSpinBox, &QDoubleSpinBox::valueChanged,
|
||||||
this, &EasingContextPane::periodChanged);
|
this, &EasingContextPane::periodChanged);
|
||||||
connect(ui->amplitudeSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
|
connect(ui->amplitudeSpinBox, &QDoubleSpinBox::valueChanged,
|
||||||
this, &EasingContextPane::amplitudeChanged);
|
this, &EasingContextPane::amplitudeChanged);
|
||||||
connect(ui->easingExtremesComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
connect(ui->easingExtremesComboBox, &QComboBox::currentIndexChanged,
|
||||||
this, &EasingContextPane::easingExtremesChanged);
|
this, &EasingContextPane::easingExtremesChanged);
|
||||||
connect(ui->easingShapeComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
connect(ui->easingShapeComboBox, &QComboBox::currentIndexChanged,
|
||||||
this, &EasingContextPane::easingShapeChanged);
|
this, &EasingContextPane::easingShapeChanged);
|
||||||
connect(ui->durationSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
connect(ui->durationSpinBox, &QSpinBox::valueChanged,
|
||||||
this, &EasingContextPane::durationChanged);
|
this, &EasingContextPane::durationChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -492,7 +492,7 @@ again:
|
|||||||
|
|
||||||
// handle comment can be called after a '/' has been read
|
// handle comment can be called after a '/' has been read
|
||||||
// and returns true if it actually encountered a comment
|
// and returns true if it actually encountered a comment
|
||||||
auto handleComment = [this](){
|
auto handleComment = [this] {
|
||||||
if (_char == u'*') {
|
if (_char == u'*') {
|
||||||
scanChar();
|
scanChar();
|
||||||
while (_codePtr <= _endPtr) {
|
while (_codePtr <= _endPtr) {
|
||||||
|
@@ -49,23 +49,23 @@ ActionEditorDialog::ActionEditorDialog(QWidget *parent)
|
|||||||
{
|
{
|
||||||
setupUIComponents();
|
setupUIComponents();
|
||||||
|
|
||||||
QObject::connect(m_comboBoxType, QOverload<int>::of(&QComboBox::activated),
|
QObject::connect(m_comboBoxType, &QComboBox::activated,
|
||||||
[this] (int idx) { this->updateComboBoxes(idx, ComboBox::Type); });
|
[this] (int idx) { this->updateComboBoxes(idx, ComboBox::Type); });
|
||||||
|
|
||||||
// Action connections
|
// Action connections
|
||||||
QObject::connect(m_actionTargetItem, QOverload<int>::of(&QComboBox::activated),
|
QObject::connect(m_actionTargetItem, &QComboBox::activated,
|
||||||
[this] (int idx) { this->updateComboBoxes(idx, ComboBox::TargetItem); });
|
[this] (int idx) { this->updateComboBoxes(idx, ComboBox::TargetItem); });
|
||||||
QObject::connect(m_actionMethod, QOverload<int>::of(&QComboBox::activated),
|
QObject::connect(m_actionMethod, &QComboBox::activated,
|
||||||
[this] (int idx) { this->updateComboBoxes(idx, ComboBox::TargetProperty); });
|
[this] (int idx) { this->updateComboBoxes(idx, ComboBox::TargetProperty); });
|
||||||
|
|
||||||
// Assignment connections
|
// Assignment connections
|
||||||
QObject::connect(m_assignmentTargetItem, QOverload<int>::of(&QComboBox::activated),
|
QObject::connect(m_assignmentTargetItem, &QComboBox::activated,
|
||||||
[this] (int idx) { this->updateComboBoxes(idx, ComboBox::TargetItem); });
|
[this] (int idx) { this->updateComboBoxes(idx, ComboBox::TargetItem); });
|
||||||
QObject::connect(m_assignmentTargetProperty, QOverload<int>::of(&QComboBox::activated),
|
QObject::connect(m_assignmentTargetProperty, &QComboBox::activated,
|
||||||
[this] (int idx) { this->updateComboBoxes(idx, ComboBox::TargetProperty); });
|
[this] (int idx) { this->updateComboBoxes(idx, ComboBox::TargetProperty); });
|
||||||
QObject::connect(m_assignmentSourceItem, QOverload<int>::of(&QComboBox::activated),
|
QObject::connect(m_assignmentSourceItem, &QComboBox::activated,
|
||||||
[this] (int idx) { this->updateComboBoxes(idx, ComboBox::SourceItem); });
|
[this] (int idx) { this->updateComboBoxes(idx, ComboBox::SourceItem); });
|
||||||
QObject::connect(m_assignmentSourceProperty, QOverload<int>::of(&QComboBox::activated),
|
QObject::connect(m_assignmentSourceProperty, &QComboBox::activated,
|
||||||
[this] (int idx) { this->updateComboBoxes(idx, ComboBox::SourceProperty); });
|
[this] (int idx) { this->updateComboBoxes(idx, ComboBox::SourceProperty); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -47,11 +47,11 @@ BindingEditorDialog::BindingEditorDialog(QWidget *parent)
|
|||||||
{
|
{
|
||||||
setupUIComponents();
|
setupUIComponents();
|
||||||
|
|
||||||
QObject::connect(m_comboBoxItem, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
QObject::connect(m_comboBoxItem, &QComboBox::currentIndexChanged,
|
||||||
this, &BindingEditorDialog::itemIDChanged);
|
this, &BindingEditorDialog::itemIDChanged);
|
||||||
QObject::connect(m_comboBoxProperty, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
QObject::connect(m_comboBoxProperty, &QComboBox::currentIndexChanged,
|
||||||
this, &BindingEditorDialog::propertyIDChanged);
|
this, &BindingEditorDialog::propertyIDChanged);
|
||||||
QObject::connect(m_checkBoxNot, QOverload<int>::of(&QCheckBox::stateChanged),
|
QObject::connect(m_checkBoxNot, &QCheckBox::stateChanged,
|
||||||
this, &BindingEditorDialog::checkBoxChanged);
|
this, &BindingEditorDialog::checkBoxChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -136,8 +136,7 @@ QWidget *ZoomAction::createWidget(QWidget *parent)
|
|||||||
m_combo->setCurrentIndex(indexOf(1.0));
|
m_combo->setCurrentIndex(indexOf(1.0));
|
||||||
m_combo->setToolTip(m_combo->currentText());
|
m_combo->setToolTip(m_combo->currentText());
|
||||||
|
|
||||||
auto currentChanged = QOverload<int>::of(&QComboBox::currentIndexChanged);
|
connect(m_combo, &QComboBox::currentIndexChanged, this, &ZoomAction::emitZoomLevelChanged);
|
||||||
connect(m_combo, currentChanged, this, &ZoomAction::emitZoomLevelChanged);
|
|
||||||
|
|
||||||
return m_combo.data();
|
return m_combo.data();
|
||||||
}
|
}
|
||||||
|
@@ -178,7 +178,7 @@ QWidget *BindingDelegate::createEditor(QWidget *parent, const QStyleOptionViewIt
|
|||||||
default: qWarning() << "BindingDelegate::createEditor column" << index.column();
|
default: qWarning() << "BindingDelegate::createEditor column" << index.column();
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(bindingComboBox, QOverload<int>::of(&QComboBox::activated), this, [=]() {
|
connect(bindingComboBox, &QComboBox::activated, this, [=] {
|
||||||
auto delegate = const_cast<BindingDelegate*>(this);
|
auto delegate = const_cast<BindingDelegate*>(this);
|
||||||
emit delegate->commitData(bindingComboBox);
|
emit delegate->commitData(bindingComboBox);
|
||||||
});
|
});
|
||||||
@@ -225,7 +225,7 @@ QWidget *DynamicPropertiesDelegate::createEditor(QWidget *parent, const QStyleOp
|
|||||||
case DynamicPropertiesModel::PropertyTypeRow: {
|
case DynamicPropertiesModel::PropertyTypeRow: {
|
||||||
|
|
||||||
auto dynamicPropertiesComboBox = new PropertiesComboBox(parent);
|
auto dynamicPropertiesComboBox = new PropertiesComboBox(parent);
|
||||||
connect(dynamicPropertiesComboBox, QOverload<int>::of(&QComboBox::activated), this, [=]() {
|
connect(dynamicPropertiesComboBox, &QComboBox::activated, this, [=] {
|
||||||
auto delegate = const_cast<DynamicPropertiesDelegate*>(this);
|
auto delegate = const_cast<DynamicPropertiesDelegate*>(this);
|
||||||
emit delegate->commitData(dynamicPropertiesComboBox);
|
emit delegate->commitData(dynamicPropertiesComboBox);
|
||||||
});
|
});
|
||||||
@@ -386,7 +386,7 @@ QWidget *ConnectionDelegate::createEditor(QWidget *parent, const QStyleOptionVie
|
|||||||
default: qWarning() << "ConnectionDelegate::createEditor column" << index.column();
|
default: qWarning() << "ConnectionDelegate::createEditor column" << index.column();
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(connectionComboBox, QOverload<int>::of(&QComboBox::activated), this, [=]() {
|
connect(connectionComboBox, &QComboBox::activated, this, [=] {
|
||||||
auto delegate = const_cast<ConnectionDelegate*>(this);
|
auto delegate = const_cast<ConnectionDelegate*>(this);
|
||||||
emit delegate->commitData(connectionComboBox);
|
emit delegate->commitData(connectionComboBox);
|
||||||
});
|
});
|
||||||
@@ -413,7 +413,7 @@ QWidget *BackendDelegate::createEditor(QWidget *parent, const QStyleOptionViewIt
|
|||||||
case BackendModel::TypeNameColumn: {
|
case BackendModel::TypeNameColumn: {
|
||||||
auto backendComboBox = new PropertiesComboBox(parent);
|
auto backendComboBox = new PropertiesComboBox(parent);
|
||||||
backendComboBox->addItems(model->possibleCppTypes());
|
backendComboBox->addItems(model->possibleCppTypes());
|
||||||
connect(backendComboBox, QOverload<int>::of(&QComboBox::activated), this, [=]() {
|
connect(backendComboBox, &QComboBox::activated, this, [=] {
|
||||||
auto delegate = const_cast<BackendDelegate*>(this);
|
auto delegate = const_cast<BackendDelegate*>(this);
|
||||||
emit delegate->commitData(backendComboBox);
|
emit delegate->commitData(backendComboBox);
|
||||||
});
|
});
|
||||||
|
@@ -101,13 +101,9 @@ CurveEditorToolBar::CurveEditorToolBar(CurveEditorModel *model, QWidget* parent)
|
|||||||
m_startSpin->setRange(std::numeric_limits<int>::lowest(), std::numeric_limits<int>::max());
|
m_startSpin->setRange(std::numeric_limits<int>::lowest(), std::numeric_limits<int>::max());
|
||||||
m_startSpin->setValue(model->minimumTime());
|
m_startSpin->setValue(model->minimumTime());
|
||||||
|
|
||||||
connect(
|
connect(m_startSpin, &QSpinBox::valueChanged, this, &CurveEditorToolBar::startFrameChanged);
|
||||||
m_startSpin, QOverload<int>::of(&QSpinBox::valueChanged),
|
connect(model, &CurveEditorModel::commitStartFrame,
|
||||||
this, &CurveEditorToolBar::startFrameChanged);
|
this, [this](int frame) { m_startSpin->setValue(frame); });
|
||||||
|
|
||||||
connect(
|
|
||||||
model, &CurveEditorModel::commitStartFrame,
|
|
||||||
[this](int frame) { m_startSpin->setValue(frame); });
|
|
||||||
|
|
||||||
auto validateEnd = [this](int val) -> bool {
|
auto validateEnd = [this](int val) -> bool {
|
||||||
if (m_startSpin==nullptr)
|
if (m_startSpin==nullptr)
|
||||||
@@ -118,20 +114,14 @@ CurveEditorToolBar::CurveEditorToolBar(CurveEditorModel *model, QWidget* parent)
|
|||||||
m_endSpin->setRange(std::numeric_limits<int>::lowest(), std::numeric_limits<int>::max());
|
m_endSpin->setRange(std::numeric_limits<int>::lowest(), std::numeric_limits<int>::max());
|
||||||
m_endSpin->setValue(model->maximumTime());
|
m_endSpin->setValue(model->maximumTime());
|
||||||
|
|
||||||
connect(
|
connect(m_endSpin, &QSpinBox::valueChanged, this, &CurveEditorToolBar::endFrameChanged);
|
||||||
m_endSpin, QOverload<int>::of(&QSpinBox::valueChanged),
|
connect(model, &CurveEditorModel::commitEndFrame,
|
||||||
this, &CurveEditorToolBar::endFrameChanged);
|
this, [this](int frame) { m_endSpin->setValue(frame); });
|
||||||
|
|
||||||
connect(
|
|
||||||
model, &CurveEditorModel::commitEndFrame,
|
|
||||||
[this](int frame) { m_endSpin->setValue(frame); });
|
|
||||||
|
|
||||||
m_currentSpin->setMinimum(0);
|
m_currentSpin->setMinimum(0);
|
||||||
m_currentSpin->setMaximum(std::numeric_limits<int>::max());
|
m_currentSpin->setMaximum(std::numeric_limits<int>::max());
|
||||||
|
|
||||||
connect(
|
connect(m_currentSpin, &QSpinBox::valueChanged, this, &CurveEditorToolBar::currentFrameChanged);
|
||||||
m_currentSpin, QOverload<int>::of(&QSpinBox::valueChanged),
|
|
||||||
this, &CurveEditorToolBar::currentFrameChanged);
|
|
||||||
|
|
||||||
auto *durationBox = new QHBoxLayout;
|
auto *durationBox = new QHBoxLayout;
|
||||||
durationBox->addWidget(new QLabel(tr("Start Frame")));
|
durationBox->addWidget(new QLabel(tr("Start Frame")));
|
||||||
|
@@ -71,7 +71,7 @@ QWidget *BackgroundAction::createWidget(QWidget *parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
comboBox->setCurrentIndex(0);
|
comboBox->setCurrentIndex(0);
|
||||||
connect(comboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
connect(comboBox, &QComboBox::currentIndexChanged,
|
||||||
this, &BackgroundAction::emitBackgroundChanged);
|
this, &BackgroundAction::emitBackgroundChanged);
|
||||||
|
|
||||||
comboBox->setProperty("hideborder", true);
|
comboBox->setProperty("hideborder", true);
|
||||||
|
@@ -53,8 +53,7 @@ QWidget *ComponentAction::createWidget(QWidget *parent)
|
|||||||
comboBox->setToolTip(tr("Edit sub components defined in this file."));
|
comboBox->setToolTip(tr("Edit sub components defined in this file."));
|
||||||
comboBox->setModel(m_componentView->standardItemModel());
|
comboBox->setModel(m_componentView->standardItemModel());
|
||||||
comboBox->setCurrentIndex(-1);
|
comboBox->setCurrentIndex(-1);
|
||||||
connect(comboBox, QOverload<int>::of(&QComboBox::activated),
|
connect(comboBox, &QComboBox::activated, this, &ComponentAction::emitCurrentComponentChanged);
|
||||||
this, &ComponentAction::emitCurrentComponentChanged);
|
|
||||||
connect(this, &ComponentAction::currentIndexChanged, comboBox, &QComboBox::setCurrentIndex);
|
connect(this, &ComponentAction::currentIndexChanged, comboBox, &QComboBox::setCurrentIndex);
|
||||||
|
|
||||||
return comboBox;
|
return comboBox;
|
||||||
|
@@ -565,8 +565,8 @@ QGridLayout *ItemLibraryAssetImportDialog::createOptionsGrid(
|
|||||||
optSpin->setMinimumWidth(controlMinWidth);
|
optSpin->setMinimumWidth(controlMinWidth);
|
||||||
optControl = optSpin;
|
optControl = optSpin;
|
||||||
if (advanced) {
|
if (advanced) {
|
||||||
QObject::connect(optSpin, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
|
QObject::connect(optSpin, &QDoubleSpinBox::valueChanged, this,
|
||||||
[this, optSpin, optKey, optionsIndex]() {
|
[this, optSpin, optKey, optionsIndex] {
|
||||||
QJsonObject optObj = m_importOptions[optionsIndex].value(optKey).toObject();
|
QJsonObject optObj = m_importOptions[optionsIndex].value(optKey).toObject();
|
||||||
QJsonValue value(optSpin->value());
|
QJsonValue value(optSpin->value());
|
||||||
optObj.insert("value", value);
|
optObj.insert("value", value);
|
||||||
@@ -577,13 +577,13 @@ QGridLayout *ItemLibraryAssetImportDialog::createOptionsGrid(
|
|||||||
m_labelToControlWidgetMaps[optionsIndex].value(optKey));
|
m_labelToControlWidgetMaps[optionsIndex].value(optKey));
|
||||||
if (advSpin) {
|
if (advSpin) {
|
||||||
// Connect corresponding advanced control
|
// Connect corresponding advanced control
|
||||||
QObject::connect(optSpin, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
|
QObject::connect(optSpin, &QDoubleSpinBox::valueChanged,
|
||||||
this, [optSpin, advSpin]() {
|
this, [optSpin, advSpin] {
|
||||||
if (advSpin->value() != optSpin->value())
|
if (advSpin->value() != optSpin->value())
|
||||||
advSpin->setValue(optSpin->value());
|
advSpin->setValue(optSpin->value());
|
||||||
});
|
});
|
||||||
QObject::connect(advSpin, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
|
QObject::connect(advSpin, &QDoubleSpinBox::valueChanged,
|
||||||
this, [optSpin, advSpin]() {
|
this, [optSpin, advSpin] {
|
||||||
if (advSpin->value() != optSpin->value())
|
if (advSpin->value() != optSpin->value())
|
||||||
optSpin->setValue(advSpin->value());
|
optSpin->setValue(advSpin->value());
|
||||||
});
|
});
|
||||||
@@ -675,9 +675,8 @@ QGridLayout *ItemLibraryAssetImportDialog::createOptionsGrid(
|
|||||||
w2->setEnabled(enable);
|
w2->setEnabled(enable);
|
||||||
};
|
};
|
||||||
enableConditionally(optSpin, conLabel, conControl, mode);
|
enableConditionally(optSpin, conLabel, conControl, mode);
|
||||||
QObject::connect(
|
QObject::connect(optSpin, &QDoubleSpinBox::valueChanged, optSpin,
|
||||||
optSpin, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
|
[optSpin, conLabel, conControl, mode, enableConditionally] {
|
||||||
optSpin, [optSpin, conLabel, conControl, mode, enableConditionally]() {
|
|
||||||
enableConditionally(optSpin, conLabel, conControl, mode);
|
enableConditionally(optSpin, conLabel, conControl, mode);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -100,25 +100,21 @@ CanvasStyleDialog::CanvasStyleDialog(const CanvasStyle &style, QWidget *parent)
|
|||||||
emit styleChanged(out);
|
emit styleChanged(out);
|
||||||
};
|
};
|
||||||
|
|
||||||
auto doubleValueChanged = QOverload<double>::of(
|
connect(m_aspect, &QDoubleSpinBox::valueChanged, this, emitValueChanged);
|
||||||
&QDoubleSpinBox::valueChanged);
|
|
||||||
auto colorValueChanged = &ColorControl::valueChanged;
|
|
||||||
|
|
||||||
connect(m_aspect, doubleValueChanged, this, emitValueChanged);
|
connect(m_thinLineWidth, &QDoubleSpinBox::valueChanged, this, emitValueChanged);
|
||||||
|
connect(m_thickLineWidth, &QDoubleSpinBox::valueChanged, this, emitValueChanged);
|
||||||
|
|
||||||
connect(m_thinLineWidth, doubleValueChanged, this, emitValueChanged);
|
connect(m_thinLineColor, &ColorControl::valueChanged, this, emitValueChanged);
|
||||||
connect(m_thickLineWidth, doubleValueChanged, this, emitValueChanged);
|
connect(m_thickLineColor, &ColorControl::valueChanged, this, emitValueChanged);
|
||||||
|
|
||||||
connect(m_thinLineColor, colorValueChanged, this, emitValueChanged);
|
connect(m_handleSize, &QDoubleSpinBox::valueChanged, this, emitValueChanged);
|
||||||
connect(m_thickLineColor, colorValueChanged, this, emitValueChanged);
|
connect(m_handleLineWidth, &QDoubleSpinBox::valueChanged, this, emitValueChanged);
|
||||||
|
|
||||||
connect(m_handleSize, doubleValueChanged, this, emitValueChanged);
|
connect(m_endPointColor, &ColorControl::valueChanged, this, emitValueChanged);
|
||||||
connect(m_handleLineWidth, doubleValueChanged, this, emitValueChanged);
|
connect(m_interPointColor, &ColorControl::valueChanged, this, emitValueChanged);
|
||||||
|
|
||||||
connect(m_endPointColor, colorValueChanged, this, emitValueChanged);
|
connect(m_curveWidth, &QDoubleSpinBox::valueChanged, this, emitValueChanged);
|
||||||
connect(m_interPointColor, colorValueChanged, this, emitValueChanged);
|
|
||||||
|
|
||||||
connect(m_curveWidth, doubleValueChanged, this, emitValueChanged);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace QmlDesigner
|
} // namespace QmlDesigner
|
||||||
|
@@ -138,18 +138,10 @@ EasingCurveDialog::EasingCurveDialog(const QList<ModelNode> &frames, QWidget *pa
|
|||||||
mainBox->addWidget(tabWidget);
|
mainBox->addWidget(tabWidget);
|
||||||
setLayout(mainBox);
|
setLayout(mainBox);
|
||||||
|
|
||||||
connect(m_splineEditor,
|
connect(m_splineEditor, &SplineEditor::easingCurveChanged,
|
||||||
&SplineEditor::easingCurveChanged,
|
this, &EasingCurveDialog::updateEasingCurve);
|
||||||
this,
|
|
||||||
&EasingCurveDialog::updateEasingCurve);
|
|
||||||
|
|
||||||
connect(m_presets, &PresetEditor::presetChanged, m_splineEditor, &SplineEditor::setEasingCurve);
|
connect(m_presets, &PresetEditor::presetChanged, m_splineEditor, &SplineEditor::setEasingCurve);
|
||||||
|
connect(durationEdit, &QSpinBox::valueChanged, m_splineEditor, &SplineEditor::setDuration);
|
||||||
connect(durationEdit,
|
|
||||||
QOverload<int>::of(&QSpinBox::valueChanged),
|
|
||||||
m_splineEditor,
|
|
||||||
&SplineEditor::setDuration);
|
|
||||||
|
|
||||||
connect(animateButton, &QPushButton::clicked, m_splineEditor, &SplineEditor::animate);
|
connect(animateButton, &QPushButton::clicked, m_splineEditor, &SplineEditor::animate);
|
||||||
|
|
||||||
m_presets->initialize(presetBar);
|
m_presets->initialize(presetBar);
|
||||||
|
@@ -56,11 +56,11 @@ TimelineAnimationForm::TimelineAnimationForm(QWidget *parent)
|
|||||||
connectSpinBox(ui->startFrame, "from");
|
connectSpinBox(ui->startFrame, "from");
|
||||||
connectSpinBox(ui->endFrame, "to");
|
connectSpinBox(ui->endFrame, "to");
|
||||||
|
|
||||||
connect(ui->loops, QOverload<int>::of(&QSpinBox::valueChanged), [this]() {
|
connect(ui->loops, &QSpinBox::valueChanged, this, [this] {
|
||||||
ui->continuous->setChecked(ui->loops->value() == -1);
|
ui->continuous->setChecked(ui->loops->value() == -1);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(ui->continuous, &QCheckBox::toggled, [this](bool checked) {
|
connect(ui->continuous, &QCheckBox::toggled, this, [this](bool checked) {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
setProperty("loops", -1);
|
setProperty("loops", -1);
|
||||||
ui->loops->setValue(-1);
|
ui->loops->setValue(-1);
|
||||||
@@ -70,7 +70,7 @@ TimelineAnimationForm::TimelineAnimationForm(QWidget *parent)
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(ui->idLineEdit, &QLineEdit::editingFinished, [this]() {
|
connect(ui->idLineEdit, &QLineEdit::editingFinished, this, [this] {
|
||||||
QTC_ASSERT(m_timeline.isValid(), return );
|
QTC_ASSERT(m_timeline.isValid(), return );
|
||||||
|
|
||||||
static QString lastString;
|
static QString lastString;
|
||||||
@@ -105,7 +105,7 @@ TimelineAnimationForm::TimelineAnimationForm(QWidget *parent)
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(ui->running, &QCheckBox::clicked, [this](bool checked) {
|
connect(ui->running, &QCheckBox::clicked, this, [this](bool checked) {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
setProperty("running", true);
|
setProperty("running", true);
|
||||||
} else {
|
} else {
|
||||||
@@ -113,7 +113,7 @@ TimelineAnimationForm::TimelineAnimationForm(QWidget *parent)
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(ui->pingPong, &QCheckBox::clicked, [this](bool checked) {
|
connect(ui->pingPong, &QCheckBox::clicked, this, [this](bool checked) {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
setProperty("pingPong", true);
|
setProperty("pingPong", true);
|
||||||
} else {
|
} else {
|
||||||
@@ -121,9 +121,7 @@ TimelineAnimationForm::TimelineAnimationForm(QWidget *parent)
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(ui->transitionToState,
|
connect(ui->transitionToState, &QComboBox::activated, this, [this](int index) {
|
||||||
QOverload<int>::of(&QComboBox::activated),
|
|
||||||
[this](int index) {
|
|
||||||
if (!m_animation.isValid())
|
if (!m_animation.isValid())
|
||||||
return;
|
return;
|
||||||
if (!m_animation.view()->rootModelNode().hasId())
|
if (!m_animation.view()->rootModelNode().hasId())
|
||||||
|
@@ -148,7 +148,7 @@ QWidget *TimelineEditorDelegate::createEditor(QWidget *parent,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (comboBox) {
|
if (comboBox) {
|
||||||
connect(comboBox, QOverload<int>::of(&QComboBox::activated), this, [=]() {
|
connect(comboBox, &QComboBox::activated, this, [=] {
|
||||||
auto delegate = const_cast<TimelineEditorDelegate *>(this);
|
auto delegate = const_cast<TimelineEditorDelegate *>(this);
|
||||||
emit delegate->commitData(comboBox);
|
emit delegate->commitData(comboBox);
|
||||||
});
|
});
|
||||||
|
@@ -37,10 +37,7 @@ public:
|
|||||||
void operator()(QProcess *process)
|
void operator()(QProcess *process)
|
||||||
{
|
{
|
||||||
process->disconnect();
|
process->disconnect();
|
||||||
QObject::connect(process,
|
QObject::connect(process, &QProcess::finished, process, &QProcess::deleteLater);
|
||||||
QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
|
||||||
process,
|
|
||||||
&QProcess::deleteLater);
|
|
||||||
process->kill();
|
process->kill();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -427,10 +427,8 @@ void DesignModeWidget::setup()
|
|||||||
workspaceComboBox->setCurrentText(m_dockManager->activeWorkspace());
|
workspaceComboBox->setCurrentText(m_dockManager->activeWorkspace());
|
||||||
});
|
});
|
||||||
connect(m_dockManager, &ADS::DockManager::workspaceLoaded, workspaceComboBox, &QComboBox::setCurrentText);
|
connect(m_dockManager, &ADS::DockManager::workspaceLoaded, workspaceComboBox, &QComboBox::setCurrentText);
|
||||||
connect(workspaceComboBox,
|
connect(workspaceComboBox, &QComboBox::activated,
|
||||||
QOverload<int>::of(&QComboBox::activated),
|
m_dockManager, [this, workspaceComboBox]([[maybe_unused]] int index) {
|
||||||
m_dockManager,
|
|
||||||
[this, workspaceComboBox]([[maybe_unused]] int index) {
|
|
||||||
m_dockManager->openWorkspace(workspaceComboBox->currentText());
|
m_dockManager->openWorkspace(workspaceComboBox->currentText());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -269,7 +269,7 @@ QWidget *SwitchLanguageComboboxAction::createWidget(QWidget *parent)
|
|||||||
refreshComboBoxFunction(project);
|
refreshComboBoxFunction(project);
|
||||||
|
|
||||||
// do this after refreshComboBoxFunction so we do not get currentLocaleChanged signals at initialization
|
// do this after refreshComboBoxFunction so we do not get currentLocaleChanged signals at initialization
|
||||||
connect(comboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [this, comboBox](int index) {
|
connect(comboBox, &QComboBox::currentIndexChanged, [this, comboBox](int index) {
|
||||||
if (index == 0) // == Default
|
if (index == 0) // == Default
|
||||||
emit currentLocaleChanged("");
|
emit currentLocaleChanged("");
|
||||||
else
|
else
|
||||||
|
@@ -571,7 +571,7 @@ void QmlJSEditorWidget::createToolBar()
|
|||||||
policy.setHorizontalPolicy(QSizePolicy::Expanding);
|
policy.setHorizontalPolicy(QSizePolicy::Expanding);
|
||||||
m_outlineCombo->setSizePolicy(policy);
|
m_outlineCombo->setSizePolicy(policy);
|
||||||
|
|
||||||
connect(m_outlineCombo, QOverload<int>::of(&QComboBox::activated),
|
connect(m_outlineCombo, &QComboBox::activated,
|
||||||
this, &QmlJSEditorWidget::jumpToOutlineElement);
|
this, &QmlJSEditorWidget::jumpToOutlineElement);
|
||||||
connect(m_qmlJsEditorDocument->outlineModel(), &Internal::QmlOutlineModel::updated,
|
connect(m_qmlJsEditorDocument->outlineModel(), &Internal::QmlOutlineModel::updated,
|
||||||
static_cast<QTreeView *>(m_outlineCombo->view()), &QTreeView::expandAll);
|
static_cast<QTreeView *>(m_outlineCombo->view()), &QTreeView::expandAll);
|
||||||
|
@@ -38,8 +38,7 @@ QmlJSCodeStyleSettingsWidget::QmlJSCodeStyleSettingsWidget(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
auto spinValueChanged = QOverload<int>::of(&QSpinBox::valueChanged);
|
connect(ui->lineLengthSpinBox, &QSpinBox::valueChanged,
|
||||||
connect(ui->lineLengthSpinBox, spinValueChanged,
|
|
||||||
this, &QmlJSCodeStyleSettingsWidget::slotSettingsChanged);
|
this, &QmlJSCodeStyleSettingsWidget::slotSettingsChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -85,8 +85,7 @@ void QmlMainFileAspect::addToLayout(LayoutBuilder &builder)
|
|||||||
|
|
||||||
connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::fileListChanged,
|
connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::fileListChanged,
|
||||||
this, &QmlMainFileAspect::updateFileComboBox);
|
this, &QmlMainFileAspect::updateFileComboBox);
|
||||||
connect(m_fileListCombo, QOverload<int>::of(&QComboBox::activated),
|
connect(m_fileListCombo, &QComboBox::activated, this, &QmlMainFileAspect::setMainScript);
|
||||||
this, &QmlMainFileAspect::setMainScript);
|
|
||||||
|
|
||||||
builder.addItems({tr("Main QML file:"), m_fileListCombo.data()});
|
builder.addItems({tr("Main QML file:"), m_fileListCombo.data()});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user