本文整理汇总了Python中PyQt4.QtCore.QDataStream.readQStringList方法的典型用法代码示例。如果您正苦于以下问题:Python QDataStream.readQStringList方法的具体用法?Python QDataStream.readQStringList怎么用?Python QDataStream.readQStringList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtCore.QDataStream
的用法示例。
在下文中一共展示了QDataStream.readQStringList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: restoreState
# 需要导入模块: from PyQt4.QtCore import QDataStream [as 别名]
# 或者: from PyQt4.QtCore.QDataStream import readQStringList [as 别名]
def restoreState(self, state):
"""
Restore the toolbox from a :class:`QByteArray` `state`.
.. note:: The toolbox should already be populated for the state
changes to take effect.
"""
# In version 1 of saved state the state was saved in
# a simple dict repr string.
if isinstance(state, QByteArray):
stream = QDataStream(state, QIODevice.ReadOnly)
version = stream.readInt()
if version == 2:
expanded = stream.readQStringList()
for action in map(self.tabAction, range(self.count())):
if (action.text() in expanded) != action.isChecked():
action.trigger()
return True
return False