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. How to hide windows close/minimize/maximize button on titlebar?
QtWS25 Last Chance

How to hide windows close/minimize/maximize button on titlebar?

Scheduled Pinned Locked Moved General and Desktop
11 Posts 7 Posters 38.6k Views
  • 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.
  • K Offline
    K Offline
    kidproquo
    wrote on 7 Jun 2011, 01:13 last edited by
    #2

    Which platform are you talking about? Windows, Mac, Linux?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      silver47
      wrote on 7 Jun 2011, 03:27 last edited by
      #3

      Look at setWindowsFlags() method.

      "The CustomizeWindowHint flag is used to enable customization of the window controls. This flag must be set to allow the WindowTitleHint, WindowSystemMenuHint, WindowMinimizeButtonHint, WindowMaximizeButtonHint and WindowCloseButtonHint flags to be changed."

      sorry for my english :(

      1 Reply Last reply
      0
      • E Offline
        E Offline
        Eddy
        wrote on 7 Jun 2011, 06:41 last edited by
        #4

        there is a good example in Qt Demo.

        examples > widgets > Window flags

        You can experiment using different settings.

        Qt Certified Specialist
        www.edalsolutions.be

        1 Reply Last reply
        1
        • K Offline
          K Offline
          kathy
          wrote on 7 Jun 2011, 14:55 last edited by
          #5

          I am working on Windows. I checked the "Window flags" example before and it would fit my application.

          If I set:

          @setWindowFlags(Qt::WindowTitleHint | Qt::CustomizeWindowHint);@

          I can get rid of 3 buttons. But the icon also gone(I need the icon). If I do not set as above, the 3 buttons always there.

          1 Reply Last reply
          0
          • E Offline
            E Offline
            Eddy
            wrote on 7 Jun 2011, 16:36 last edited by
            #6

            Try
            @setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint);@

            Qt Certified Specialist
            www.edalsolutions.be

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kathy
              wrote on 9 Jun 2011, 18:56 last edited by
              #7

              not work.

              1 Reply Last reply
              0
              • G Offline
                G Offline
                giesbert
                wrote on 9 Jun 2011, 20:51 last edited by
                #8

                you have to add the Qt::WindowSystemMenuHint for the icon. But take care, it might also add the close button (see docs).

                EDIT: Hiding the buittons from the title bar will not disable the functions from the system menu....

                Nokia Certified Qt Specialist.
                Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kathy
                  wrote on 10 Jun 2011, 15:40 last edited by
                  #9

                  using Qt::WindowSystemMenuHint will not hide close button. But at least it disable the close button. I might use it. But I wish only icon, title on title bar. Nothing else.

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    lgeyer
                    wrote on 10 Jun 2011, 17:12 last edited by
                    #10

                    I think this is a limitation by the Windows window system. You will experience the same problems in native Windows code, eg. C#.

                    What you can do without fail is using a frameless window (Qt::FramelessWindowHint) and draw your own icon and title.

                    1 Reply Last reply
                    0
                    • J Offline
                      J Offline
                      jaosimt
                      wrote on 16 Nov 2011, 09:45 last edited by
                      #11

                      try setting the form's minimum size equal to the form's maximum size. it worked for me. except for the close button.... I use the QcloseEvent() to handle that...

                      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