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 close button in windowsTitleBar
Qt 6.11 is out! See what's new in the release blog

Change close button in windowsTitleBar

Scheduled Pinned Locked Moved General and Desktop
7 Posts 3 Posters 3.1k 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.
  • A Offline
    A Offline
    ahura_24
    wrote on last edited by
    #1

    hi guys. can you help me how can i change close button in qwidget or other window in qt ?
    tnx a lot

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mlong
      wrote on last edited by
      #2

      In what way to you mean change? Remove it? Change its appearance? Generally the native title bar buttons are controlled by the underlying OS (and/or window manager.) While you can give the widget hints on which buttons to show, it's beyond the scope of Qt to paint the or render them differently.

      Software Engineer
      My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        ahura_24
        wrote on last edited by
        #3

        i want to change and draw my icon instead of X close button of windows. in some of theme we can do this.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          Qt does not support doing this. You might be able to using windows API directly, but not through Qt itself.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            ahura_24
            wrote on last edited by
            #5

            can i do this with CSS (setstylesheet) ? or with QStyle (PE_indicatorTabClose)?

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

              Nope. Like I said: there is no Qt API.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                ahura_24
                wrote on last edited by
                #7

                ok tnx alot

                1 Reply Last reply
                0

                • Login

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