Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,19 @@ def load(self, uifile, *args, **kwargs):
widget = Qt._QtUiTools.QUiLoader.load(
self, uifile, *args, **kwargs)

if self.baseinstance:
# correct geometry on show
parent = self.baseinstance.parentWidget()
if parent and hasattr(parent, 'frameGeometry'):
geo = self.baseinstance.geometry()
pgeo = parent.geometry()
pfgeo = parent.frameGeometry()
hdiff = pfgeo.height() - pgeo.height()
self.baseinstance.move(
pgeo.x() + pgeo.width()/2 - geo.width()/2,
pgeo.y() + pgeo.height()/2 - geo.height()/2 -
hdiff)

# Workaround for PySide 1.0.9, see issue #208
widget.parentWidget()

Expand Down