semi fixed missing sections
This commit is contained in:
@@ -36,9 +36,6 @@ XQChildModel::XQChildModel( QObject *parent )
|
||||
void XQChildModel::addModelData( const XQNodePtr& contentRoot )
|
||||
{
|
||||
|
||||
setObjectName( contentRoot->to_string() );
|
||||
//qDebug() << " --- create Model Data: " << contentRoot->to_string();
|
||||
|
||||
// Die Datenbasis als shared_ptr sichern
|
||||
_contentRoot = contentRoot;
|
||||
|
||||
|
||||
@@ -117,9 +117,9 @@ void XQMainWindow::initMainWindow()
|
||||
|
||||
// #2. load demo data
|
||||
loadDocument( c_DocumentFileName1 );
|
||||
//loadDocument( c_DocumentFileName2, true );
|
||||
loadDocument( c_DocumentFileName2, true );
|
||||
//loadDocument( c_DocumentFileName2 );
|
||||
loadDocument( c_DocumentFileName3 );
|
||||
//loadDocument( c_DocumentFileName3 );
|
||||
|
||||
|
||||
qDebug() << " --- all here: " << XQNode::s_Count;
|
||||
@@ -260,7 +260,7 @@ void XQMainWindow::onTreeViewItemClicked( const XQItem& item )
|
||||
|
||||
void XQMainWindow::onTreeViewItemChanged(const XQItem& item )
|
||||
{
|
||||
qDebug() << " --- TREE VIEW itemChanged:" << item.text() << " : " << item.parent()->text() << " : " << (void*)&_mainModel << " : " << (void*) sender();
|
||||
qDebug() << " --- TREE VIEW itemChanged: text" << item.text() << " parent: " << item.parent()->text() << " type: " << item.itemType().text() << " : " << (void*)&_mainModel << " : " << (void*) sender();
|
||||
// hier müssen wir erst das projekt aktivieren
|
||||
XQItem* xqItem = static_cast<XQItem*>(item.parent());
|
||||
onTreeViewItemClicked( *xqItem );
|
||||
@@ -269,7 +269,7 @@ void XQMainWindow::onTreeViewItemChanged(const XQItem& item )
|
||||
int idx = _tabWidget->currentIndex();
|
||||
if(_documentStore.contains(idx) )
|
||||
{
|
||||
qDebug() << " --- should toggle: " << item.text();
|
||||
qDebug() << " --- Has Document and might toggle: " << item.text();
|
||||
XQViewModel& childModel = *_documentStore[idx].viewModel;
|
||||
childModel.onToggleSection(item.text());
|
||||
}
|
||||
@@ -362,6 +362,7 @@ XQChildModel* XQMainWindow::createChildModel( const XQNodePtr& contentRoot )
|
||||
|
||||
// model inhalte laden
|
||||
childModel->addModelData( contentRoot->first_child() );
|
||||
childModel->setObjectName( contentRoot->friendly_name() );
|
||||
|
||||
return childModel;
|
||||
|
||||
@@ -404,7 +405,7 @@ void XQMainWindow::loadDocument( const QString& fileName, bool useQML )
|
||||
QWidget* childView{};
|
||||
if(useQML)
|
||||
{
|
||||
XQQuickWidget* quickView= new XQQuickWidget(_tabWidget);
|
||||
XQQuickWidget* quickView = new XQQuickWidget(_tabWidget);
|
||||
//quickChild->setResizeMode(QQuickWidget::SizeViewToRootObject);
|
||||
|
||||
quickView->rootContext()->setContextProperty("xtrChildModel", childModel);
|
||||
|
||||
@@ -117,7 +117,7 @@ const XQModelSection& XQSectionManager::sectionByKey( const QString& sectionKey
|
||||
if( hasValidSection( sectionKey ) )
|
||||
return _sections.at(sectionKey);
|
||||
|
||||
throw XQException( "No section for key: ", sectionKey);
|
||||
throw XQException( "No section for key", sectionKey);
|
||||
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ const XQModelSection& XQSectionManager::sectionByRow(int itemRow ) const
|
||||
return section;
|
||||
}
|
||||
|
||||
throw XQException( "No section for item row: ", QString::number(itemRow));
|
||||
throw XQException( "No section for item row", QString::number(itemRow));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -181,8 +181,11 @@ void XQViewModel::addSection(const XQItemList& list, const XQNodePtr& sheetNode
|
||||
//! SLOT, toggled die section mit dem 'sectionKey' (hier: contentType)
|
||||
|
||||
void XQViewModel::onToggleSection(const QString& sectionKey )
|
||||
{
|
||||
toggleSection( _sections.sectionByKey(sectionKey) );
|
||||
{
|
||||
qDebug() << " --- Model: " << this->objectName() << " should toggle: " << sectionKey << ": " << _sections.hasValidSection( sectionKey );
|
||||
_sections.dump();
|
||||
if(_sections.hasValidSection( sectionKey ) )
|
||||
toggleSection( _sections.sectionByKey(sectionKey) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user