Changing x button color



  • Hello folks,

    How can I change mainwindows x button color?


  • Qt Champions 2016

    Hi and welcome
    Do you mean the close button up on the title bar?
    If yes, they are drawn by the Operating system and can not be changed from Qt.
    In linux, you can use different windows managers and often change the look.
    In windows, you can not change it in any easy way.

    There is the option to use
    setWindowFlags(Qt::Window | Qt::FramelessWindowHint)
    to remove it completely and use a button where u can change colors.
    But you must re.implement dragging in caption etc so this often turns
    into a huge task.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.