Added setFloating function to CDockWidget to support making a dock widget floating with from code

This commit is contained in:
Uwe Kindler
2019-11-25 15:59:08 +01:00
parent aee9fb1c95
commit f497944d2c
5 changed files with 26 additions and 5 deletions

View File

@@ -371,7 +371,7 @@ void CDockWidgetTab::contextMenuEvent(QContextMenuEvent* ev)
d->DragStartMousePosition = ev->pos();
QMenu Menu(this);
auto Action = Menu.addAction(tr("Detach"), this, SLOT(onDetachActionTriggered()));
auto Action = Menu.addAction(tr("Detach"), this, SLOT(detachDockWidget()));
Action->setEnabled(d->DockWidget->features().testFlag(CDockWidget::DockWidgetFloatable));
Menu.addSeparator();
Action = Menu.addAction(tr("Close"), this, SIGNAL(closeRequested()));
@@ -526,7 +526,7 @@ bool CDockWidgetTab::isClosable() const
//===========================================================================
void CDockWidgetTab::onDetachActionTriggered()
void CDockWidgetTab::detachDockWidget()
{
if (!d->DockWidget->features().testFlag(CDockWidget::DockWidgetFloatable))
{