space_otter
8th November 2011, 06:11
The following code appears in a custom dialog constructor:
layout = QVBoxLayout()
watcher = DWatcher(None, DProperties({'value':settings}))
scroller = QScrollArea()
scroller.setWidget(watcher)
layout.addWidget(scroller)
layout2 = QHBoxLayout()
layout2.addWidget(QPushButton('OK'))
layout2.addWidget(QPushButton('Cancel'))
layout.addItem(layout2)
self.setLayout(layout)
When the dialog appears, there is nothing in the scrollarea. DWatcher has a layout after its constructor exits. If I simply add the DWatcher, it works just like it's supposed to, but it can be really big so I want it in a scrollarea. Any ideas how this might happen?
layout = QVBoxLayout()
watcher = DWatcher(None, DProperties({'value':settings}))
scroller = QScrollArea()
scroller.setWidget(watcher)
layout.addWidget(scroller)
layout2 = QHBoxLayout()
layout2.addWidget(QPushButton('OK'))
layout2.addWidget(QPushButton('Cancel'))
layout.addItem(layout2)
self.setLayout(layout)
When the dialog appears, there is nothing in the scrollarea. DWatcher has a layout after its constructor exits. If I simply add the DWatcher, it works just like it's supposed to, but it can be really big so I want it in a scrollarea. Any ideas how this might happen?