Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTableWidget Headers, QStringList and character set

QTableWidget Headers, QStringList and character set

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 766 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JohK
    wrote on 13 Jan 2018, 21:53 last edited by
    #1

    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

    A 1 Reply Last reply 14 Jan 2018, 21:19
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 13 Jan 2018, 21:55 last edited by
      #2

      Hi and welcome to devnet,

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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • J JohK
        13 Jan 2018, 21:53

        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

        A Offline
        A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on 14 Jan 2018, 21:19 last edited by
        #3

        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

        Qt has to stay free or it will die.

        1 Reply Last reply
        0

        3/3

        14 Jan 2018, 21:19

        • Login

        • Login or register to search.
        3 out of 3
        • First post
          3/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved