本文整理汇总了Python中PyQt4.QtCore.QDataStream.readUInt16方法的典型用法代码示例。如果您正苦于以下问题:Python QDataStream.readUInt16方法的具体用法?Python QDataStream.readUInt16怎么用?Python QDataStream.readUInt16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtCore.QDataStream
的用法示例。
在下文中一共展示了QDataStream.readUInt16方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: restoreState
# 需要导入模块: from PyQt4.QtCore import QDataStream [as 别名]
# 或者: from PyQt4.QtCore.QDataStream import readUInt16 [as 别名]
def restoreState(self, state):
"""
Public method to restore the state of the sidebar.
@param state byte array containing the saved state (QByteArray)
@return flag indicating success (boolean)
"""
if state.isEmpty():
return False
if self.__orientation in [E4SideBar.North, E4SideBar.South]:
minSize = self.layout.minimumSize().height()
maxSize = self.maximumHeight()
else:
minSize = self.layout.minimumSize().width()
maxSize = self.maximumWidth()
data = QByteArray(state)
stream = QDataStream(data, QIODevice.ReadOnly)
stream.readUInt16() # version
minimized = stream.readBool()
if minimized:
self.shrink()
stream >> self.__bigSize
self.__minSize = max(stream.readUInt16(), minSize)
self.__maxSize = max(stream.readUInt16(), maxSize)
count = stream.readUInt16()
self.splitterSizes = []
for i in range(count):
self.splitterSizes.append(stream.readUInt16())
self.__autoHide = stream.readBool()
self.__autoHideButton.setChecked(not self.__autoHide)
if not minimized:
self.expand()
return True