Reputation: 267
When I try to print a PyQT string, it is not converted to a normal string. How can I do it? See the code below.
def _execute_test(self):
test_in = str(self.buildFlags.inFlags)
test_out = str(self.buildFlags.exFlags)
print(str(test_in))
print("============")
print(str(test_out))
The output I get is:
>>> [PyQt4.QtCore.QString(u'Documents'), PyQt4.QtCore.QString(u'New folder')]
Upvotes: 3
Views: 7701
Reputation: 3775
If you want to print a list of string from a list of PyQt4.QtCore.QString try this:
print([str(x) for x in my_qstring_list])
Upvotes: 6