Porting old code to Qt4
-
Hi,
I want to use old Qt code with Qt4 (because of Qt3Support). But the following code does not compile
@QMetaData *slot_tbl = QMetaObject::new_metadata(1);
QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(1);
slot_tbl[0].name = "slotRepositionText()";
slot_tbl[0].ptr = (QMember)ov1_0;
slot_tbl_access[0] = QMetaData::Public;@Can you give me a hint how to fix this?
thx
Christof -
Hi and welcome to devnet,
Where does that code come from ?
-
Looks like auto-generated code to me?
-
Looks also like it to me, that's why I wanted to know it's origin. It would be strange getting wrong code from moc even while porting.
-
Hi,
thx for the fast reply. I want port the following code (from 2004) (Modelling Software) to Qt 4 (because of Qt3Support... otherwise Qt 5 :( )
http://code.google.com/p/daisy-model/source/browse/trunk/qmain_moc.C
Christof
-
That is indeed a generated file. No need to port it manually, it (or something like it with the same functionality) will be created for you automatically.
-
In addition to what Andre said, you should also remove all moc files from your source tree.
-
many thanks again. It is not my source tree, but I'm trying to convince the maintainer
-
In general: don't put generated files in a source repository. That includes the moc_.cpp files, but also ui_.h and qrc_*.cpp files, besides all that is created by the non-qt parts of your toolchain of course.