Do not show cache plot marker upon creation, if mouse not in plot view
MODIFY
src/cachesim/cacheplotview.cpp
src/cachesim/cacheplotview.cpp
@@ -60,6 +60,7 @@ CachePlotView::CachePlotView(QWidget* parent) : QGraphicsView(new QGraphicsScene
}
void CachePlotView::enterEvent(QEvent* event) {
+ m_mouseInView = true;
for (const auto& marker : m_markers) {
marker->marker->show();
}
@@ -68,6 +69,7 @@ void CachePlotView::enterEvent(QEvent* event) {
}
void CachePlotView::leaveEvent(QEvent* event) {
+ m_mouseInView = false;
for (const auto& marker : m_markers) {
marker->marker->hide();
}
@@ -109,6 +111,7 @@ void CachePlotView::hideSeriesMarker(const QLineSeries* series) {
void CachePlotView::showSeriesMarker(const QLineSeries* series) {
m_markers.emplace_back(std::make_unique<MarkerObjects>(this, m_chart, series));
+ m_markers.rbegin()->get()->marker->setVisible(m_mouseInView);
resizeObjects(scene()->sceneRect().size());
}

MODIFY
src/cachesim/cacheplotview.h
src/cachesim/cacheplotview.h
@@ -74,6 +74,7 @@ private:
Callout* m_tooltip = nullptr;
QMutex m_tooltipLock;
+ bool m_mouseInView = false;
bool m_crosshairEnabled = true;
};

Do not show cache plot marker upon creation, if mouse not in plot view