View Single Post
Old 07-12-2014, 10:45 AM   #70
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 29,148
Karma: 211348980
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Having trouble with a personal (inherited) plugin that has a lot of the following calls
Code:
return unicode(self.lineedit.text().toUtf8(), 'utf8').strip()
that work with Qt4 but not with Qt5 (self.lineedit is a QLineEdit object. if that wasn't clear). I get the following error under Qt5:
Code:
unicode object has no toUtf8 attribute
I was thinking this might fall under the QVariant conversion portion of your porting guide (toInt, toBool, etc), but wasn't certain if I should utilize your convert_qvariant() solution for that, or if there's just some plain overkill going on in the original code that could be fixed with something like:
Code:
return unicode(self.lineedit.text()).strip()
Thanks for any advice.

**NOTE: these values from the QLineEdit objects may contain non-ascii characters and will eventually be saved/retrieved in/from the plugin's JSON prefs file if that has any bearing at all.
DiapDealer is offline   Reply With Quote