Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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



  • 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.



  • Below should work:

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



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

    @title = this->windowTitle();@

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


Log in to reply