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) if (SingleDroppedDockWidget)
{ {
std::cout << "SingleDockWidget dropped" << std::endl; std::cout << "SingleDockWidget dropped" << std::endl;
d->DockManager->notifyWidgetDrop(SingleDroppedDockWidget); d->DockManager->notifyWidgetOrAreaRelocation(SingleDroppedDockWidget);
} }
d->DockManager->notifyFloatingWidgetDrop(FloatingWidget); d->DockManager->notifyFloatingWidgetDrop(FloatingWidget);
} }
@ -1499,7 +1499,7 @@ void CDockContainerWidget::dropWidget(QWidget* Widget, DockWidgetArea DropArea,
} }
window()->activateWindow(); 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(); auto NewFloatingWidget = FocusedDockWidget->dockContainer()->floatingWidget();
if (NewFloatingWidget) if (NewFloatingWidget)
{ {
std::cout << "NewFloatingWidget->setProperty(FocusedDockWidget)" << std::endl;
NewFloatingWidget->setProperty("FocusedDockWidget", QVariant::fromValue(DockWidget)); 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; std::cout << "\n\nCDockManager::notifyWidgetDrop" << std::endl;
CDockWidget* DockWidget = qobject_cast<CDockWidget*>(DroppedWidget); CDockWidget* DockWidget = qobject_cast<CDockWidget*>(DroppedWidget);
@ -1084,7 +1085,6 @@ void CDockManager::notifyWidgetDrop(QWidget* DroppedWidget)
{ {
std::cout << "CDockManager::setWidgetFocus " << DockWidget->objectName().toStdString() << std::endl; std::cout << "CDockManager::setWidgetFocus " << DockWidget->objectName().toStdString() << std::endl;
CDockManager::setWidgetFocus(DockWidget->tabWidget()); CDockManager::setWidgetFocus(DockWidget->tabWidget());
emit dockWidgetDropped(DockWidget);
return; return;
} }

View File

@ -126,7 +126,7 @@ protected:
* A container needs to call this function if a widget has been dropped * A container needs to call this function if a widget has been dropped
* into it * into it
*/ */
void notifyWidgetDrop(QWidget* DroppedWidget); void notifyWidgetOrAreaRelocation(QWidget* RelocatedWidget);
/** /**
* This function is called, if a floating widget has been dropped into * 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. * docking system but it is not deleted yet.
*/ */
void dockWidgetRemoved(CDockWidget* DockWidget); 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 }; // class DockManager
} // namespace ads } // namespace ads
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

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

View File

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