QTableWidget Headers, QStringList and character set



  • Hi all,
    I wanted to create a QStringList where the strings containg special characters. Therefore I created the following code (similar to the explanation in Qt documentation):

    QStringList Headers;
    Headers << "Empfänger" << .....;
    tableWidget->setHorizontalHeaderLabels(Headers);
    

    However, when the program is run the "ä" in "Empfänger" in the Header in the QTableWidget is shown as 2 special characters (can't show them here..)

    How can I show the "ä" in the Header?

    Thanks,
    Johannes


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Which version of Qt ?
    On which platform ?
    With which compiler ?
    What are your locale settings ?



  • Hi @JohK,

    The very best thing is to limit the character set in source files to ASCII (that's what I do).

    Qt provides translation tools, which allows to write tr("Receiver") in your source code and translate the program later to any language you like. Please see for more information: http://doc.qt.io/qt-5/i18n-source-translation.html


Log in to reply
 

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