2019-10-09 20:15:53 +08:00
|
|
|
%Import QtWidgets/QtWidgetsmod.sip
|
|
|
|
|
|
|
|
%If (Qt_5_0_0 -)
|
|
|
|
|
|
|
|
namespace ads
|
|
|
|
{
|
|
|
|
|
|
|
|
class CDockWidget : QFrame
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <DockWidget.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
protected:
|
2020-02-22 05:47:09 +08:00
|
|
|
void setDockManager(ads::CDockManager* DockManager /Transfer/ );
|
|
|
|
void setDockArea(ads::CDockAreaWidget* DockArea /Transfer/ );
|
|
|
|
void setToggleViewActionChecked(bool Checked);
|
|
|
|
void saveState(QXmlStreamWriter& Stream) const;
|
|
|
|
void flagAsUnassigned();
|
|
|
|
static void emitTopLevelEventForWidget(ads::CDockWidget* TopLevelDockWidget, bool Floating);
|
|
|
|
void emitTopLevelChanged(bool Floating);
|
|
|
|
void setClosedState(bool Closed);
|
|
|
|
void toggleViewInternal(bool Open);
|
|
|
|
bool closeDockWidgetInternal(bool ForceClose = false);
|
2019-10-09 20:15:53 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
enum DockWidgetFeature
|
|
|
|
{
|
|
|
|
DockWidgetClosable,
|
|
|
|
DockWidgetMovable,
|
|
|
|
DockWidgetFloatable,
|
2019-12-19 07:17:28 +08:00
|
|
|
DockWidgetDeleteOnClose,
|
2020-02-25 14:22:51 +08:00
|
|
|
CustomCloseHandling,
|
|
|
|
DefaultDockWidgetFeatures,
|
|
|
|
AllDockWidgetFeatures,
|
2019-10-09 20:15:53 +08:00
|
|
|
NoDockWidgetFeatures
|
|
|
|
};
|
|
|
|
typedef QFlags<ads::CDockWidget::DockWidgetFeature> DockWidgetFeatures;
|
|
|
|
|
|
|
|
enum eState
|
|
|
|
{
|
|
|
|
StateHidden,
|
|
|
|
StateDocked,
|
|
|
|
StateFloating
|
|
|
|
};
|
|
|
|
|
|
|
|
enum eInsertMode
|
|
|
|
{
|
|
|
|
AutoScrollArea,
|
|
|
|
ForceScrollArea,
|
|
|
|
ForceNoScrollArea
|
|
|
|
};
|
2020-03-29 02:32:07 +08:00
|
|
|
|
|
|
|
enum eMinimumSizeHintMode
|
|
|
|
{
|
|
|
|
MinimumSizeHintFromDockWidget,
|
|
|
|
MinimumSizeHintFromContent
|
|
|
|
};
|
2019-10-09 20:15:53 +08:00
|
|
|
|
|
|
|
enum eToggleViewActionMode
|
|
|
|
{
|
|
|
|
ActionModeToggle,
|
|
|
|
ActionModeShow
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
CDockWidget(const QString &title, QWidget* parent /TransferThis/ = 0);
|
|
|
|
virtual ~CDockWidget();
|
|
|
|
virtual QSize minimumSizeHint() const;
|
|
|
|
void setWidget(QWidget* widget /Transfer/, ads::CDockWidget::eInsertMode InsertMode = AutoScrollArea);
|
|
|
|
QWidget* takeWidget() /TransferBack/;
|
|
|
|
QWidget* widget() const;
|
|
|
|
ads::CDockWidgetTab* tabWidget() const;
|
|
|
|
void setFeatures(ads::CDockWidget::DockWidgetFeatures features);
|
|
|
|
void setFeature(ads::CDockWidget::DockWidgetFeature flag, bool on);
|
|
|
|
ads::CDockWidget::DockWidgetFeatures features() const;
|
|
|
|
ads::CDockManager* dockManager() const;
|
|
|
|
ads::CDockContainerWidget* dockContainer() const;
|
|
|
|
ads::CDockAreaWidget* dockAreaWidget() const;
|
|
|
|
bool isFloating() const;
|
|
|
|
bool isInFloatingContainer() const;
|
|
|
|
bool isClosed() const;
|
|
|
|
QAction* toggleViewAction() const;
|
|
|
|
void setToggleViewActionMode(ads::CDockWidget::eToggleViewActionMode Mode);
|
2020-03-29 02:32:07 +08:00
|
|
|
void setMinimumSizeHintMode(ads::CDockWidget::eMinimumSizeHintMode Mode);
|
2019-10-09 20:15:53 +08:00
|
|
|
void setIcon(const QIcon& Icon);
|
|
|
|
QIcon icon() const;
|
|
|
|
QToolBar* toolBar() const;
|
|
|
|
QToolBar* createDefaultToolBar();
|
2020-02-22 05:47:09 +08:00
|
|
|
void setToolBar(QToolBar* ToolBar /Transfer/ );
|
2019-10-09 20:15:53 +08:00
|
|
|
void setToolBarStyle(Qt::ToolButtonStyle Style, ads::CDockWidget::eState State);
|
|
|
|
Qt::ToolButtonStyle toolBarStyle(ads::CDockWidget::eState State) const;
|
|
|
|
void setToolBarIconSize(const QSize& IconSize, ads::CDockWidget::eState State);
|
|
|
|
QSize toolBarIconSize(eState State) const;
|
2020-02-25 14:22:51 +08:00
|
|
|
void setTitleBarActions(QList<QAction*> actions);
|
|
|
|
virtual QList<QAction*> titleBarActions() const;
|
|
|
|
|
2019-10-09 20:15:53 +08:00
|
|
|
void setTabToolTip(const QString &text);
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual bool event(QEvent *e);
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void toggleView(bool Open = true);
|
2019-12-19 06:21:34 +08:00
|
|
|
void setFloating();
|
2019-12-19 07:17:28 +08:00
|
|
|
void deleteDockWidget();
|
2020-02-25 14:22:51 +08:00
|
|
|
void closeDockWidget();
|
2019-10-09 20:15:53 +08:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void viewToggled(bool Open);
|
|
|
|
void closed();
|
|
|
|
void titleChanged(const QString& Title);
|
|
|
|
void topLevelChanged(bool topLevel);
|
2020-02-25 14:22:51 +08:00
|
|
|
void closeRequested();
|
2020-01-15 17:08:13 +08:00
|
|
|
void visibilityChanged(bool visible);
|
|
|
|
void featuresChanged(ads::CDockWidget::DockWidgetFeatures features);
|
2019-10-09 20:15:53 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
%End
|