QString.trimmed(),移除字符串两端的空白字符,然后用isEmtpy()判断真假,示例如下:
from PyQt4.QtCore import *
a = QString(' ')
a.trimmed()
PyQt4.QtCore.QString(u'')
b = a.trimmed()
b.isEmpty()
True
a = QString('aaaaaaa')
a.trimmed()
PyQt4.QtCore.QString(u'aaaaaaa')
b = a.trimmed()
b.isEmpty()
False