Rabbit Remote Control 0.1.0-bate6
Loading...
Searching...
No Matches
Signals | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
CDatabaseTree Class Reference
Inheritance diagram for CDatabaseTree:
Inheritance graph
[legend]
Collaboration diagram for CDatabaseTree:
Collaboration graph
[legend]

Signals

void sigAddFolder (int id, int parentId)
 
void sigAdd (int id, int parentId)
 
- Signals inherited from CDatabase
void sigChanged ()
 

Public Member Functions

 CDatabaseTree (QObject *parent=nullptr)
 
 CDatabaseTree (const QString &szPrefix, QObject *parent=nullptr)
 
virtual int Add (const TreeItem &item)
 Add item.
 
virtual bool Update (const TreeItem &item)
 
virtual bool Delete (int id, bool delKey=false)
 
virtual bool Delete (QList< int > items, bool delKey=false)
 
virtual bool DeleteChild (int parentId, bool delKey=false)
 
virtual bool Move (int id, int newParent)
 
TreeItem GetLeaf (int id)
 
QList< TreeItemGetLeaves (int nodeId)
 Get the leaves under nodeId.
 
QList< TreeItemGetLeavesByKey (int key)
 Get leaves.
 
QList< TreeItemGetLeavesByKey (QList< int > key)
 
int GetLeafCount (int parentId=0)
 
virtual int AddNode (const QString &name, int parentId=0)
 
virtual bool RenameNode (int id, const QString &newName)
 
virtual bool DeleteNode (int id, bool delKey=false)
 
virtual bool MoveNode (int id, int newParentId)
 
TreeItem GetNode (int id)
 
QList< TreeItemGetAllNodes ()
 
QList< TreeItemGetSubNodes (int parentId)
 
int GetNodeCount (int nParentId=0)
 
int GetCount (int parentId=0)
 Get the count of parentId.
 
virtual bool OnInitializeDatabase () override
 
virtual bool ExportToJson (QJsonObject &obj) override
 
virtual bool ImportFromJson (const QJsonObject &obj) override
 
- Public Member Functions inherited from CDatabase
 CDatabase (QObject *parent=nullptr)
 
void SetDatabase (QSqlDatabase db, CParameterDatabase *pPara=nullptr)
 
QSqlDatabase GetDatabase () const
 
virtual bool OpenDatabase (CParameterDatabase *pPara=nullptr)
 OpenDatabase.
 
virtual bool OpenMySqlDatabase (CParameterDatabase *pPara)
 
virtual bool OpenODBCDatabase (CParameterDatabase *pPara)
 
virtual bool OpenSQLiteDatabase (const QString &connectionName=QString(), const QString &dbPath=QString())
 
virtual bool IsOpen () const
 
virtual void CloseDatabase ()
 
virtual bool ExportToJsonFile (const QString &szFile)
 
virtual bool ImportFromJsonFile (const QString &szFile)
 

Protected Member Functions

virtual bool OnDeleteKey (int key)
 
virtual bool OnInitializeSqliteDatabase () override
 
virtual bool OnInitializeMySqlDatabase () override
 

Private Attributes

QString m_szTableName
 
CDatabaseFolder m_FolderDB
 

Additional Inherited Members

- Protected Attributes inherited from CDatabase
QString m_szConnectName
 
QString m_MinVersion
 
CParameterDatabasem_pPara
 

Detailed Description

Definition at line 93 of file DatabaseTree.h.

Constructor & Destructor Documentation

◆ CDatabaseTree() [1/2]

CDatabaseTree::CDatabaseTree ( QObject *  parent = nullptr)
explicit

Definition at line 512 of file DatabaseTree.cpp.

◆ CDatabaseTree() [2/2]

CDatabaseTree::CDatabaseTree ( const QString &  szPrefix,
QObject *  parent = nullptr 
)
explicit

Definition at line 519 of file DatabaseTree.cpp.

Member Function Documentation

◆ Add()

int CDatabaseTree::Add ( const TreeItem item)
virtual

Add item.

Parameters
item
Returns
> 0 , id of added item. = 0 , failed

Definition at line 609 of file DatabaseTree.cpp.

◆ AddNode()

int CDatabaseTree::AddNode ( const QString &  name,
int  parentId = 0 
)
virtual

Definition at line 966 of file DatabaseTree.cpp.

◆ Delete() [1/2]

bool CDatabaseTree::Delete ( int  id,
bool  delKey = false 
)
virtual

Definition at line 693 of file DatabaseTree.cpp.

◆ Delete() [2/2]

bool CDatabaseTree::Delete ( QList< int >  items,
bool  delKey = false 
)
virtual

Definition at line 721 of file DatabaseTree.cpp.

