diff options
author | Andy Shaw <andy.shaw@qt.io> | 2017-07-25 10:53:46 +0200 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2017-08-08 09:07:30 +0000 |
commit | bd1192957248edb189f697da6c4b57bc8e004543 (patch) | |
tree | b682c4e56b4d03526e073dd33e5a04eb71493e31 /src/charts/barchart | |
parent | c5af1dd3af0a59166672fa30f24c3039c532cd7d (diff) |
BarSeries: Account for labels when hovering over the bar
If you hover over a label then it will send a hoverLeaveEvent() because
the label is not accounted for. So we set the labels to not accept
hover events to ensure they don't interfere with the bar.
Task-number: QTBUG-62137
Change-Id: I59097d14a7ce73948eda7a8332f927d1d465b273
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/charts/barchart')
-rw-r--r-- | src/charts/barchart/abstractbarchartitem.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/charts/barchart/abstractbarchartitem.cpp b/src/charts/barchart/abstractbarchartitem.cpp index f62c0ef7..910066b5 100644 --- a/src/charts/barchart/abstractbarchartitem.cpp +++ b/src/charts/barchart/abstractbarchartitem.cpp @@ -500,6 +500,7 @@ void AbstractBarChartItem::createLabelItems() QGraphicsTextItem *label = bars.at(j)->labelItem(); if (!label) { QGraphicsTextItem *newLabel = new QGraphicsTextItem(this); + newLabel->setAcceptHoverEvents(false); newLabel->document()->setDocumentMargin(ChartPresenter::textMargin()); bars.at(j)->setLabelItem(newLabel); } |