mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-24 23:31:32 +08:00
Using grabMouse() leads to more problems. I think there is a better way to ensure that the mouse sometimes doesn't lose the current dragging floating widget.
This commit is contained in:
parent
4ce04ecf2b
commit
45f269835b
@ -68,7 +68,6 @@ void SectionTitleWidget::setActiveTab(bool active)
|
|||||||
void SectionTitleWidget::mousePressEvent(QMouseEvent* ev)
|
void SectionTitleWidget::mousePressEvent(QMouseEvent* ev)
|
||||||
{
|
{
|
||||||
// qDebug() << Q_FUNC_INFO << ev->pos();
|
// qDebug() << Q_FUNC_INFO << ev->pos();
|
||||||
this->grabMouse();
|
|
||||||
if (ev->button() == Qt::LeftButton)
|
if (ev->button() == Qt::LeftButton)
|
||||||
{
|
{
|
||||||
_dragStartPos = ev->pos();
|
_dragStartPos = ev->pos();
|
||||||
@ -81,8 +80,6 @@ void SectionTitleWidget::mousePressEvent(QMouseEvent* ev)
|
|||||||
void SectionTitleWidget::mouseReleaseEvent(QMouseEvent* ev)
|
void SectionTitleWidget::mouseReleaseEvent(QMouseEvent* ev)
|
||||||
{
|
{
|
||||||
// qDebug() << Q_FUNC_INFO << ev->pos();
|
// qDebug() << Q_FUNC_INFO << ev->pos();
|
||||||
if(QWidget::mouseGrabber() == this)
|
|
||||||
this->releaseMouse();
|
|
||||||
SectionWidget* section = NULL;
|
SectionWidget* section = NULL;
|
||||||
|
|
||||||
// Drop contents of FloatingWidget into SectionWidget.
|
// Drop contents of FloatingWidget into SectionWidget.
|
||||||
|
Loading…
Reference in New Issue
Block a user