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.
nmWATI/Include/iBase/iProperty/ZxPtyDock.h

136 lines
2.9 KiB
C

#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;
// 属性载体Dock)
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);
// 入口
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 changeEvent(QEvent* e);
// 模版存/取
void slotSaveTempl_Self();
void slotSaveTempl_All();
// Tips显示
void slotShowItemTips(const QString& s);
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;
};