KanoopGuiQt 1.3.0
Qt GUI utility library
Loading...
Searching...
No Matches
abstracttreemodel.h
1/******************************************************************************************
2**
3** abstracttreemodel.h
4**
5** Extends AbstractItemModel to provide some tree-specific functions.
6**
7** Moved from my Tesseract Engineering repo to open-source
8**
9** Author: Stephen Punak
10** Created: Tue Oct 10 09:37:57 2023
11**
12******************************************************************************************/
13#ifndef ABSTRACTTREEMODEL_H
14#define ABSTRACTTREEMODEL_H
15#include "abstractitemmodel.h"
16
17/**
18 * @brief AbstractItemModel specialization for hierarchical (tree) models.
19 *
20 * Adds a columnChangedAtRowIndex() hook for notifying subclasses when a
21 * cell's column data changes during a tree-model update.
22 */
23class LIBKANOOPGUI_EXPORT AbstractTreeModel : public AbstractItemModel
24{
25 Q_OBJECT
26public:
27 /** @brief Construct with an optional parent. */
28 AbstractTreeModel(QObject* parent = nullptr);
29
30 /**
31 * @brief Construct with a logging category and optional parent.
32 * @param loggingCategory Category name used for log output
33 * @param parent Optional QObject parent
34 */
35 AbstractTreeModel(const QString& loggingCategory, QObject* parent = nullptr);
36
37protected:
38 // AbstractItemModel interface
39 /**
40 * @brief Called when a specific column cell at rowIndex has changed.
41 * @param rowIndex Row index of the changed cell
42 * @param columnHeader Column header type of the changed cell
43 */
44 virtual void columnChangedAtRowIndex(const QModelIndex& rowIndex, int columnHeader);
45};
46
47#endif // ABSTRACTTREEMODEL_H
Extended QAbstractItemModel providing EntityMetadata-based item lookup and header management.
AbstractItemModel specialization for hierarchical (tree) models.
virtual void columnChangedAtRowIndex(const QModelIndex &rowIndex, int columnHeader)
Called when a specific column cell at rowIndex has changed.
AbstractTreeModel(const QString &loggingCategory, QObject *parent=nullptr)
Construct with a logging category and optional parent.
AbstractTreeModel(QObject *parent=nullptr)
Construct with an optional parent.