<div dir="ltr"><div class="gmail_quote">On Thu, Aug 23, 2012 at 3:17 AM, Charley Bay <span dir="ltr"><<a href="mailto:charleyb123@gmail.com" target="_blank">charleyb123@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="gmail_quote">JM spaketh:</div><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
What are the best practices to return from a common dialog window?<br>
At the moment I have already solved with a Slot connected to the closure of the dialog,<br>
that invokes methods to retreive data. But what are the best practices?<br>
What are the pros and cons of every solution?<br></blockquote><div><br></div></div><div>Yes, there are several ways to do this.  IMHO it breaks out into two patterns:</div><div><br></div><div>(a) Dialog operates on (references-to) *real* data, changes in the dialog cause immediate change on the system, the dialog can later be closed.</div>


<div><br></div><div>(b) Dialog operates on a *copy* of the data-to-be edited, may have an "apply" button to "push" changes to the system, but "cancel" means all changes in the dialog are "un-done".</div>


<div><br></div><div>For (b) (which is most of my dialogs), IMHO it's easiest to explicitly extract data from dialog-data-members after you confirmed the user "closed" and did not "cancel".</div><div>


<br></div></div></blockquote><br>I usually "exec()" the dialog and then use a set of getData/setData() methods (still using my TurboVision mentality... its been... 10-15 years since I programmed in TV....). For modaless dialogs, I fire up a signal when the "apply" button is pressed.<br>

</div></div>