#pragma once #include #include "iPlugin_global.h" // ZxTabWidget该类实现TabWidget相关附加功能 class I_PLUGIN_EXPORT ZxTabWidget : public QTabWidget { Q_OBJECT public: ZxTabWidget(QWidget *parent = 0); ~ZxTabWidget(); // Tab是否允许移动,默认不移动 void setTabMovable(bool b); bool isTabMovable(); // TabBar void setTabBarHorW(int n); int getTabBarHorW(); protected: // virtual void mouseDoubleClickEvent(QMouseEvent *); // event分发 virtual bool eventFilter(QObject *, QEvent *); signals: // 双击Item void sigItemDoubleClicked(int n); // 右击Item void sigItemRightClicked(int n, QPoint pos); private: QTabBar* m_pTabBar; bool m_bTabMovable; //TabItem允许移动 };