From e7213c60b8d0214b82d5f0fd8743822809e2c197 Mon Sep 17 00:00:00 2001 From: "PANIK\\chris" Date: Thu, 7 Aug 2025 03:11:56 +0200 Subject: [PATCH] renamings. --- src/application/xqchildmodel.cpp | 4 +- src/application/xqchildmodel.h | 4 +- src/application/xqdocumentstore.cpp | 4 +- src/application/xqdocumentstore.h | 8 +-- src/application/xqmainmodel.cpp | 4 +- src/application/xqmainmodel.h | 6 +- src/application/xqmainwindow.cpp | 4 +- src/application/xqmainwindow.ui | 6 +- src/items/xqitem.cpp | 4 +- src/items/xqitemdelegate.cpp | 8 +-- src/items/xqitemdelegate.h | 10 +-- src/items/xqitemfactory.cpp | 2 +- src/items/xqitemfactory.h | 2 +- src/model/xqcommand.cpp | 6 +- src/model/xqcommand.h | 6 +- src/model/xqsimpleclipboard.cpp | 2 +- src/model/{xqmodel.cpp => xqviewmodel.cpp} | 62 +++++++++---------- src/model/{xqmodel.h => xqviewmodel.h} | 24 +++---- .../{xqtreeview.cpp => xqtreetable.cpp} | 28 ++++----- src/widgets/{xqtreeview.h => xqtreetable.h} | 16 ++--- src/xtree.pro | 10 +-- 21 files changed, 110 insertions(+), 110 deletions(-) rename src/model/{xqmodel.cpp => xqviewmodel.cpp} (88%) rename src/model/{xqmodel.h => xqviewmodel.h} (87%) rename src/widgets/{xqtreeview.cpp => xqtreetable.cpp} (85%) rename src/widgets/{xqtreeview.h => xqtreetable.h} (88%) diff --git a/src/application/xqchildmodel.cpp b/src/application/xqchildmodel.cpp index 0bb245a..42bb2ab 100644 --- a/src/application/xqchildmodel.cpp +++ b/src/application/xqchildmodel.cpp @@ -17,11 +17,11 @@ #include #include #include -#include +#include #include XQChildModel::XQChildModel( QObject *parent ) - : XQModel{parent} + : XQViewModel{parent} { } diff --git a/src/application/xqchildmodel.h b/src/application/xqchildmodel.h index 71d046f..7fa96ff 100644 --- a/src/application/xqchildmodel.h +++ b/src/application/xqchildmodel.h @@ -16,11 +16,11 @@ #define XQCHILDMODEL_H -#include +#include -class XQChildModel : public XQModel +class XQChildModel : public XQViewModel { Q_OBJECT diff --git a/src/application/xqdocumentstore.cpp b/src/application/xqdocumentstore.cpp index 70416eb..20cebfc 100644 --- a/src/application/xqdocumentstore.cpp +++ b/src/application/xqdocumentstore.cpp @@ -20,7 +20,7 @@ -XQDocument::XQDocument(const QString& aFileName, const QString& aFriendlyName, XQItem* aTreeItem, XQModel* aModelView ) +XQDocument::XQDocument(const QString& aFileName, const QString& aFriendlyName, XQItem* aTreeItem, XQViewModel* aModelView ) : fileName{ aFileName }, friendlyName{ aFriendlyName }, treeItem{ aTreeItem }, modelView{ aModelView } { @@ -47,7 +47,7 @@ XQDocumentStore::~XQDocumentStore() -void XQDocumentStore::addDocument( const QString& aFileName, const QString& aFriendlyName, XQItem* aTreeItem, XQModel* aModelView ) +void XQDocumentStore::addDocument( const QString& aFileName, const QString& aFriendlyName, XQItem* aTreeItem, XQViewModel* aModelView ) { XQDocument newDocument( aFileName, aFriendlyName, aTreeItem,aModelView ); addAtKey( aFileName, newDocument ); diff --git a/src/application/xqdocumentstore.h b/src/application/xqdocumentstore.h index e019ebf..bd379f7 100644 --- a/src/application/xqdocumentstore.h +++ b/src/application/xqdocumentstore.h @@ -18,7 +18,7 @@ #include #include -class XQModel; +class XQViewModel; class XQItem; // should this be internal?? @@ -26,14 +26,14 @@ struct XQDocument { XQDocument() = default; - XQDocument( const QString& aFileName, const QString& aFriendlyName, XQItem* aTreeItem, XQModel* aModelView ); + XQDocument( const QString& aFileName, const QString& aFriendlyName, XQItem* aTreeItem, XQViewModel* aModelView ); virtual ~XQDocument(); QString fileName; // also used as key QString friendlyName; XQItem* treeItem{}; - XQModel* modelView{}; + XQViewModel* modelView{}; }; @@ -46,7 +46,7 @@ public: XQDocumentStore() = default; virtual ~ XQDocumentStore(); - void addDocument( const QString& aFileName, const QString& aFriendlyName, XQItem* aTreeItem, XQModel* aModelView ); + void addDocument( const QString& aFileName, const QString& aFriendlyName, XQItem* aTreeItem, XQViewModel* aModelView ); protected: diff --git a/src/application/xqmainmodel.cpp b/src/application/xqmainmodel.cpp index 90bc9d6..a61a953 100644 --- a/src/application/xqmainmodel.cpp +++ b/src/application/xqmainmodel.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include #include @@ -27,7 +27,7 @@ XQMainModel::XQMainModel(QObject *parent ) - : XQModel{parent} + : XQViewModel{parent} { } diff --git a/src/application/xqmainmodel.h b/src/application/xqmainmodel.h index df3ba63..57c5b50 100644 --- a/src/application/xqmainmodel.h +++ b/src/application/xqmainmodel.h @@ -17,13 +17,13 @@ //#include -#include +#include //#include -class XQTreeView; +class XQTreeTable; -class XQMainModel : public XQModel +class XQMainModel : public XQViewModel { Q_OBJECT diff --git a/src/application/xqmainwindow.cpp b/src/application/xqmainwindow.cpp index 13b7792..0fe9115 100644 --- a/src/application/xqmainwindow.cpp +++ b/src/application/xqmainwindow.cpp @@ -63,7 +63,7 @@ void XQMainWindow::initMainWindow() connect( _mainTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(onTreeItemClicked(QModelIndex)) ); connect( _tabWidget, SIGNAL(tabBarClicked(int)), this, SLOT(onTabClicked(int)) ); - connect( &_mainModelView, &XQModel::xqItemCreated, this, [=, this](XQItem* item) + connect( &_mainModelView, &XQViewModel::xqItemCreated, this, [=, this](XQItem* item) { // when a new main tree item has been created ... QString pID = item->contentNode()->attribute(c_ProjectID); @@ -247,7 +247,7 @@ void XQMainWindow::loadDocument( const QString& fileName ) QString pTitle = QString("Project %1: %2").arg( pID, fName ); // Eine neue TreeView erzeugn und im TabWidget parken. - XQTreeView* childTreeView = new XQTreeView(_tabWidget); + XQTreeTable* childTreeView = new XQTreeTable(_tabWidget); _tabWidget->addTab( childTreeView, pTitle ); _tabWidget->setCurrentWidget( childTreeView ); setWindowTitle( pTitle ); diff --git a/src/application/xqmainwindow.ui b/src/application/xqmainwindow.ui index d689464..b66f586 100644 --- a/src/application/xqmainwindow.ui +++ b/src/application/xqmainwindow.ui @@ -101,7 +101,7 @@ 0 - + @@ -280,9 +280,9 @@ - XQTreeView + XQTreeTable QTreeView -
xqtreeview.h
+
xqtreetable.h
diff --git a/src/items/xqitem.cpp b/src/items/xqitem.cpp index f03e35c..631508a 100644 --- a/src/items/xqitem.cpp +++ b/src/items/xqitem.cpp @@ -13,7 +13,7 @@ #include -#include +#include #include #include #include @@ -576,7 +576,7 @@ XQItem& XQItem::xqItemFromIndex(const QModelIndex& index) { if (index.isValid()) { - const XQModel* mdl = dynamic_cast(index.model()); + const XQViewModel* mdl = dynamic_cast(index.model()); if (mdl) return mdl->xqItemFromIndex(index); } diff --git a/src/items/xqitemdelegate.cpp b/src/items/xqitemdelegate.cpp index 932d3f5..62513ea 100644 --- a/src/items/xqitemdelegate.cpp +++ b/src/items/xqitemdelegate.cpp @@ -23,9 +23,9 @@ #include #include -#include +#include #include -#include +#include class XQItemEditorFactory : public QItemEditorFactory @@ -61,7 +61,7 @@ public: -XQItemDelegate::XQItemDelegate( XQModel& modelView) +XQItemDelegate::XQItemDelegate( XQViewModel& modelView) : _modelView{modelView} { static XQItemEditorFactory s_EditorFactory; @@ -69,7 +69,7 @@ XQItemDelegate::XQItemDelegate( XQModel& modelView) } -XQTreeView* XQItemDelegate::treeView() const +XQTreeTable* XQItemDelegate::treeView() const { return _modelView.treeView(); } diff --git a/src/items/xqitemdelegate.h b/src/items/xqitemdelegate.h index 5ef16ae..a51b692 100644 --- a/src/items/xqitemdelegate.h +++ b/src/items/xqitemdelegate.h @@ -19,8 +19,8 @@ #include class XQItem; -class XQTreeView; -class XQModel; +class XQTreeTable; +class XQViewModel; /** * @brief A specialized QItemDelegate class to draw different XQItem styles. @@ -32,9 +32,9 @@ class XQItemDelegate : public QStyledItemDelegate public: - explicit XQItemDelegate(XQModel& modelView); + explicit XQItemDelegate(XQViewModel& modelView); - XQTreeView* treeView() const; + XQTreeTable* treeView() const; XQItem& xqItemFromIndex( const QModelIndex& index ) const; void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; @@ -53,7 +53,7 @@ protected: void drawComboBoxStyle(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; void drawSpinBoxStyle(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; - XQModel& _modelView; + XQViewModel& _modelView; }; diff --git a/src/items/xqitemfactory.cpp b/src/items/xqitemfactory.cpp index f76d275..bd0ab4d 100644 --- a/src/items/xqitemfactory.cpp +++ b/src/items/xqitemfactory.cpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/items/xqitemfactory.h b/src/items/xqitemfactory.h index 613ea7b..f76dfdf 100644 --- a/src/items/xqitemfactory.h +++ b/src/items/xqitemfactory.h @@ -19,7 +19,7 @@ #include #include -class XQModel; +class XQViewModel; // erzeugt items aus XQNodes diff --git a/src/model/xqcommand.cpp b/src/model/xqcommand.cpp index 9245322..f724e6f 100644 --- a/src/model/xqcommand.cpp +++ b/src/model/xqcommand.cpp @@ -13,8 +13,8 @@ #include -#include -#include +#include +#include void XQNodeStore::dumpList( const QString& title ) const @@ -26,7 +26,7 @@ void XQNodeStore::dumpList( const QString& title ) const } -XQCommand::XQCommand(CmdType cmdType, XQModel* modelView ) +XQCommand::XQCommand(CmdType cmdType, XQViewModel* modelView ) : _cmdType{ cmdType }, _model(modelView) { diff --git a/src/model/xqcommand.h b/src/model/xqcommand.h index b1c0c7a..6464b5e 100644 --- a/src/model/xqcommand.h +++ b/src/model/xqcommand.h @@ -18,7 +18,7 @@ #include #include -class XQModel; +class XQViewModel; struct XQNodeBackup { @@ -66,7 +66,7 @@ public: cmdExtern //?? }; - XQCommand(CmdType cmdType, XQModel* modelView ); + XQCommand(CmdType cmdType, XQViewModel* modelView ); virtual ~XQCommand(); CmdType commandType() const; @@ -85,7 +85,7 @@ public: protected: CmdType _cmdType{cmdInvalid}; - XQModel* _model{}; // needed for redo() / undo() + XQViewModel* _model{}; // needed for redo() / undo() QModelIndex _originIndex; /* diff --git a/src/model/xqsimpleclipboard.cpp b/src/model/xqsimpleclipboard.cpp index ad471c5..b9c7119 100644 --- a/src/model/xqsimpleclipboard.cpp +++ b/src/model/xqsimpleclipboard.cpp @@ -13,7 +13,7 @@ #include -#include +#include bool XQSimpleClipBoard::canPaste( const QModelIndex& curIdx ) const diff --git a/src/model/xqmodel.cpp b/src/model/xqviewmodel.cpp similarity index 88% rename from src/model/xqmodel.cpp rename to src/model/xqviewmodel.cpp index e70bb06..c68a193 100644 --- a/src/model/xqmodel.cpp +++ b/src/model/xqviewmodel.cpp @@ -16,9 +16,9 @@ #include #include -#include +#include #include -#include +#include #include #include #include @@ -38,12 +38,12 @@ void showItemList( const XQItemList& list) } -XQModel::~XQModel() +XQViewModel::~XQViewModel() { } -XQModel::XQModel( QObject* parent ) +XQViewModel::XQViewModel( QObject* parent ) : QStandardItemModel{ parent }, _itemFactory{ XQItemFactory::instance() } { invisibleRootItem()->setData( "[rootItem]", Qt::DisplayRole ); @@ -51,7 +51,7 @@ XQModel::XQModel( QObject* parent ) } -const XQItem& XQModel::xqRootItem() +const XQItem& XQViewModel::xqRootItem() { // das ist ein hack, denn 'invisibleRootItem()' ist und bleibt ein // QStandardItem. Trick: keine eigenen members in XQItem, alles @@ -62,7 +62,7 @@ const XQItem& XQModel::xqRootItem() } -XQItem& XQModel::xqItemFromIndex(const QModelIndex& index) const +XQItem& XQViewModel::xqItemFromIndex(const QModelIndex& index) const { if( index.isValid() ) { @@ -73,12 +73,12 @@ XQItem& XQModel::xqItemFromIndex(const QModelIndex& index) const return XQItem::fallBackDummyItem(); } -XQItem& XQModel::xqFirstItem(int row) const +XQItem& XQViewModel::xqFirstItem(int row) const { return *static_cast( QStandardItemModel::item(row) ); } -void XQModel::onActionTriggered(QAction* action) +void XQViewModel::onActionTriggered(QAction* action) { qDebug() << " --- onActionTriggered: count:" << XQNode::s_Count; @@ -125,11 +125,11 @@ void XQModel::onActionTriggered(QAction* action) /** - * @brief XQModel::onCommandRedo called to execute a command ('do'). + * @brief XQViewModel::onCommandRedo called to execute a command ('do'). * @param command the current command */ -void XQModel::onCommandRedo( XQCommand& command ) +void XQViewModel::onCommandRedo( XQCommand& command ) { try { @@ -167,11 +167,11 @@ void XQModel::onCommandRedo( XQCommand& command ) /** - * @brief XQModel::onCommandUndo: called to 'undo' a command. + * @brief XQViewModel::onCommandUndo: called to 'undo' a command. * @param command the command to be undone. */ -void XQModel::onCommandUndo( XQCommand& command ) +void XQViewModel::onCommandUndo( XQCommand& command ) { qDebug() << " --- onCommandUndo: count: " << XQNode::s_Count; try @@ -220,7 +220,7 @@ void XQModel::onCommandUndo( XQCommand& command ) // undo-/redo-able stuff //! markierte knoten entfernen, 'command' enthält die liste -void XQModel::cmdCut( XQCommand& command ) +void XQViewModel::cmdCut( XQCommand& command ) { // wir gehen rückwärts über alle gemerkten knoten ... for (auto it = command.rbegin(); it != command.rend(); ++it) @@ -238,7 +238,7 @@ void XQModel::cmdCut( XQCommand& command ) //! entfernte knoten wieder einfügen , 'command' enthält die liste -void XQModel::cmdCutUndo( XQCommand& command ) +void XQViewModel::cmdCutUndo( XQCommand& command ) { // die anfangsposition int itmPos = command.first().itemPos; @@ -262,7 +262,7 @@ void XQModel::cmdCutUndo( XQCommand& command ) //! clipboard inhalte einfügen -void XQModel::cmdPaste( XQCommand& command ) +void XQViewModel::cmdPaste( XQCommand& command ) { // selection holen ... QItemSelectionModel* selectionModel = treeView()->selectionModel(); @@ -303,7 +303,7 @@ void XQModel::cmdPaste( XQCommand& command ) //! einfügen aus dem clipboard wieder rückgängig machen -void XQModel::cmdPasteUndo( XQCommand& command ) +void XQViewModel::cmdPasteUndo( XQCommand& command ) { command.dumpList("Paste UNDO"); // wir gehen rückwärts über alle markieren knoten ... @@ -322,7 +322,7 @@ void XQModel::cmdPasteUndo( XQCommand& command ) // don't clone into clipboard, remove items -void XQModel::cmdDelete( XQCommand& command ) +void XQViewModel::cmdDelete( XQCommand& command ) { // wir gehen rückwärts über alle markieren knoten ... for (auto it = command.rbegin(); it != command.rend(); ++it) @@ -337,18 +337,18 @@ void XQModel::cmdDelete( XQCommand& command ) } } -void XQModel::cmdDeleteUndo( XQCommand& command ) +void XQViewModel::cmdDeleteUndo( XQCommand& command ) { } /** - * @brief XQModel::cmdNewRow create one new item row + * @brief XQViewModel::cmdNewRow create one new item row * @param command the command */ -void XQModel::cmdNew( XQCommand& command ) +void XQViewModel::cmdNew( XQCommand& command ) { // __fix @@ -382,12 +382,12 @@ void XQModel::cmdNew( XQCommand& command ) */ } -void XQModel::cmdNewUndo( XQCommand& command ) +void XQViewModel::cmdNewUndo( XQCommand& command ) { } -void XQModel::cmdToggleSection( const QModelIndex& index ) +void XQViewModel::cmdToggleSection( const QModelIndex& index ) { Q_ASSERT(index.isValid()); @@ -401,12 +401,12 @@ void XQModel::cmdToggleSection( const QModelIndex& index ) } -XQTreeView* XQModel::treeView() +XQTreeTable* XQViewModel::treeView() { return _treeView; } -void XQModel::setTreeView(XQTreeView* mainView ) +void XQViewModel::setTreeView(XQTreeTable* mainView ) { // store view for direct access: the maintree _treeView = mainView; @@ -426,11 +426,11 @@ void XQModel::setTreeView(XQTreeView* mainView ) } /** - * @brief XQModel::setupViewProperties set the tree views' properties: context menu policy, + * @brief XQViewModel::setupViewProperties set the tree views' properties: context menu policy, * edit triggers and so on. */ -void XQModel::setupViewProperties() +void XQViewModel::setupViewProperties() { _treeView->setContextMenuPolicy(Qt::CustomContextMenu); _treeView->setEditTriggers(QAbstractItemView::DoubleClicked | QAbstractItemView::EditKeyPressed); @@ -441,26 +441,26 @@ void XQModel::setupViewProperties() } -void XQModel::addSection( const XQItemList& list, const XQNodePtr& sheetNode ) +void XQViewModel::addSection( const XQItemList& list, const XQNodePtr& sheetNode ) { appendRow(list); _sections.addSectionEntry( list[0]->index(), sheetNode ); } -QUndoStack* XQModel::undoStack() +QUndoStack* XQViewModel::undoStack() { return _undoStack; } -void XQModel::setUndoStack( QUndoStack* undoStack ) +void XQViewModel::setUndoStack( QUndoStack* undoStack ) { _undoStack = undoStack; } -void XQModel::onShowContextMenu(const QPoint& point) +void XQViewModel::onShowContextMenu(const QPoint& point) { initContextMenu(); _contextMenu->popup(_treeView->mapToGlobal(point)); @@ -468,7 +468,7 @@ void XQModel::onShowContextMenu(const QPoint& point) -QHash XQModel::roleNames() const +QHash XQViewModel::roleNames() const { QHash roles; diff --git a/src/model/xqmodel.h b/src/model/xqviewmodel.h similarity index 87% rename from src/model/xqmodel.h rename to src/model/xqviewmodel.h index 1238772..57e1d2f 100644 --- a/src/model/xqmodel.h +++ b/src/model/xqviewmodel.h @@ -12,8 +12,8 @@ ***************************************************************************/ -#ifndef XQMODEL_H -#define XQMODEL_H +#ifndef XQVIEWMODEL_H +#define XQVIEWMODEL_H #include #include @@ -25,7 +25,7 @@ #include -class XQTreeView; +class XQTreeTable; class XQItem; class XQCommand; @@ -35,25 +35,25 @@ class XQCommand; */ // might be own implementation of QAbstractItemModel, not done yet. -//using QStandardItemModel = XQSimpleItemModel; +// using QStandardItemModel = XQSimpleItemModel; using QStandardItemModel = QStandardItemModel; /** - * @brief The XQModel class: An extendend QStandardItem model + * @brief The XQViewModel class: An extendend QStandardItem model * containing its own view. */ -class XQModel : public QStandardItemModel +class XQViewModel : public QStandardItemModel { Q_OBJECT public: - XQModel(QObject* parent = nullptr); - virtual ~XQModel(); + XQViewModel(QObject* parent = nullptr); + virtual ~XQViewModel(); - XQTreeView* treeView(); - virtual void setTreeView( XQTreeView* mainView ); + XQTreeTable* treeView(); + virtual void setTreeView( XQTreeTable* mainView ); QUndoStack* undoStack(); void setUndoStack( QUndoStack* undoStack ); @@ -125,7 +125,7 @@ protected: XQSimpleClipBoard _clipBoard; XQModelSections _sections; - XQTreeView* _treeView{}; + XQTreeTable* _treeView{}; QUndoStack* _undoStack{}; XQContextMenu* _contextMenu{}; @@ -136,4 +136,4 @@ protected: }; -#endif // XQMODEL_H +#endif // XQVIEWMODEL_H diff --git a/src/widgets/xqtreeview.cpp b/src/widgets/xqtreetable.cpp similarity index 85% rename from src/widgets/xqtreeview.cpp rename to src/widgets/xqtreetable.cpp index cc1226b..81d2069 100644 --- a/src/widgets/xqtreeview.cpp +++ b/src/widgets/xqtreetable.cpp @@ -15,12 +15,12 @@ #include #include "qheaderview.h" -#include -#include +#include +#include #define DB_TIMESTAMP QTime::currentTime().toString(" -- HH:mm:ss.zzz") -XQTreeView::XQTreeView(QWidget* parent) +XQTreeTable::XQTreeTable(QWidget* parent) : QTreeView(parent) { /* @@ -34,24 +34,24 @@ XQTreeView::XQTreeView(QWidget* parent) } -XQTreeView::~XQTreeView() +XQTreeTable::~XQTreeTable() { } -XQModel* XQTreeView::modelView() +XQViewModel* XQTreeTable::modelView() { - return static_cast(model()); + return static_cast(model()); } // __fixme: necessary? -XQItem& XQTreeView::xqItemFromIndex(const QModelIndex& index ) +XQItem& XQTreeTable::xqItemFromIndex(const QModelIndex& index ) { return modelView()->xqItemFromIndex( index ); } -void XQTreeView::currentChanged(const QModelIndex& current, const QModelIndex& previous) +void XQTreeTable::currentChanged(const QModelIndex& current, const QModelIndex& previous) { QTreeView::currentChanged(current, previous); @@ -68,7 +68,7 @@ void XQTreeView::currentChanged(const QModelIndex& current, const QModelIndex& p } -void XQTreeView::mouseResizeHeaderEntry(int xpos) +void XQTreeTable::mouseResizeHeaderEntry(int xpos) { // resize colummn: minimal vertical margin in pixels static const int s_MinimalMargin = 50; @@ -90,7 +90,7 @@ void XQTreeView::mouseResizeHeaderEntry(int xpos) } } -void XQTreeView::mouseMoveEvent(QMouseEvent* event) +void XQTreeTable::mouseMoveEvent(QMouseEvent* event) { // pixel Grenzwert zur Anzeige des Splitcursors static const int s_CatchOffset = 5; @@ -128,7 +128,7 @@ void XQTreeView::mouseMoveEvent(QMouseEvent* event) QTreeView::mouseMoveEvent(event); } -void XQTreeView::mouseDoubleClickEvent(QMouseEvent* event) +void XQTreeTable::mouseDoubleClickEvent(QMouseEvent* event) { /* QModelIndex idxFromPos = indexAt(event->pos()); @@ -144,7 +144,7 @@ void XQTreeView::mouseDoubleClickEvent(QMouseEvent* event) } -void XQTreeView::mousePressEvent(QMouseEvent* event) +void XQTreeTable::mousePressEvent(QMouseEvent* event) { // case #1: @@ -161,7 +161,7 @@ void XQTreeView::mousePressEvent(QMouseEvent* event) } -void XQTreeView::mouseReleaseEvent(QMouseEvent* event) +void XQTreeTable::mouseReleaseEvent(QMouseEvent* event) { // reset index for resize column _indexToResize = QModelIndex(); @@ -170,7 +170,7 @@ void XQTreeView::mouseReleaseEvent(QMouseEvent* event) } -void XQTreeView::wheelEvent(QWheelEvent* event) +void XQTreeTable::wheelEvent(QWheelEvent* event) { // Ctrl-key down? if (!event->modifiers().testFlag(Qt::ControlModifier)) diff --git a/src/widgets/xqtreeview.h b/src/widgets/xqtreetable.h similarity index 88% rename from src/widgets/xqtreeview.h rename to src/widgets/xqtreetable.h index 67c7a47..dfc215e 100644 --- a/src/widgets/xqtreeview.h +++ b/src/widgets/xqtreetable.h @@ -12,32 +12,32 @@ ***************************************************************************/ -#ifndef XQTREEVIEW_H -#define XQTREEVIEW_H +#ifndef XQTREETABLE_H +#define XQTREETABLE_H #include #include #include class XQItem; -class XQModel; +class XQViewModel; /** * @brief A specialized QTreeView that will handle the drawing of * empty or non-existing items in the future. */ -class XQTreeView : public QTreeView +class XQTreeTable : public QTreeView { Q_OBJECT Q_DECLARE_PRIVATE(QTreeView) public: - XQTreeView(QWidget* parent = nullptr ); - virtual ~XQTreeView(); + XQTreeTable(QWidget* parent = nullptr ); + virtual ~XQTreeTable(); - XQModel* modelView(); + XQViewModel* modelView(); XQItem& xqItemFromIndex(const QModelIndex& index ); protected: @@ -59,4 +59,4 @@ protected: QModelIndex _indexToResize; }; -#endif // XQTREEVIEW_H +#endif // XQTREETABLE_H diff --git a/src/xtree.pro b/src/xtree.pro index 0f40f59..dc73ba4 100644 --- a/src/xtree.pro +++ b/src/xtree.pro @@ -21,12 +21,12 @@ HEADERS += \ items/xqitemtype.h \ items/xqitemdelegate.h \ model/xqcommand.h \ - model/xqmodel.h \ model/xqmodelsections.h \ model/xqnode.h \ model/xqnodewriter.h \ model/xqselectionmodel.h \ model/xqsimpleclipboard.h \ + model/xqviewmodel.h \ nodes/znode.h \ nodes/znode_factory.h \ nodes/znode_id.h \ @@ -44,7 +44,7 @@ HEADERS += \ util/xsingleton.h \ util/xtreewalker.h \ widgets/xqcontextmenu.h \ - widgets/xqtreeview.h + widgets/xqtreetable.h SOURCES += \ application/xqchildmodel.cpp \ @@ -59,17 +59,17 @@ SOURCES += \ items/xqitemdelegate.cpp \ main.cpp \ model/xqcommand.cpp \ - model/xqmodel.cpp \ model/xqmodelsections.cpp \ model/xqnode.cpp \ model/xqnodewriter.cpp \ model/xqselectionmodel.cpp \ model/xqsimpleclipboard.cpp \ + model/xqviewmodel.cpp \ nodes/znode.cpp \ - pugixml/pugixml.cpp \ + pugixml/pugixml.cpp \ util/xqexception.cpp \ widgets/xqcontextmenu.cpp \ - widgets/xqtreeview.cpp + widgets/xqtreetable.cpp FORMS += \