get position of a dockable widget in python
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to make a Pyside widget dockable to the main max window. Since i'm working in max17, as far as i can see, my only option is using MaxPlus.MakeQWidgetDockable
But after setting the widget to dockable, the normal pyside calls to geometry(), pos() etc stops working:
from PySide import QtGui, QtCore import MaxPlus class TestWindow(QtGui.QWidget): def __init__(self, parent): super(TestWindow, self).__init__(parent) # make dockable to right side MaxPlus.MakeQWidgetDockable(self, 8) self.main_layout = QtGui.QVBoxLayout() self.setLayout(self.main_layout) self.label = QtGui.QLabel("This window docks right") self.main_layout.addWidget(self.label) self.show() w = TestWindow(parent=MaxPlus.GetQMaxWindow()) print w.pos()
>> PySide.QtCore.QPoint(0, 0)
and after moving the window around, printing the pos again will continue to return:
PySide.QtCore.QPoint(4, 4)
Any ideas or workarounds to how i can allow my users to dock the window, but if they haven't, store the window-geometry using QtCore.QSettings?
Link copied