[Development] App name in window title

Mark markg85 at gmail.com
Thu Jun 21 23:41:12 CEST 2012


On Thu, Jun 21, 2012 at 10:23 PM, David Faure <faure at kde.org> wrote:
> On Thursday 21 June 2012 22:05:24 Mark wrote:
>> On Thu, Jun 21, 2012 at 9:55 PM, David Faure <faure at kde.org> wrote:
>> > On Thursday 21 June 2012 21:27:32 Иван Комиссаров wrote:
>> >> Modal dialogs on Mac doesn't show any title at all.
>> >
>> > OK, thanks for this information.
>> > However what about non-modal windows on Mac?
>> > Dialogs were just an example, really, the same applies to all toplevel
>> > windows in KDE4.
>> >
>> >> So this will be platform-dependent (kde only?) feature:)
>> >
>> > Depends what happens on Windows, really.
>>
>> Hi David,
>>
>> for windows the following applies:
>> - Normal windows don't have a title at all since Windows Vista.
>
> Are you sure? Isn't that only the explorer and other core apps that don't?
> http://www.paulscomputerservice.net/articles/images/Vista_Computer_Management.jpg
>
> Same in Windows 7:
> http://screenshots.en.sftcdn.net/blog/en/2008/10/windows-7-screenshot.png
>
>> - (error) dialogs do have a title with the application name in it.
>
> In the case of Qt programs, does Qt add the application name, or Windows
> itself ... or is it missing? If Qt, which string does it pick up exactly?
>
> --
> David Faure, faure at kde.org, http://www.davidfaure.fr
> Sponsored by Nokia to work on KDE, incl. KDE Frameworks 5
>

Ahh darn, the only app that diverges. Oke, Windows does indeed show
the application name.
However, windows is doing something strange with the title.

QWidget has http://qt-project.org/doc/qt-4.8/qwidget.html#windowTitle-prop
and that one is used in the title when it's set.
QApplication has setApplicationName and that one is _not_ being used.
Rather the executable filename (without the extension) is used.

So: it's only being set afaict when setWindowTitle from QWidget is
called otherwise it's the executable name minus extension.

As for messages. If you don't provide a title
(QMessageBox::warning(...)) then the application executable minus
extension is the title. Even if you have set the application window
title to something else (just tested that). If you do set a title for
the message dialog with QMessageBox::warning it's being used as the
title.. obviously ;)

Hope that helps a bit better.

Cheers,
Mark



More information about the Development mailing list