Code/Framework/AzQtComponents/AzQtComponents/Components/StyledDockWidget.cpp
bool StyledDockWidget::event(QEvent* event)
    {
        switch (event->type())
        {
        case QEvent::NonClientAreaMouseMove:
        case QEvent::NonClientAreaMouseButtonPress:
        case QEvent::NonClientAreaMouseButtonRelease:
        case QEvent::NonClientAreaMouseButtonDblClick:
            {
                return true;
            }
        case QEvent::MouseButtonPress:
        case QEvent::MouseMove:
        case QEvent::MouseButtonRelease:
            {
                // For these events, make sure FancyDocking is being used or it will disable
                // Mouse events for the whole Widget
                DockMainWindow* parentMainWindow = qobject_cast<DockMainWindow*>(parentWidget());
                if (parentMainWindow && parentMainWindow->HasFancyDocking())
                {
                    return true;
                }
            }
        }

        return QDockWidget::event(event);
    }
/**
     * Override of event handler so that we can ignore the Mouse events on our dock widgets.
     * This fixes an issue where the QDockWidget only respects the movable feature on mouse press,
     * not on non client area events (e.g. resizing); this also fixes another issue affecting
     * DockWidgets in a standalone QWindow, that could be detached from said Window through
     * the legacy Qt dragging.
     * We disable the movable feature on our dock widgets so that we can use our own custom
     * docking solution instead of the default Qt docking, but we need to override these events
     * that get triggered when resizing otherwise it will activate the default qt docking.
     */
Override of event handler so that we can ignore the Mouse events on our dock widgets.
This fixes an issue where the QDockWidget only respects the movable feature on mouse press,
not on non client area events ; this also fixes another issue affecting
DockWidgets in a standalone QWindow, that could be detached from said Window through
the legacy Qt dragging.
We disable the movable feature on our dock widgets so that we can use our own custom
docking solution instead of the default Qt docking, but we need to override these events
that get triggered when resizing otherwise it will activate the default qt docking.
Override of event handler so that we can ignore the Mouse events on our dock widgets . This fixes an issue where the QDockWidget only respects the movable feature on mouse press not on non client area events ; this also fixes another issue affecting DockWidgets in a standalone QWindow that could be detached from said Window through the legacy Qt dragging . We disable the movable feature on our dock widgets so that we can use our own custom docking solution instead of the default Qt docking but we need to override these events that get triggered when resizing otherwise it will activate the default qt docking .
bool StyledDockWidget::event(QEvent* event)
    {
        switch (event->type())
        {
        case QEvent::NonClientAreaMouseMove:
        case QEvent::NonClientAreaMouseButtonPress:
        case QEvent::NonClientAreaMouseButtonRelease:
        case QEvent::NonClientAreaMouseButtonDblClick:
            {
                return true;
            }
        case QEvent::MouseButtonPress:
        case QEvent::MouseMove:
        case QEvent::MouseButtonRelease:
            {
                DockMainWindow* parentMainWindow = qobject_cast<DockMainWindow*>(parentWidget());
                if (parentMainWindow && parentMainWindow->HasFancyDocking())
                {
                    return true;
                }
            }
        }
        return QDockWidget::event(event);
    }
bool StyledDockWidget :: event ( QEvent * event ) { switch ( event -> type ( ) ) { case QEvent :: NonClientAreaMouseMove : case QEvent :: NonClientAreaMouseButtonPress : case QEvent :: NonClientAreaMouseButtonRelease : case QEvent :: NonClientAreaMouseButtonDblClick : { return true ; } case QEvent :: MouseButtonPress : case QEvent :: MouseMove : case QEvent :: MouseButtonRelease : { DockMainWindow * parentMainWindow = qobject_cast < DockMainWindow * > ( parentWidget ( ) ) ; if ( parentMainWindow && parentMainWindow -> HasFancyDocking ( ) ) { return true ; } } } return QDockWidget :: event ( event ) ; }
Override of event handler so that we can ignore the Mouse events on our dock widgets.
Override of event handler so that we can ignore the Mouse events on our dock widgets .
// For these events, make sure FancyDocking is being used or it will disable // Mouse events for the whole Widget