Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-140118

It should be possible to disable implicit conversion from std::wstring to QString

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • None
    • None

      This conversion causes a lot of pain in cross-platform projects that use both QString and std::wstring. For example, this code compiles fine on Windows but does not on other systems:

      std::wstring GetWorld() { return L"world"; }
      auto str = QString("Hello %1").arg(GetWorld());
      

      In the past few years I've seen hundreds of failed builds due to this problem alone. It would be nice if Qt had something similar to QT_NO_CAST_FROM_ASCII but for std::wstring. 

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            mmutz Marc Mutz
            osyotr Wont Say
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes