[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] Storing QString/Unicode in Sqlite Database
From: Tayfun Kayhan <tayfun92_kayhan () yahoo ! com>
Date: 2011-11-15 23:13:21
Message-ID: 1321398801.40492.YahooMailNeo () web120305 ! mail ! ne1 ! yahoo ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Yes, this is how I wrote when I tried it. It's given the same error. What's more \
interesting, in another program, that I wrote and that uses unicodes, does not give \
any error with the same use of sip.setapi('QString', 2) . But I see a little addition \
code , I added :
try:
from PyQt4.QtCore import QString
except ImportError:
QString = str
So this may be what prevents program from giving error. I'll try it as soon as I'm \
able to. Thank you.
________________________________
From: Hans-Peter Jansen <hpj@urpla.net>
To: pyqt@riverbankcomputing.com
Sent: Wednesday, November 16, 2011 12:42 AM
Subject: Re: [PyQt] Storing QString/Unicode in Sqlite Database
On Wednesday 09 November 2011, 10:29:55 Tayfun Kayhan wrote:
> Thank you, the first one is working well. I tried setting API V2 but
> it gave an error which says that it has been already set to V1. I'll
> try fixing this, as well.
Quoting
http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/incompatible_apis.html
(the link, that you got from Andrei):
An application calls sip.setapi() to set the version number of a
particular API. This call must be made before any module that
implements the API is imported. Once set the version number cannot be
changed.
In short, before your very first:
from PyQt4 import QtCore, QtGui
Pete
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[Attachment #5 (text/html)]
<html><body><div style="color:#000; background-color:#fff; font-family:tahoma, new \
york, times, serif;font-size:10pt"><div style="font-family: tahoma, 'new york', \
times, serif; font-size: 10pt; "><span>Yes, this is how I wrote when I tried it. It's \
given the same error. What's more interesting, in another program, that I wrote and \
that uses unicodes, does not give any error with the same use of \
<i><b>sip.setapi('QString', 2) . </b>But I see a little addition code , I added \
: </i></span></div><div style="font-family: tahoma, 'new york', times, serif; \
font-size: 10pt; "><span><i><br></i></span></div><div><font class="Apple-style-span" \
size="2"><i><div>try:</div><div><span class="Apple-tab-span" \
style="white-space:pre"> </span>from PyQt4.QtCore import QString</div><div><span \
class="Apple-tab-span" style="white-space:pre"> </span></div><div>except \
ImportError:</div><div><span class="Apple-tab-span" style="white-space: pre; \
"> </span>QString = str</div><div><br></div><div>So this may be what prevents \
program from giving error. I'll try it as soon as I'm able to. Thank \
you.</div></i></font></div><div style="font-size: 10pt; font-family: tahoma, 'new \
york', times, serif; "><div style="font-size: 12pt; font-family: 'times new roman', \
'new york', times, serif; "><font size="2" face="Arial"><hr size="1"><b><span \
style="font-weight:bold;">From:</span></b> Hans-Peter Jansen \
<hpj@urpla.net><br><b><span style="font-weight: bold;">To:</span></b> \
pyqt@riverbankcomputing.com<br><b><span style="font-weight: bold;">Sent:</span></b> \
Wednesday, November 16, 2011 12:42 AM<br><b><span style="font-weight: \
bold;">Subject:</span></b> Re: [PyQt] Storing QString/Unicode in Sqlite \
Database<br></font><br> On Wednesday 09 November 2011, 10:29:55 Tayfun Kayhan \
wrote:<br>> Thank you, the first one is working well. I tried setting API V2 \
but<br>> it gave an error which says that it has been already set to V1. \
I'll<br>> try fixing this, as \
well.<br><br>Quoting<br>http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/incompatible_apis.html<br>(the \
link, that you got from Andrei):<br><br> An application calls \
sip.setapi() to set the version number of a <br> particular API. \
This call must be made before any module that<br> implements the \
API is imported. Once set the version number cannot be<br> \
changed.<br><br>In short, before your very first:<br><br> from \
PyQt4 import QtCore, \
QtGui<br><br>Pete<br>_______________________________________________<br>PyQt mailing \
list <a ymailto="mailto:PyQt@riverbankcomputing.com" \
href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br>http://ww \
w.riverbankcomputing.com/mailman/listinfo/pyqt<br><br><br></div></div></div></body></html>
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic