[Qt5-feedback] Qt5 and C++ exception
lars.knoll at nokia.com
lars.knoll at nokia.com
Mon Jun 27 10:18:04 CEST 2011
On 6/27/11 10:10 AM, "ext Дмитрий Б." <dmitry_bsd at inbox.ru> wrote:
>I very much respect your opinion, but there is a part of community who
>believe that exceptions is very important.
Nobody is stopping you from using them. Not using them in Qt has however
been a conscious decision.
>
>In addition it is one of the standard of the C++ which Qt does not
>support on the API level and it is a standard for any object-oriented
>library at all.
Having something part of a standard doesn't imply you are forced to use
that part. We do what's required to interact well with exceptions in Qt
(they will for example pass nicely through a signal/slot connection).
But introducing them on an API level would change fundamentally how Qt
worked and how app developers have to write their code, breaking with our
fundamental idea of Qt5 being as source compatible as possible with Qt 4.
Cheers,
Lars
>
>
>27 июня 2011, 10:51 от <lars.knoll at nokia.com>:
>> The short answer is no. Of course you can use exceptions in your own
>>code
>> together with Qt, but we don't intend of making their use mandatory (ie.
>> make the Qt API depend upon them).
>>
>> There's a couple of reasons for that. API compatibility is one of them,
>> the other is related to the fact that we don't believe exceptions (in
>>the
>> general case) make code easier to read or handle and the third due to
>>the
>> fact that exceptions do not interact nicely with shared libraries on
>>some
>> platforms.
>>
>> Cheers,
>> Lars
>>
>> On 6/27/11 8:26 AM, "ext Дмитрий Б." <dmitry_bsd at inbox.ru> wrote:
>>
>> >Sorry guys if this question has already been discussed. Is any plans to
>> >make changes in Qt-API to be able to use C++ exceptions, as in the
>>other
>> >frameworks?
>> >Like this:
>> >QThread* thread = new QThread();
>> >try
>> >{
>> > thread->start();
>> >}
>> >catch (e)
>> >{
>> > //Error, thread has not been created
>> >}
>> >
More information about the Qt5-feedback
mailing list