You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
1.6 KiB
C++
72 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include <QTreeWidget>
|
|
#include "iGuiConfigBase_global.h"
|
|
|
|
class X_GUI_CONFIGBASE_EXPORT iWxTreeBase : public QTreeWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
iWxTreeBase(QWidget* parent = 0);
|
|
~iWxTreeBase();
|
|
|
|
virtual void refresh();
|
|
|
|
protected:
|
|
|
|
// 填充
|
|
virtual void fillTree();
|
|
|
|
// 公共Action初始化
|
|
void initCommonActions();
|
|
|
|
// 右键菜单功能总调用
|
|
virtual void initContextMenu(QMenu* pMenu);
|
|
|
|
// 空节点通用
|
|
virtual void initContextMenuCommonAll(QMenu* pMenu);
|
|
|
|
// 节点通用
|
|
virtual void initContextMenuCommonNode(QMenu* pMenu);
|
|
|
|
// 右键的部分功能重载实现
|
|
virtual bool showOrEditNode(QTreeWidgetItem* pItem);
|
|
virtual bool delCurrentNodes(QList<QTreeWidgetItem*>& listItems);
|
|
virtual bool renameCurrentNode(QString sNew);
|
|
virtual void doubleClickItem(QTreeWidgetItem* pItem);
|
|
|
|
Q_SIGNALS:
|
|
|
|
|
|
public slots:
|
|
|
|
// 具体响应函数
|
|
virtual void slotShowContextMenu(const QPoint &pos);
|
|
virtual void slotItemDoubleClicked(QTreeWidgetItem*, int);
|
|
|
|
virtual void slotDelNodes();
|
|
virtual void slotEditNode();
|
|
virtual void slotRenameNode();
|
|
virtual void slotItemNodeNameChanged(); //节点名称改变的槽
|
|
|
|
virtual void slotExpandNode();
|
|
virtual void slotExpandNodeAll();
|
|
virtual void slotCollapseNode();
|
|
virtual void slotCollapseNodeAll();
|
|
|
|
virtual void slotRefresh();
|
|
|
|
protected:
|
|
|
|
QMenu* m_pMenu;
|
|
QTreeWidgetItem* m_pItemSel;
|
|
QTreeWidgetItem* m_pRenameItem;
|
|
|
|
// 公共的Action项
|
|
QAction* m_pActionRename;
|
|
QAction* m_pActionEdit;
|
|
QAction* m_pActionDel;
|
|
};
|