Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to use ICU with QT sql
Forum Updated to NodeBB v4.3 + New Features

How to use ICU with QT sql

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 3 Posters 3.9k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    abhi.dhiman83
    wrote on last edited by
    #1

    Hi,

    I am working on an application where I have created our database using QTsql
    and Sqlite.
    Now I want to sort the data in the tables and this sorting should support
    all the languages like English, Chinese, Korean etc.

    So i found ICU as a useful tool to solve my purpose. But I don't know how to
    use ICU with QTsql queries.

    Will you please tell me how to do this?

    Thanks in Advance
    Abhi

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      ICU is indeed a great unicode library, but most of the stuff it does is build into Qt already. So if you are not using some really exotic sorting behaviour you might be able to get away with "QString::localeAwareCompare(...)":http://doc.qt.nokia.com/latest/qstring.html#localeAwareCompare.

      To use ICU you need to define conversion operators between QString and the strings used by ICU. You might want to work with QByteArrays wherever possible to store the raw ICU strings as a sequence of bytes to avoid the conversation overhead.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        abhi.dhiman83
        wrote on last edited by
        #3

        Hi Tobias,

        Thanks for you reply.
        Would help a bit more. Actually I am very new to QT, So it would be a great help to me if you can provide some example of how to sort a sqlite database table using Qstring::localeAwareCompare.

        Thanks in Advance
        Abhi

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kamalakshantv
          wrote on last edited by
          #4

          [quote author="abhi.dhiman83" date="1293091323"]Hi Tobias,

          Thanks for you reply.
          Would help a bit more. Actually I am very new to QT, So it would be a great help to me if you can provide some example of how to sort a sqlite database table using Qstring::localeAwareCompare.

          Thanks in Advance
          Abhi[/quote]

          Abhi,

          Its Qt and not QT.

          1 Reply Last reply
          0

          • Login

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