|
|
|
@@ -304,9 +304,7 @@ QString XQItem::editorTypeToString() const
|
|
|
|
|
|
|
|
|
|
void XQItem::setEditorType(EditorType editorType)
|
|
|
|
|
{
|
|
|
|
|
setData( QVariant::fromValue(editorType), XQItem::EditorTypeRole);
|
|
|
|
|
// Der EditorType wohnt im ItemType
|
|
|
|
|
//itemType().replaceAttribute( this, EditorTypeRole, editorType );
|
|
|
|
|
setData( QVariant::fromValue(editorType), XQItem::EditorTypeRole);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -453,7 +451,6 @@ QVariant XQItem::data(int role ) const
|
|
|
|
|
case IconRole: // aka Qt::DecorationRole,
|
|
|
|
|
case RenderStyleRole:
|
|
|
|
|
case EditorTypeRole:
|
|
|
|
|
case UnitTypeRole:
|
|
|
|
|
case ContentFormatRole:
|
|
|
|
|
case FixedChoicesRole:
|
|
|
|
|
{
|
|
|
|
@@ -485,7 +482,7 @@ QVariant XQItem::data(int role ) const
|
|
|
|
|
|
|
|
|
|
case Qt::ToolTipRole:
|
|
|
|
|
{
|
|
|
|
|
return content() + ":" + itemType().text() + ":" + renderStyleToString();
|
|
|
|
|
return content() + ":" + itemType().text() + ":" + renderStyleToString() + ":" + unitTypeToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
@@ -507,11 +504,12 @@ QVariant XQItem::data(int role ) const
|
|
|
|
|
return firstItem.data( XQItem::ContentNodeRole );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case UnitTypeRole:
|
|
|
|
|
|
|
|
|
|
case Qt::StatusTipRole:
|
|
|
|
|
case Qt::WhatsThisRole:
|
|
|
|
|
case Qt::SizeHintRole:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case Qt::FontRole:
|
|
|
|
|
case Qt::TextAlignmentRole:
|
|
|
|
|
case Qt::BackgroundRole:
|
|
|
|
@@ -556,7 +554,6 @@ void XQItem::setData(const QVariant& value, int role )
|
|
|
|
|
|
|
|
|
|
case RenderStyleRole :
|
|
|
|
|
case EditorTypeRole :
|
|
|
|
|
case UnitTypeRole:
|
|
|
|
|
case ContentFormatRole:
|
|
|
|
|
case FlagsRole: // Stimmt das?
|
|
|
|
|
case IconRole:
|
|
|
|
@@ -574,7 +571,7 @@ void XQItem::setData(const QVariant& value, int role )
|
|
|
|
|
case ContentRole:
|
|
|
|
|
{
|
|
|
|
|
// what will happen? value is a string ptr ?!
|
|
|
|
|
qDebug() << " --- setting content: " << value.toString();
|
|
|
|
|
//qDebug() << " --- setting content: " << value.toString();
|
|
|
|
|
// string ptr setzen kann die basis.
|
|
|
|
|
break;
|
|
|
|
|
return;
|
|
|
|
@@ -596,6 +593,8 @@ void XQItem::setData(const QVariant& value, int role )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// alles andere wie gehabt
|
|
|
|
|
case UnitTypeRole:
|
|
|
|
|
|
|
|
|
|
case ContentNodeRole:
|
|
|
|
|
case SheetNodeRole:
|
|
|
|
|
|
|
|
|
@@ -610,12 +609,17 @@ void XQItem::setData(const QVariant& value, int role )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//! gibt ein statisches invalid-item zurück, anstelle von nullptr
|
|
|
|
|
|
|
|
|
|
XQItem& XQItem::fallBackDummyItem()
|
|
|
|
|
{
|
|
|
|
|
static XQItem s_fallBackDummyItem;
|
|
|
|
|
return s_fallBackDummyItem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//! gibt das item für den gegebenen index aus.
|
|
|
|
|
|
|
|
|
|
XQItem& XQItem::xqItemFromIndex(const QModelIndex& index)
|
|
|
|
|
{
|
|
|
|
|
if (index.isValid())
|
|
|
|
@@ -624,10 +628,12 @@ XQItem& XQItem::xqItemFromIndex(const QModelIndex& index)
|
|
|
|
|
if (mdl)
|
|
|
|
|
return mdl->xqItemFromIndex(index);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return fallBackDummyItem();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//! gibt den enum-type für den gegebenen datarole-key aus.
|
|
|
|
|
|
|
|
|
|
int XQItem::fetchItemDataRole( const QString& dataRoleKey )
|
|
|
|
|
{
|
|
|
|
|
if(!dataRoleKey.isEmpty() && s_ItemDataRoleMap.contains(dataRoleKey) )
|
|
|
|
@@ -637,12 +643,16 @@ int XQItem::fetchItemDataRole( const QString& dataRoleKey )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//! gibt die bezeichung für die gegebene datarole aus.
|
|
|
|
|
|
|
|
|
|
QString XQItem::fetchItemDataRoleName( int dataRole )
|
|
|
|
|
{
|
|
|
|
|
return s_ItemDataRoleMap.key(dataRole);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//! gibt das flag für den gegebenen itemflag-key aus.
|
|
|
|
|
|
|
|
|
|
Qt::ItemFlag XQItem::fetchItemFlag( const QString& flagKey )
|
|
|
|
|
{
|
|
|
|
|
if(!flagKey.isEmpty() && s_ItemFlagMap.contains(flagKey) )
|
|
|
|
@@ -650,6 +660,7 @@ Qt::ItemFlag XQItem::fetchItemFlag( const QString& flagKey )
|
|
|
|
|
return Qt::NoItemFlags;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//! gibt die bezeichung für das gegebene itemFlag aus.
|
|
|
|
|
|
|
|
|
|
QString XQItem::fetchItemFlagName( int flag )
|
|
|
|
|
{
|
|
|
|
@@ -657,6 +668,8 @@ QString XQItem::fetchItemFlagName( int flag )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//! gibt den enum-type für den gegebenen renderStyle-key aus.
|
|
|
|
|
|
|
|
|
|
XQItem::RenderStyle XQItem::fetchRenderStyle(const QString& styleKey )
|
|
|
|
|
{
|
|
|
|
|
if(!styleKey.isEmpty() && s_RenderStyleMap.contains(styleKey) )
|
|
|
|
@@ -665,12 +678,16 @@ XQItem::RenderStyle XQItem::fetchRenderStyle(const QString& styleKey )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//! gibt die bezeichung für den gegebenen renderStyle aus.
|
|
|
|
|
|
|
|
|
|
QString XQItem::fetchRenderStyleToString(XQItem::RenderStyle renderStyle )
|
|
|
|
|
{
|
|
|
|
|
return s_RenderStyleMap.key(renderStyle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//! gibt den renderstyle enum-type für den gegebenen editorType-key aus.
|
|
|
|
|
|
|
|
|
|
XQItem::EditorType XQItem::fetchEditorType( const QString& editorTypeKey )
|
|
|
|
|
{
|
|
|
|
|
if(!editorTypeKey.isEmpty() && s_EditorTypeMap.contains(editorTypeKey) )
|
|
|
|
@@ -679,17 +696,22 @@ XQItem::EditorType XQItem::fetchEditorType( const QString& editorTypeKey )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//! gibt die bezeichung für den gegebenen editorType aus.
|
|
|
|
|
|
|
|
|
|
QString XQItem::fetchEditorTypeToString( EditorType editorType )
|
|
|
|
|
{
|
|
|
|
|
return s_EditorTypeMap.key(editorType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//! gibt den unitType für den gegebenen unitType-key aus.
|
|
|
|
|
|
|
|
|
|
XQItem::UnitType XQItem::fetchUnitType(const QString& unitTypeKey)
|
|
|
|
|
{
|
|
|
|
|
return s_UnitTypeMap.key(unitTypeKey);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//! gibt die bezeichung für den gegebenen unitType aus.
|
|
|
|
|
|
|
|
|
|
QString XQItem::fetchUnitTypeToString( UnitType unitType)
|
|
|
|
|
{
|
|
|
|
|