Results 1 to 3 of 3

Thread: QString and wchar_t?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2006
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default QString and wchar_t?

    Hello;

    Still evaluating Qt 4.1.2. Our existing code uses Unicode strings based on wchar_t. Unfortunately, QString does not seem to recognize such strings at all; I'm getting compile errors of the form:

    .\MidiOptionsDialog.cpp(28) : error C2665: 'QString::QString' : none of the 10 overloads could convert all the argument types
    C:\Qt\4.1.2\include\QtCore/qstring.h(68): could be 'QString::QString(const QChar *,int)'
    C:\Qt\4.1.2\include\QtCore/qstring.h(70): or 'QString::QString(int,QChar)'
    C:\Qt\4.1.2\include\QtCore/qstring.h(486): or 'QString::QString(QString:ata *,int)'
    while trying to match the argument list '(const wchar_t *, size_t)'

    Obviously a QChar is not a wchar_t; it's a class.

    Is there a way to construct a QString from a wchar_t*, without converting the string to chars?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QString and wchar_t?


  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QString and wchar_t?


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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.