CppEditor: Add context object into connections

Change-Id: I1a74f62b0a42ea4971b14fb82213f662b5fe4736
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Jarek Kobus
2023-08-01 19:49:35 +02:00
parent a6df8ebb53
commit 1ceea7a91f
8 changed files with 19 additions and 20 deletions

View File

@@ -8907,9 +8907,8 @@ public:
QSizePolicy labelSizePolicy = errorLabel->sizePolicy();
labelSizePolicy.setRetainSizeWhenHidden(true);
errorLabel->setSizePolicy(labelSizePolicy);
connect(constructorParamsModel,
&ConstructorParams::validOrder,
[=, button = buttonBox->button(QDialogButtonBox::Ok)](bool valid) {
connect(constructorParamsModel, &ConstructorParams::validOrder, this,
[errorLabel, button = buttonBox->button(QDialogButtonBox::Ok)](bool valid) {
button->setEnabled(valid);
errorLabel->setVisible(!valid);
});
@@ -8917,7 +8916,8 @@ public:
// setup select all/none checkbox
QCheckBox *const checkBox = new QCheckBox(Tr::tr("Initialize all members"));
checkBox->setChecked(true);
connect(checkBox, &QCheckBox::stateChanged, [model = constructorParamsModel](int state) {
connect(checkBox, &QCheckBox::stateChanged, this,
[model = constructorParamsModel](int state) {
if (state != Qt::PartiallyChecked) {
for (int i = 0; i < model->rowCount(); ++i)
model->setData(model->index(i, ConstructorParams::ShouldInitColumn),