Skip to content

Commit

Permalink
OWWidget: Change geom/layout serialization for PyQt4 compatibility
Browse files Browse the repository at this point in the history
PyQt4 has broken {read,write}UInt8 overloads (maps quint8 to str)
  • Loading branch information
ales-erjavec committed Jun 18, 2018
1 parent 52fc390 commit 407ad1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Orange/widgets/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ def saveGeometryAndLayoutState(self):
data = QByteArray()
stream = QDataStream(data, QBuffer.WriteOnly)
stream.writeUInt32(version)
stream.writeUInt8((have_spliter << 1) | splitter_state)
stream.writeUInt16((have_spliter << 1) | splitter_state)
stream << self.saveGeometry()
return data

Expand All @@ -820,7 +820,7 @@ def restoreGeometryAndLayoutState(self, state):
version_ = stream.readUInt32()
if stream.status() != QDataStream.Ok or version_ != version:
return False
splitter_state = stream.readUInt8()
splitter_state = stream.readUInt16()
has_spliter = splitter_state & 0x2
splitter_state = splitter_state & 0x1
if has_spliter and self.__splitter is not None:
Expand Down

0 comments on commit 407ad1d

Please sign in to comment.