created src subdir.
This commit is contained in:
2987
doc/Doxyfile
Normal file
2987
doc/Doxyfile
Normal file
File diff suppressed because it is too large
Load Diff
@@ -94,7 +94,7 @@ void XQChildModel::setContent( const XQNodePtr& contentRoot )
|
||||
section.contentRootNode = contentEntry->parent();
|
||||
int newRow = _sections.lastRow(section);
|
||||
|
||||
qDebug() << " --- AHJA: " << key << " -- last Row dazu: " << newRow;
|
||||
//qDebug() << " --- AHJA: " << key << " -- last Row dazu: " << newRow;
|
||||
XQItemList list = _itemFactory.makeContentRow( contentEntry, section.sheetRootNode );
|
||||
// als Baum?
|
||||
//section.headerItem().appendRow( list );
|
@@ -156,6 +156,8 @@ XQItem::XQItem(const XQItem& other)
|
||||
}
|
||||
|
||||
|
||||
//! firz
|
||||
|
||||
XQItem::~XQItem()
|
||||
{
|
||||
// fixed choices lebt im item type, also
|
||||
@@ -167,6 +169,8 @@ XQItem::~XQItem()
|
||||
}
|
||||
|
||||
|
||||
//! firz
|
||||
|
||||
XQItem* XQItem::clone() const
|
||||
{
|
||||
//return new XQItem( *this );
|
||||
@@ -176,6 +180,9 @@ XQItem* XQItem::clone() const
|
||||
return new XQItem();
|
||||
}
|
||||
|
||||
|
||||
//! firz
|
||||
|
||||
bool XQItem::isValid() const
|
||||
{
|
||||
// fragwürdig
|
||||
@@ -183,24 +190,31 @@ bool XQItem::isValid() const
|
||||
}
|
||||
|
||||
|
||||
//! firz
|
||||
|
||||
XQNodePtr XQItem::contentNode() const
|
||||
{
|
||||
return data( ContentNodeRole ).value<XQNodePtr>();
|
||||
}
|
||||
|
||||
|
||||
//! firz
|
||||
|
||||
void XQItem::setContentNode( const XQNodePtr& contentNode )
|
||||
{
|
||||
QStandardItem::setData( QVariant::fromValue(contentNode), ContentNodeRole);
|
||||
}
|
||||
|
||||
|
||||
//! firz
|
||||
|
||||
XQNodePtr XQItem::sheetNode() const
|
||||
{
|
||||
//
|
||||
return data( SheetNodeRole ).value<XQNodePtr>();
|
||||
}
|
||||
|
||||
//! firz
|
||||
|
||||
void XQItem::setSheetNode(const XQNodePtr& sheetNode )
|
||||
{
|
||||
@@ -208,12 +222,16 @@ void XQItem::setSheetNode(const XQNodePtr& sheetNode )
|
||||
}
|
||||
|
||||
|
||||
//! firz
|
||||
|
||||
bool XQItem::hasAttribute( const QString& attribKey ) const
|
||||
{
|
||||
return contentNode()->has_attribute( attribKey );
|
||||
}
|
||||
|
||||
|
||||
//! firz
|
||||
|
||||
const QString& XQItem::attribute( const QString& attribKey, const QString& defaultValue ) const
|
||||
{
|
||||
if( !hasAttribute(attribKey ) )
|
||||
@@ -221,18 +239,24 @@ const QString& XQItem::attribute( const QString& attribKey, const QString& defau
|
||||
return contentNode()->attribute( attribKey );
|
||||
}
|
||||
|
||||
|
||||
//! firz
|
||||
|
||||
bool XQItem::testAttribute( const QString& attribKey, const QString& attribValue ) const
|
||||
{
|
||||
return contentNode()->test_attribute( attribKey, attribValue );
|
||||
}
|
||||
|
||||
|
||||
//! firz
|
||||
|
||||
XQItemType& XQItem::itemType() const
|
||||
{
|
||||
XQItemType* itemTypePtr = QStandardItem::data( XQItem::ItemTypeRole ).value<XQItemType*>();
|
||||
return *itemTypePtr;
|
||||
}
|
||||
|
||||
//! firz
|
||||
|
||||
void XQItem::setItemType( XQItemType* itemTypePtr )
|
||||
{
|
||||
@@ -241,12 +265,16 @@ void XQItem::setItemType( XQItemType* itemTypePtr )
|
||||
}
|
||||
|
||||
|
||||
//! firz
|
||||
|
||||
void XQItem::addFlag( Qt::ItemFlag newFlag )
|
||||
{
|
||||
setFlags( flags() | newFlag );
|
||||
}
|
||||
|
||||
|
||||
//! firz
|
||||
|
||||
void XQItem::clearFlag( Qt::ItemFlag newFlag )
|
||||
{
|
||||
setFlags( flags() & ~newFlag);
|
||||
@@ -256,16 +284,22 @@ void XQItem::clearFlag( Qt::ItemFlag newFlag )
|
||||
/// data() access shortcuts
|
||||
///
|
||||
|
||||
//! firz
|
||||
|
||||
XQItem::RenderStyle XQItem::renderStyle() const
|
||||
{
|
||||
return data( RenderStyleRole ).value<RenderStyle>();
|
||||
}
|
||||
|
||||
|
||||
//! firz
|
||||
|
||||
QString XQItem::renderStyleToString() const
|
||||
{
|
||||
return XQItem::fetchRenderStyleToString( renderStyle() );
|
||||
}
|
||||
|
||||
//! firz
|
||||
|
||||
void XQItem::setRenderStyle(RenderStyle renderStyle )
|
||||
{
|
||||
@@ -275,17 +309,22 @@ void XQItem::setRenderStyle(RenderStyle renderStyle )
|
||||
}
|
||||
|
||||
|
||||
//! firz
|
||||
|
||||
XQItem::EditorType XQItem::editorType() const
|
||||
{
|
||||
return data( EditorTypeRole ).value<EditorType>();
|
||||
}
|
||||
|
||||
|
||||
//! firz
|
||||
|
||||
QString XQItem::editorTypeToString() const
|
||||
{
|
||||
return XQItem::fetchEditorTypeToString( editorType() );
|
||||
}
|
||||
|
||||
//! firz
|
||||
|
||||
void XQItem::setEditorType(EditorType editorType)
|
||||
{
|
||||
@@ -295,24 +334,32 @@ void XQItem::setEditorType(EditorType editorType)
|
||||
}
|
||||
|
||||
|
||||
//! firz
|
||||
|
||||
XQItem::UnitType XQItem::unitType() const
|
||||
{
|
||||
return data( XQItem::UnitTypeRole ).value<UnitType>();
|
||||
}
|
||||
|
||||
|
||||
//! firz
|
||||
|
||||
QString XQItem::unitTypeToString() const
|
||||
{
|
||||
return XQItem::fetchUnitTypeToString( unitType() );
|
||||
}
|
||||
|
||||
|
||||
//! firz
|
||||
|
||||
void XQItem::setUnitType(UnitType unitType)
|
||||
{
|
||||
setData( QVariant::fromValue(unitType), XQItem::UnitTypeRole);
|
||||
}
|
||||
|
||||
|
||||
//! firz
|
||||
|
||||
const QString& XQItem::content() const
|
||||
{
|
||||
const QString* contentPtr = QStandardItem::data( XQItem::ContentRole ).value<const QString*>();
|
||||
@@ -325,16 +372,22 @@ const QString& XQItem::content() const
|
||||
}
|
||||
|
||||
|
||||
//! firz
|
||||
|
||||
void XQItem::setContent( const QString* content )
|
||||
{
|
||||
setData( QVariant::fromValue<const QString*>(content), XQItem::ContentRole );
|
||||
}
|
||||
|
||||
|
||||
//! firz
|
||||
|
||||
const QString& XQItem::contentKey() const
|
||||
{
|
||||
return contentNode()->attributes().key_of( content() );
|
||||
}
|
||||
|
||||
//! gibt den content-format string zurück
|
||||
|
||||
QString XQItem::contentFormat() const
|
||||
{
|
||||
@@ -348,12 +401,17 @@ void XQItem::setContentFormat(const QString& contentFormat)
|
||||
}
|
||||
|
||||
|
||||
//! gibt das read-only auswahl-model zurück (wenn dieses item als
|
||||
//! combobox gerendert wird)
|
||||
|
||||
QStandardItemModel* XQItem::fixedChoices() const
|
||||
{
|
||||
return data( XQItem::FixedChoicesRole ).value<QStandardItemModel*>();
|
||||
}
|
||||
|
||||
|
||||
//! erzeugt einen string aus den werten des read-only auswahl-models
|
||||
|
||||
QString XQItem::fixedChoicesToString() const
|
||||
{
|
||||
QStandardItemModel* model = fixedChoices();
|
||||
@@ -375,21 +433,29 @@ QString XQItem::fixedChoicesToString() const
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//! setzt das auswahl-model für read-only comboboxes
|
||||
void XQItem::setfixedChoices( QStandardItemModel* newModel )
|
||||
{
|
||||
// Der RenderStyle wohnt im ItemType
|
||||
{
|
||||
setData( QVariant::fromValue(newModel), XQItem::FixedChoicesRole);
|
||||
}
|
||||
|
||||
//! true, wenn 'ich' ein header item bin
|
||||
bool XQItem::isHeaderStyle()
|
||||
{
|
||||
return renderStyle() == XQItem::HeaderStyle;
|
||||
}
|
||||
|
||||
|
||||
//! gibt den namen der datarole zurück
|
||||
QString XQItem::dataRoleName(int role)
|
||||
{
|
||||
if( role < XQItem::NoRole && model() )
|
||||
return model()->roleNames()[role];
|
||||
return XQItem::fetchItemDataRoleName(role);
|
||||
}
|
||||
|
||||
|
||||
//! angespasste variante von qstandarditem::setData. geteilte attribute
|
||||
//! werden vom xqitemtype geholt
|
||||
QVariant XQItem::data(int role ) const
|
||||
{
|
||||
//emitDataChanged()
|
@@ -223,9 +223,14 @@ public:
|
||||
//
|
||||
|
||||
bool isHeaderStyle();
|
||||
// ...
|
||||
|
||||
//! gibt den namen der datarole zurück
|
||||
QString dataRoleName(int role);
|
||||
|
||||
//! angespasste variante von qstandarditem::data
|
||||
QVariant data(int role = Qt::DisplayRole ) const override;
|
||||
|
||||
//! angespasste variante von qstandarditem::setData
|
||||
void setData(const QVariant &value, int role ) override;
|
||||
|
||||
// Das sind die die items im tree links: icon,text, node pointer
|
@@ -272,7 +272,8 @@ void XQModel::cmdCut( XQCommand& command )
|
||||
}
|
||||
}
|
||||
|
||||
//! entfernte knoten aus wieder einfügen , 'command' enthält die liste
|
||||
//! entfernte knoten wieder einfügen , 'command' enthält die liste
|
||||
|
||||
void XQModel::cmdCutUndo( XQCommand& command )
|
||||
{
|
||||
// die anfangsposition
|
||||
@@ -296,6 +297,7 @@ void XQModel::cmdCutUndo( XQCommand& command )
|
||||
|
||||
|
||||
//! clipboard inhalte einfügen
|
||||
|
||||
void XQModel::cmdPaste( XQCommand& command )
|
||||
{
|
||||
// selection holen ...
|
||||
@@ -315,19 +317,13 @@ void XQModel::cmdPaste( XQCommand& command )
|
||||
// wir pasten das clipboard
|
||||
for (auto& entry : _clipBoard )
|
||||
{
|
||||
//
|
||||
// siehe! und es war schrott!
|
||||
//
|
||||
|
||||
// das ist ein clon
|
||||
XQNodePtr savedNode = entry.contentNode;
|
||||
// der wir hier rein gelinkt
|
||||
XQItemList list = _itemFactory.makeContentRow( savedNode, section.sheetRootNode );
|
||||
|
||||
// wir klonen den knoten aus dem clipbord
|
||||
savedNode->clone(section.contentRootNode )->add_me_at( nodePos );
|
||||
// noch ein clone vom clone erzeugen ...
|
||||
XQNodePtr newNode = entry.contentNode->clone(section.contentRootNode );
|
||||
newNode->clone(section.contentRootNode )->add_me_at( nodePos );
|
||||
// ... und damit eine frische item-row erzeugen
|
||||
XQItemList list = _itemFactory.makeContentRow( newNode, section.sheetRootNode );
|
||||
insertRow( insRow, list );
|
||||
|
||||
// die neue item-row selektieren
|
||||
const QModelIndex& selIdx = list[0]->index();
|
||||
_treeView->selectionModel()->select(selIdx, QItemSelectionModel::Select | QItemSelectionModel::Rows);
|
||||
// zur nächsten zeile
|
||||
@@ -341,6 +337,8 @@ void XQModel::cmdPaste( XQCommand& command )
|
||||
}
|
||||
|
||||
|
||||
//! einfügen aus dem clipboard wieder rückgängig machen
|
||||
|
||||
void XQModel::cmdPasteUndo( XQCommand& command )
|
||||
{
|
||||
command.dumpList("Paste UNDO");
|
||||
@@ -359,6 +357,7 @@ void XQModel::cmdPasteUndo( XQCommand& command )
|
||||
|
||||
|
||||
// don't clone into clipboard, remove items
|
||||
|
||||
void XQModel::cmdDelete( XQCommand& command )
|
||||
{
|
||||
// wir gehen rückwärts über alle markieren knoten ...
|
@@ -72,8 +72,6 @@ SOURCES += \
|
||||
widgets/xqtreeview.cpp
|
||||
|
||||
|
||||
|
||||
|
||||
FORMS += \
|
||||
application/xqmainwindow.ui
|
||||
|
8
src/xtree.qrc
Normal file
8
src/xtree.qrc
Normal file
@@ -0,0 +1,8 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>../xml/modeldata1.xtr</file>
|
||||
<file>../xml/modeldata2.xtr</file>
|
||||
<file>../xml/modeldata3.xtr</file>
|
||||
<file>../xml/modelsheets.xml</file>
|
||||
</qresource>
|
||||
</RCC>
|
Reference in New Issue
Block a user