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. Change background color of side and topbar of application
Qt 6.11 is out! See what's new in the release blog

Change background color of side and topbar of application

Scheduled Pinned Locked Moved General and Desktop
background cologuistyle
4 Posts 2 Posters 1.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.
  • T Offline
    T Offline
    TMJJ001
    wrote on last edited by
    #1

    Hi all,

    I'm here with an other qt question. How to change the background color of the sidebar and top bar of your application?
    So I have to following application where the I would like to change the background of the red circled area.
    Now this are 2 grid layouts. I know it is possible in qml but I would like to do it in c++ if possible.

    0_1525073651821_application.png

    Thanks in advance,
    Kind regards,
    TMJJ

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      If its only a layouts, then the background is the form. (for both)
      You could use a widget with the grid layouts and set background
      on the placeholder widget.
      Stylesheet would do it easy.

      T 1 Reply Last reply
      2
      • mrjjM mrjj

        Hi
        If its only a layouts, then the background is the form. (for both)
        You could use a widget with the grid layouts and set background
        on the placeholder widget.
        Stylesheet would do it easy.

        T Offline
        T Offline
        TMJJ001
        wrote on last edited by
        #3

        @mrjj
        This I tried. But then I get stuff like this:
        0_1527176863099_Screenshot from 2018-05-24 17_43_54.png

        The sides and bottom also color green. This because I can't stretch the widget completely over the mainwindows.

        Any solution for this as well?

        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi
          I assume its all in a layout.
          Layouts have a default border/margin that you might want to change to zero and see
          alt text

          1 Reply Last reply
          1

          • Login

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