mirror of
https://github.com/Lurkki14/tuxclocker.git
synced 2025-02-25 18:55:24 -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());
|
return assignableInfoEquals(origAssData.assignableInfo(), otherAssData.assignableInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeviceTreeView::commitData(QWidget *w) {
|
void DeviceTreeView::dataChanged(
|
||||||
for (auto &index : m_editSelection) {
|
const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles) {
|
||||||
// See if node is applicable to being set the same value
|
auto assData = topLeft.data(DeviceModel::AssignableRole);
|
||||||
// as the node the editor was opened for
|
if (assData.isValid() && roles.contains(DeviceModel::AssignableRole)) {
|
||||||
if (indexApplicableForIndex(m_editedIndex, index))
|
for (auto &index : m_editSelection) {
|
||||||
m_delegate->setModelData(w, model(), index);
|
// 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
|
// TODO: allow to start editing with the keyboard
|
||||||
EditTriggers editTriggers() { return QAbstractItemView::AllEditTriggers; }
|
EditTriggers editTriggers() { return QAbstractItemView::AllEditTriggers; }
|
||||||
void commitData(QWidget *) override;
|
void dataChanged(const QModelIndex &, const QModelIndex &, const QVector<int> &) override;
|
||||||
private:
|
private:
|
||||||
// Suspend/resume readable updates
|
// Suspend/resume readable updates
|
||||||
void suspendChildren(const QModelIndex &);
|
void suspendChildren(const QModelIndex &);
|
||||||
|
Loading…
Reference in New Issue
Block a user