[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Use of processEvents()
From:       Jaroslaw Staniek <js () iidea ! pl>
Date:       2006-02-10 11:45:43
Message-ID: 43EC7CE7.9060300 () iidea ! pl
[Download RAW message or body]

David Faure said the following, On 2006-02-09 18:04:

> On Thursday 09 February 2006 10:04, Jaroslaw Staniek wrote:
> 
>>Hmm, in Kexi I am calling processEvents() from within a loop on data loading 
>>in "data table view" destruction (both actions can a few seconds or more) to 
>>make GUI more responsive. Both operations are isolated and not GUI-related, 
>>just loading/destroying some data. Any risks?
> 
> 
> Yes, if you don't use a modal progress dialog while doing that, then the user
> could close the window, and assuming it is deleted and not just leaked,
> your code will be running inside a deleted object. Boom.

I am trying to make the "time-consuming job" that allows to 'process GUI 
events' (for now: 'close' or 'open window')  separated in terms of data 
sharing. Later this won't be necessary, as pending jobs will be performed at 
widgets level, but now entire windows is displayed only when the job is finished.

Let's concentrate on the 1st case - opening a window with data taking 5 
seconds. I've got procesEvents() inside the loop that loads the data. Thus 
it's possible that closeProject() will be called in the main window as an 
answer to 'app quit' event initiated by user. Then I am just looking at 
'pending actions' list - it must be empty to allow close the project window. 
If it's not empty: hmm, I probably need to cancel the event and remember that 
I should close the dialog when pending jobs are finished.

Is there any simpler workaround when we only have one GUI thread?

-- 
regards / pozdrawiam,
  Jaroslaw Staniek / OpenOffice Polska

  Kexi Developer:      http://www.kexi-project.org | http://koffice.org/kexi
  Kexi Support:        http://www.kexi-project.org/support.html
  Kexi For MS Windows: http://kexi.pl/wiki/index.php/Kexi_for_MS_Windows
  KDE3, KDE4 Libraries For Developing MS Windows Applications:
                       http://www.kdelibs.com/wiki
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic