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.bak

116 lines
2.6 KiB
C

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#pragma once
#include <QStyleOption>
#include <QDialog>
#include <QPainter>
#include <QDockWidget>
#include <ZxDynamic.h>
#include "ZxPtyItem.h"
#include "iProperty_global.h"
#include "ZxBaseUtil.h"
#include "zxLogInstance.h"
class QTextEdit;
class I_PROPERTY_EXPORT ZxPtyDock : public QDockWidget
, virtual public IxPtyPano
, virtual public IxDynObj
{
Q_OBJECT
ZX_DECLARE_DYNAMIC
public:
explicit 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 slotLoadTempl();
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)
{
//
if (bNovelQss)
{
return;
}
setAutoFillBackground(true);
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 *)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
};