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.1k 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.
  • S Offline
    S Offline
    sehnkim
    wrote on 12 Oct 2016, 22:43 last edited by A Former User
    #1

    Hello experts.

    I am trying to change the title font of the Qt Main window with "Segoe UI".
    I tried changing style sheet and Font etc, but I couldn't make it.
    Actually, I could do for labels, but not for the title.

    Any comments would be really appreciated.
    Thanks.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tham
      wrote on 12 Oct 2016, 22:57 last edited by
      #2

      Maybe what you need is "setWindowTitle();"

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 12 Oct 2016, 23:02 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

        S V 2 Replies Last reply 13 Oct 2016, 01:40
        3
        • S SGaist
          12 Oct 2016, 23:02

          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.

          S Offline
          S Offline
          sehnkim
          wrote on 13 Oct 2016, 01:40 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
          • N Offline
            N Offline
            Ni.Sumi
            wrote on 13 Oct 2016, 08:04 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.

            S 1 Reply Last reply 13 Oct 2016, 14:55
            3
            • N Ni.Sumi
              13 Oct 2016, 08:04

              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.

              S Offline
              S Offline
              sehnkim
              wrote on 13 Oct 2016, 14:55 last edited by sehnkim
              #6
              This post is deleted!
              M 1 Reply Last reply 13 Oct 2016, 15:56
              0
              • V Offline
                V Offline
                VRonin
                wrote on 13 Oct 2016, 14:56 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
                • S sehnkim
                  13 Oct 2016, 14:55

                  This post is deleted!

                  M Offline
                  M Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 13 Oct 2016, 15:56 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
                  • S Offline
                    S Offline
                    sehnkim
                    wrote on 13 Oct 2016, 19:32 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
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 13 Oct 2016, 20:09 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
                      • S SGaist
                        12 Oct 2016, 23:02

                        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 1 Nov 2023, 05:16 last edited by
                        #11

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

                        S C 2 Replies Last reply 1 Nov 2023, 20:07
                        0
                        • V Vijaykarthikeyan
                          1 Nov 2023, 05:16

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

                          S Offline
                          S Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on 1 Nov 2023, 20:07 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
                            1 Nov 2023, 05:16

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

                            C Offline
                            C Offline
                            CPPUIX
                            wrote on 1 Nov 2023, 20:33 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 Nov 2023, 10:54
                            2
                            • C CPPUIX
                              1 Nov 2023, 20:33

                              @Vijaykarthikeyan Perhaps this could be useful:

                              • Qt Blog: Custom client-side window decorations in Qt 5.15
                              V Offline
                              V Offline
                              Vijaykarthikeyan
                              wrote on 2 Nov 2023, 10:54 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