
void Wid::test() {
    vector<string> stp;
    stp.push_back(text->toPlainText().toStdString());
    // В stp одна штука
    sort(stp.begin(),stp.end());
    // Ну что ей будет, этой штуке?
    stp.erase(unique(stp.begin(),stp.end()),stp.end());
    // unique даст end; поведение vector при этом не определено.
    ofstream filesave(pp);
    copy(stp.begin(),stp.end(), ostream_iterator<string>(filesave,"\n"));
}