diff options
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/moc/generator.cpp | 40 | ||||
-rw-r--r-- | src/tools/moc/keywords.cpp | 2 | ||||
-rw-r--r-- | src/tools/moc/moc.cpp | 12 | ||||
-rw-r--r-- | src/tools/moc/moc.h | 2 | ||||
-rw-r--r-- | src/tools/moc/ppkeywords.cpp | 2 | ||||
-rw-r--r-- | src/tools/moc/util/generate_keywords.cpp | 9 | ||||
-rw-r--r-- | src/tools/moc/utils.h | 4 | ||||
-rw-r--r-- | src/tools/qdoc/qdoc.pro | 3 | ||||
-rw-r--r-- | src/tools/qdoc/qmlcodeparser.cpp | 2 | ||||
-rw-r--r-- | src/tools/uic/customwidgetsinfo.h | 1 | ||||
-rw-r--r-- | src/tools/uic/qclass_lib_map.h | 18 |
11 files changed, 55 insertions, 40 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index ef3b381842..4957f7de67 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2013 Olivier Goffart <ogoffart@woboq.com> ** Contact: http://www.qt-project.org/ ** ** This file is part of the tools applications of the Qt Toolkit. @@ -719,7 +720,9 @@ void Generator::generateProperties() uint flags = Invalid; if (!isBuiltinType(p.type)) flags |= EnumOrFlag; - if (!p.read.isEmpty()) + if (!p.member.isEmpty() && !p.constant) + flags |= Writable; + if (!p.read.isEmpty() || !p.member.isEmpty()) flags |= Readable; if (!p.write.isEmpty()) { flags |= Writable; @@ -893,12 +896,12 @@ void Generator::generateMetacall() bool needUser = false; for (int i = 0; i < cdef->propertyList.size(); ++i) { const PropertyDef &p = cdef->propertyList.at(i); - needGet |= !p.read.isEmpty(); - if (!p.read.isEmpty()) + needGet |= !p.read.isEmpty() || !p.member.isEmpty(); + if (!p.read.isEmpty() || !p.member.isEmpty()) needTempVarForGet |= (p.gspec != PropertyDef::PointerSpec && p.gspec != PropertyDef::ReferenceSpec); - needSet |= !p.write.isEmpty(); + needSet |= !p.write.isEmpty() || (!p.member.isEmpty() && !p.constant); needReset |= !p.reset.isEmpty(); needDesignable |= p.designable.endsWith(')'); needScriptable |= p.scriptable.endsWith(')'); @@ -917,7 +920,7 @@ void Generator::generateMetacall() fprintf(out, " switch (_id) {\n"); for (int propindex = 0; propindex < cdef->propertyList.size(); ++propindex) { const PropertyDef &p = cdef->propertyList.at(propindex); - if (p.read.isEmpty()) + if (p.read.isEmpty() && p.member.isEmpty()) continue; QByteArray prefix; if (p.inPrivateClass.size()) { @@ -933,9 +936,12 @@ void Generator::generateMetacall() else if (cdef->enumDeclarations.value(p.type, false)) fprintf(out, " case %d: *reinterpret_cast<int*>(_v) = QFlag(%s%s()); break;\n", propindex, prefix.constData(), p.read.constData()); - else + else if (!p.read.isEmpty()) fprintf(out, " case %d: *reinterpret_cast< %s*>(_v) = %s%s(); break;\n", propindex, p.type.constData(), prefix.constData(), p.read.constData()); + else + fprintf(out, " case %d: *reinterpret_cast< %s*>(_v) = %s%s; break;\n", + propindex, p.type.constData(), prefix.constData(), p.member.constData()); } fprintf(out, " }\n"); } @@ -952,7 +958,9 @@ void Generator::generateMetacall() fprintf(out, " switch (_id) {\n"); for (int propindex = 0; propindex < cdef->propertyList.size(); ++propindex) { const PropertyDef &p = cdef->propertyList.at(propindex); - if (p.write.isEmpty()) + if (p.constant) + continue; + if (p.write.isEmpty() && p.member.isEmpty()) continue; QByteArray prefix; if (p.inPrivateClass.size()) { @@ -962,9 +970,25 @@ void Generator::generateMetacall() if (cdef->enumDeclarations.value(p.type, false)) { fprintf(out, " case %d: %s%s(QFlag(*reinterpret_cast<int*>(_v))); break;\n", propindex, prefix.constData(), p.write.constData()); - } else { + } else if (!p.write.isEmpty()) { fprintf(out, " case %d: %s%s(*reinterpret_cast< %s*>(_v)); break;\n", propindex, prefix.constData(), p.write.constData(), p.type.constData()); + } else { + fprintf(out, " case %d:\n", propindex); + fprintf(out, " if (%s%s != *reinterpret_cast< %s*>(_v)) {\n", + prefix.constData(), p.member.constData(), p.type.constData()); + fprintf(out, " %s%s = *reinterpret_cast< %s*>(_v);\n", + prefix.constData(), p.member.constData(), p.type.constData()); + if (!p.notify.isEmpty() && p.notifyId != -1) { + const FunctionDef &f = cdef->signalList.at(p.notifyId); + if (f.arguments.size() == 0) + fprintf(out, " emit %s();\n", p.notify.constData()); + else if (f.arguments.size() == 1 && f.arguments.at(0).normalizedType == p.type) + fprintf(out, " emit %s(%s%s);\n", + p.notify.constData(), prefix.constData(), p.member.constData()); + } + fprintf(out, " }\n"); + fprintf(out, " break;\n"); } } fprintf(out, " }\n"); diff --git a/src/tools/moc/keywords.cpp b/src/tools/moc/keywords.cpp index 558e99c1d6..dc03af3378 100644 --- a/src/tools/moc/keywords.cpp +++ b/src/tools/moc/keywords.cpp @@ -45,7 +45,7 @@ static const short keyword_trans[][128] = { {0,0,0,0,0,0,0,0,0,546,543,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 546,252,544,547,0,38,239,545,25,26,236,234,30,235,27,237, + 546,252,544,547,8,38,239,545,25,26,236,234,30,235,27,237, 22,22,22,22,22,22,22,22,22,22,34,41,23,39,24,43, 0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,21,8,8,8,8,8,8,8,8,8,31,549,32,238,8, diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index f49cc23ce5..1ebb82ffad 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -1059,6 +1059,12 @@ void Moc::createPropertyDef(PropertyDef &propDef) v2 = "()"; } switch (l[0]) { + case 'M': + if (l == "MEMBER") + propDef.member = v; + else + error(2); + break; case 'R': if (l == "READ") propDef.read = v; @@ -1099,11 +1105,11 @@ void Moc::createPropertyDef(PropertyDef &propDef) error(2); } } - if (propDef.read.isNull()) { + if (propDef.read.isNull() && propDef.member.isNull()) { QByteArray msg; msg += "Property declaration "; msg += propDef.name; - msg += " has no READ accessor function. The property will be invalid."; + msg += " has no READ accessor function or associated MEMBER variable. The property will be invalid."; warning(msg.constData()); } if (propDef.constant && !propDef.write.isNull()) { @@ -1515,7 +1521,7 @@ void Moc::checkProperties(ClassDef *cdef) // for (int i = 0; i < cdef->propertyList.count(); ++i) { PropertyDef &p = cdef->propertyList[i]; - if (p.read.isEmpty()) + if (p.read.isEmpty() && p.member.isEmpty()) continue; for (int j = 0; j < cdef->publicList.count(); ++j) { const FunctionDef &f = cdef->publicList.at(j); diff --git a/src/tools/moc/moc.h b/src/tools/moc/moc.h index 5b3c364a73..f97a537215 100644 --- a/src/tools/moc/moc.h +++ b/src/tools/moc/moc.h @@ -127,7 +127,7 @@ struct FunctionDef struct PropertyDef { PropertyDef():notifyId(-1), constant(false), final(false), gspec(ValueSpec), revision(0){} - QByteArray name, type, read, write, reset, designable, scriptable, editable, stored, user, notify, inPrivateClass; + QByteArray name, type, member, read, write, reset, designable, scriptable, editable, stored, user, notify, inPrivateClass; int notifyId; bool constant; bool final; diff --git a/src/tools/moc/ppkeywords.cpp b/src/tools/moc/ppkeywords.cpp index e9d199705d..76387d4b18 100644 --- a/src/tools/moc/ppkeywords.cpp +++ b/src/tools/moc/ppkeywords.cpp @@ -45,7 +45,7 @@ static const short pp_keyword_trans[][128] = { {0,0,0,0,0,0,0,0,0,98,12,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 98,76,96,13,0,60,62,97,9,10,58,56,11,57,102,59, + 98,76,96,13,1,60,62,97,9,10,58,56,11,57,102,59, 6,6,6,6,6,6,6,6,6,6,92,0,7,81,8,91, 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,0,101,0,61,1, diff --git a/src/tools/moc/util/generate_keywords.cpp b/src/tools/moc/util/generate_keywords.cpp index 47ff0f9ac8..7ad553608c 100644 --- a/src/tools/moc/util/generate_keywords.cpp +++ b/src/tools/moc/util/generate_keywords.cpp @@ -268,7 +268,7 @@ inline bool is_ident_start(char s) { return ((s >= 'a' && s <= 'z') || (s >= 'A' && s <= 'Z') - || s == '_' + || s == '_' || s == '$' ); } @@ -277,7 +277,7 @@ inline bool is_ident_char(char s) return ((s >= 'a' && s <= 'z') || (s >= 'A' && s <= 'Z') || (s >= '0' && s <= '9') - || s == '_' + || s == '_' || s == '$' ); } struct State @@ -360,8 +360,9 @@ void makeTable(const Keyword keywords[]) newState(states, pre?"PP_CHARACTER":"CHARACTER", c); for (c = 'A'; c <= 'Z'; ++c) newState(states, pre?"PP_CHARACTER":"CHARACTER", c); - c = '_'; - newState(states, pre?"PP_CHARACTER":"CHARACTER", c); + + newState(states, pre?"PP_CHARACTER":"CHARACTER", '_'); + newState(states, pre?"PP_CHARACTER":"CHARACTER", '$'); // add digits for (c = '0'; c <= '9'; ++c) diff --git a/src/tools/moc/utils.h b/src/tools/moc/utils.h index aeb9b745f1..a2c65e4b2a 100644 --- a/src/tools/moc/utils.h +++ b/src/tools/moc/utils.h @@ -60,7 +60,7 @@ inline bool is_ident_start(char s) { return ((s >= 'a' && s <= 'z') || (s >= 'A' && s <= 'Z') - || s == '_' + || s == '_' || s == '$' ); } @@ -69,7 +69,7 @@ inline bool is_ident_char(char s) return ((s >= 'a' && s <= 'z') || (s >= 'A' && s <= 'Z') || (s >= '0' && s <= '9') - || s == '_' + || s == '_' || s == '$' ); } diff --git a/src/tools/qdoc/qdoc.pro b/src/tools/qdoc/qdoc.pro index 9df79ec718..cd792e73e8 100644 --- a/src/tools/qdoc/qdoc.pro +++ b/src/tools/qdoc/qdoc.pro @@ -1,6 +1,7 @@ option(host_build) -DEFINES += QDOC2_COMPAT +DEFINES += QDOC2_COMPAT \ + QT_CRYPTOGRAPHICHASH_ONLY_SHA1 INCLUDEPATH += $$QT_SOURCE_TREE/src/tools/qdoc \ $$QT_SOURCE_TREE/src/tools/qdoc/qmlparser diff --git a/src/tools/qdoc/qmlcodeparser.cpp b/src/tools/qdoc/qmlcodeparser.cpp index 02ab4b07fb..c86982eb95 100644 --- a/src/tools/qdoc/qmlcodeparser.cpp +++ b/src/tools/qdoc/qmlcodeparser.cpp @@ -86,6 +86,8 @@ QT_BEGIN_NAMESPACE Constructs the QML code parser. */ QmlCodeParser::QmlCodeParser() + : lexer( 0 ), + parser( 0 ) { } diff --git a/src/tools/uic/customwidgetsinfo.h b/src/tools/uic/customwidgetsinfo.h index 5e6405807d..d4ac02aba9 100644 --- a/src/tools/uic/customwidgetsinfo.h +++ b/src/tools/uic/customwidgetsinfo.h @@ -83,7 +83,6 @@ public: private: typedef QMap<QString, DomCustomWidget*> NameCustomWidgetMap; NameCustomWidgetMap m_customWidgets; - bool m_scriptsActivated; }; QT_END_NAMESPACE diff --git a/src/tools/uic/qclass_lib_map.h b/src/tools/uic/qclass_lib_map.h index c4d4d840a6..075b2d52e8 100644 --- a/src/tools/uic/qclass_lib_map.h +++ b/src/tools/uic/qclass_lib_map.h @@ -556,24 +556,6 @@ QT_CLASS_LIB(QSqlRelationalDelegate, QtSql, qsqlrelationaldelegate.h) QT_CLASS_LIB(QSqlRelation, QtSql, qsqlrelationaltablemodel.h) QT_CLASS_LIB(QSqlRelationalTableModel, QtSql, qsqlrelationaltablemodel.h) QT_CLASS_LIB(QSqlTableModel, QtSql, qsqltablemodel.h) -QT_CLASS_LIB(QDB2Result, QtSql, qsql_db2.h) -QT_CLASS_LIB(QDB2Driver, QtSql, qsql_db2.h) -QT_CLASS_LIB(QIBaseResult, QtSql, qsql_ibase.h) -QT_CLASS_LIB(QIBaseDriver, QtSql, qsql_ibase.h) -QT_CLASS_LIB(QMYSQLResult, QtSql, qsql_mysql.h) -QT_CLASS_LIB(QMYSQLDriver, QtSql, qsql_mysql.h) -QT_CLASS_LIB(QOCIResult, QtSql, qsql_oci.h) -QT_CLASS_LIB(QOCIDriver, QtSql, qsql_oci.h) -QT_CLASS_LIB(QODBCResult, QtSql, qsql_odbc.h) -QT_CLASS_LIB(QODBCDriver, QtSql, qsql_odbc.h) -QT_CLASS_LIB(QPSQLResult, QtSql, qsql_psql.h) -QT_CLASS_LIB(QPSQLDriver, QtSql, qsql_psql.h) -QT_CLASS_LIB(QSQLiteResult, QtSql, qsql_sqlite.h) -QT_CLASS_LIB(QSQLiteDriver, QtSql, qsql_sqlite.h) -QT_CLASS_LIB(QSQLite2Result, QtSql, qsql_sqlite2.h) -QT_CLASS_LIB(QSQLite2Driver, QtSql, qsql_sqlite2.h) -QT_CLASS_LIB(QTDSResult, QtSql, qsql_tds.h) -QT_CLASS_LIB(QTDSDriver, QtSql, qsql_tds.h) QT_CLASS_LIB(QAccessible, QtWidgets, qaccessible.h) QT_CLASS_LIB(QAccessibleInterface, QtWidgets, qaccessible.h) QT_CLASS_LIB(QAccessibleInterfaceEx, QtWidgets, qaccessible.h) |