This commit is contained in:
Christoph Holzheuer
2025-09-03 17:23:52 +02:00
parent 3e7b65dca5
commit 831daf898c
8 changed files with 21 additions and 72 deletions

View File

@@ -47,14 +47,14 @@ XQViewModel::XQViewModel( QObject* parent )
{
invisibleRootItem()->setData( "[rootItem]", Qt::DisplayRole );
setItemPrototype( new XQItem );
/*
// auf änderungen kann in den unterklassen reagiert werden
connect(this, &QStandardItemModel::itemChanged, this, [this](QStandardItem *item)
{
XQItem* xqItem = static_cast<XQItem*>(item);
onItemChanged( *xqItem );
emit xqItemChanged( *xqItem );
});
*/
//qRegisterMetaType<XQItem>("XQItem");
}
@@ -171,22 +171,6 @@ void XQViewModel::addSection(const XQItemList& list, const XQNodePtr& sectionNod
void XQViewModel::onToggleSection(const QString& sectionKey )
{
qDebug() << " --- onToggleSection: " << sectionKey;
/*
connect(model, &QStandardItemModel::dataChanged, this, &YourClass::onItemChanged);
void YourClass::onItemChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles)
{
if (roles.contains(Qt::CheckStateRole)) {
Qt::CheckState state = static_cast<Qt::CheckState>(topLeft.data(Qt::CheckStateRole).toInt());
if (state == Qt::Checked) {
qDebug() << "Checkbox wurde aktiviert!";
// Hier kannst du dein QObject benachrichtigen
}
}
}
*/
}
/*

View File

@@ -95,8 +95,9 @@ public:
*/
signals:
virtual void onItemChanged( XQItem& item ) = 0;
void xqItemChanged( const XQItem& item );
public slots:
@@ -104,7 +105,6 @@ public slots:
virtual void onActionTriggered(QAction* action);
virtual void onToggleSection(const QString& sectionKey );
// handle XQCommands ( == UndoCommand )
virtual void onCommandRedo( const XQCommand& command );
virtual void onCommandUndo( const XQCommand& command );