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. Style checkbox for a QStandardItem.
QtWS25 Last Chance

Style checkbox for a QStandardItem.

Scheduled Pinned Locked Moved General and Desktop
qstandarditemcheckboxstylesheet
5 Posts 3 Posters 3.7k 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.
  • E Offline
    E Offline
    ealione
    wrote on 28 May 2015, 10:24 last edited by
    #1

    I have a QStandardItem that at some point I make checkable

    thumbIitem->setCheckable(true);
    

    I would like to use my own icons for the checkbox though.

    The only thing I could find was this answer on SO, but I am not sure how It can be applied in my case.

    Does anyone know how to do this?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on 28 May 2015, 10:45 last edited by
      #2

      Hi,

      have you tried to use that solution? What's the results?

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      0
      • E Offline
        E Offline
        ealione
        wrote on 28 May 2015, 10:49 last edited by ealione
        #3

        No I have not. Mostly because I am not sure how.

        Obviously simply typing

        thumbIitem::indicator:checked
          {
            image: url(.../Checkbox_checked_normal.png);
          }
        

        Is not correct.
        Since I have not cared much about stylesheets and appearance until now, I don't know how to proceed.

        Edit:
        Also, Hi :)

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mcosta
          wrote on 28 May 2015, 14:08 last edited by
          #4

          Hi,

          have a look to QWidget::setStyleSheet()

          Once your problem is solved don't forget to:

          • Mark the thread as SOLVED using the Topic Tool menu
          • Vote up the answer(s) that helped you to solve the issue

          You can embed images using (http://imgur.com/) or (http://postimage.org/)

          1 Reply Last reply
          0
          • I Offline
            I Offline
            iliyas
            wrote on 2 May 2019, 15:12 last edited by
            #5

            use this
            QComboBox QAbstractItemView {
            selection-background-color: lightgray;
            }

            QAbstractItemView::indicator {
            background-color: rgb(0, 255, 0);
            width :20;
            height :20;
            }
            QAbstractItemView::indicator:checked {
            background-color: rgb(255, 170, 0);
            }

            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