[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] Fwd: QFileDialog error
From: "Hans-Peter Jansen" <hpj () urpla ! net>
Date: 2011-07-23 12:11:41
Message-ID: 201107231411.42000.hpj () urpla ! net
[Download RAW message or body]
On Saturday 23 July 2011, 07:49:02 Martin Airs wrote:
> On Saturday 23 July 2011 07:41:18 Vincent Vande Vyvre wrote:
> > It's normal, lineedit.text() returns a QString and Python don't
> > like that.
> >
> > Use : os.path.split(str(self.lineedit.text()))
> >
> > --
> > Vincent V.V.
> > Oqapy . Qarte+7 . PaQager
>
> Aha, thats got it, thankyou very much
While at it, either use unicode instead of str or begin your script
(before the first PyQt4 import) with:
import sip
sip.setapi('QString', 2)
which would convert all QStrings to unicode strings behind the scenes
for you, hence your snippet wouldn't have thrown that exception in the
first place.
Pete
_______________________________________________
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