Changeset 769 for trunk/src/tools
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/tools/moc/generator.cpp
r651 r769 739 739 if (p.read.isEmpty()) 740 740 continue; 741 QByteArray prefix; 742 if (p.inPrivateClass.size()) { 743 prefix = p.inPrivateClass; 744 prefix.append("->"); 745 } 741 746 if (p.gspec == PropertyDef::PointerSpec) 742 fprintf(out, " case %d: _a[0] = const_cast<void*>(reinterpret_cast<const void*>(%s ())); break;\n",743 propindex, p .read.constData());747 fprintf(out, " case %d: _a[0] = const_cast<void*>(reinterpret_cast<const void*>(%s%s())); break;\n", 748 propindex, prefix.constData(), p.read.constData()); 744 749 else if (p.gspec == PropertyDef::ReferenceSpec) 745 fprintf(out, " case %d: _a[0] = const_cast<void*>(reinterpret_cast<const void*>(&%s ())); break;\n",746 propindex, p .read.constData());750 fprintf(out, " case %d: _a[0] = const_cast<void*>(reinterpret_cast<const void*>(&%s%s())); break;\n", 751 propindex, prefix.constData(), p.read.constData()); 747 752 else if (cdef->enumDeclarations.value(p.type, false)) 748 fprintf(out, " case %d: *reinterpret_cast<int*>(_v) = QFlag(%s ()); break;\n",749 propindex, p .read.constData());753 fprintf(out, " case %d: *reinterpret_cast<int*>(_v) = QFlag(%s%s()); break;\n", 754 propindex, prefix.constData(), p.read.constData()); 750 755 else 751 fprintf(out, " case %d: *reinterpret_cast< %s*>(_v) = %s (); break;\n",752 propindex, p.type.constData(), p .read.constData());756 fprintf(out, " case %d: *reinterpret_cast< %s*>(_v) = %s%s(); break;\n", 757 propindex, p.type.constData(), prefix.constData(), p.read.constData()); 753 758 } 754 759 fprintf(out, " }\n"); … … 769 774 if (p.write.isEmpty()) 770 775 continue; 776 QByteArray prefix; 777 if (p.inPrivateClass.size()) { 778 prefix = p.inPrivateClass; 779 prefix.append("->"); 780 } 771 781 if (cdef->enumDeclarations.value(p.type, false)) { 772 fprintf(out, " case %d: %s (QFlag(*reinterpret_cast<int*>(_v))); break;\n",773 propindex, p .write.constData());782 fprintf(out, " case %d: %s%s(QFlag(*reinterpret_cast<int*>(_v))); break;\n", 783 propindex, prefix.constData(), p.write.constData()); 774 784 } else { 775 fprintf(out, " case %d: %s (*reinterpret_cast< %s*>(_v)); break;\n",776 propindex, p .write.constData(), p.type.constData());785 fprintf(out, " case %d: %s%s(*reinterpret_cast< %s*>(_v)); break;\n", 786 propindex, prefix.constData(), p.write.constData(), p.type.constData()); 777 787 } 778 788 } … … 792 802 if (!p.reset.endsWith(')')) 793 803 continue; 794 fprintf(out, " case %d: %s; break;\n", 795 propindex, p.reset.constData()); 804 QByteArray prefix; 805 if (p.inPrivateClass.size()) { 806 prefix = p.inPrivateClass; 807 prefix.append("->"); 808 } 809 fprintf(out, " case %d: %s%s; break;\n", 810 propindex, prefix.constData(), p.reset.constData()); 796 811 } 797 812 fprintf(out, " }\n"); -
trunk/src/tools/moc/keywords.cpp
r651 r769 44 44 45 45 static const short keyword_trans[][128] = { 46 {0,0,0,0,0,0,0,0,0,5 25,522,0,0,0,0,0,47 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 48 5 25,252,523,526,0,38,239,524,25,26,236,234,30,235,27,237,46 {0,0,0,0,0,0,0,0,0,533,530,0,0,0,0,0, 47 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 48 533,252,531,534,0,38,239,532,25,26,236,234,30,235,27,237, 49 49 22,22,22,22,22,22,22,22,22,22,34,41,23,39,24,43, 50 50 0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 51 8,21,8,8,8,8,8,8,8,8,8,31,5 27,32,238,8,51 8,21,8,8,8,8,8,8,8,8,8,31,535,32,238,8, 52 52 0,1,2,3,4,5,6,7,8,9,8,8,10,11,12,13, 53 53 14,8,15,16,17,18,19,20,8,8,8,36,245,37,248,0}, … … 191 191 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 192 192 0,0,0,0,0,0,0,0,0,0,42,0,0,0,28,0, 193 53 0,530,530,530,530,530,530,530,530,530,0,0,0,0,0,0,193 538,538,538,538,538,538,538,538,538,538,0,0,0,0,0,0, 194 194 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 195 195 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, … … 350 350 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 351 351 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 352 0,0,0,0,0,0,0,0,0,0,5 29,0,0,0,0,528,352 0,0,0,0,0,0,0,0,0,0,537,0,0,0,0,536, 353 353 0,0,0,0,0,0,0,0,0,0,0,0,0,258,0,0, 354 354 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, … … 426 426 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 427 427 0,0,0,0,450,0,506,0,0,0,0,0,0,0,0,0, 428 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 429 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, 430 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 431 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 432 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 433 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 434 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 435 522,0,0,481,0,0,0,0,0,0,0,0,0,0,0,0, 428 436 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 429 437 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, … … 926 934 {CHARACTER, 0, 69, 479, CHARACTER}, 927 935 {CHARACTER, 0, 95, 480, CHARACTER}, 928 {CHARACTER, 0, 83, 481, CHARACTER},936 {CHARACTER, 48, 0, 0, CHARACTER}, 929 937 {CHARACTER, 0, 76, 482, CHARACTER}, 930 938 {CHARACTER, 0, 79, 483, CHARACTER}, 931 939 {CHARACTER, 0, 84, 484, CHARACTER}, 932 940 {Q_PRIVATE_SLOT_TOKEN, 0, 0, 0, CHARACTER}, 933 {CHARACTER, 4 8, 0, 0, CHARACTER},941 {CHARACTER, 49, 0, 0, CHARACTER}, 934 942 {CHARACTER, 0, 77, 487, CHARACTER}, 935 943 {CHARACTER, 0, 79, 488, CHARACTER}, … … 968 976 {CHARACTER, 0, 69, 521, CHARACTER}, 969 977 {Q_SCRIPTABLE_TOKEN, 0, 0, 0, CHARACTER}, 978 {CHARACTER, 0, 82, 523, CHARACTER}, 979 {CHARACTER, 0, 79, 524, CHARACTER}, 980 {CHARACTER, 0, 80, 525, CHARACTER}, 981 {CHARACTER, 0, 69, 526, CHARACTER}, 982 {CHARACTER, 0, 82, 527, CHARACTER}, 983 {CHARACTER, 0, 84, 528, CHARACTER}, 984 {CHARACTER, 0, 89, 529, CHARACTER}, 985 {Q_PRIVATE_PROPERTY_TOKEN, 0, 0, 0, CHARACTER}, 970 986 {NEWLINE, 0, 0, 0, NOTOKEN}, 971 987 {QUOTE, 0, 0, 0, NOTOKEN}, -
trunk/src/tools/moc/moc.cpp
r651 r769 659 659 parseSlotInPrivate(&def, access); 660 660 break; 661 case Q_PRIVATE_PROPERTY_TOKEN: 662 parsePrivateProperty(&def); 663 break; 661 664 case ENUM: { 662 665 EnumDef enumDef; … … 873 876 } 874 877 875 876 void Moc::parseProperty(ClassDef *def) 877 { 878 next(LPAREN); 879 PropertyDef propDef; 878 void Moc::createPropertyDef(PropertyDef &propDef) 879 { 880 880 QByteArray type = parseType().name; 881 881 if (type.isEmpty()) … … 965 965 } 966 966 } 967 next(RPAREN);968 967 if (propDef.read.isNull()) { 969 968 QByteArray msg; … … 989 988 warning(msg.constData()); 990 989 } 990 } 991 992 void Moc::parseProperty(ClassDef *def) 993 { 994 next(LPAREN); 995 PropertyDef propDef; 996 createPropertyDef(propDef); 997 next(RPAREN); 998 999 1000 if(!propDef.notify.isEmpty()) 1001 def->notifyableProperties++; 1002 def->propertyList += propDef; 1003 } 1004 1005 void Moc::parsePrivateProperty(ClassDef *def) 1006 { 1007 next(LPAREN); 1008 PropertyDef propDef; 1009 next(IDENTIFIER); 1010 propDef.inPrivateClass = lexem(); 1011 while (test(SCOPE)) { 1012 propDef.inPrivateClass += lexem(); 1013 next(IDENTIFIER); 1014 propDef.inPrivateClass += lexem(); 1015 } 1016 // also allow void functions 1017 if (test(LPAREN)) { 1018 next(RPAREN); 1019 propDef.inPrivateClass += "()"; 1020 } 1021 1022 next(COMMA); 1023 1024 createPropertyDef(propDef); 991 1025 992 1026 if(!propDef.notify.isEmpty()) -
trunk/src/tools/moc/moc.h
r651 r769 117 117 { 118 118 PropertyDef():notifyId(-1), constant(false), final(false), gspec(ValueSpec){} 119 QByteArray name, type, read, write, reset, designable, scriptable, editable, stored, user, notify ;119 QByteArray name, type, read, write, reset, designable, scriptable, editable, stored, user, notify, inPrivateClass; 120 120 int notifyId; 121 121 bool constant; … … 218 218 void parseSignals(ClassDef *def); 219 219 void parseProperty(ClassDef *def); 220 void createPropertyDef(PropertyDef &def); 220 221 void parseEnumOrFlag(ClassDef *def, bool isFlag); 221 222 void parseFlag(ClassDef *def); … … 225 226 void parseDeclareMetatype(); 226 227 void parseSlotInPrivate(ClassDef *def, FunctionDef::Access access); 228 void parsePrivateProperty(ClassDef *def); 227 229 228 230 void parseFunctionArguments(FunctionDef *def); -
trunk/src/tools/moc/token.cpp
r651 r769 180 180 case Q_SLOT_TOKEN: return "Q_SLOT_TOKEN"; 181 181 case Q_PRIVATE_SLOT_TOKEN: return "Q_PRIVATE_SLOT_TOKEN"; 182 case Q_PRIVATE_PROPERTY_TOKEN: return "Q_PRIVATE_PROPERTY_TOKEN"; 182 183 case SPECIAL_TREATMENT_MARK: return "SPECIAL_TREATMENT_MARK"; 183 184 case MOC_INCLUDE_BEGIN: return "MOC_INCLUDE_BEGIN"; -
trunk/src/tools/moc/token.h
r651 r769 186 186 Q_INVOKABLE_TOKEN, 187 187 Q_SCRIPTABLE_TOKEN, 188 Q_PRIVATE_PROPERTY_TOKEN, 188 189 Q_META_TOKEN_END, 189 190 SPECIAL_TREATMENT_MARK = Q_META_TOKEN_END, -
trunk/src/tools/moc/util/generate_keywords.cpp
r651 r769 249 249 { "Q_SLOT", "Q_SLOT_TOKEN" }, 250 250 { "Q_SCRIPTABLE", "Q_SCRIPTABLE_TOKEN" }, 251 251 { "Q_PRIVATE_PROPERTY", "Q_PRIVATE_PROPERTY_TOKEN" }, 252 252 { "\n", "NEWLINE" }, 253 253 { "\"", "QUOTE" }, -
trunk/src/tools/rcc/rcc.cpp
r651 r769 545 545 RCCFileInfo *s = new RCCFileInfo(file); 546 546 s->m_parent = parent; 547 if (parent->m_children.contains(filename)) 548 qWarning("potential duplicate alias detected: '%s'", qPrintable(filename)); 547 549 parent->m_children.insertMulti(filename, s); 548 550 return true; -
trunk/src/tools/uic/cpp/cppwriteinitialization.cpp
r651 r769 2789 2789 2790 2790 QMap<QString, bool> map; // bool is dummy. The idea is to sort that (always generate in the same order) by putting a set into a map 2791 foreach ( QStringstr, directives)2792 map [str] = true;2791 foreach (const QString &str, directives) 2792 map.insert(str, true); 2793 2793 2794 2794 if (map.size() == 1) { … … 2799 2799 outputStream << "#if"; 2800 2800 bool doOr = false; 2801 foreach ( QStringstr, map.keys()) {2801 foreach (const QString &str, map.keys()) { 2802 2802 if (doOr) 2803 2803 outputStream << " ||"; -
trunk/src/tools/uic/qclass_lib_map.h
r561 r769 458 458 QT_CLASS_LIB(QWebSettings, QtWebKit, qwebsettings.h) 459 459 QT_CLASS_LIB(QWebView, QtWebKit, qwebview.h) 460 QT_CLASS_LIB(QAudio, QtMultimedia, qaudio.h) 460 461 QT_CLASS_LIB(QAudioDeviceInfo, QtMultimedia, qaudiodeviceinfo.h) 461 462 QT_CLASS_LIB(QAbstractAudioDeviceInfo, QtMultimedia, qaudioengine.h) -
trunk/src/tools/uic3/converter.cpp
r651 r769 402 402 if (objName == receiver) { 403 403 // see if it's a custom slot 404 foreach ( QStringcs, ui_custom_slots) {404 foreach (const QString &cs, ui_custom_slots) { 405 405 if (cs == slot) { 406 406 resolved = true; … … 1123 1123 QStringList flags = prop->elementSet().split(QLatin1Char('|')); 1124 1124 QStringList v; 1125 foreach ( QStringfl, flags) {1125 foreach (const QString &fl, flags) { 1126 1126 QString e = WidgetInfo::resolveEnumerator(className, fl); 1127 1127 if (e.isEmpty()) { … … 1284 1284 //split type name on <>*& and whitespace 1285 1285 QStringList typeNames = t.split(QRegExp(QLatin1String("<|>|\\*|&| ")), QString::SkipEmptyParts); 1286 foreach( QStringtypeName , typeNames) {1286 foreach(const QString &typeName , typeNames) { 1287 1287 QString newName = fixClassName(typeName); 1288 1288 if( newName != typeName ) { -
trunk/src/tools/uic3/main.cpp
r651 r769 339 339 ui3.computeDeps(e, globalIncludes, localIncludes, impl); 340 340 341 foreach ( QStringi, globalIncludes)341 foreach (const QString &i, globalIncludes) 342 342 printf("%s\n", i.toLatin1().constData()); 343 343 344 foreach ( QStringi, localIncludes)344 foreach (const QString &i, localIncludes) 345 345 printf("%s\n", i.toLatin1().constData()); 346 346
Note:
See TracChangeset
for help on using the changeset viewer.