mirror of
https://github.com/Lurkki14/tuxclocker.git
synced 2025-02-16 14:34:46 -06:00
allow setting parametrization for multiple nodes at once
This commit is contained in:
parent
49b28238ce
commit
e45f9a5f10
@ -130,12 +130,16 @@ bool indexApplicableForIndex(QModelIndex &orig, QModelIndex &other) {
|
||||
return assignableInfoEquals(origAssData.assignableInfo(), otherAssData.assignableInfo());
|
||||
}
|
||||
|
||||
void DeviceTreeView::commitData(QWidget *w) {
|
||||
for (auto &index : m_editSelection) {
|
||||
// See if node is applicable to being set the same value
|
||||
// as the node the editor was opened for
|
||||
if (indexApplicableForIndex(m_editedIndex, index))
|
||||
m_delegate->setModelData(w, model(), index);
|
||||
void DeviceTreeView::dataChanged(
|
||||
const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles) {
|
||||
auto assData = topLeft.data(DeviceModel::AssignableRole);
|
||||
if (assData.isValid() && roles.contains(DeviceModel::AssignableRole)) {
|
||||
for (auto &index : m_editSelection) {
|
||||
// See if node is applicable to being set the same value
|
||||
// as the node the editor was opened for
|
||||
if (indexApplicableForIndex(m_editedIndex, index))
|
||||
model()->setData(index, assData, DeviceModel::AssignableRole);
|
||||
}
|
||||
}
|
||||
QTreeView::commitData(w);
|
||||
QTreeView::dataChanged(topLeft, bottomRight, roles);
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ protected:
|
||||
}
|
||||
// TODO: allow to start editing with the keyboard
|
||||
EditTriggers editTriggers() { return QAbstractItemView::AllEditTriggers; }
|
||||
void commitData(QWidget *) override;
|
||||
void dataChanged(const QModelIndex &, const QModelIndex &, const QVector<int> &) override;
|
||||
private:
|
||||
// Suspend/resume readable updates
|
||||
void suspendChildren(const QModelIndex &);
|
||||
|
Loading…
Reference in New Issue
Block a user