#pragma once #include #include #include #include #include #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); } };