Nov-22-2018, 06:16 PM
(Nov-22-2018, 03:19 PM)Atalanttore Wrote: 1. Does your explanation mean that every window instantiated after the main window always needs to be an attribute of another object?
I think that when you have a blocking window, such as:
msg = QtWidgets.QInputDialog() print(msg.exec_())You don't need to attribute it to self. In your case, the show() method was not blocking, so the new window is destroyed right after the execution of the method (I could see the window appearing for a fraction of a sec).
(Nov-22-2018, 03:19 PM)Atalanttore Wrote: 2. What's the reason for changing the (constant) class variable 'COLORS' to an object variable 'self.COLORS'?
I just felt that it was weird to see a variable declared there. But to avoid clutter in the top of your class I would rather save this space for declarations that requires it (Qt macros or thread signals). I'm not sure about what the best practice, so it might just be a matter of personnal preferences but I think it make more sense this way.