Hi !
I made a simple project with a simple MainWindow:

Qt Code:
  1. MainWindow::MainWindow( QWidget *parent, Qt::WFlags flags )
  2. : QMainWindow( parent, flags )
  3. {
  4. ui.setupUi( this );
  5.  
  6. setWindowTitle( "My Program Caption[*] - " );
  7. setWindowFilePath( "filename.ext" );
  8. //setWindowModified( true );
  9. }
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.