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. [SOLVED] QStatusBar Background Color
Servers for Qt installer are currently down

[SOLVED] QStatusBar Background Color

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 7.5k 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.
  • G Offline
    G Offline
    Gundi
    wrote on 24 Nov 2014, 16:00 last edited by
    #1

    All I have been doing some searching around and some attempts to change the background color of the Status bar at the bottom of the main window. Basically as I connect and disconnect from another networked system I want to display red for disconnected and green for connected. I was able to change the font color ok but what I really want to is the entire bar to be green or red. Here is what I have tried.

    @
    ui->statusBar->setStyleSheet("{background-color:rgb(0, 255, 0);");
    @

    Any ideas? This does not work

    1 Reply Last reply
    0
    • I Offline
      I Offline
      ion_knight
      wrote on 24 Nov 2014, 16:48 last edited by
      #2

      If you are using a custom widget you need to overload the PaintEvent specifically you should have a look at drawPrimitive. Creating a custom widget with a custom paint event should solve your problem, of not being able to use some of QSS's features.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Chris Kawa
        Lifetime Qt Champion
        wrote on 24 Nov 2014, 17:01 last edited by
        #3

        Loose the {
        @
        ui->statusBar->setStyleSheet("background-color: rgb(0, 255, 0);");
        @

        1 Reply Last reply
        0
        • G Offline
          G Offline
          Gundi
          wrote on 24 Nov 2014, 20:11 last edited by
          #4

          Perfect thank you Chris!

          1 Reply Last reply
          0

          1/4

          24 Nov 2014, 16:00

          • Login

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