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. QListView Stylesheet Question
Qt 6.11 is out! See what's new in the release blog

QListView Stylesheet Question

Scheduled Pinned Locked Moved Unsolved General and Desktop
qlistviewstylesheet
2 Posts 2 Posters 2.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.
  • SolaVitaeS Offline
    SolaVitaeS Offline
    SolaVitae
    wrote on last edited by
    #1

    So currently i have a QListView, and i have ve set its stylesheet to

    ("
    QListView::item {border: 0px solid black; padding-left: 5px}"
    "QListView::text { left: 25px }"
    "QListView::text:!selected { left: 25px }"
    "QListView::text:selected { left: 25px }"
    "QListView::icon {spacing: 15px }"
    );
    

    And because of that it looks like this
    http://runeapps.org/i/d2p7.png

    That is how i want it to look, except for the icons are not correct size. But when i mouse over it it transforms to

    http://runeapps.org/i/d3a8.png

    as you can see in the second image, the icons are not aligned and neither is the text. How can i get the text and icons to permanently be aligned?

    raven-worxR 1 Reply Last reply
    0
    • SolaVitaeS SolaVitae

      So currently i have a QListView, and i have ve set its stylesheet to

      ("
      QListView::item {border: 0px solid black; padding-left: 5px}"
      "QListView::text { left: 25px }"
      "QListView::text:!selected { left: 25px }"
      "QListView::text:selected { left: 25px }"
      "QListView::icon {spacing: 15px }"
      );
      

      And because of that it looks like this
      http://runeapps.org/i/d2p7.png

      That is how i want it to look, except for the icons are not correct size. But when i mouse over it it transforms to

      http://runeapps.org/i/d3a8.png

      as you can see in the second image, the icons are not aligned and neither is the text. How can i get the text and icons to permanently be aligned?

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @SolaVitae
      Do you have any additional stylesheet set for a widget in the parent hierarchy?
      Because the posted stylesheet of yours shouldn't result in this effect.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      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