diff --git a/src/application/xqmainwindow.cpp b/src/application/xqmainwindow.cpp index 684bb9d..391b3d1 100644 --- a/src/application/xqmainwindow.cpp +++ b/src/application/xqmainwindow.cpp @@ -117,7 +117,7 @@ void XQMainWindow::initMainWindow() // #2. load demo data loadDocument( c_DocumentFileName1 ); - loadDocument( c_DocumentFileName2, true ); + //loadDocument( c_DocumentFileName2, true ); //loadDocument( c_DocumentFileName2 ); //loadDocument( c_DocumentFileName3 ); @@ -428,44 +428,6 @@ void XQMainWindow::loadDocument( const QString& fileName, bool useQML ) } - -void XQMainWindow::loadDocumentQML( const QString& fileName ) -{ - // gibts die Datei? - if( !QFile::exists( fileName) ) - throw XQException( "no such file", fileName ); - - XQNodeFactory treeLoader; - // xml daten laden - XQNodePtr rawTree = treeLoader.load_tree( qPrintable(fileName) ); - // versteckten root node ignorieren - XQNodePtr contentRoot = rawTree->first_child(); - - - // 'friendly Name' ist ein Link auf ein anderes Attribute - // das als Namen verwendet wird. - const QString& fName = contentRoot->friendly_name(); - - // Ein neues Child-Model erzeugen - XQChildModel* childModel = new XQChildModel(this); - // die Modelstruktur anlegen - childModel->initModel( c_ChildModelName ); - // model inhalte laden - childModel->addModelData( contentRoot->first_child() ); - - XQQuickWidget* quickChild = new XQQuickWidget(_tabWidget); - //quickChild->setResizeMode(QQuickWidget::SizeViewToRootObject); - - quickChild->rootContext()->setContextProperty("xtrChildModel", childModel); - quickChild->setSource(QUrl("qrc:/xqtreeview.qml")); - _tabWidget->addTab( quickChild, "QML:"+fName ); - _tabWidget->setCurrentWidget( quickChild ); - quickChild->setResizeMode(QQuickWidget::SizeRootObjectToView); - -} - - - //! speichert ein XML unter dem 'filename' void XQMainWindow::saveDocument( const QString& fileName ) diff --git a/src/application/xqmainwindow.h b/src/application/xqmainwindow.h index d8251b6..b23bca0 100644 --- a/src/application/xqmainwindow.h +++ b/src/application/xqmainwindow.h @@ -64,12 +64,10 @@ public slots: // fixme implement //void showDocument( const QString& key ){} void loadDocument( const QString& fileName, bool useQML=false ); - void loadDocumentQML( const QString& fileName ); void saveDocument( const QString& fileName ); static void setupWorkingDir(); - protected: XQNodePtr createDataTree( const QString& fileName ); diff --git a/src/items/xqitemfactory.cpp b/src/items/xqitemfactory.cpp index 6433cc6..0135389 100644 --- a/src/items/xqitemfactory.cpp +++ b/src/items/xqitemfactory.cpp @@ -165,7 +165,7 @@ XQItemList XQItemFactory::makeRow(const XQNodePtr& sheetNode, const XQNodePtr& c return list; } -XQItemList XQItemFactory::makeChildRow( XQItem* parent, const XQNodePtr& sheetNode, const XQNodePtr& contentNode ) +XQItemList XQItemFactory::makeChildRow( XQItem* parent, const XQNodePtr& sheetNode, const XQNodePtr& contentNode ) { Q_UNUSED(parent); Q_UNUSED(sheetNode); diff --git a/src/model/xqviewmodel.cpp b/src/model/xqviewmodel.cpp index dc03910..8c5a2ad 100644 --- a/src/model/xqviewmodel.cpp +++ b/src/model/xqviewmodel.cpp @@ -166,10 +166,10 @@ void XQViewModel::addSection(const XQItemList& list, const XQNodePtr& sheetNode if( !sheetNode->has_attribute( c_ContentType) ) throw XQException( "section list: Section node needs attribute 'ContentType'!"); - // 5. das erzeugt dann auch valide indices + // 4. das erzeugt dann auch valide indices appendRow(list); - // 6. jetzt können wir auch die section erzeugen + // 5. jetzt können wir auch die section erzeugen const XQModelSection& section = _sections.createSection( list[0]->index(), sheetNode ); // ... und es der welt mitteilen.