MCPcopy Create free account
hub / github.com/KDE/kdevelop / showDockWidget

Method showDockWidget

kdevplatform/sublime/idealcontroller.cpp:626–658  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

624}
625
626void IdealController::showDockWidget(IdealDockWidget* dock, bool show)
627{
628 Qt::DockWidgetArea area = dock->dockWidgetArea();
629 qCDebug(SUBLIME) << (show ? "showing" : "hiding") << "dock widget" << PrintDockWidget{dock} << "in" << area;
630
631 if (show) {
632 m_mainWindow->addDockWidget(area, dock);
633 dock->show();
634
635 // A floating dock widget is a top-level window. When a floating dock widget becomes visible,
636 // its window is activated, and consequently the dock widget gets the focus, automatically.
637 // Do not activate or focus a floating dock widget redundantly here, because that breaks
638 // activating and raising a previously active floating dock widget in raiseView().
639 if (!dock->isFloating()) {
640 // Activate the newly shown non-floating dock widget's window (i.e. the main window) in order
641 // to transfer the focus to it in case some other floating dock widget is currently active.
642 dock->activateWindow();
643 dock->setFocus(Qt::ShortcutFocusReason);
644 }
645 } else {
646 // Calling dock->hide() is necessary to make QMainWindow::saveState() store its removed state correctly.
647 // Without this call, a previously hidden tool view can become shown on next KDevelop start (see QTBUG-11909).
648 dock->hide();
649 m_mainWindow->removeDockWidget(dock);
650
651 // Activate the main window that contains the editor view in case some other floating
652 // dock widget is the active window, and focus the editor view after hiding a tool view.
653 m_mainWindow->activateWindow();
654 m_mainWindow->focusEditor();
655 }
656
657 setShowDockStatus(area, show);
658}
659
660QWidget* IdealController::statusBarLocation() const
661{

Callers

nothing calls this directly

Calls 4

dockWidgetAreaMethod · 0.80
showMethod · 0.80
activateWindowMethod · 0.80
focusEditorMethod · 0.80

Tested by

no test coverage detected