How to create simple dialog that can be cancelled from code

Login to reply to this topic.
Fri, 2007-11-30 13:10
Joined: 2007-09-07
Forum posts: 7

Hi all,

could you please help me with the following issue:

I wonder whats the best way to create a "please wait" dialog that has a Cancel button, so that such dialog can be cancelled in 2 ways:
1) when the user presses cancel, the dialog should report about cancelled operation to, lets say, AppUi, and close itself
2) when some operation (that was running in background while dialog was on screen) is complete, the dialog should be closed from the code
(lets say, AppUi gets some notification that some task is done, and tries to close the dialog)

I looked to UIQ example QDialogs, the one with Progress bar, it handles user command Cancel, thats cool, but my problem is how to close this dialog without user notification?
Should I keep the reference to the dialog for that and use CloseDialog() on it? I mean, is it a normal way to do that?
Because it doesnt work for me - I use PrepareL in constructor to load the dialog once, and RunL every time I need to show it, but trying to call CloseDialog does nothing :S

So, do you have any advice for me, maybe im doing it all wrong way, just wonder if im close to solution and thats just technical problem, or I need to try some other approach

Thanks in advance!

  • Login to reply to this topic.