本文整理汇总了Python中PyQt4.QtCore.QDataStream.writeUInt16方法的典型用法代码示例。如果您正苦于以下问题:Python QDataStream.writeUInt16方法的具体用法?Python QDataStream.writeUInt16怎么用?Python QDataStream.writeUInt16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtCore.QDataStream
的用法示例。
在下文中一共展示了QDataStream.writeUInt16方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: saveState
# 需要导入模块: from PyQt4.QtCore import QDataStream [as 别名]
# 或者: from PyQt4.QtCore.QDataStream import writeUInt16 [as 别名]
def saveState(self):
"""
Public method to save the state of the sidebar.
@return saved state as a byte array (QByteArray)
"""
if len(self.splitterSizes) == 0:
if self.splitter:
self.splitterSizes = self.splitter.sizes()
self.__bigSize = self.size()
if self.__orientation in [E4SideBar.North, E4SideBar.South]:
self.__minSize = self.minimumSizeHint().height()
self.__maxSize = self.maximumHeight()
else:
self.__minSize = self.minimumSizeHint().width()
self.__maxSize = self.maximumWidth()
data = QByteArray()
stream = QDataStream(data, QIODevice.WriteOnly)
stream.writeUInt16(self.Version)
stream.writeBool(self.__minimized)
stream << self.__bigSize
stream.writeUInt16(self.__minSize)
stream.writeUInt16(self.__maxSize)
stream.writeUInt16(len(self.splitterSizes))
for size in self.splitterSizes:
stream.writeUInt16(size)
stream.writeBool(self.__autoHide)
return data