Fixup for legend mouse events in chartspace

.. when a userchart is embedded into an overview mouse events
   do not propagate in their entirety- as a result the legend
   widgets do not see MouseRelease (even though they see
   MousePress).

   So the click to show/hide when hovering over a legend item
   responds to the press not the release.
This commit is contained in:
Mark Liversedge
2021-08-03 19:39:31 +01:00
parent 72f91c31a8
commit bd864344bb

View File

@@ -94,7 +94,11 @@ GenericLegendItem::eventFilter(QObject *obj, QEvent *e)
if (obj != this) return false;
switch (e->type()) {
case QEvent::MouseButtonRelease: // for now just one event, but may do more later
// release is not propagated when embedded in chartspace
// so we respond to press not release events, see:
// https://github.com/GoldenCheetah/GoldenCheetah/issues/3992
case QEvent::MouseButtonPress:
{
if (clickable && underMouse()) {
enabled=!enabled;