Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, May 2007
When should I choose “-nometaobject” in Qt\4.3.0beta\bin\dumpcpp ?


Message 1 in thread

When should I choose “-nometaobject” in Qt\4.3.0beta\bin\dumpcpp ?
(This question is not limited to this version only.)

Qt doc says: “-nometaobject : Do not generate a .cpp file with the meta 
object information. The meta object is then generated in runtime.”

In my practice, if dumpcpp without “-nometaobject” I got link error:

error LNK2001: unresolved external symbol "public: virtual void * 
__thiscall rptaxLib::ITwoImagesWidget::qt_metacast(char const *)

This error was triggered by a handler declared for an interface:

    rptaxLib::ITwoImagesWidget  iobj(iDispatch);

where, rptaxLib is a namespace, and ITwoImagesWidget can be found in the 
machine-generated wrapper.

However, with “-nometaobject” , no error, and an exe was created, but 
the iobj didn’t seem working well in runtime.

“not work well” means loose dynamic call. If, for example, make a call:

    iobj.dynamicCall("setNames(QStringList)", params);

The   QAxBase::dynamicCallHelper will say “No such property” in Debug 
window.

So question is when should I choose “-nometaobject” ?

Thanks in advance,
Lingfa


--
 [ signature omitted ]