#pragma once #include #include "iPlugin_global.h" // TabWidgetEx该类实现TabWidget相关附加功能 class I_PLUGIN_EXPORT TabWidgetEx : public QTabWidget { Q_OBJECT public: TabWidgetEx(QWidget *parent = 0); ~TabWidgetEx(); // 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允许移动 };