[Qt-interest] 答复: how to know derive class
pengliang(彭亮)
pengliang at founder.com
Thu Nov 11 09:00:52 CET 2010
Hi
Thank you.
But how to know which QWidget is QLineEdit and which is QComboBox?
Is this only method?
Thanks
彭亮 Ken
-----邮件原件-----
发件人: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] 代表 Ivan Kharin
发送时间: 2010年11月11日 15:57
收件人: qt-interest at trolltech.com
主题: Re: [Qt-interest] how to know derive class
> Now, snippets: convert QWidget to QLineEdit, if failed, then it’s a QComboBox.
> But I think this is not good.
don't use C-cast. use qobject_cast<WidgetType*>() instead.
--
Regards,
Ivan Kharin
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
More information about the Qt-interest-old
mailing list