Add tooltips to sidebar items

Bug #1017034 reported by mutil on 2012-06-24
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mixxx
Wishlist
Nicu Badescu

Bug Description

Currently, there are no tooltips when you hover over items in the sidebar.
This would be useful especially in the browser where the paths often get truncated.

jus (jus) on 2012-08-01
Changed in mixxx:
status: New → Confirmed
importance: Undecided → Wishlist
tags: added: wishlist
Changed in mixxx:
assignee: nobody → Nicu Badescu (badescunicu)
Nicu Badescu (badescunicu) wrote :

Sorry for the delay, but I am in the middle of my finals and I am on a tight schedule.

However, I managed to read from a Qt book that I have to implement somehow the case when the role is Qt::ToolTipRole the model's "data" method. The question would be, on which model? TreeItemModel?

Thanks!

Hi Nicu -- I think that's right.. the TreeItemModel is the sidebar's data
model.

On Tue, Jan 21, 2014 at 5:29 PM, Nicu Badescu <email address hidden> wrote:

> Sorry for the delay, but I am in the middle of my finals and I am on a
> tight schedule.
>
> However, I managed to read from a Qt book that I have to implement
> somehow the case when the role is Qt::ToolTipRole the model's "data"
> method. The question would be, on which model? TreeItemModel?
>
> Thanks!
>
> --
> You received this bug notification because you are a member of Mixxx
> Development Team, which is subscribed to Mixxx.
> https://bugs.launchpad.net/bugs/1017034
>
> Title:
> Add tooltips to sidebar items
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mixxx/+bug/1017034/+subscriptions
>

Nicu Badescu (badescunicu) wrote :

Hello Ryan,

I've tried to add a ToolTipRole to TreeItemModel but it had no effect.

On the other hand I have discovered sidebarmodel.cpp. It seems to work fine if I make these modifications ( http://bit.ly/1bhTlo1 ), with one exception, which happens to crash the application: hovering on one of the top items ("Library", "Browse", "Recordings").

My guess is that those items react strangely to dataPath() method. Do you have any ideas on how should I solve this?

Thank you!

Daniel Schürmann (daschuer) wrote :

Hi Nico,

The usage of index.internalPointer(); is really hacky here because in case of a root item it points to a SidebarModel
and in case of a child to a TreeItem.

In your case TreeItem* tree_item = (TreeItem*)index.internalPointer(); fails without warning.
Later it crashes when trying to access SidebarModel as TreeItem

I think a quick hack is checking for

        if (index.internalPointer() == this) {
            // we are at root
        } else {
           // we are at child
      }

Kind regards,

Daniel

Nicu Badescu (badescunicu) wrote :

Hello Daniel,

Thanks for your answer. Indeed that worked, here is an implemenation of your idea (http://bit.ly/19OeYBc). The only thing I'm not happy with is that for "Quick Links" the tooltip says "::mixxx_quick_lnk_node::". Is there a way to make it display only the string "Quick Links", or nothing at all?

Daniel Schürmann (daschuer) wrote :

Please do the check for "this" above
TreeItem* tree_item = (TreeItem*)index.internalPointer();
So we never do a wrong cast.
--
You can check for "::mixxx_quick_lnk_node::" and replace it with the desired translated tool tip.
Or we can introduce a additional tooltip member variable inside TreeItem. Than way we are independent from dataPath();

Nicu Badescu (badescunicu) wrote :

Let me know what do you think about this approach: https://github.com/mixxxdj/mixxx/pull/158

Changed in mixxx:
status: Confirmed → In Progress
RJ Skerry-Ryan (rryan) on 2014-01-23
Changed in mixxx:
status: In Progress → Fix Committed
milestone: none → 1.12.0
RJ Skerry-Ryan (rryan) on 2015-12-30
Changed in mixxx:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers