[PyQt] pyuic : backslash escaping with untranslatable strings

Phil Thompson phil at riverbankcomputing.com
Thu Nov 5 10:02:44 GMT 2009


On Tue, 03 Nov 2009 12:02:46 +0100, Felix Schmidt
<fschmidt at bihl-wiedemann.de> wrote:
> Hi,
> I got the following bug (or Feature?) in pyuic :
> 
> With Qt Designer I created a QLineEdit with inputMask set to 
> "\0\x>HHHH;_" (to input a hex-value like "0x12AB").
> So far it's fine.
> But when I uncheck the "translatable" flag of this inputMask (don't want 
> it to be translated in any language),
> pyuic doesn't escape the backslashes anymore.
> I get a "ValueError: invalid \x escape" on line
>  > self.linHexcode.setInputMask("\0\x>HHHH;_")
> 
> With the translatable Flag set again, pyuic correctly generates a
>  > 
>
self.linHexcode.setInputMask(QtGui.QApplication.translate("AddSlaveDialog",
> 
> "\\0\\x>HHHH;_", None, QtGui.QApplication.UnicodeUTF8))
> 
> With other string properties (instead of "inputMask") it's the same
thing.
> 
> Is there any way to get this fixed? (Of course, i can just ignore this 
> string in Linguist, but its not the neat solution. Manually escape the 
> string in Qt Designer isn't either.)

Should be fixed in tonight's snapshot.

Phil


More information about the PyQt mailing list