[Qt-interest] QString constructor is not overloaded to take std::string as parameter

Diego Iastrubni diegoiast at gmail.com
Mon May 31 22:53:08 CEST 2010


>From 1999 -
http://lists.trolltech.com/qt-interest/1999-06/thread00098-0.html

*QString::fromLocal8Bit( ss.c_str() );*

>From the docs - http://doc.qt.nokia.com/4.6/qstring.html#fromStdString

*std::string s = "Hello Shlomo!"
QString = QString::fromStdString(s):*

2010/5/31 Bahadır Doğan <abahadirdogan at gmail.com>

> Hello
>
> I just wonder why QString class doesn't have a constructor taking
> std::string as parameter.
> Here are overloaded constructors:
>
>    - *QString <http://doc.trolltech.com/4.5/qstring.html#QString>* ()
>    - *QString <http://doc.trolltech.com/4.5/qstring.html#QString-2>* (
>    const QChar * *unicode*, int *size* )
>    - *QString <http://doc.trolltech.com/4.5/qstring.html#QString-3>* (
>    QChar *ch* )
>    - *QString <http://doc.trolltech.com/4.5/qstring.html#QString-4>* ( int
>    *size*, QChar *ch* )
>    - *QString <http://doc.trolltech.com/4.5/qstring.html#QString-5>* (
>    const QLatin1String & *str* )
>    - *QString <http://doc.trolltech.com/4.5/qstring.html#QString-6>* (
>    const QString & *other* )
>    - *QString <http://doc.trolltech.com/4.5/qstring.html#QString-7>* (
>    const char * *str* )
>    - *QString <http://doc.trolltech.com/4.5/qstring.html#QString-8>* (
>    const QByteArray & *ba* )
>
> What is the reason of that?
> Thanks.
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100531/b682e6ac/attachment.html 


More information about the Qt-interest-old mailing list