From ca028e1fe07f2fb268d1da73eeaccb0f7f264a04 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 23 Feb 2012 13:52:16 +0100 Subject: Bump the moc output revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit aee1f6cc413f56bf4962324799ee3887c3dd037f changed the values of some built-in meta-type ids. Since the ids of built-in types are directly encoded -- not as the symbolic QMetaType::Type name, but as a raw integer -- in the flags for meta-properties, the moc output prior to that change is incompatible with the current output. Change-Id: I970484825137a4f19c80726cfe2024e741e3e879 Reviewed-by: Jędrzej Nowacki Reviewed-by: Roberto Raggi Reviewed-by: Thiago Macieira Reviewed-by: Olivier Goffart --- src/tools/moc/outputrevision.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/tools/moc') diff --git a/src/tools/moc/outputrevision.h b/src/tools/moc/outputrevision.h index 15661a43aa..2ce5b9b765 100644 --- a/src/tools/moc/outputrevision.h +++ b/src/tools/moc/outputrevision.h @@ -43,6 +43,6 @@ #define OUTPUTREVISION_H // if the output revision changes, you MUST change it in qobjectdefs.h too -enum { mocOutputRevision = 63 }; // moc format output revision +enum { mocOutputRevision = 64 }; // moc format output revision #endif // OUTPUTREVISION_H -- cgit v1.2.3 From d91cf1e53b450483d92c50965fd3c33ab1da4300 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 21 Feb 2012 16:09:30 +0100 Subject: clean up qmake-generated projects remove "header" and assignmets which are defaults or bogus, reorder some assignments. Change-Id: I67403872168c890ca3b696753ceb01c605d19be7 Reviewed-by: Rohan McGovern --- src/tools/moc/util/generate_keywords.pro | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/tools/moc') diff --git a/src/tools/moc/util/generate_keywords.pro b/src/tools/moc/util/generate_keywords.pro index eb04409922..88e5553f54 100644 --- a/src/tools/moc/util/generate_keywords.pro +++ b/src/tools/moc/util/generate_keywords.pro @@ -1,12 +1,4 @@ -###################################################################### -# Automatically generated by qmake (1.08a) Mon Feb 23 13:08:28 2004 -###################################################################### - -TEMPLATE = app CONFIG -= moc mac:CONFIG -= app_bundle -INCLUDEPATH += . -# Input SOURCES += generate_keywords.cpp -CONFIG += qt create_prl link_prl -- cgit v1.2.3 From 0d9714f44549bf2e3a39d5c9833a4744cc3e6410 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Sat, 25 Feb 2012 20:48:56 +0100 Subject: moc: Only generate IndexOfMethod for signals. moc is currently generating code to convert from a pointer to member function of a slot or signal to its index. The idea was that it could be usefull for slots to have the new syntax do the same as the old one (connecting signal index to slot index). But in practice, the new syntax do not use the IndexOfMethod for slots. Also, it does not work for all the slots (no Q_PRIVATE_SLOT, no static slots) So since it is not used, and that it would take room in the binaries to generate all the code to get the index of slots, we remove it. If ever we need it, we can still add it later. Change-Id: Ia417e3e524d7915ca86433ea86c66ac2b299c81a Reviewed-by: Kent Hansen --- src/tools/moc/generator.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/tools/moc') diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index c7c7d96487..ac602fd6e8 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -951,13 +951,17 @@ void Generator::generateStaticMetacall() } fprintf(out, " default: ;\n"); fprintf(out, " }\n"); - - fprintf(out, " } else if (_c == QMetaObject::IndexOfMethod) {\n"); + fprintf(out, " }"); + needElse = true; + } + if (!cdef->signalList.isEmpty()) { + Q_ASSERT(needElse); // if there is signal, there was method. + fprintf(out, " else if (_c == QMetaObject::IndexOfMethod) {\n"); fprintf(out, " int *result = reinterpret_cast(_a[0]);\n"); fprintf(out, " void **func = reinterpret_cast(_a[1]);\n"); bool anythingUsed = false; - for (int methodindex = 0; methodindex < methodList.size(); ++methodindex) { - const FunctionDef &f = methodList.at(methodindex); + for (int methodindex = 0; methodindex < cdef->signalList.size(); ++methodindex) { + const FunctionDef &f = cdef->signalList.at(methodindex); if (f.wasCloned || !f.inPrivateClass.isEmpty() || f.isStatic) continue; anythingUsed = true; -- cgit v1.2.3