PyQt self.close() in __init__()

前端 未结 1 364
不知归路
不知归路 2021-01-17 05:11

I encountered a few minor issues while working with PyQt4 under Python 2.7

I\'m writing a little project where there are some QDialogs opening each other. So there

1条回答
  •  隐瞒了意图╮
    2021-01-17 06:00

    This is normal behavior of Python. self.close() is not a return statement, so it will not exit from __init__.

    Furthermore, __init__ does not actually show the dialog on screen, so writing self.close() in __init__ is pointless. I'd suggest restructuring your code so this application logic is outside of the __init__ and will decide whether to initialize and show a MyDialog based on the results from QInputDialog and checker

    0 讨论(0)
提交回复
热议问题