View Full Version : Dirty QDialog
SElsner
9th March 2010, 11:11
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
high_flyer
9th March 2010, 11:25
all widgets that manage some sort of data, such as text etc, emit signals when their values are changed.
SElsner
9th March 2010, 14:43
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?
high_flyer
9th March 2010, 16:03
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.
SElsner
9th March 2010, 19:27
Thank you very much. This is not really about code, it's more about understanding and best practice in Qt.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.