Changeset 846 for trunk/src/tools/moc/generator.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/tools/moc/generator.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 174 174 fprintf(out, "static const uint qt_meta_data_%s[] = {\n", qualifiedClassNameIdentifier.constData()); 175 175 fprintf(out, "\n // content:\n"); 176 fprintf(out, " %4d, // revision\n", 4);176 fprintf(out, " %4d, // revision\n", 5); 177 177 fprintf(out, " %4d, // classname\n", strreg(cdef->qualified)); 178 178 fprintf(out, " %4d, %4d, // classinfo\n", cdef->classInfoList.count(), cdef->classInfoList.count() ? index : 0); … … 483 483 void Generator::generateProperties() 484 484 { 485 //486 // specify get function, for compatibiliy we accept functions487 // returning pointers, or const char * for QByteArray.488 //489 for (int i = 0; i < cdef->propertyList.count(); ++i) {490 PropertyDef &p = cdef->propertyList[i];491 if (p.read.isEmpty())492 continue;493 for (int j = 0; j < cdef->publicList.count(); ++j) {494 const FunctionDef &f = cdef->publicList.at(j);495 if (f.name != p.read)496 continue;497 if (!f.isConst) // get functions must be const498 continue;499 if (f.arguments.size()) // and must not take any arguments500 continue;501 PropertyDef::Specification spec = PropertyDef::ValueSpec;502 QByteArray tmp = f.normalizedType;503 if (p.type == "QByteArray" && tmp == "const char *")504 tmp = "QByteArray";505 if (tmp.left(6) == "const ")506 tmp = tmp.mid(6);507 if (p.type != tmp && tmp.endsWith('*')) {508 tmp.chop(1);509 spec = PropertyDef::PointerSpec;510 } else if (f.type.name.endsWith('&')) { // raw type, not normalized type511 spec = PropertyDef::ReferenceSpec;512 }513 if (p.type != tmp)514 continue;515 p.gspec = spec;516 break;517 }518 if(!p.notify.isEmpty()) {519 int notifyId = -1;520 for (int j = 0; j < cdef->signalList.count(); ++j) {521 const FunctionDef &f = cdef->signalList.at(j);522 if(f.name != p.notify) {523 continue;524 } else {525 notifyId = j /* Signal indexes start from 0 */;526 break;527 }528 }529 p.notifyId = notifyId;530 }531 }532 533 485 // 534 486 // Create meta data
Note:
See TracChangeset
for help on using the changeset viewer.