Hy, I'm a french student (15 years old) so sorry for my english
Code 1)
connect(textEdit, SIGNAL(textChanged()), SLOT(documentWasModified()));
connect(textEdit, SIGNAL(textChanged()), SLOT(documentWasModified()));
To copy to clipboard, switch view to plain text mode
With this code, when I launch my application, my title is always "myfile* - myapp"
Code 2)
connect(textEdit->document(), SIGNAL(textChanged()), SLOT(documentWasModified()));
connect(textEdit->document(), SIGNAL(textChanged()), SLOT(documentWasModified()));
To copy to clipboard, switch view to plain text mode
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());
if (currentFile.isEmpty())
{
name = "sanstitre";
}
else
{
name = strippedName(currentFile);
}
setWindowTitle(tr("%1[*] - %2").arg(name).arg(tr("SamSoft_DEV")));
}
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")));
}
To copy to clipboard, switch view to plain text mode
thank you in advance
Bookmarks