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 get windowTitle as shown on the application title bar.
Qt 6.11 is out! See what's new in the release blog

How to get windowTitle as shown on the application title bar.

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.4k 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.
  • B Offline
    B Offline
    brianrrichter
    wrote on last edited by
    #1

    Hi, is there a way to get the windowTitle from a widget without showing the '[*]' placeholder?
    I mean, I would like to to get exactly the text that would be shown on the application title bar.

    Thanks in advance.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alex_malyu
      wrote on last edited by
      #2

      Below should work:

      @QString str;
      bool was = isWindowModified ();
      if( was )
      {
      setWindowModified ( false );
      str = windowTitle();
      setWindowModified ( true );
      }
      else
      str = windowTitle();
      @

      1 Reply Last reply
      0
      • C Offline
        C Offline
        c2ypt1c
        wrote on last edited by
        #3

        I can't see why this wouldn't suffice:

        @title = this->windowTitle();@

        Nevermind...feel free to delete this post :P

        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