<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Jurgen,<br>
<br>
I needed this for subprocess.call/Popen since it does not accept
QStrings.<br>
I always read at doc.qt.nokia, that's where I found it.<br>
<a href="http://qt-project.org/doc/qt-4.8/qstring.html#toStdString">http://qt-project.org/doc/qt-4.8/qstring.html#toStdString</a><br>
"
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<span style="color: rgb(54, 53, 52); font-family: Verdana, 'DejaVu
Sans', Geneva, sans-serif; font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing: normal;
line-height: 20px; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255); display: inline !important; float: none; ">This operator is
only available if Qt is configured with STL compatibility
enabled."<br>
<br>
</span>I thought that everything in qt was in pyqt, but this is
apparently not true.<br>
<br>
I finally end up using str("%s" % myString), which works.<br>
<br>
Thanks a lot for your answer.<br>
<br>
Denis<br>
<br>
<br>
<br>
On 04/11/2012 10:39 AM, Jürgen E. Fischer wrote:
<blockquote cite="mid:20120411083913.GA15123@norbit.de" type="cite">
<pre wrap="">Hi Denis,
On Wed, 11. Apr 2012 at 09:49:41 +0200, Denis Rouzaud wrote:
</pre>
<blockquote type="cite">
<pre wrap=""> I have an error when I try to use toStdString method on a QString:
AttributeError: 'QString' object has no attribute 'toStdString'
Someone has a clue on this???
</pre>
</blockquote>
<pre wrap="">
Apparently PyQt doesn't have that method[1]. What do you need that for in
Python?
Jürgen
[1] <a class="moz-txt-link-freetext" href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html</a>
</pre>
</blockquote>
</body>
</html>