MCPcopy Create free account
hub / github.com/KDE/kdevelop / CheckSetNameEditor

Method CheckSetNameEditor

plugins/clazy/config/checksetmanagewidget.cpp:85–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83};
84
85CheckSetNameEditor::CheckSetNameEditor(CheckSetSelectionListModel* checkSetSelectionListModel,
86 const QString& defaultName, QWidget* parent)
87 : QDialog(parent)
88{
89 setWindowTitle(i18nc("@title:window", "Enter Name of New Check Set"));
90
91 auto* layout = new QVBoxLayout(this);
92
93 auto* editLayout = new QHBoxLayout;
94
95 auto* label = new QLabel(i18nc("@label:textbox", "Name:"));
96 editLayout->addWidget(label);
97 m_nameEdit = new QLineEdit;
98 m_nameEdit->setClearButtonEnabled(true);
99 editLayout->addWidget(m_nameEdit);
100 layout->addLayout(editLayout);
101
102 auto* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
103 m_okButton = buttonBox->button(QDialogButtonBox::Ok);
104 m_okButton->setEnabled(false);
105 m_okButton->setDefault(true);
106 connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
107 connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
108 layout->addWidget(buttonBox);
109
110 m_validator = new CheckSetNameValidator(checkSetSelectionListModel, this);
111 connect(m_nameEdit, &QLineEdit::textChanged, this, &CheckSetNameEditor::handleNameEdit);
112
113 m_nameEdit->setText(defaultName);
114 m_nameEdit->selectAll();
115}
116
117QString CheckSetNameEditor::name() const
118{

Callers

nothing calls this directly

Calls 5

buttonMethod · 0.80
addWidgetMethod · 0.45
setEnabledMethod · 0.45
setTextMethod · 0.45
selectAllMethod · 0.45

Tested by

no test coverage detected