Important: Please read the Qt Code of Conduct -

Changing x button color

  • Hello folks,

    How can I change mainwindows x button color?

  • Lifetime Qt Champion

    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