faking success.

This commit is contained in:
2025-08-09 21:33:03 +02:00
parent 4a08e71115
commit c973712352
7 changed files with 71 additions and 36 deletions

View File

@@ -59,9 +59,12 @@ XQItem* XQMainModel::createTreeEntry( XQNodePtr contentNode )
{
for(const auto& section : _sections )
{
qDebug() << " --- wtf1: " << contentNode->to_string();
qDebug() << " --- wtf2: " << section.sheetRootNode->to_string();
if( contentNode->attribute("State") == section.sheetRootNode->attribute("State") )
{
XQItem* newTreeentry = _itemFactory.makeContentItem( contentNode, section.sheetRootNode );
XQItem* newTreeentry = _itemFactory.makeTreeChildItem( contentNode, section.sheetRootNode );
section.headerItem().appendRow( newTreeentry );
_treeTable->expand( section.modelIndex );
// ??

View File

@@ -23,7 +23,7 @@
#include <xqnodewriter.h>
//! firz
//! konstruktor.
XQMainWindow::XQMainWindow( QWidget* parent )
: QMainWindow(parent)
@@ -34,7 +34,7 @@ XQMainWindow::XQMainWindow( QWidget* parent )
}
//! firz
//! actions & document struktur einrichten.
void XQMainWindow::initMainWindow()
{
@@ -67,6 +67,7 @@ void XQMainWindow::initMainWindow()
connect( _mainTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(onTreeItemClicked(QModelIndex)) );
connect( _tabWidget, SIGNAL(tabBarClicked(int)), this, SLOT(onTabClicked(int)) );
connect( &_mainModelView, &XQViewModel::xqItemCreated, this, [=, this](XQItem* item)
{
// when a new main tree item has been created ...
@@ -102,7 +103,7 @@ void XQMainWindow::initMainWindow()
}
//! firz
//! slot für zentrales undo
void XQMainWindow::onUndo()
{
@@ -113,14 +114,13 @@ void XQMainWindow::onUndo()
}
//!
//! slot für zentrales redo
void XQMainWindow::onRedo()
{
qDebug() << " --- redo Pressed";
if(_undoStack.canRedo())
_undoStack.redo();
}
@@ -214,8 +214,9 @@ void XQMainWindow::onAbout()
}
//! firz
// when item in the left tree is clicked, switch view on the right side
//! wenn ein item im navigations-baum geklickt wird, soll die document
//! view rechts angepasst werden.
void XQMainWindow::onTreeItemClicked(const QModelIndex& index )
{
@@ -234,8 +235,8 @@ void XQMainWindow::onTreeItemClicked(const QModelIndex& index )
}
//! firz
// when item in the left tree is clicked, switch view on the right side
//! beim click auf ein tab im linken fenster wird der navigationsbaum angepasst.
void XQMainWindow::onTabClicked( int index )
{
const QString& key = _documentStore[index].treeItem->attribute( c_ProjectID );
@@ -293,8 +294,10 @@ void XQMainWindow::loadDocument( const QString& fileName )
// read the model data
childModel->setContent( contentRoot->first_child() );
// create new entry in the left side main tree view
XQItem* newEntry = _mainModelView.createTreeEntry( contentRoot );
XQItem* newEntry = _mainModelView.createTreeEntry( contentRoot );
_mainTreeView->setCurrentIndex( newEntry->index() );
_documentStore.addDocument( fileName, pTitle, newEntry, childModel );