Add tooltips to sidebar items

Bug #1017034 reported by mutil
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
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)
Changed in mixxx:
status: New → Confirmed
importance: Undecided → Wishlist
tags: added: wishlist
Changed in mixxx:
assignee: nobody → Nicu Badescu (badescunicu)
Revision history for this message
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!

Revision history for this message
RJ Skerry-Ryan (rryan) wrote : Re: [Bug 1017034] Re: Add tooltips to sidebar items

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
>

Revision history for this message
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!

Revision history for this message
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

Revision history for this message
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?

Revision history for this message
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();

Revision history for this message
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)
Changed in mixxx:
status: In Progress → Fix Committed
milestone: none → 1.12.0
RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/6536

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.