QWidget.Show()
-
im using async qt (this shouldnt make a difference that much for what i'm doing right here) -
https://github.com/CaedenPH/integrated-bot-gui/tree/main/bot-gui -- > this is the whole code, not that it makes that much difference i think.
@asyncSlot() async def send_message(self): window = QtWidgets.QWidget() ui = Sendmessage_Dialog() ui.setupUi(window) window.show()
this is called at the
main.py
;def windowLauncher(): """Launch panel""" app = QtWidgets.QApplication(sys.argv) loop = QEventLoop(app) asyncio.set_event_loop(loop) win = MainWindow() win.show() loop.run_forever() if __name__ == "__main__": windowLauncher()
I've noticed that when I make a function and use
show
in it it only shows for a split second? am I using this incorrectly?sorry for long post
-
im using async qt (this shouldnt make a difference that much for what i'm doing right here) -
https://github.com/CaedenPH/integrated-bot-gui/tree/main/bot-gui -- > this is the whole code, not that it makes that much difference i think.
@asyncSlot() async def send_message(self): window = QtWidgets.QWidget() ui = Sendmessage_Dialog() ui.setupUi(window) window.show()
this is called at the
main.py
;def windowLauncher(): """Launch panel""" app = QtWidgets.QApplication(sys.argv) loop = QEventLoop(app) asyncio.set_event_loop(loop) win = MainWindow() win.show() loop.run_forever() if __name__ == "__main__": windowLauncher()
I've noticed that when I make a function and use
show
in it it only shows for a split second? am I using this incorrectly?sorry for long post
@Caeden Read about scope of variables. In your case
window
andui
are local variables so they will be removed after the function is executed. Change to:@asyncSlot() async def send_message(self): self.window = QtWidgets.QWidget() self.ui = Sendmessage_Dialog() self.ui.setupUi(self.window) self.window.show()