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 Designer: Push Button Error
Forum Updated to NodeBB v4.3 + New Features

QT Designer: Push Button Error

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 361 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.
  • K Offline
    K Offline
    KevinAR
    wrote on last edited by KevinAR
    #1

    Background push button disappears even when it has been colored.

    6ea4e47d-2921-4d5a-8a27-70e35469a6e9-image.png

    I am a beginner and trying to create a GUI following a tutorial on Youtube. I am only 7 minutes in. When importing the button and changing the background color, there is no effect.

    Does anyone have a solution? Thank You

    JonBJ 1 Reply Last reply
    0
    • K KevinAR

      Background push button disappears even when it has been colored.

      6ea4e47d-2921-4d5a-8a27-70e35469a6e9-image.png

      I am a beginner and trying to create a GUI following a tutorial on Youtube. I am only 7 minutes in. When importing the button and changing the background color, there is no effect.

      Does anyone have a solution? Thank You

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @KevinAR
      I am not sure whether/how much of stylesheet rules are actually shown in Designer. Run your program and see if that doesn't show it with background color? From Designer I think there is also some kind of "Preview" menu item you can pick to show the window you are designing as it will be at runtime?

      1 Reply Last reply
      0
      • K Offline
        K Offline
        KevinAR
        wrote on last edited by
        #3

        If I preview or run it, the output is the same as in the design mode.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          KevinAR
          wrote on last edited by
          #4

          I think I find the cause of this problem when I use a background with a JPG file. It causes the button to become transparent. However, when I don’t use the background, the button still appears.

          Pl45m4P 1 Reply Last reply
          0
          • K Offline
            K Offline
            KevinAR
            wrote on last edited by
            #5

            But I don't know how to solve it

            1 Reply Last reply
            0
            • K KevinAR

              I think I find the cause of this problem when I use a background with a JPG file. It causes the button to become transparent. However, when I don’t use the background, the button still appears.

              Pl45m4P Offline
              Pl45m4P Offline
              Pl45m4
              wrote on last edited by Pl45m4
              #6

              @KevinAR said in QT Designer: Push Button Error:

              I think I find the cause of this problem when I use a background with a JPG file. It causes the button to become transparent. However, when I don’t use the background, the button still appears.

              Your assumptions might be wrong here.
              How do you set the background for your widget/app?

              Note: if you go

              QWidget { background-image: "someImage"; }
              

              your QPushButton will also inherit the stylesheet... maybe that's why you think it's transparent.


              If debugging is the process of removing software bugs, then programming must be the process of putting them in.

              ~E. W. Dijkstra

              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