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. Custom QCheckbox does not appear when the program runs
Forum Updated to NodeBB v4.3 + New Features

Custom QCheckbox does not appear when the program runs

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 4 Posters 570 Views 1 Watching
  • 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.
  • M Offline
    M Offline
    maria.v
    wrote on 7 May 2020, 17:43 last edited by
    #1

    I want to change the default blue color of the checkboxes. I added a png to the resorces and then add it in the checkbox stylesheet. In QtDesigner I see it but when the program run it's not there.

    In QtDesigner:

    Screen Shot 2020-05-07 at 14.40.27.png

    When the program runs:

    checked
    Screen Shot 2020-05-07 at 14.35.49.png !
    unchecked
    Screen Shot 2020-05-07 at 14.35.56.png

    Configuration:

    Screen Shot 2020-05-07 at 14.37.52.png

    Styles in the QCheckbox:

    Screen Shot 2020-05-07 at 14.38.06.png

    Anyone knows why this is happening? Or how to see what is happening? The console is not giving me any errors

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 7 May 2020, 17:46 last edited by
      #2

      Hi,

      Just a wild guess but I am not sure that the @ notation is supported. Try with a normal file name.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        maria.v
        wrote on 7 May 2020, 18:07 last edited by
        #3

        I rename the file but still got the same result

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 7 May 2020, 18:15 last edited by
          #4

          I just realized, in the examples, there are no single quotes around the url.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • M Offline
            M Offline
            maria.v
            wrote on 7 May 2020, 18:17 last edited by
            #5

            Yeah, I tried both ways and I get the same result. Don't know whats the correct way tho

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 7 May 2020, 18:18 last edited by
              #6

              Then I would test loading that image in QLabel to see it loads properly there.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • B Offline
                B Offline
                Bonnie
                wrote on 7 May 2020, 18:26 last edited by
                #7
                This post is deleted!
                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  maria.v
                  wrote on 7 May 2020, 18:55 last edited by
                  #8

                  I think it has something to do with the way my program works. I add the .png images in another folder and add it in the stylesheet with a relative path and it works. I also had to add the unchecked and disable png

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 7 May 2020, 19:01 last edited by
                    #9

                    Are you sure that your resources are properly built ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • B Offline
                      B Offline
                      beibei
                      wrote on 8 May 2020, 08:39 last edited by
                      #10

                      You can try to add a style sheet with code.

                      1 Reply Last reply
                      0

                      1/10

                      7 May 2020, 17:43

                      • Login

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