[Qt-interest] check if QPaintDevice is QPrinter

Dan Milburn danmilburn at clara.co.uk
Wed Sep 8 17:47:37 CEST 2010


Thiago Macieira wrote:
> Em Quarta-feira 08 Setembro 2010, às 16:09:07, Dmitry Teslenko escreveu:
>> Hello!
>> I want to check if QPaintDevice is QPrinter. In Qt3 there was
>> bool QPaintDevice::isExtDev () const  for that.
>>
>> In Qt4 there is int QPaintDevice::devType() instead which is undocumented
>> and returns member of QInternal enum.
>>
>> Is dynamic_cast my only option?
> 
> You can also use qobject_cast.
> 
Um, no you can't.  Neither QPaintDevice or QPrinter are QObjects.

Dan



More information about the Qt-interest-old mailing list