From e3256c68f02b786650617107a403471c3384f2bf Mon Sep 17 00:00:00 2001 From: "PANIK\\chris" Date: Thu, 7 Aug 2025 02:36:13 +0200 Subject: [PATCH] minor cleanups. --- .gitignore | 3 ++- doc/Doxyfile | 14 +++++------ src/items/xqitem.cpp | 9 ++----- src/items/xqitem.h | 28 ++++----------------- src/items/xqitemtype.cpp | 54 ---------------------------------------- src/items/xqitemtype.h | 28 +++------------------ src/model/xqmodel.cpp | 36 --------------------------- src/model/xqmodel.h | 4 --- src/model/xqnode.h | 30 ---------------------- 9 files changed, 20 insertions(+), 186 deletions(-) diff --git a/.gitignore b/.gitignore index 267d9ce..13f2cda 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ doc/~$ree_thoughts.docx doc/~WRL0004.tmp UsersC998D~1.HOLAppDataLocalTemptmpj0mbo3rd xml/fitzefatz.xml -build* \ No newline at end of file +build* +doc/ diff --git a/doc/Doxyfile b/doc/Doxyfile index 1308ef2..89220d8 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -74,7 +74,7 @@ PROJECT_ICON = # entered, it will be relative to the location where Doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = +OUTPUT_DIRECTORY = C:/syncMePlease/sourceworx.ng/xtree.ng/doc # If the CREATE_SUBDIRS tag is set to YES then Doxygen will create up to 4096 # sub-directories (in 2 levels) under the output directory of each output format @@ -534,7 +534,7 @@ TIMESTAMP = NO # normally produced when WARNINGS is set to YES. # The default value is: NO. -EXTRACT_ALL = NO +EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. @@ -991,7 +991,7 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = C:/syncMePlease/sourceworx.ng/xtree.ng +INPUT = C:/syncMePlease/sourceworx.ng/xtree.ng/src # This tag can be used to specify the character encoding of the source files # that Doxygen parses. Internally Doxygen uses the UTF-8 encoding. Doxygen uses @@ -1237,7 +1237,7 @@ FORTRAN_COMMENT_AFTER = 72 # also VERBATIM_HEADERS is set to NO. # The default value is: NO. -SOURCE_BROWSER = NO +SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body of functions, # multi-line macros, enums or list initialized variables directly into the @@ -1455,7 +1455,7 @@ HTML_STYLESHEET = # documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = +HTML_EXTRA_STYLESHEET = doxygen-awesome-css/doxygen-awesome.css # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -1478,7 +1478,7 @@ HTML_EXTRA_FILES = # The default value is: AUTO_LIGHT. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_COLORSTYLE = AUTO_LIGHT +HTML_COLORSTYLE = TOGGLE # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to @@ -2061,7 +2061,7 @@ EXTRA_SEARCH_MAPPINGS = # If the GENERATE_LATEX tag is set to YES, Doxygen will generate LaTeX output. # The default value is: YES. -GENERATE_LATEX = YES +GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of diff --git a/src/items/xqitem.cpp b/src/items/xqitem.cpp index d5bdcc5..f03e35c 100644 --- a/src/items/xqitem.cpp +++ b/src/items/xqitem.cpp @@ -120,10 +120,7 @@ XQItem::XQPrefixExponentMap XQItem::s_PrefixExponentMap XQItem::XQItem() : XQItem{XQItemType::staticItemType()} { - setFlags(Qt::NoItemFlags); - //setText("[dummy]"); - //XQItemType::setStaticType( this ); - //setItemType(NTItemType::defaultItemType()); + } XQItem::XQItem( XQItemType* itemType ) @@ -146,7 +143,7 @@ XQItem::XQItem(XQItemType* itemType, const QString *content, const XQNodePtr& co setContentNode(contentNode); } -/// ------------------ forbidden fruits ------------------ + XQItem::XQItem(const XQItem& other) : QStandardItem( other ) @@ -309,8 +306,6 @@ void XQItem::setRenderStyle(RenderStyle renderStyle ) } -//! firz - XQItem::EditorType XQItem::editorType() const { return data( EditorTypeRole ).value(); diff --git a/src/items/xqitem.h b/src/items/xqitem.h index e1b7ed6..1d51a91 100644 --- a/src/items/xqitem.h +++ b/src/items/xqitem.h @@ -24,7 +24,6 @@ using XQItemList = QList; -//class QStyleOptionViewItem; class XQItemFactory; class XQItemType; @@ -38,9 +37,6 @@ class XQItem : public QStandardItem public: - //friend class XQItemType; - //friend class XQItemFactory; - /// Die data(enum role) Infrastruktur wird sowohl für XQItem als auch /// für den XQItemType verwendet, deshalb definieren wir hier _alle_ /// notwendigen Roles @@ -69,11 +65,6 @@ public: TypeKeyRole, //TypeNameRole, nicht so wichtig - /* - renderStyleToStringRole, - editorTypeToStringRole, - unitTypeToStringRole, - */ RoleEnd }; @@ -94,11 +85,6 @@ public: CustomRenderStyle, RenderStyleEnd //!< Not a special editor. Keep at end of this enumeration! // ... - /* - PickerStyle - LineEditStyle , - UserDefStyle , - */ }; // wie wirds editiert @@ -146,12 +132,6 @@ public: XQItem( XQItemType* itemType, const QString* content ); XQItem( XQItemType* itemType, const QString* content, const XQNodePtr& contentNode ); - /* - XQItem(const QString& text); - XQItem(const QIcon& icon, const QString& text); - XQItem(int rows, int columns); - */ - XQItem(const XQItem& other); XQItem(const QStandardItem& other); @@ -161,13 +141,14 @@ public: //! -- not used at the moment -- XQItem* clone() const override; + //! bool isValid() const; - - // shortcuts auf XQNodePtr - + //! gibt den zu diesem item gehörigen datenknoten virtual XQNodePtr contentNode() const; + + virtual void setContentNode(const XQNodePtr& contentNode ); virtual XQNodePtr sheetNode() const; @@ -203,6 +184,7 @@ public: QString renderStyleToString() const; void setRenderStyle(RenderStyle renderStyle ); + //! fitze FATZE! EditorType editorType() const; QString editorTypeToString() const; void setEditorType(EditorType editorType); diff --git a/src/items/xqitemtype.cpp b/src/items/xqitemtype.cpp index 1feac9c..87b79d3 100644 --- a/src/items/xqitemtype.cpp +++ b/src/items/xqitemtype.cpp @@ -181,32 +181,6 @@ XQItemType* XQItemType::staticItemType() return &s_DummyItemType; } -// -// Das ist eigentlich Blödsinn, KISS baby KISS! -// Die ItemTypes sollten statisch bleiben, zusätzliche -// oder geänderte Attribute eines Items landen dann -// halt in G.N. in QStadardItem::data Vector! -// -/* -XQItemType* XQItemType::storeItemType(XQItemType* protoType) -{ - // haben wir den prototype schon? - QString itemTypeKey = protoType->makeItemTypeKey(); - if(s_ItemTypeMap.contains( itemTypeKey ) ) - { - // dann weg damit ... - delete protoType; - // ... und die alte Version zurückgeben - return s_ItemTypeMap[itemTypeKey]; - } - // sonst: wir speichern den prototype - s_ItemTypeMap.insert( itemTypeKey, protoType); - s_ItemTypeCount++; - qDebug() << " --- ItemTypes: " << s_ItemTypeCount; - - return protoType; -} -*/ QString XQItemType::makeItemTypeKey() { @@ -221,34 +195,6 @@ QString XQItemType::makeItemTypeKey() key = key.arg( icon().name() ); key = key.arg( fixedChoicesToString() ); - /* - static const QList roleList - { - XQItem::RenderStyleRole, - XQItem::EditorTypeRole, - XQItem::UnitTypeRole, - XQItem::ContentFormatRole, - XQItem::FlagsRole, - XQItem::IconRole, - XQItem::FixedChoicesRole - }; - - QString key; - - for( const auto role : roleList ) - { - qDebug() << " --- YYY trying: " << XQItem::fetchItemDataRoleName( role ); - QVariant entry = data(role); - if( !entry.isNull() && entry.isValid()) - { - // fckin' sonderlocke: - key += role == XQItem::IconRole ? entry.value().name() : entry.toString(); - } - key += ":"; - } - */ - - //qDebug() << " --- YES: KEY: " << key; return key; } diff --git a/src/items/xqitemtype.h b/src/items/xqitemtype.h index e8b025d..9846a73 100644 --- a/src/items/xqitemtype.h +++ b/src/items/xqitemtype.h @@ -21,22 +21,14 @@ #include -/// -/// Ist das Unsinn!? Einfach ein QStandardItem mit data() nehmen? -/// Ok, das erspart die die attribs, aber wo ist der fette gewinn? -/// statt _editorType = x hast Du dann halt setData( QVariant::fromValue<>(x) ); -/// Aber: Du kannst T abbilden auf QString ... und dann -/// - using XQItemTypeMap = QMap; -//class XQItemType : public QObject + class XQItemType : public XQItem// public QObject { - // - //Q_OBJECT - // wäre auch eine möglichkeit !? - //Q_PROPERTY(XQItem::RenderStyle renderStyle renderStyle getDate WRITE setrenderStyle ) + // Q_OBJECT + // wäre dann auch eine möglichkeit: + // Q_PROPERTY(XQItem::RenderStyle renderStyle renderStyle getDate WRITE setrenderStyle ) public: @@ -52,12 +44,10 @@ public: QString formatToSI(const QString& rawText ) const; QString unFormatFromSI(const QString& valueText ) const; - void replaceAttribute( XQItem* item, const QVariant& newValue, int role ); QString makeItemTypeKey(); - //static XQItemType* storeItemType( XQItemType* protoType ); static XQItemType* staticItemType(); protected: @@ -65,16 +55,6 @@ protected: static XQItemTypeMap s_ItemTypeMap; static size_t s_ItemTypeCount; - /* - static void setItemType( XQItem* item, RenderStyle renderStyle, Qt::ItemFlags flags, UnitType unitType, const QString& format ); - static void setStaticType( XQItem* item ); - */ - // fix __ch - // static void setItemType( XQItem* item, const QString& renderStyle, const QString& unitType, const QString& itemTypeID ); - - //static XQItemType* addItemType( const QString& key, RenderStyle renderStyle, UnitType unitType); - //static XQItemType* makeItemType( RenderStyle renderStyle, UnitType unitType); - }; diff --git a/src/model/xqmodel.cpp b/src/model/xqmodel.cpp index 2d86459..e70bb06 100644 --- a/src/model/xqmodel.cpp +++ b/src/model/xqmodel.cpp @@ -73,47 +73,11 @@ XQItem& XQModel::xqItemFromIndex(const QModelIndex& index) const return XQItem::fallBackDummyItem(); } - - XQItem& XQModel::xqFirstItem(int row) const { return *static_cast( QStandardItemModel::item(row) ); } - -QString XQModel::fetchNodeAttribute(int row, const QString& key ) -{ - /* - __fix - XQItem* item = fromRow(row); - if( item && item->hasNode() ) - return item->contentNode()->attribute( key ); - - */ - return ""; -} - - -/** - * @brief XQModel::fetchNodeTagName get the tag_name of the contentNode - * in a row - * @param row the row - * @return - */ - -QString XQModel::fetchNodeTagName( int row ) -{ - // __fix - /* - XQItem* item = fromRow(row); - if( item && item->hasNode() ) - return item->contentNode()->tag_name(); - */ - return ""; -} - - - void XQModel::onActionTriggered(QAction* action) { qDebug() << " --- onActionTriggered: count:" << XQNode::s_Count; diff --git a/src/model/xqmodel.h b/src/model/xqmodel.h index 28ee926..1238772 100644 --- a/src/model/xqmodel.h +++ b/src/model/xqmodel.h @@ -69,10 +69,6 @@ public: XQItem& xqItemFromIndex(const QModelIndex& index) const; XQItem& xqFirstItem(int row) const; - // was ist das? - QString fetchNodeAttribute(int row, const QString& key ); - QString fetchNodeTagName(int row ); - // undo-/redo-able stuff virtual void cmdToggleSection( const QModelIndex& index ); diff --git a/src/model/xqnode.h b/src/model/xqnode.h index 5df8602..173de3b 100644 --- a/src/model/xqnode.h +++ b/src/model/xqnode.h @@ -34,48 +34,18 @@ std::ostream& operator<<(std::ostream& os, const QString& obj); using XQNode = znode::zbasic_node; // default shared node using XQNodePtr = std::shared_ptr>; -// const ref on XQNodePtr, ok but what its good for? -//using const XQNodePtr& = const XQNodePtr&; -/* -class XQBasicSheetNode : public znode::zbasic_node -{ -public: - - //... -}; - -using XQSheetNode = std::shared_ptr; -using XQSheetNodeCRef = const XQSheetNode&; -*/ - -/// -/// __fix -/// sollte man einen XQNodePtr einführen, um 'setAttr()' von -/// setAttr() unterscheiden zu können? -/// -/// nice try. (siehe oben). Haut aber so nicht hin, node.children() gibt wieder -/// Pointer auf die Basisklasse zurück, ( vgl. XQItemList -> QList. -/// Erst dass behandeln! -/// - -// weak pointer to znode, used for parent() -using XQWeakNode = std::weak_ptr>; // the node factory using XQNodeFactory = znode::znode_factory; class XQNodeList : public znode::zbasic_node::znode_list { - friend class XQSimpleClipBoard; - public: XQNodeList() = default; virtual ~XQNodeList() = default; - - };