Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [Solved] ListView -- Change color of current item text when moving to new item
QtWS25 Last Chance

[Solved] ListView -- Change color of current item text when moving to new item

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 1 Posters 873 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.
  • D Offline
    D Offline
    Duff
    wrote on last edited by
    #1

    Hi,

    Is there anyway to gain access to my delegates text color and change it when i move from one item to the next in my ListView?

    Brian

    --Duff

    1 Reply Last reply
    0
    • D Offline
      D Offline
      Duff
      wrote on last edited by
      #2

      Hi,

      I developed my delegate this way to accomplish it ...
      @
      Component {
      id: categoryDelegate

      Text {
      id: delText
      x: 25;
      color: ListView.isCurrentItem ? "white" : "red"
      text: name;
      font.family: openSansReg.name
      font.pointSize: 36
      Behavior on color { ColorAnimation {duration: 200 }}
      }
      }
      @

      --Duff

      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