Results 1 to 3 of 3

Thread: Override locale with QSystemLocale

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Nov 2012
    Posts
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Override locale with QSystemLocale

    This code work for me.
    Qt Code:
    1. #include <QSystemLocale>
    2.  
    3. class MySystemLocale : QSystemLocale
    4. {
    5.  
    6. public: MySystemLocale() { }
    7.  
    8. QVariant query(QueryType type, QVariant in) const
    9. {
    10. if (type==QSystemLocale::DecimalPoint) {
    11. return ".";
    12. }
    13. return QSystemLocale::query(type, in);
    14. }
    15.  
    16. };
    17.  
    18. int main(int argc, char *argv[])
    19. {
    20. MySystemLocale appSystemLocale; // work fine
    21. QApplication a(argc, argv);
    22. // MySystemLocale appSystemLocale;// not work
    23.  
    24. return a.exec();
    25. }
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to frost_asm for this useful post:

    sedi (22nd August 2013)

Similar Threads

  1. Locale and database
    By lynnH in forum Qt Programming
    Replies: 5
    Last Post: 24th February 2012, 16:40
  2. How to change locale
    By memus in forum Newbie
    Replies: 5
    Last Post: 29th May 2011, 12:50
  3. About locale issue
    By xiajingan in forum Qt Programming
    Replies: 3
    Last Post: 26th February 2009, 21:18
  4. Setting locale for the whole app
    By maverick_pol in forum Qt Programming
    Replies: 2
    Last Post: 22nd June 2008, 22:53
  5. Qt4 and system locale
    By L.Marvell in forum Qt Programming
    Replies: 9
    Last Post: 15th January 2007, 13:00

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.