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. Style of Window
Forum Updated to NodeBB v4.3 + New Features

Style of Window

Scheduled Pinned Locked Moved General and Desktop
11 Posts 5 Posters 5.7k 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.
  • R Offline
    R Offline
    Ruzik
    wrote on last edited by
    #1

    How can i with or without QSS change style of Window: buttons of closing, min and max, title area and other
    Advance many thanks for your help!

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DenisKormalev
      wrote on last edited by
      #2

      AFAIK you can't do it with Qt only. You need to draw your own decorations and use non-decorated window flag. Maybe there are also some solutions in WinAPI, but I don't know

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sigrid
        wrote on last edited by
        #3

        The titlebar belongs to the OS and, so Qt does not have control over it and it is hence not possible to modify it using Qt. The following "FAQ":http://developer.qt.nokia.com/faq/answer/how_can_i_handle_events_in_the_titlebar_and_change_its_color_etc contains information on how you can create your own titlebar though and an example on how to do it.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on last edited by
          #4

          If you create an own title bar on Windows OS, you loos some other windows features like maximizing != Fullscreen, menu in the task bar etc.

          If you want to keep that, you must write OS specific code and overwrite WM_NCPAINT etc...

          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
          • A Offline
            A Offline
            andre
            wrote on last edited by
            #5

            Also: users of window systems that allow you to adapt the layout of these buttons and frames (KDE comes to mind) will probably hate you for tampering with this. They expect their applications to follow their preference, instead of having to follow the preferences of the application's author.

            1 Reply Last reply
            0
            • R Offline
              R Offline
              Ruzik
              wrote on last edited by
              #6

              How can i use QToolBar and QMenuBar in this modif window?

              1 Reply Last reply
              0
              • G Offline
                G Offline
                giesbert
                wrote on last edited by
                #7

                I did not get your question.
                What is the problem?

                If you modify the header style it has no influence on the client widgets. Use them as normal.

                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
                • R Offline
                  R Offline
                  Ruzik
                  wrote on last edited by
                  #8

                  But QMenuBar and QToolBar attached to QMainWindow, is it?

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    giesbert
                    wrote on last edited by
                    #9

                    Yes, but they are part of the client area. The title bar and the title bar buttons are at the non client area.

                    The NonClient area is (AFAIK always) part of the OS, the content is part of the application.

                    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
                    • R Offline
                      R Offline
                      Ruzik
                      wrote on last edited by
                      #10

                      Then, write please code how can i set QToolBar or QMenuBar to QWidget or dont attached al all(if it is posible)

                      1 Reply Last reply
                      0
                      • G Offline
                        G Offline
                        giesbert
                        wrote on last edited by
                        #11

                        This can be found in the "docs":http://doc.qt.nokia.com/4.7/index.html and "main window examples":http://doc.qt.nokia.com/4.7/examples-mainwindow.html . If you want to add a menu bar or a tool bar to a "normal" qwidget,. you have to add it amnually to a layout like all other widgets.

                        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

                        • Login

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