def fill(self): logging.debug(__name__ + ': fill') self.setLayout(QVBoxLayout()) self._splitter = QSplitter() self.layout().addWidget(self._splitter) self._toolList = QListWidget(self._splitter) self.connect(self._toolList, SIGNAL("itemSelectionChanged()"), self.toolSelected) self._properties = PropertyView(self._splitter) bottom = QHBoxLayout() self.layout().addLayout(bottom) changedir = QPushButton("&Change tools directory...") bottom.addWidget(changedir) self.connect(changedir, SIGNAL('clicked()'), self.changedir) help = QPushButton("&Help") bottom.addWidget(help) self.connect(help, SIGNAL('clicked()'), self.help) bottom.addStretch() cancel = QPushButton('&Cancel') bottom.addWidget(cancel) self.connect(cancel, SIGNAL('clicked()'), self.reject) self.ok = QPushButton("&Apply") bottom.addWidget(self.ok) self.ok.setDefault(True) self.connect(self.ok, SIGNAL('clicked()'), self.apply)
def createPropertyView(self): """ Creates PropertyView object, adds it to this tab and makes it available via propertyView(). """ if self._topLevelPropertyView: parent=self else: parent=self.horizontalSplitter() self._propertyView = PropertyView(parent, "PropertyView")
def testExample(self): logging.debug(self.__class__.__name__ + ': testExample()') self.app = QApplication(sys.argv) self.window = QMainWindow() self.window.setWindowTitle("test PropertyView") self.app.setActiveWindow(self.window) self.window.show() self.propertyView = PropertyView(self.window) self.window.setCentralWidget(self.propertyView) self.propertyView.setDataAccessor(TestDataAccessor()) self.propertyView.setDataObject("particle1") self.propertyView.updateContent() if not hasattr(unittest, "NO_GUI_TEST"): self.app.exec_()