forked from qt-creator/qt-creator
CppEditor: Make pure virtual functions opt-in
... in the "Create implementations for all member functions" quickfix. Fixes: QTCREATORBUG-26468 Change-Id: I0965290c38cc66cffaf5dd3871eb96b6ff24b4d2 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -3116,8 +3116,10 @@ public:
|
|||||||
defaultImplTargetComboBox->insertItems(0, implTargetStrings);
|
defaultImplTargetComboBox->insertItems(0, implTargetStrings);
|
||||||
connect(defaultImplTargetComboBox, qOverload<int>(&QComboBox::currentIndexChanged), this,
|
connect(defaultImplTargetComboBox, qOverload<int>(&QComboBox::currentIndexChanged), this,
|
||||||
[this](int index) {
|
[this](int index) {
|
||||||
for (QComboBox * const cb : qAsConst(m_implTargetBoxes))
|
for (int i = 0; i < m_implTargetBoxes.size(); ++i) {
|
||||||
cb->setCurrentIndex(index);
|
if (!m_candidates.at(i)->type()->asFunctionType()->isPureVirtual())
|
||||||
|
static_cast<QComboBox *>(m_implTargetBoxes.at(i))->setCurrentIndex(index);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
const auto defaultImplTargetLayout = new QHBoxLayout;
|
const auto defaultImplTargetLayout = new QHBoxLayout;
|
||||||
defaultImplTargetLayout->addWidget(new QLabel(tr("Default implementation location:")));
|
defaultImplTargetLayout->addWidget(new QLabel(tr("Default implementation location:")));
|
||||||
@@ -3128,10 +3130,13 @@ public:
|
|||||||
oo.showFunctionSignatures = true;
|
oo.showFunctionSignatures = true;
|
||||||
oo.showReturnTypes = true;
|
oo.showReturnTypes = true;
|
||||||
for (int i = 0; i < m_candidates.size(); ++i) {
|
for (int i = 0; i < m_candidates.size(); ++i) {
|
||||||
|
const Function * const func = m_candidates.at(i)->type()->asFunctionType();
|
||||||
|
QTC_ASSERT(func, continue);
|
||||||
const auto implTargetComboBox = new QComboBox;
|
const auto implTargetComboBox = new QComboBox;
|
||||||
m_implTargetBoxes.append(implTargetComboBox);
|
m_implTargetBoxes.append(implTargetComboBox);
|
||||||
implTargetComboBox->insertItems(0, implTargetStrings);
|
implTargetComboBox->insertItems(0, implTargetStrings);
|
||||||
const Symbol * const func = m_candidates.at(i);
|
if (func->isPureVirtual())
|
||||||
|
implTargetComboBox->setCurrentIndex(0);
|
||||||
candidatesLayout->addWidget(new QLabel(oo.prettyType(func->type(), func->name())),
|
candidatesLayout->addWidget(new QLabel(oo.prettyType(func->type(), func->name())),
|
||||||
i, 0);
|
i, 0);
|
||||||
candidatesLayout->addWidget(implTargetComboBox, i, 1);
|
candidatesLayout->addWidget(implTargetComboBox, i, 1);
|
||||||
|
Reference in New Issue
Block a user