Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Change background color of side and topbar of application



  • 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


  • Lifetime Qt Champion

    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.



  • @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?


  • Lifetime Qt Champion

    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


Log in to reply