|
|
#pragma once
|
|
|
|
|
|
#include <QStyleOption>
|
|
|
#include <QDialog>
|
|
|
#include <QPainter>
|
|
|
#include <QDockWidget>
|
|
|
|
|
|
#include "ZxDynamic.h"
|
|
|
#include "ZxPtyItem.h"
|
|
|
#include "ZxBaseUtil.h"
|
|
|
#include "zxLogInstance.h"
|
|
|
#include "iProperty_global.h"
|
|
|
|
|
|
class QTextEdit;
|
|
|
|
|
|
// 属性载体
|
|
|
class I_PROPERTY_EXPORT ZxPtyDock : public QDockWidget
|
|
|
, virtual public IxPtyPano
|
|
|
, virtual public IxDynObj
|
|
|
{
|
|
|
Q_OBJECT
|
|
|
ZX_DECLARE_DYNAMIC
|
|
|
|
|
|
public:
|
|
|
|
|
|
ZxPtyDock(bool bShowBtns = false);
|
|
|
|
|
|
public:
|
|
|
|
|
|
// 添加组
|
|
|
virtual IxPtyItem* addGroup(const QString& key, \
|
|
|
bool expand = true, \
|
|
|
bool visible = true);
|
|
|
|
|
|
// 添加项
|
|
|
virtual IxPtyItem* add(ZX_PROPERTY_CHANGED_CALLBACK callback, \
|
|
|
const QString& key, \
|
|
|
const QVariant& var, \
|
|
|
IxPtyItem::ItemType type = IxPtyItem::typeDefault);
|
|
|
|
|
|
// 入口
|
|
|
virtual void beginSession(const QString& configName, \
|
|
|
IxInterface* pSessionOwner);
|
|
|
virtual void endSession();
|
|
|
|
|
|
// 具体对象
|
|
|
virtual void beginObject(IxPtySource* p);
|
|
|
virtual void endObject();
|
|
|
|
|
|
// 检索
|
|
|
virtual IxPtyItem* findPropertyItem(const QString& sKey);
|
|
|
|
|
|
virtual void clear(IxInterface* pSessionOwner = 0);
|
|
|
|
|
|
// 封装,仅仅为外界调用方便
|
|
|
void loadTemplOfCurItem();
|
|
|
void saveTemplOfCurItem();
|
|
|
|
|
|
signals:
|
|
|
|
|
|
void sigItemPropertyTempl(IxPtySource*, bool b, bool bSelf);
|
|
|
|
|
|
protected slots:
|
|
|
|
|
|
void onHelpMessage(const QString& help);
|
|
|
void changeEvent(QEvent* e);
|
|
|
|
|
|
void slotSaveTempl_Self();
|
|
|
void slotSaveTempl_All();
|
|
|
|
|
|
private:
|
|
|
|
|
|
void initUI();
|
|
|
|
|
|
protected:
|
|
|
|
|
|
IxPtyPano* m_pSheet;
|
|
|
QTextEdit* m_pHelpBox;
|
|
|
|
|
|
bool m_bShowBtns; //是否显示Btns
|
|
|
|
|
|
// 是否启用新的样式表,ZXF202407
|
|
|
bool m_bNovelQss;
|
|
|
};
|
|
|
|
|
|
/// @brief 该类主要目的就是为了属性页的透明显示
|
|
|
class I_PROPERTY_EXPORT QWidgetTemp : public QDialog
|
|
|
{
|
|
|
Q_OBJECT
|
|
|
|
|
|
public:
|
|
|
explicit QWidgetTemp(bool bNovelQss, QWidget *parent = 0)
|
|
|
: QDialog(parent)
|
|
|
{
|
|
|
//
|
|
|
//m_bNovelQss = bNovelQss;
|
|
|
//ZXF202407
|
|
|
setAutoFillBackground(true);
|
|
|
if (bNovelQss)
|
|
|
{
|
|
|
setStyleSheet("background : #EAF7FF;"
|
|
|
"border: 0px;"
|
|
|
"border-color:#88b3ee;"
|
|
|
"border-style: solid;");
|
|
|
return;
|
|
|
}
|
|
|
QString sName = QString("Image/%1_Pty.png").arg(zxAppID);
|
|
|
QString sImg = ZxBaseUtil::getDirOf(s_Dir_Res) + sName;
|
|
|
QString s = QString("QWidgetTemp {border-image: url(%1);}").arg(sImg);
|
|
|
setStyleSheet(s);
|
|
|
}
|
|
|
|
|
|
protected:
|
|
|
|
|
|
// paint
|
|
|
virtual void paintEvent(QPaintEvent *paint)
|
|
|
{
|
|
|
QStyleOption opt;
|
|
|
opt.init(this);
|
|
|
QPainter p(this);
|
|
|
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
|
|
}
|
|
|
protected:
|
|
|
//bool m_bNovelQss;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|