Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
check for non valid object
user4592357 last edited by
say i have such code:
... self.mw = QMainWindow() self.create_dock_widgets() ... def create_dock_widgets(self): # should i check if window is valid object? self.mw.addDockWidget...
should i actually do it?
JonB last edited by JonB
And do what if it isn't? You're only going to
raiseanyway if it isn't. Plus
self.mw = QMainWindow()would have
raised in the first place if it couldn't create a main window.
Of course you can check everywhere if you wish. But that can be a lot of code. I wouldn't bother here.
Unless you're doing it for a school project. In which case, goodness knows...