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.
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <QGridLayout>
|
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
|
|
|
|
|
#include "Defines.h"
|
|
|
|
|
#include "ZxBaseUtil.h"
|
|
|
|
|
#include "ZxDockWidget.h"
|
|
|
|
|
|
|
|
|
|
#include "mGuiTree_global.h"
|
|
|
|
|
|
|
|
|
|
class M_GUI_TREE_EXPORT iDockBaseWx : public ZxDockWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit iDockBaseWx(const QString& sTitle, QWidget *parent = 0);
|
|
|
|
|
~iDockBaseWx();
|
|
|
|
|
|
|
|
|
|
// 多个Tab或单个
|
|
|
|
|
virtual void initUI(QStringList listTags, QStringList listIcons = QStringList());
|
|
|
|
|
// 功能按钮
|
|
|
|
|
virtual QHBoxLayout* initToolBars();
|
|
|
|
|
// 搜索相关
|
|
|
|
|
virtual QHBoxLayout* initSearchAbout();
|
|
|
|
|
// 返回窗体
|
|
|
|
|
QWidget* getWxItemOf(QString sTag);
|
|
|
|
|
// 返回当前窗体
|
|
|
|
|
QWidget* getCurrentWx();
|
|
|
|
|
// 返回TreeWidget
|
|
|
|
|
QTreeWidget* getTreeWxFrom(QWidget* p);
|
|
|
|
|
|
|
|
|
|
// virtual QSize sizeHint() const;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
// 创建第nIndex个
|
|
|
|
|
virtual QWidget* buildCentrlWx(int nIndex);
|
|
|
|
|
bool getTagOf(int nIndex, QString& sTag, QString& sIcon);
|
|
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
|
void slotSearchTextChanged(QString);
|
|
|
|
|
void slotFindNext();
|
|
|
|
|
// 这是为了当用户选择时,清除原有的Find造成的状态
|
|
|
|
|
void slotTreeCurrentChanged(QTreeWidgetItem*,QTreeWidgetItem*);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
// 内部包含的窗体,可以多个或一个
|
|
|
|
|
QStringList m_listTags;
|
|
|
|
|
QStringList m_listIcons;
|
|
|
|
|
QMap<QString, QWidget*> m_mapAllWxs;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
// 查找功能
|
|
|
|
|
QPushButton* m_pBtnFind; //查找按钮
|
|
|
|
|
QLineEdit* m_pTbxValue; //要查找内容
|
|
|
|
|
QList<QTreeWidgetItem*> m_vecFindItems; //当前查找到的项
|
|
|
|
|
int m_nFindIndex; //当前是第几个
|
|
|
|
|
|
|
|
|
|
};
|