def setupUi(self): self.setGeometry(QtCore.QRect(100, 100, 500, 500)) # create widget inside this window self.w = QtWidgets.QFrame(self) self.w.setAutoFillBackground(True) self.w.setStyleSheet("QFrame {background-color: blue;}") self.setCentralWidget(self.w) # lets create another window with a widget inside self.another_window = QtWidgets.QMainWindow() self.w2 = QtWidgets.QFrame(self.another_window) self.w2.setAutoFillBackground(True) self.w2.setStyleSheet("QFrame {background-color: green;}") self.another_window.setCentralWidget(self.w2) self.another_window.show()
def setupUi(self): self.setGeometry(QtCore.QRect(100, 100, 500, 500)) # create widget inside this window self.w = QtWidgets.QFrame(self) self.w.setAutoFillBackground(True) self.w.setStyleSheet("QFrame {background-color: blue;}") self.setCentralWidget(self.w) self.lay = QtWidgets.QVBoxLayout(self.w) self.thread = QOnvifThread(user="******", password="******", ip="192.168.0.134") self.b = QtWidgets.QPushButton(self, "Push Me") self.b.clicked.connect(self.b_slot) self.lay.addWidget(self.b) self.thread.start()
def setupUi(self): self.setGeometry(QtCore.QRect(100, 100, 500, 500)) # create widget inside this window self.w = QtWidgets.QFrame(self) self.w.setAutoFillBackground(True) self.w.setStyleSheet("QFrame {background-color: blue;}") self.setCentralWidget(self.w) self.lay = QtWidgets.QVBoxLayout(self.w) self.thread = IPCQThread( "/tmp/test-socket.ipc" ) self.b = QtWidgets.QPushButton(self, "Push Me") self.b.clicked.connect(self.b_slot) self.lay.addWidget(self.b) self.thread.start()
def setupUi(self): self.setGeometry(QtCore.QRect(100, 100, 500, 500)) # create widget inside this window self.w = QtWidgets.QFrame(self) self.w.setAutoFillBackground(True) self.w.setStyleSheet("QFrame {background-color: blue;}") self.setCentralWidget(self.w) self.lay = QtWidgets.QVBoxLayout(self.w) self.thread = WWWQThread(singleton.ipc_dir.getFile("pyramid.ipc"), inspect.currentframe()) self.ws_thread = WebSocketThread(singleton.ipc_dir.getFile("ws.ipc")) self.b = QtWidgets.QPushButton(self, "Push Me") self.b.clicked.connect(self.b_slot) self.lay.addWidget(self.b) self.ws_thread.signals.base.connect(self.ws_message) self.thread.start() time.sleep(1) self.ws_thread.start()