mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-01-13 00:30:25 +08:00
Fixed creation a FloatingDockContainer
This commit is contained in:
parent
1be8f2861d
commit
3cd12ce1d3
@ -243,10 +243,12 @@ bool CFloatingOverlay::eventFilter(QObject *watched, QEvent *event)
|
|||||||
ADS_PRINT("FloatingWidget::eventFilter QEvent::MouseButtonRelease");
|
ADS_PRINT("FloatingWidget::eventFilter QEvent::MouseButtonRelease");
|
||||||
std::cout << "CFloatingOverlay::eventFilter QEvent::MouseButtonRelease" << std::endl;
|
std::cout << "CFloatingOverlay::eventFilter QEvent::MouseButtonRelease" << std::endl;
|
||||||
|
|
||||||
if (d->DropContainer)
|
auto DockDropArea = d->DockManager->dockAreaOverlay()->dropAreaUnderCursor();
|
||||||
|
auto ContainerDropArea = d->DockManager->containerOverlay()->dropAreaUnderCursor();
|
||||||
|
bool DropPossible = (DockDropArea != InvalidDockWidgetArea) || (ContainerDropArea != InvalidDockWidgetArea);
|
||||||
|
if (d->DropContainer && DropPossible)
|
||||||
{
|
{
|
||||||
d->DropContainer->dropWidget(d->Content, QCursor::pos());
|
d->DropContainer->dropWidget(d->Content, QCursor::pos());
|
||||||
d->DropContainer = nullptr;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -263,6 +265,11 @@ bool CFloatingOverlay::eventFilter(QObject *watched, QEvent *event)
|
|||||||
}
|
}
|
||||||
FloatingWidget->setGeometry(this->geometry());
|
FloatingWidget->setGeometry(this->geometry());
|
||||||
FloatingWidget->show();
|
FloatingWidget->show();
|
||||||
|
QApplication::processEvents();
|
||||||
|
int FrameHeight = FloatingWidget->frameGeometry().height() - FloatingWidget->geometry().height();
|
||||||
|
QRect FixedGeometry = this->geometry();
|
||||||
|
FixedGeometry.adjust(0, FrameHeight, 0, 0);
|
||||||
|
FloatingWidget->setGeometry(FixedGeometry);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->close();
|
this->close();
|
||||||
|
Loading…
Reference in New Issue
Block a user