QTextEdit: how group a lot of operations? (or how convert QString<->QStringList)

  • Sometimes controls have methods beginUpdate/endUpdate od lock/unlock. How to prevent emit a 2000 textChanged() signal when :

    for (int i=0; i<2000; i++)

    (alternatively: how change CString->vector of CStrings ->CString?)

  • Qt Champions 2017


    (alternatively: how change CString->vector of CStrings ->CString?)

    What do you mean by CString?

    QStringList has a join operator that might do what you want:

    QStringList lines = { "first", "second", "third" };
    QString result = lines.join('\n');

  • Yes, QString and QStringList :

    QStringList lines = text.split("\n");
    string = lines.join("\n");

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.