#pragma once #include #include "Defines.h" #include "iPlugin_global.h" // 主要重载其信号响应 class I_PLUGIN_EXPORT ZxMdiArea : public QMdiArea { Q_OBJECT public: ZxMdiArea(QWidget* parent = 0); ~ZxMdiArea(); // 布局 // bFilterMode二次布局时,如果bFilterMode为true则过滤掉Hide的窗体 void layoutSubWnds(WndLayoutMode o, bool bFilterMode = false); WndLayoutMode getLayoutMode(); void relayoutSubWnds(); void setLastAutoSpan(bool b); void setColCount(int n); private: // 布局实现 void _layoutOne(QList listSubWnds); void _layoutVert(QList listSubWnds); void _layoutHori(QList listSubWnds); void _layoutCell(QList listSubWnds); void _layoutCascade(QList listSubWnds); protected: bool eventFilter(QObject *object, QEvent *event); void childEvent(QChildEvent *childEvent); void resizeEvent(QResizeEvent *resizeEvent); void timerEvent(QTimerEvent *timerEvent); void showEvent(QShowEvent *showEvent); signals: // Mdi大小发生了切换 void sigMdiSizeChanged(); // 在布局前允许用户对窗体顺序进行调整 void sigAdjustSubWnds(QList&); // nMode = 0: added 1:removed 2:polished // void sigChildActioned(QObject* pChild, int nMode); protected: WndLayoutMode m_oMode; bool m_bFilterMode; bool m_bLastSpan; //最后一个是否对齐(如果不够的话),默认为true int m_nColCount; //默认为2 };