[Qt-interest] Configure QtDesigner ui.h

Bo Thorsen bo at fioniasoftware.dk
Sat Sep 3 08:02:06 CEST 2011


Den 02-09-2011 21:24, Thiago Macieira skrev:
> On Friday, 2 de September de 2011 19:39:52 Danny Price wrote:
>>> QScopedPointer
>>>
>>>
>>
>> I didn't mention the Qt pointers because they seem to have issues with
>> forward-declared classes. MSVC doesn't complain but GCC warns that virtual
>> destructors will NOT be called. I don't trust them.
>
> Only if you delete them where the class is still forward-declared.
>
> The warning is right. And it means you probably have a trivial assignment
> operator. You need to prevent its instantiation so the compiler won't
> complain.

I have experimented with QScopedPointer around my d-pointers. The trick 
you mention here is to just add an empty destructor in the cpp file, and 
all is well.

However, since I use d-pointer in pretty much all my code, it screams at 
me when I don't see the "delete d; d = 0;", so I'm not personally 
convinced of the need to use it or any of the others. It is a good way, 
though, for sloppy customer code :)

Bo Thorsen,
Fionia Software.

-- 

Expert Qt and C++ developer for hire
Contact me if you need expert Qt help
http://www.fioniasoftware.dk



More information about the Qt-interest-old mailing list