_SamSoft_
3rd June 2007, 10:23
Hy, I'm a french student (15 years old) so sorry for my english :p
Code 1)
connect(textEdit, SIGNAL(textChanged()), SLOT(documentWasModified()));
With this code, when I launch my application, my title is always "myfile* - myapp"
Code 2)
connect(textEdit->document(), SIGNAL(textChanged()), SLOT(documentWasModified()));
With the code 2), when I make a modification in my textEdit, the title stays "myfile - myapp" instead of "myfile* - myapp".
The code of "documentWasModified" :
void MainWindowimpl::documentWasModified()
{
setWindowModified(textEdit->document()->isModified());
QString name;
if (currentFile.isEmpty())
{
name = "sanstitre";
}
else
{
name = strippedName(currentFile);
}
setWindowTitle(tr("%1 - %2").arg(name).arg(tr("SamSoft_DEV")));
}
thank you in advance :)
Code 1)
connect(textEdit, SIGNAL(textChanged()), SLOT(documentWasModified()));
With this code, when I launch my application, my title is always "myfile* - myapp"
Code 2)
connect(textEdit->document(), SIGNAL(textChanged()), SLOT(documentWasModified()));
With the code 2), when I make a modification in my textEdit, the title stays "myfile - myapp" instead of "myfile* - myapp".
The code of "documentWasModified" :
void MainWindowimpl::documentWasModified()
{
setWindowModified(textEdit->document()->isModified());
QString name;
if (currentFile.isEmpty())
{
name = "sanstitre";
}
else
{
name = strippedName(currentFile);
}
setWindowTitle(tr("%1 - %2").arg(name).arg(tr("SamSoft_DEV")));
}
thank you in advance :)