MCPcopy Create free account
hub / github.com/KDE/labplot / startFloating

Method startFloating

src/3rdparty/Qt-Advanced-Docking-System/src/DockWidgetTab.cpp:302–353  ·  view source on GitHub ↗

============================================================================

Source from the content-addressed store, hash-verified

300
301//============================================================================
302bool DockWidgetTabPrivate::startFloating(eDragState DraggingState)
303{
304 auto dockContainer = DockWidget->dockContainer();
305 ADS_PRINT("isFloating " << dockContainer->isFloating());
306 ADS_PRINT("areaCount " << dockContainer->dockAreaCount());
307 ADS_PRINT("widgetCount " << DockWidget->dockAreaWidget()->dockWidgetsCount());
308 // if this is the last dock widget inside of this floating widget,
309 // then it does not make any sense, to make it floating because
310 // it is already floating
311 if (dockContainer->isFloating()
312 && (dockContainer->visibleDockAreaCount() == 1)
313 && (DockWidget->dockAreaWidget()->dockWidgetsCount() == 1))
314 {
315 return false;
316 }
317
318 ADS_PRINT("startFloating");
319 DragState = DraggingState;
320 IFloatingWidget* FloatingWidget = nullptr;
321 bool CreateContainer = (DraggingFloatingWidget != DraggingState);
322
323 // If section widget has multiple tabs, we take only one tab
324 // If it has only one single tab, we can move the complete
325 // dock area into floating widget
326 QSize Size;
327 if (DockArea->dockWidgetsCount() > 1)
328 {
329 FloatingWidget = createFloatingWidget(DockWidget, CreateContainer);
330 Size = DockWidget->size();
331 }
332 else
333 {
334 FloatingWidget = createFloatingWidget(DockArea, CreateContainer);
335 Size = DockArea->size();
336 }
337
338 if (DraggingFloatingWidget == DraggingState)
339 {
340 FloatingWidget->startFloating(DragStartMousePosition, Size, DraggingFloatingWidget, _this);
341 auto DockManager = DockWidget->dockManager();
342 auto Overlay = DockManager->containerOverlay();
343 Overlay->setAllowedAreas(OuterDockAreas);
344 this->FloatingWidget = FloatingWidget;
345 qApp->postEvent(DockWidget, new QEvent((QEvent::Type)internal::DockedWidgetDragStartEvent));
346 }
347 else
348 {
349 FloatingWidget->startFloating(DragStartMousePosition, Size, DraggingInactive, nullptr);
350 }
351
352 return true;
353}
354
355
356//============================================================================

Callers 3

mouseMoveEventMethod · 0.45
mouseDoubleClickEventMethod · 0.45
detachDockWidgetMethod · 0.45

Calls 10

dockAreaCountMethod · 0.80
dockWidgetsCountMethod · 0.80
visibleDockAreaCountMethod · 0.80
containerOverlayMethod · 0.80
dockContainerMethod · 0.45
isFloatingMethod · 0.45
dockAreaWidgetMethod · 0.45
sizeMethod · 0.45
dockManagerMethod · 0.45
setAllowedAreasMethod · 0.45

Tested by

no test coverage detected