|
Rabbit Remote Control 0.1.0-bate14
|
The CDatabaseNode class. More...
#include <DatabaseTree.h>


Signals | |
| void | sigAddNode (int id, int parentId) |
| Signals inherited from CDatabase | |
| void | sigChanged () |
Public Member Functions | |
| CDatabaseNode (const QString &szPrefix=QString(), QObject *parent=nullptr) | |
| int | AddNode (const QString &name, int parentId=0) |
| bool | RenameNode (int id, const QString &newName) |
| bool | DeleteNode (int id, std::function< bool(int parentId)> cbDeleteLeaf=nullptr, bool checkReturn=true) |
| bool | MoveNode (int id, int newParentId) |
| TreeItem | GetNode (int id) |
| QList< TreeItem > | GetAllNodes () |
| QList< TreeItem > | GetSubNodes (int parentId) |
| bool | InSubNode (int parentId, int id) |
| int | GetCount (int parentId=0) |
| Get count. | |
| virtual bool | ExportToJson (QJsonObject &obj) override |
| virtual bool | ImportFromJson (const QJsonObject &obj) override |
| Public Member Functions inherited from CDatabase | |
| CDatabase (QObject *parent=nullptr) | |
| QSqlDatabase | GetDatabase () const |
| virtual bool | IsOpen () const |
| void | CloseDatabase () |
| Close database. | |
| const CParameterDatabase * | GetParameter () const |
| const QString | GetError () const |
| bool | SetDatabase (const CDatabase *db) |
| Share an existing database. | |
| bool | SetDatabase (const QSqlDatabase db, const CParameterDatabase *pPara) |
| Share an existing database. | |
| bool | OpenDatabase (const CParameterDatabase *pPara=nullptr, const QString &szConnectName=QString()) |
| Open a new database. | |
| bool | OpenMySqlDatabase (const CParameterDatabase *pPara, const QString &szConnectName=QString()) |
| bool | OpenODBCDatabase (const CParameterDatabase *pPara, const QString &szConnectName=QString()) |
| bool | OpenSQLiteDatabase (const CParameterDatabase *pPara, const QString &szConnectionName=QString()) |
| bool | OpenSQLiteDatabase (const QString &szFile, const QString &szConnectionName=QString()) |
| virtual bool | ExportToJsonFile (const QString &szFile) |
| virtual bool | ImportFromJsonFile (const QString &szFile) |
Protected Member Functions | |
| virtual bool | OnDeleteLeafs (int id) |
| virtual bool | OnInitializeSqliteDatabase () override |
| virtual bool | OnInitializeMySqlDatabase () override |
| Protected Member Functions inherited from CDatabase | |
| void | SetError (const QString &szErr=QString()) |
| virtual bool | OnInitializeDatabase () |
| Initialize database. | |
Private Attributes | |
| QString | m_szTableName |
Additional Inherited Members | |
| Protected Attributes inherited from CDatabase | |
| QString | m_szConnectName |
| QString | m_MinVersion |
| const CParameterDatabase * | m_pPara |
The CDatabaseNode class.
Definition at line 60 of file DatabaseTree.h.
|
explicit |
Definition at line 132 of file DatabaseTree.cpp.
| int CDatabaseNode::AddNode | ( | const QString & | name, |
| int | parentId = 0 ) |
Definition at line 208 of file DatabaseTree.cpp.
| bool CDatabaseNode::DeleteNode | ( | int | id, |
| std::function< bool(int parentId)> | cbDeleteLeaf = nullptr, | ||
| bool | checkReturn = true ) |
Definition at line 291 of file DatabaseTree.cpp.
|
nodiscardoverridevirtual |
Reimplemented from CDatabase.
Definition at line 494 of file DatabaseTree.cpp.
|
nodiscard |
Definition at line 401 of file DatabaseTree.cpp.
|
nodiscard |
Get count.
| parentId | - 0 : Get all count
|
Definition at line 474 of file DatabaseTree.cpp.
|
nodiscard |
Definition at line 374 of file DatabaseTree.cpp.
|
nodiscard |
Definition at line 429 of file DatabaseTree.cpp.
|
nodiscardoverridevirtual |
Reimplemented from CDatabase.
Definition at line 523 of file DatabaseTree.cpp.
|
nodiscard |
Definition at line 461 of file DatabaseTree.cpp.
| bool CDatabaseNode::MoveNode | ( | int | id, |
| int | newParentId ) |
Definition at line 342 of file DatabaseTree.cpp.
|
nodiscardprotectedvirtual |
Definition at line 336 of file DatabaseTree.cpp.
|
nodiscardoverrideprotectedvirtual |
Reimplemented from CDatabase.
Definition at line 177 of file DatabaseTree.cpp.
|
nodiscardoverrideprotectedvirtual |
Reimplemented from CDatabase.
Definition at line 141 of file DatabaseTree.cpp.
| bool CDatabaseNode::RenameNode | ( | int | id, |
| const QString & | newName ) |
Definition at line 273 of file DatabaseTree.cpp.
|
private |
Definition at line 102 of file DatabaseTree.h.