Fixed ::setData, part II
This commit is contained in:
@@ -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<const QString*>();
|
||||
//Q_ASSERT(contentPtr);
|
||||
*contentPtr = newValue.toString();
|
||||
const QString* constContentPtr = QStandardItem::data( XQItem::ContentRole ).value<const QString*>();
|
||||
// aua, aua, muss aber sein, weil sonst alle anderen consts nicht durchgehalten werden könnten
|
||||
*const_cast<QString*>(constContentPtr) = newValue.toString();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -28,23 +28,14 @@ class XQItemFactory : public xsingleton<XQItemFactory>
|
||||
|
||||
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;
|
||||
|
Reference in New Issue
Block a user