diff --git a/src/items/xqitem.cpp b/src/items/xqitem.cpp index 6642c3f..f2e865d 100644 --- a/src/items/xqitem.cpp +++ b/src/items/xqitem.cpp @@ -138,7 +138,7 @@ XQItem::XQItem( XQItemType* itemType ) //! konstruiert ein daten-item mit zeiger auf 'unser' attribut //! im übergeordneten content-node. -XQItem::XQItem(XQItemType* itemType, const QString *content ) +XQItem::XQItem(XQItemType* itemType, const QString* content ) : XQItem{ itemType } { // hier setzen wir direkt ohne umwege den string pointer @@ -622,12 +622,12 @@ void XQItem::setData(const QVariant& value, int role ) // fallback: wenns keinen content node gibt, dann nehmen wir // das standardverfahren. if( !hasContentPtr() ) - return QStandardItem::setData( newValue, XQItem::ContentRole ); + return QStandardItem::setData( newValue, Qt::DisplayRole ); // wir nehmen den string pointer - const QString* contentPtr = QStandardItem::data( XQItem::ContentRole ).value(); - //Q_ASSERT(contentPtr); - *contentPtr = newValue.toString(); + const QString* constContentPtr = QStandardItem::data( XQItem::ContentRole ).value(); + // aua, aua, muss aber sein, weil sonst alle anderen consts nicht durchgehalten werden könnten + *const_cast(constContentPtr) = newValue.toString(); return; } diff --git a/src/items/xqitemfactory.h b/src/items/xqitemfactory.h index eb23d2c..cf51a4e 100644 --- a/src/items/xqitemfactory.h +++ b/src/items/xqitemfactory.h @@ -28,23 +28,14 @@ class XQItemFactory : public xsingleton public: - - void initItemFactory(const QString& modelSheetFileName ); XQNodePtr findModelSheet( const QString& modelName ) const; - XQItemList makeRow( const XQNodePtr& sheetNode, const XQNodePtr& contentNode ); + XQItemList makeRow( const XQNodePtr& sheetNode, const XQNodePtr& contentNode ); + XQItem* makeSingleItem( const XQNodePtr& sheetNode, const QString& caption ); - //XQItemList makeEmptyRow( const XQNodePtr& contentNode, const XQNodePtr& sheetNode ); - - XQItem* makeSingleItem( const XQNodePtr& sheetNode, const QString& caption ); - - - // wozu ist das gut? - //XQItemList createGenericRow( const XQNodePtr& contentNode, const XQNodePtr& sheetNode ); - - void setItemDataFromString( XQItem& item, const QString& roleKey, const QString& source ) const; + void setItemDataFromString( XQItem& item, const QString& roleKey, const QString& source ) const; XQItemType* makeItemType(const XQNodePtr& sheetEntry ); XQItemType* findItemTypeTemplate(const QString& key ) const; diff --git a/xml/saved_testfile.xtr b/xml/saved_testfile.xtr index ac8e3ef..b21fb3f 100644 --- a/xml/saved_testfile.xtr +++ b/xml/saved_testfile.xtr @@ -1,9 +1,9 @@ - + - +