mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 21:25:44 +08:00
Added support for make a single tab floating via double click
This commit is contained in:
parent
aa7b36dbd1
commit
5d380708e1
@ -373,6 +373,22 @@ const QIcon& CDockWidgetTab::icon() const
|
|||||||
{
|
{
|
||||||
return d->Icon;
|
return d->Icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================================
|
||||||
|
void CDockWidgetTab::mouseDoubleClickEvent(QMouseEvent *event)
|
||||||
|
{
|
||||||
|
// If this is the last dock area in a dock container it does not make
|
||||||
|
// sense to move it to a new floating widget and leave this one
|
||||||
|
// empty
|
||||||
|
if (!d->DockArea->dockContainer()->isFloating() || d->DockArea->count() > 1)
|
||||||
|
{
|
||||||
|
d->startFloating();
|
||||||
|
}
|
||||||
|
|
||||||
|
Super::mouseDoubleClickEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace ads
|
} // namespace ads
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@ -59,7 +59,13 @@ protected:
|
|||||||
virtual void mouseReleaseEvent(QMouseEvent* ev) override;
|
virtual void mouseReleaseEvent(QMouseEvent* ev) override;
|
||||||
virtual void mouseMoveEvent(QMouseEvent* ev) override;
|
virtual void mouseMoveEvent(QMouseEvent* ev) override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Double clicking the tab widget makes the assigned dock widget floating
|
||||||
|
*/
|
||||||
|
virtual void mouseDoubleClickEvent(QMouseEvent *event) override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
using Super = QFrame;
|
||||||
/**
|
/**
|
||||||
* Default Constructor
|
* Default Constructor
|
||||||
* param[in] DockWidget The dock widget this title bar belongs to
|
* param[in] DockWidget The dock widget this title bar belongs to
|
||||||
|
Loading…
Reference in New Issue
Block a user