mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profile: show events in ToolTipItem
Reimplement a feature that was lost when porting the ToolTipOtem to QtQuick. This is a bit of a longer commit, because the icon of the event is now drawn explicitly, instead of using HTML. This encompasses a UI change: the icon is now the icon shown on the profile and not a general "warning" icon. This commit also fixes update of the tooltip when panning the profile. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
c6eeeb7d28
commit
06b0a7eeae
8 changed files with 105 additions and 91 deletions
|
@ -615,3 +615,14 @@ int ProfileScene::timeAt(QPointF pos) const
|
|||
{
|
||||
return lrint(timeAxis->valueAt(pos));
|
||||
}
|
||||
|
||||
std::vector<std::pair<QString, QPixmap>> ProfileScene::eventsAt(QPointF pos) const
|
||||
{
|
||||
std::vector<std::pair<QString, QPixmap>> res;
|
||||
for (const auto &item: eventItems) {
|
||||
if (!item->contains(item->mapFromScene(pos)))
|
||||
continue;
|
||||
res.emplace_back(item->text, item->pixmap);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue