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 change style of window?
Forum Updated to NodeBB v4.3 + New Features

How to change style of window?

Scheduled Pinned Locked Moved General and Desktop
9 Posts 4 Posters 15.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.
  • S Offline
    S Offline
    soroush
    wrote on last edited by
    #1

    Hello

    Is it possible to change style of windows application in Qt? I want some styles like Delphi 6 styles.
    For example program should be able to change style its style from Windows XP default to a Vista-like, or Mac style (Window control buttons, widgets and background changes...)

    1 Reply Last reply
    0
    • EddyE Offline
      EddyE Offline
      Eddy
      wrote on last edited by
      #2

      Do you want this to happen on a windows system only?

      Qt follows the style of the OS it is on, but you can change the style yourself. You can even test some of them using Qt Creator using the form preview.
      Some of the styles are dependant of the OS. On Windows for instance it is not possible to have the Mac style because the mac api's are needed for that.

      You can use code to set the style and you can make your own style if you want.
      there is a good introduction in the "the official -QT- Qt book.":http://www.qtrac.eu/C++-GUI-Programming-with-Qt-4-1st-ed.zip

      Qt Certified Specialist
      www.edalsolutions.be

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

        bq. Do you want this to happen on a windows system only?

        Yes, my app is a windows application.

        I can set style of widgets with style sheets, but also want to change style of the window. I mean title bar, close button, maximize and minimize button.

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

          With the styles, you can change the inner part of the application, but not the top level window borders, or the window headers with the app name, min/max/close button etc.

          Changing this must be done in an OS dependant way by overwriting some messages...

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

            bq. Changing this must be done in an OS dependant way by overwriting some messages…

            So, how should I do that?

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

              [quote author="Eddy" date="1313307714"]
              "the official -QT- Qt book.":http://www.qtrac.eu/C++-GUI-Programming-with-Qt-4-1st-ed.zip
              [/quote]
              Eddy you did it again :-D

              1 Reply Last reply
              0
              • EddyE Offline
                EddyE Offline
                Eddy
                wrote on last edited by
                #7

                @rokemoon
                Thanks for being my personal Qt spellchecker.

                I'll have a look at some settings to avoid this automatic uppercase while i'm mobile.

                Qt Certified Specialist
                www.edalsolutions.be

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  rokemoon
                  wrote on last edited by
                  #8

                  [quote author="Eddy" date="1313331476"]@rokemoon
                  Thanks for being my personal Qt spellchecker.
                  [/quote]
                  Eddy, I'm just kidding, nothing personal :-)

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

                    [quote author="soroush" date="1313309286"]bq. Changing this must be done in an OS dependant way by overwriting some messages…

                    So, how should I do that?[/quote]

                    As I told you, it's OS dependant. I don't know how to do it on Linux / mac, but on windows, you have to overwrite winEvent and handle WM_NCXXX messages. there are couple of descriptions around on the internet about that, so I suggest you search with google. It's not trivial, and it's on my list to write a wiki for windows on that, but that's currently far away, it's much code you need for that currently...

                    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