MCPcopy Create free account
hub / github.com/davy7125/polyphone / updateEnableState

Method updateEnableState

sources/clavier/combocc.cpp:94–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94void ComboCC::updateEnableState()
95{
96 // List of excluded controllers
97 QList<int> excludedCCs;
98 foreach (ComboCC * combo, _comboGroup->keys())
99 if (combo != this)
100 excludedCCs << _comboGroup->value(combo);
101
102 // Set the enabled states
103 QStandardItemModel * model = qobject_cast<QStandardItemModel *>(this->model());
104 for (int i = 0; i < this->count(); i++)
105 {
106 QStandardItem * item = model->item(i);
107 item->setFlags(!excludedCCs.contains(this->itemData(i).toInt()) ?
108 item->flags() | Qt::ItemIsEnabled :
109 item->flags() & ~Qt::ItemIsEnabled);
110 }
111}
112
113QSize ComboCC::minimumSizeHint() const
114{

Callers 1

onCurrentIndexChangedMethod · 0.80

Calls 5

containsMethod · 0.80
toIntMethod · 0.80
flagsMethod · 0.80
foreachFunction · 0.70
countMethod · 0.45

Tested by

no test coverage detected