Qt ListView Highlight on MouseOver
-
Hello Everyone,
I am a complete rookie when it comes to using Qt or C++. I decided to start small, and make a list that highlights an object when you mouse over it. I started this mouse over journey 3 days ago... I absolutely hate scrounging for examples in forums, but I was wondering if anyone had an example or direction as to where I should look to get a ListView to have a highlight-on-mouseover effect. Right now I'm drowning in a see of QAbstractItemViews, QListItemWidgets, Components and Delegates.For more information, have you seen the Github for Windows app ? You know on the left side there is that list/menu that lists "local" and "remote" and when you mouse over it, you get a blue background ? That is the effect I am going for and failing miserably at.
Any help is greatly appreciated.
-
@ QListView::item:hover {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #FAFBFE, stop: 1 #DCDEF1);
}@Check "Here":http://doc.qt.digia.com/main-snapshot/stylesheet-examples.html#customizing-qlistview
-
Link broken viv, working one here:
http://doc.qt.digia.com/4.5/stylesheet-examples.html#customizing-qlistview -
Link broken viv, working one here:
http://doc.qt.digia.com/4.5/stylesheet-examples.html#customizing-qlistview