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

Function buttonClicked

plugins/custom-buildsystem/tests/kcmuitestmain.cpp:26–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24static const char version[] = "0.1";
25
26class State : public QObject
27{
28Q_OBJECT
29public:
30 explicit State(QDialogButtonBox* buttonBox, CustomBuildSystemConfigWidget* cfgWidget, KConfig* config)
31 : buttonBox(buttonBox)
32 , configWidget(cfgWidget)
33 , cfg(config)
34 {
35 connect(buttonBox, &QDialogButtonBox::clicked, this, &State::buttonClicked);
36 connect(configWidget, &CustomBuildSystemConfigWidget::changed, this, &State::configChanged);
37 }
38public Q_SLOTS:
39 void buttonClicked(QAbstractButton* button)
40 {
41 if (button == buttonBox->button(QDialogButtonBox::Apply)) {
42 apply();
43 } else if (button == buttonBox->button(QDialogButtonBox::Ok)) {
44 ok();
45 } else if (button == buttonBox->button(QDialogButtonBox::Cancel)) {
46 qApp->quit();
47 }
48 }
49
50 void apply() {
51 configWidget->saveTo(cfg);

Callers

nothing calls this directly

Calls 4

okFunction · 0.85
buttonMethod · 0.80
quitMethod · 0.80
applyFunction · 0.70

Tested by

no test coverage detected