[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] AttributeError: 'QString' object has no attribute 'endswith'
From: Hans-Peter Jansen <hpj () urpla ! net>
Date: 2016-10-26 15:44:44
Message-ID: 3019839.2nu9TJnhFn () xrated
[Download RAW message or body]
On Mittwoch, 26. Oktober 2016 17:17:38 Hans-Peter Jansen wrote:
> On Dienstag, 25. Oktober 2016 12:37:00 Yosbanis Vicente Gonzalez wrote:
> > dir = self.ledit_send_dir.text()
>
> You're getting a QString out of your UI. Try:
>
> dir = unicode(self.ledit_send_dir.text())
>
> _One_ way to avoid these games is using Python 3, where all strings are
> unicode strings, and consequently, PyQt has eliminated QString altogether..
Another for Python 2 is:
import sip
sip.setapi('QString', 2)
before _any_ PyQt imports, with the same result.
Pete
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
https://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