From kde-core-devel Tue Jun 01 13:44:28 2010 From: Hans Meine Date: Tue, 01 Jun 2010 13:44:28 +0000 To: kde-core-devel Subject: Re: Review Request: Avoid setting a style that is already set Message-Id: <201006011544.30070.hans_meine () gmx ! net> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=127539992200794 On Sunday 30 May 2010 17:37:28 Matthias Fuchs wrote: > > Christoph Feck wrote: > > Matthias, if Qt cannot find any style you have a bigger problem... > > > > Qt itself does not handle the cases where style is 0, it just uses > > style()->pixelMetric() etc. and it would be ridiculous to add a null > > check everywhere. > > That argument is ok, but not that Qt asserts anyway because you cannot be > sure what Qt is compiled like on the user's machine. Note that that does not matter - the Q_ASSERT() indicates the /basic assumption/ that its argument will always hold, irrespective of QT_NO_DEBUG. It is correct, however, that assertions must not be confused with runtime checks. AFAICS it makes sense to use assertions for checking data coming from API clients, i.e. programmers, but not for user data, i.e. data read from files. Have a nice day, Hans