Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt ListView Highlight on MouseOver

Qt ListView Highlight on MouseOver

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 4.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    UbuntuPenguin
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • N Offline
      N Offline
      Nosf
      wrote on last edited by
      #2

      @ 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

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qtforet
        wrote on last edited by
        #3

        Link broken viv, working one here:
        http://doc.qt.digia.com/4.5/stylesheet-examples.html#customizing-qlistview

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          qtforet
          wrote on last edited by
          #4

          Link broken viv, working one here:
          http://doc.qt.digia.com/4.5/stylesheet-examples.html#customizing-qlistview

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved