#pragma once #include #include #include #include #include "iPlugin_global.h" // DockWidget扩展 class I_PLUGIN_EXPORT QDockWidgetEx : public QDockWidget { Q_OBJECT public: QDockWidgetEx(const QString &title, QWidget *parent = 0, Qt::WindowFlags flags = 0); QDockWidgetEx(QWidget *parent = 0, Qt::WindowFlags flags = 0); ~QDockWidgetEx(); bool IsWindowOpacity(void); void WindowOpacity(bool bOpacity); void changeTitle(bool bTopLevel); public slots: void slotFeaturesChanged(QDockWidget::DockWidgetFeatures features); void slotTopLevelChanged(bool topLevel); void slotAllowedAreasChanged(Qt::DockWidgetAreas allowedAreas); void slotVisibilityChanged(bool visible); void slotDockLocationChanged(Qt::DockWidgetArea area); protected: virtual void leaveEvent(QEvent * event); virtual void enterEvent(QEvent * event); virtual bool event(QEvent *event); void paintEvent(QPaintEvent *event); void init(); protected: bool m_bIsWindowOpacity; QString m_sTitle; };