Use Native Windows (#797)
* Avoid changing to a top-level window when moving a native window. * Support using native windows for the dock/area widgets.
This commit is contained in:
@@ -460,6 +460,12 @@ CDockAreaWidget::CDockAreaWidget(CDockManager* DockManager, CDockContainerWidget
|
||||
|
||||
d->createTitleBar();
|
||||
d->ContentsLayout = new DockAreaLayout(d->Layout);
|
||||
|
||||
if (CDockManager::testConfigFlag(CDockManager::UseNativeWindows))
|
||||
{
|
||||
winId();
|
||||
}
|
||||
|
||||
if (d->DockManager)
|
||||
{
|
||||
Q_EMIT d->DockManager->dockAreaCreated(this);
|
||||
|
||||
@@ -1574,7 +1574,10 @@ void CDockContainerWidget::removeDockArea(CDockAreaWidget* area)
|
||||
|
||||
// Remove are from parent splitter and recursively hide tree of parent
|
||||
// splitters if it has no visible content
|
||||
area->setParent(nullptr);
|
||||
if (area->testAttribute(Qt::WA_NativeWindow))
|
||||
area->setParent(d->DockManager);
|
||||
else
|
||||
area->setParent(nullptr);
|
||||
internal::hideEmptyParentSplitters(Splitter);
|
||||
|
||||
// Remove this area from cached areas
|
||||
|
||||
@@ -217,6 +217,7 @@ public:
|
||||
ShowTabTextOnlyForActiveTab =0x8000000, //! Set this flag to show label texts in dock area tabs only for active tabs
|
||||
DoubleClickUndocksWidget = 0x10000000, //!< If the flag is set, a double click on a tab undocks the widget
|
||||
TabsAtBottom = 0x20000000, //!< If the flag is set, tabs will be shown at the bottom instead of in the title bar.
|
||||
UseNativeWindows = 0x40000000, //!< If the flag is set, windows for the dock and area widgets will be native.
|
||||
|
||||
|
||||
DefaultDockAreaButtons = DockAreaHasCloseButton
|
||||
|
||||
@@ -396,6 +396,11 @@ CDockWidget::CDockWidget(CDockManager *manager, const QString &title, QWidget* p
|
||||
{
|
||||
setFocusPolicy(Qt::ClickFocus);
|
||||
}
|
||||
|
||||
if (CDockManager::testConfigFlag(CDockManager::UseNativeWindows))
|
||||
{
|
||||
winId();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -728,6 +728,11 @@ CFloatingDockContainer::CFloatingDockContainer(CDockManager *DockManager) :
|
||||
l->addWidget(d->DockContainer);
|
||||
#endif
|
||||
|
||||
if (CDockManager::testConfigFlag(CDockManager::UseNativeWindows))
|
||||
{
|
||||
winId();
|
||||
}
|
||||
|
||||
DockManager->registerFloatingWidget(this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user