◆ DeleteChild()

bool CDatabaseTree::DeleteChild ( int  parentId,
bool  delKey = false 
)
virtual

Definition at line 761 of file DatabaseTree.cpp.

◆ DeleteNode()

bool CDatabaseTree::DeleteNode ( int  id,
bool  delKey = false 
)
virtual

Definition at line 976 of file DatabaseTree.cpp.

◆ ExportToJson()

bool CDatabaseTree::ExportToJson ( QJsonObject &  obj)
overridevirtual

Implements CDatabase.

Definition at line 1018 of file DatabaseTree.cpp.

◆ GetAllNodes()

QList< TreeItem > CDatabaseTree::GetAllNodes ( )

Definition at line 993 of file DatabaseTree.cpp.

◆ GetCount()

int CDatabaseTree::GetCount ( int  parentId = 0)

Get the count of parentId.

include nodes and leaves

Parameters
parentId0, Get all count
Returns

Definition at line 1008 of file DatabaseTree.cpp.

◆ GetLeaf()

TreeItem CDatabaseTree::GetLeaf ( int  id)

Definition at line 805 of file DatabaseTree.cpp.

◆ GetLeafCount()

int CDatabaseTree::GetLeafCount ( int  parentId = 0)

Definition at line 952 of file DatabaseTree.cpp.

◆ GetLeaves()

QList< TreeItem > CDatabaseTree::GetLeaves ( int  nodeId)

Get the leaves under nodeId.

Parameters
nodeId
  • < 0: Get all leaves
  • >= 0: Get the leaves under the node

Definition at line 837 of file DatabaseTree.cpp.

◆ GetLeavesByKey() [1/2]

QList< TreeItem > CDatabaseTree::GetLeavesByKey ( int  key)

Get leaves.

Parameters
valueGet the leaves of value

Definition at line 873 of file DatabaseTree.cpp.

◆ GetLeavesByKey() [2/2]

QList< TreeItem > CDatabaseTree::GetLeavesByKey ( QList< int >  key)

Definition at line 909 of file DatabaseTree.cpp.

◆ GetNode()

TreeItem CDatabaseTree::GetNode ( int  id)

Definition at line 988 of file DatabaseTree.cpp.

◆ GetNodeCount()

int CDatabaseTree::GetNodeCount ( int  nParentId = 0)

Definition at line 1003 of file DatabaseTree.cpp.

◆ GetSubNodes()

QList< TreeItem > CDatabaseTree::GetSubNodes ( int  parentId)

Definition at line 998 of file DatabaseTree.cpp.

◆ ImportFromJson()

bool CDatabaseTree::ImportFromJson ( const QJsonObject &  obj)
overridevirtual

Implements CDatabase.

Definition at line 1053 of file DatabaseTree.cpp.

◆ Move()

bool CDatabaseTree::Move ( int  id,
int  newParent 
)
virtual

Definition at line 786 of file DatabaseTree.cpp.

◆ MoveNode()

bool CDatabaseTree::MoveNode ( int  id,
int  newParentId 
)
virtual

Definition at line 983 of file DatabaseTree.cpp.

◆ OnDeleteKey()

bool CDatabaseTree::OnDeleteKey ( int  key)
protectedvirtual

Definition at line 1013 of file DatabaseTree.cpp.

◆ OnInitializeDatabase()

bool CDatabaseTree::OnInitializeDatabase ( )
overridevirtual

Reimplemented from CDatabase.

Definition at line 527 of file DatabaseTree.cpp.

◆ OnInitializeMySqlDatabase()

bool CDatabaseTree::OnInitializeMySqlDatabase ( )
overrideprotectedvirtual

Reimplemented from CDatabase.

Definition at line 577 of file DatabaseTree.cpp.

◆ OnInitializeSqliteDatabase()

bool CDatabaseTree::OnInitializeSqliteDatabase ( )
overrideprotectedvirtual

Reimplemented from CDatabase.

Definition at line 543 of file DatabaseTree.cpp.

◆ RenameNode()

bool CDatabaseTree::RenameNode ( int  id,
const QString &  newName 
)
virtual

Definition at line 971 of file DatabaseTree.cpp.

◆ Update()

bool CDatabaseTree::Update ( const TreeItem item)
virtual

Definition at line 662 of file DatabaseTree.cpp.

Member Data Documentation

◆ m_FolderDB

CDatabaseFolder CDatabaseTree::m_FolderDB
private

Definition at line 175 of file DatabaseTree.h.

◆ m_szTableName

QString CDatabaseTree::m_szTableName
private

Definition at line 174 of file DatabaseTree.h.


The documentation for this class was generated from the following files: