QString doesn't provide QString::QString(std::string)

Bug #793249 reported by GreatBunzinni
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qt4-x11 (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Although my program doesn't have the QT_NO_STL macro defined, when I try to assign a std::string object to a QString object the operation fails silently, either through QString::FromStdString() and QString::QString(std::string &). Moreover, when I try to compile code which outputs QString objects to the standard output stream, I get the following error:

error: cannot bind ‘std::ostream’ lvalue to ‘std::basic_ostream<char>&&

This didn't happened in Kubuntu 10.10.

Shimi Chen (shimi-chen)
affects: ubuntu → qt4-x11 (Ubuntu)
Revision history for this message
Jonathan Thomas (echidnaman) wrote :

The docs don't mention any such constructor existing: http://doc.qt.nokia.com/latest/qstring.html

Revision history for this message
Terence Simpson (tsimpson) wrote :

I see 3 issues reported.
1) QString::fromStdString "failing silently"
2) No QString constructor from std::string
3) Error when attempting to output a QString to an std::ostream

for 1), can you explain exactly what you mean by "fails silently", perhaps with a code testcase?
as for 2), there is no such constructor, so that's not something we would "fix"
and for 3), the same as for 1), a test case would help us diagnose the issue

Changed in qt4-x11 (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for qt4-x11 (Ubuntu) because there has been no activity for 60 days.]

Changed in qt4-x11 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.