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

Change title font of Qt Main Window

Scheduled Pinned Locked Moved Unsolved General and Desktop
14 Posts 8 Posters 13.3k Views 4 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.
  • thamT Offline
    thamT Offline
    tham
    wrote on last edited by
    #2

    Maybe what you need is "setWindowTitle();"

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #3

      Hi,

      The title bar is handled by the window manager not by Qt so it's not something you can modify within the app by default.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      sehnkimS V 2 Replies Last reply
      3
      • SGaistS SGaist

        Hi,

        The title bar is handled by the window manager not by Qt so it's not something you can modify within the app by default.

        sehnkimS Offline
        sehnkimS Offline
        sehnkim
        wrote on last edited by
        #4

        @SGaist
        Thanks a lot for your comment. :)
        Then, there is nothing I can do in Qt for changing the title bar font? Only way is to use the windows manager somehow?

        1 Reply Last reply
        1
        • Ni.SumiN Offline
          Ni.SumiN Offline
          Ni.Sumi
          wrote on last edited by
          #5

          Hi @sehnkim ,

          AFAIK, Some one can't force the title bar font from the Qt as Mr. @SGaist said . It's completely from the desktop settings. You can change this from the Desktop settings . if your are really worried about the font size. But the problem is. the desktop setting will be applicable to all windows on Windows.

          sehnkimS 1 Reply Last reply
          3
          • Ni.SumiN Ni.Sumi

            Hi @sehnkim ,

            AFAIK, Some one can't force the title bar font from the Qt as Mr. @SGaist said . It's completely from the desktop settings. You can change this from the Desktop settings . if your are really worried about the font size. But the problem is. the desktop setting will be applicable to all windows on Windows.

            sehnkimS Offline
            sehnkimS Offline
            sehnkim
            wrote on last edited by sehnkim
            #6
            This post is deleted!
            mrjjM 1 Reply Last reply
            0
            • VRoninV Offline
              VRoninV Offline
              VRonin
              wrote on last edited by
              #7

              https://forum.qt.io/topic/62615/how-to-insert-image-on-this-forum

              "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
              ~Napoleon Bonaparte

              On a crusade to banish setIndexWidget() from the holy land of Qt

              1 Reply Last reply
              0
              • sehnkimS sehnkim

                This post is deleted!

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by mrjj
                #8

                @sehnkim
                Hi
                sadly dragging images to forum post is bugged. we cant see the image.
                Please use external site such as postimage.org (or what u prefer)

                About drawing Title bar or borders:
                This is called decorations and is beyond Qts control. As already stated it's
                not really possible in any platform neutral way.

                So the only solutions is to
                1: make a fake windows widget and draw caption and implement dragging etc.
                This is a road of pain as if to be used as a Mainwindow it will show some of its fake nature in
                various aspects of the OS.
                2: use native SDK
                This covers it ok and also discuss Win native api calls to use to make possible.
                https://forum.qt.io/topic/3258/how-to-draw-to-the-windows-title-bar-with-qt-is-this-possible
                Note that this will ofc not work on linux etc.

                1 Reply Last reply
                1
                • sehnkimS Offline
                  sehnkimS Offline
                  sehnkim
                  wrote on last edited by
                  #9

                  Thank you so much @Ni.Sumi and @SGaist

                  May I ask you one follow-up question?
                  As shown in the attached picture, I need to change the color of the title bar (refer to the green arrow) and the color of the border line (refer to the red arrow) of the main window.
                  I am not sure if I can change them or not. Any comments would be really appreciated.

                  Thanks a lot.

                  https://s20.postimg.org/ycgqe4e5p/gui.png

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #10

                    You might be able to do that with some native API on Windows but I haven't tested them. This article might help you get further

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • SGaistS SGaist

                      Hi,

                      The title bar is handled by the window manager not by Qt so it's not something you can modify within the app by default.

                      V Offline
                      V Offline
                      Vijaykarthikeyan
                      wrote on last edited by
                      #11

                      @SGaist so we can't customize the title bar of the application window of QML?

                      SGaistS C 2 Replies Last reply
                      0
                      • V Vijaykarthikeyan

                        @SGaist so we can't customize the title bar of the application window of QML?

                        SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #12

                        @Vijaykarthikeyan Qt does not manage window decoration. That's the OS that does it.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        2
                        • V Vijaykarthikeyan

                          @SGaist so we can't customize the title bar of the application window of QML?

                          C Offline
                          C Offline
                          CPPUIX
                          wrote on last edited by
                          #13

                          @Vijaykarthikeyan Perhaps this could be useful:

                          • Qt Blog: Custom client-side window decorations in Qt 5.15
                          V 1 Reply Last reply
                          2
                          • C CPPUIX

                            @Vijaykarthikeyan Perhaps this could be useful:

                            • Qt Blog: Custom client-side window decorations in Qt 5.15
                            V Offline
                            V Offline
                            Vijaykarthikeyan
                            wrote on last edited by
                            #14

                            @Abderrahmene_Rayene thank you

                            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