Re: [PyQt] Storing QString/Unicode in Sqlite Database

2011-11-15 Thread Tayfun Kayhan
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 
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___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Storing QString/Unicode in Sqlite Database

2011-11-15 Thread Hans-Peter Jansen
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 listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Why won't my dialog show properly when I set its parent on instantiation?

2011-11-15 Thread Hans-Peter Jansen
On Tuesday 08 November 2011, 02:47:54 Åke Kullenberg wrote:
> In the attached example script, why won't the MyDialog instance show
> properly when I set MyDialog's parent to self on line 20 instead of
> leaving it blank?

Well, is does show properly. The difference is in positioning (as 
expected). Without a parent, the frameless dialog is positioned 
somewhere on the screen by the WM, in the other case, it is positioned 
relative to the main window. For some reason, the WM overlays the main 
window with the dialog then, but the concrete behavior of this rather 
esoteric window flag is highly WM dependent anyway.

Pete
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt