diff --git a/src/application/xqchildmodel.cpp b/src/application/xqchildmodel.cpp index 1d988fe..eae879f 100644 --- a/src/application/xqchildmodel.cpp +++ b/src/application/xqchildmodel.cpp @@ -20,6 +20,10 @@ #include #include + + +//! default konstruktor. + XQChildModel::XQChildModel( QObject *parent ) : XQViewModel{parent} { @@ -27,15 +31,8 @@ XQChildModel::XQChildModel( QObject *parent ) } -XQChildModel::~XQChildModel() -{ +//! erzeugt die basisstruktur des models. -} - -/** - * @brief XQChildModel::initModel: Create the own modelstructure - * using subtree 'Components' - */ void XQChildModel::initModel(const QString& modelName) { // #0: Wir suchen die Model-Beschreibung @@ -65,6 +62,8 @@ void XQChildModel::initModel(const QString& modelName) } +//! erzegut den sichtbaren inhalt des models aus einem root-datenknoten. + void XQChildModel::setContent( const XQNodePtr& contentRoot ) { @@ -105,6 +104,8 @@ void XQChildModel::setContent( const XQNodePtr& contentRoot ) } +//! firz + void XQChildModel::createModelContentChildRow( QStandardItem* parent, XQNodePtr contentNode ) { /* @@ -121,6 +122,8 @@ void XQChildModel::createModelContentChildRow( QStandardItem* parent, XQNodePtr } +//! erzeugt ein adhoc-contextmenu, je nachdem welche aktionen gerade möflich sind. + void XQChildModel::initContextMenu() { diff --git a/src/application/xqchildmodel.h b/src/application/xqchildmodel.h index 7fa96ff..6ef0fe3 100644 --- a/src/application/xqchildmodel.h +++ b/src/application/xqchildmodel.h @@ -27,7 +27,7 @@ class XQChildModel : public XQViewModel public: explicit XQChildModel(QObject *parent = nullptr); - virtual ~XQChildModel(); + virtual ~XQChildModel() = default; void initModel(const QString& modelName) override; void setContent(const XQNodePtr& contentRoot ); diff --git a/src/model/xqcommand.cpp b/src/model/xqcommand.cpp index cf2b343..931ab71 100644 --- a/src/model/xqcommand.cpp +++ b/src/model/xqcommand.cpp @@ -28,7 +28,7 @@ void XQNodeStore::dumpList( const QString& title ) const } -//! firz +//! kostruktor. übergibt command-type und die aufrufende modelView. XQCommand::XQCommand(CmdType cmdType, XQViewModel* modelView ) : _cmdType{ cmdType }, _model(modelView) @@ -46,7 +46,7 @@ XQCommand::~XQCommand() -//! firz +//! gibt den enum-type dieses commands zurück. XQCommand::CmdType XQCommand::commandType() const { @@ -54,7 +54,7 @@ XQCommand::CmdType XQCommand::commandType() const } -//! firz +//! setzt den enum-type dieses commands. void XQCommand::setCommandType( XQCommand::CmdType cmdType ) { diff --git a/src/model/xqmodelsections.cpp b/src/model/xqmodelsections.cpp index f1e456d..90b668d 100644 --- a/src/model/xqmodelsections.cpp +++ b/src/model/xqmodelsections.cpp @@ -16,7 +16,8 @@ #include -//! firz +//! kontstruktor. übergibt den start-index und einen model-knoten mit der beschreibung +//! der datenknoten. XQModelSection::XQModelSection(const QModelIndex& aModelIndex, XQNodePtr aSheetNode) : modelIndex{ aModelIndex }, sheetRootNode{ aSheetNode } @@ -25,7 +26,7 @@ XQModelSection::XQModelSection(const QModelIndex& aModelIndex, XQNodePtr aSheetN } -//! firz +//! elementvergleich. bool XQModelSection::operator==(const XQModelSection& other) const { @@ -33,7 +34,7 @@ bool XQModelSection::operator==(const XQModelSection& other) const } -//! firz +//! true wenn der start-index valide und ein model-knoten vorhanden. bool XQModelSection::isValid() const { @@ -41,7 +42,7 @@ bool XQModelSection::isValid() const } -//! firz +//! gibt die zeile des start-index zurück. int XQModelSection::XQModelSection::row() const { @@ -49,7 +50,7 @@ int XQModelSection::XQModelSection::row() const } -//! firz +//! gibt das dieser section entsprechende header-item zurück. XQItem& XQModelSection::XQModelSection::headerItem() const { @@ -57,20 +58,14 @@ XQItem& XQModelSection::XQModelSection::headerItem() const } -// -// -// ------------------------------------------------------------------------------------------------------------------------------------------------------- -// -// - -void XQModelSections::addSectionEntry(const QModelIndex& idx, XQNodePtr sheetNode) +void XQModelSectionList::addSectionEntry(const QModelIndex& idx, XQNodePtr sheetNode) { XQModelSection section(idx, sheetNode); addAtKey(sheetNode->tag_name(), section); } -bool XQModelSections::hasValidSection(const QString& sectionKey) const +bool XQModelSectionList::hasValidSection(const QString& sectionKey) const { if (!contains(sectionKey) ) return false; @@ -78,13 +73,13 @@ bool XQModelSections::hasValidSection(const QString& sectionKey) const } -const XQModelSection& XQModelSections::sectionxqItemFromIndex( const QModelIndex& index ) const +const XQModelSection& XQModelSectionList::sectionxqItemFromIndex( const QModelIndex& index ) const { return sectionFromRow( index.row() ); } -const XQModelSection& XQModelSections::sectionFromRow(int itemRow ) const +const XQModelSection& XQModelSectionList::sectionFromRow(int itemRow ) const { int i = size() - 1; @@ -100,19 +95,19 @@ const XQModelSection& XQModelSections::sectionFromRow(int itemRow ) const } -int XQModelSections::firstRow(const QModelIndex& idx) const +int XQModelSectionList::firstRow(const QModelIndex& idx) const { return sectionFromRow(idx.row() ).row(); } -int XQModelSections::lastRow(const QModelIndex& idx) const +int XQModelSectionList::lastRow(const QModelIndex& idx) const { return lastRow(sectionFromRow(idx.row())); } -int XQModelSections::lastRow(const XQModelSection& section ) const +int XQModelSectionList::lastRow(const XQModelSection& section ) const { //qDebug() << " -- last row in section: " << section.modelIndex.data().toString() << " --> " << section.modelIndex.row(); // row() der section unterhalb dieser @@ -130,7 +125,7 @@ int XQModelSections::lastRow(const XQModelSection& section ) const } -void XQModelSections::dump() const +void XQModelSectionList::dump() const { qDebug() << " --- sections dump(): " < +class XQModelSectionList : public XQMaptor { public: - XQModelSections() = default; - virtual ~XQModelSections() = default; + XQModelSectionList() = default; + virtual ~XQModelSectionList() = default; void addSectionEntry(const QModelIndex& idx, XQNodePtr sheetNode ); bool hasValidSection(const QString& sectionKey) const; diff --git a/src/model/xqviewmodel.h b/src/model/xqviewmodel.h index b05e6b8..2ac99c2 100644 --- a/src/model/xqviewmodel.h +++ b/src/model/xqviewmodel.h @@ -123,7 +123,7 @@ protected: // das eine reference auf ein globales singleton XQItemFactory& _itemFactory; XQSimpleClipBoard _clipBoard; - XQModelSections _sections; + XQModelSectionList _sections; XQTreeTable* _treeTable{}; QUndoStack* _undoStack{};