Removed new dropped signals

This commit is contained in:
Uwe Kindler 2020-06-05 07:27:44 +02:00
parent 4041aa72cc
commit a65b1bdcaf
5 changed files with 11 additions and 34 deletions

View File

@ -1464,7 +1464,7 @@ void CDockContainerWidget::dropFloatingWidget(CFloatingDockContainer* FloatingWi
if (SingleDroppedDockWidget)
{
std::cout << "SingleDockWidget dropped" << std::endl;
d->DockManager->notifyWidgetDrop(SingleDroppedDockWidget);
d->DockManager->notifyWidgetOrAreaRelocation(SingleDroppedDockWidget);
}
d->DockManager->notifyFloatingWidgetDrop(FloatingWidget);
}
@ -1499,7 +1499,7 @@ void CDockContainerWidget::dropWidget(QWidget* Widget, DockWidgetArea DropArea,
}
window()->activateWindow();
d->DockManager->notifyWidgetDrop(Widget);
d->DockManager->notifyWidgetOrAreaRelocation(Widget);
}

View File

@ -530,6 +530,7 @@ void DockManagerPrivate::updateDockWidgetFocus(CDockWidget* DockWidget)
auto NewFloatingWidget = FocusedDockWidget->dockContainer()->floatingWidget();
if (NewFloatingWidget)
{
std::cout << "NewFloatingWidget->setProperty(FocusedDockWidget)" << std::endl;
NewFloatingWidget->setProperty("FocusedDockWidget", QVariant::fromValue(DockWidget));
}
@ -1076,7 +1077,7 @@ void CDockManager::onFocusedDockAreaViewToggled(bool Open)
//===========================================================================
void CDockManager::notifyWidgetDrop(QWidget* DroppedWidget)
void CDockManager::notifyWidgetOrAreaRelocation(QWidget* DroppedWidget)
{
std::cout << "\n\nCDockManager::notifyWidgetDrop" << std::endl;
CDockWidget* DockWidget = qobject_cast<CDockWidget*>(DroppedWidget);
@ -1084,7 +1085,6 @@ void CDockManager::notifyWidgetDrop(QWidget* DroppedWidget)
{
std::cout << "CDockManager::setWidgetFocus " << DockWidget->objectName().toStdString() << std::endl;
CDockManager::setWidgetFocus(DockWidget->tabWidget());
emit dockWidgetDropped(DockWidget);
return;
}

View File

@ -126,7 +126,7 @@ protected:
* A container needs to call this function if a widget has been dropped
* into it
*/
void notifyWidgetDrop(QWidget* DroppedWidget);
void notifyWidgetOrAreaRelocation(QWidget* RelocatedWidget);
/**
* This function is called, if a floating widget has been dropped into
@ -517,18 +517,6 @@ signals:
* docking system but it is not deleted yet.
*/
void dockWidgetRemoved(CDockWidget* DockWidget);
/**
* This signal is emitted if a dock widget has been dropped into a new
* position
*/
void dockWidgetDropped(CDockWidget* DockWidget);
/**
* This signal is emitted if a dock area has been dropped into a new
* position
*/
void dockAreaDropped(CDockAreaWidget* DockArea);
}; // class DockManager
} // namespace ads
//-----------------------------------------------------------------------------

View File

@ -466,24 +466,9 @@ void CDockWidgetTab::setActiveTab(bool active)
bool AllTabsHaveCloseButton = d->testConfigFlag(CDockManager::AllTabsHaveCloseButton);
bool TabHasCloseButton = (ActiveTabHasCloseButton && active) | AllTabsHaveCloseButton;
d->CloseButton->setVisible(DockWidgetClosable && TabHasCloseButton);
if (CDockManager::configFlags().testFlag(CDockManager::FocusStyling))
if (d->IsActiveTab == active)
{
bool UpdateFocusStyle = false;
if (active && !hasFocus())
{
setFocus(Qt::OtherFocusReason);
UpdateFocusStyle = true;
}
if (d->IsActiveTab == active)
{
if (UpdateFocusStyle)
{
updateStyle();
}
return;
}
return;
}
d->IsActiveTab = active;

View File

@ -637,6 +637,8 @@ CFloatingDockContainer::CFloatingDockContainer(CDockAreaWidget *DockArea) :
{
TopLevelDockWidget->emitTopLevelChanged(true);
}
d->DockManager->notifyWidgetOrAreaRelocation(DockArea);
}
//============================================================================
@ -652,6 +654,8 @@ CFloatingDockContainer::CFloatingDockContainer(CDockWidget *DockWidget) :
{
TopLevelDockWidget->emitTopLevelChanged(true);
}
d->DockManager->notifyWidgetOrAreaRelocation(DockWidget);
}
//============================================================================