Hi !
I made a simple project with a simple MainWindow:
MainWindow
::MainWindow( QWidget *parent, Qt
::WFlags flags
){
ui.setupUi( this );
setWindowTitle( "My Program Caption[*] - " );
setWindowFilePath( "filename.ext" );
//setWindowModified( true );
}
MainWindow::MainWindow( QWidget *parent, Qt::WFlags flags )
: QMainWindow( parent, flags )
{
ui.setupUi( this );
setWindowTitle( "My Program Caption[*] - " );
setWindowFilePath( "filename.ext" );
//setWindowModified( true );
}
To copy to clipboard, switch view to plain text mode
and window has only "My Program Caption - " in it's title, but no "filename.ext".
It doesn't matter, if I call setWindowModified either with true or false, of if I don't call it at all...
The question is: how can I make a title of my window like this
My Program Caption - filename.ext
?
Of course I can make it "by hands" every time I change filename, but I do not want to keep "clear" title ("My Program Caption - "). I want to call setWindowTitle one time in the constructor.
Thanks.
P.S. Windows 7, MSVC 2008, Qt 4.6.
Bookmarks