Subject: Re: [boost] [rfc] cppgui
From: Sohail Somani (sohail_at_[hidden])
Date: 2009-06-15 14:45:05
Felipe Magno de Almeida wrote:
> On Mon, Jun 15, 2009 at 2:50 PM, Sohail Somani<sohail_at_[hidden]> wrote:
>> Felipe Magno de Almeida wrote:
>>> I've been working the past two years, on and off, unfortunately more
>>> often not, in a GUI library. But I have gotten back to it. And I
>>> wanted to make it usable. I believe there are some great things in it.
>>> This library has a named parameter interface which is extensible by
>>> the backend implementation.
>>> I've been working on a QT port, which have been fairly easy so far.
>>> My intention is to rework some parts of it, finish most widgets and
>>> the surface concept I've been working on and submit to review to
>> How do you handle exceptions in Qt?
> I don't. Cppgui is exception neutral. Do you foresee a problem? I must
> be honest, I haven't considered this at all.
In general you can't throw exceptions from functions that Qt calls
directly or indirectly (which is basically all your code.) You can get
it 99.34% correct if you override QApplication::notify and catch them in
there. I have not had a problem doing it this way, though that doesn't
mean it is right.
I think the latest versions of Qt can deal with exceptions in the sense
that no resources are leaked. But you can't do stuff like throw in the
middle of a paint operation unless you can restore the painter and undo
the operations until then. I'm sure there is more stuff that won't work
properly with exceptions.
-- Sohail Somani http://uint32t.blogspot.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk