Hey,
how do I determine whether a Dialog is dirty (i.e. the values of the widgets were changed)? I could install an event filter but that fires far too often and i am concerned about performance...
Thanks
Sebastian
Hey,
how do I determine whether a Dialog is dirty (i.e. the values of the widgets were changed)? I could install an event filter but that fires far too often and i am concerned about performance...
Thanks
Sebastian
all widgets that manage some sort of data, such as text etc, emit signals when their values are changed.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Ok, but how would you do that in an application with a lot of widgets? I am thinking of undo/redo. Would you need to connect EVERY widget to a method handling the case when something changed?! Or is there a shorcut?
you didn't supply almost any details about your code, or the particulars of what you are doing.
But in a very general way - yes, you have to connect each signal to a slot, if you wan to handle that signal.
You can have one slot connected to any arbitrary compatible signals though.
So you could have one slot in your dialog, that sets a "dirty" flag when ever any of the widgets in it changed.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Thank you very much. This is not really about code, it's more about understanding and best practice in Qt.
Bookmarks