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 create a button on the title bar using Qtcreator?
Forum Updated to NodeBB v4.3 + New Features

How to create a button on the title bar using Qtcreator?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 470 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.
  • H Offline
    H Offline
    himanshu chauhan
    wrote on 20 Jun 2022, 09:37 last edited by
    #1

    I want to create a button named as "Log Out" in the title bar in the rightmost corner of the application.

    J 1 Reply Last reply 20 Jun 2022, 09:39
    0
    • H himanshu chauhan
      20 Jun 2022, 09:37

      I want to create a button named as "Log Out" in the title bar in the rightmost corner of the application.

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 20 Jun 2022, 09:39 last edited by
      #2

      @himanshu-chauhan I don't think you can do that with Qt, unless you implement your own title bar (title bar is handled by the OS window manager, not Qt).
      Also, this would be unusual: why do you want to put a button in the title bar?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • H Offline
        H Offline
        himanshu chauhan
        wrote on 20 Jun 2022, 09:48 last edited by
        #3

        Ok thanks.
        If I ever had multiple users than I can just make use of that logout button.

        J 1 Reply Last reply 20 Jun 2022, 09:50
        0
        • H himanshu chauhan
          20 Jun 2022, 09:48

          Ok thanks.
          If I ever had multiple users than I can just make use of that logout button.

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 20 Jun 2022, 09:50 last edited by
          #4

          @himanshu-chauhan Yes, but this button does not have to be in the title bar :-)
          There are applications putting UI controls into title bar (like Firefox), but most don't do this.
          You would either have to use native APIs or implement the title bar by yourself.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          2

          1/4

          20 Jun 2022, 09:37

          • Login

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