Changeset 846 for trunk/tools/qdoc3/cppcodemarker.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/tools/qdoc3/cppcodemarker.cpp
r651 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) … … 146 146 else { 147 147 QString fullName; 148 for (;;) {148 while (node) { 149 149 fullName.prepend(plainName(node)); 150 150 if (node->parent() == relative || node->parent()->name().isEmpty()) … … 483 483 FastSection privateFunctions(classe, 484 484 "Private Functions", 485 "", 485 486 "private function", 486 487 "private functions"); 487 FastSection privateSlots(classe, "Private Slots", " private slot", "private slots");488 FastSection privateTypes(classe, "Private Types", " private type", "private types");488 FastSection privateSlots(classe, "Private Slots", "", "private slot", "private slots"); 489 FastSection privateTypes(classe, "Private Types", "", "private type", "private types"); 489 490 FastSection protectedFunctions(classe, 490 491 "Protected Functions", 492 "", 491 493 "protected function", 492 494 "protected functions"); 493 495 FastSection protectedSlots(classe, 494 496 "Protected Slots", 497 "", 495 498 "protected slot", 496 499 "protected slots"); 497 500 FastSection protectedTypes(classe, 498 501 "Protected Types", 502 "", 499 503 "protected type", 500 504 "protected types"); 501 505 FastSection protectedVariables(classe, 502 506 "Protected Variables", 507 "", 503 508 "protected type", 504 509 "protected variables"); 505 510 FastSection publicFunctions(classe, 506 511 "Public Functions", 512 "", 507 513 "public function", 508 514 "public functions"); 509 FastSection publicSignals(classe, "Signals", " signal", "signals");510 FastSection publicSlots(classe, "Public Slots", " public slot", "public slots");511 FastSection publicTypes(classe, "Public Types", " public type", "public types");515 FastSection publicSignals(classe, "Signals", "", "signal", "signals"); 516 FastSection publicSlots(classe, "Public Slots", "", "public slot", "public slots"); 517 FastSection publicTypes(classe, "Public Types", "", "public type", "public types"); 512 518 FastSection publicVariables(classe, 513 519 "Public Variables", 514 "public type", 520 "", 521 "public variable", 515 522 "public variables"); 516 FastSection properties(classe, "Properties", " property", "properties");523 FastSection properties(classe, "Properties", "", "property", "properties"); 517 524 FastSection relatedNonMembers(classe, 518 525 "Related Non-Members", 526 "", 519 527 "related non-member", 520 528 "related non-members"); 521 529 FastSection staticPrivateMembers(classe, 522 530 "Static Private Members", 531 "", 523 532 "static private member", 524 533 "static private members"); 525 534 FastSection staticProtectedMembers(classe, 526 535 "Static Protected Members", 536 "", 527 537 "static protected member", 528 538 "static protected members"); 529 539 FastSection staticPublicMembers(classe, 530 540 "Static Public Members", 541 "", 531 542 "static public member", 532 543 "static public members"); 533 FastSection macros(inner, "Macros", " macro", "macros");544 FastSection macros(inner, "Macros", "", "macro", "macros"); 534 545 535 546 NodeList::ConstIterator r = classe->relatedNodes().begin(); … … 667 678 } 668 679 else if (style == Detailed) { 669 FastSection memberFunctions(classe,"Member Function Documentation" );670 FastSection memberTypes(classe,"Member Type Documentation" );671 FastSection memberVariables(classe,"Member Variable Documentation" );672 FastSection properties(classe,"Property Documentation" );673 FastSection relatedNonMembers(classe,"Related Non-Members" );674 FastSection macros(classe,"Macro Documentation" );680 FastSection memberFunctions(classe,"Member Function Documentation","func","member","members"); 681 FastSection memberTypes(classe,"Member Type Documentation","types","member","members"); 682 FastSection memberVariables(classe,"Member Variable Documentation","vars","member","members"); 683 FastSection properties(classe,"Property Documentation","prop","member","members"); 684 FastSection relatedNonMembers(classe,"Related Non-Members","relnonmem","member","members"); 685 FastSection macros(classe,"Macro Documentation","macros","member","members"); 675 686 676 687 NodeList::ConstIterator r = classe->relatedNodes().begin(); … … 718 729 } 719 730 else { 720 FastSection all(classe );731 FastSection all(classe,"","","member","members"); 721 732 722 733 QStack<const ClassNode *> stack; … … 748 759 FastSection namespaces(inner, 749 760 "Namespaces", 761 style == Detailed ? "nmspace" : "", 750 762 "namespace", 751 763 "namespaces"); 752 764 FastSection classes(inner, 753 765 "Classes", 766 style == Detailed ? "classes" : "", 754 767 "class", 755 768 "classes"); 756 769 FastSection types(inner, 757 style == Summary ? 758 "Types" : "Type Documentation",770 style == Summary ? "Types" : "Type Documentation", 771 style == Detailed ? "types" : "", 759 772 "type", 760 773 "types"); … … 762 775 style == Summary ? 763 776 "Functions" : "Function Documentation", 777 style == Detailed ? "func" : "", 764 778 "function", 765 779 "functions"); … … 767 781 style == Summary ? 768 782 "Macros" : "Macro Documentation", 783 style == Detailed ? "macros" : "", 769 784 "macro", 770 785 "macros"); … … 811 826 } 812 827 813 const Node *CppCodeMarker::resolveTarget(const QString &target, 814 const Tree *tree, 815 const Node *relative) 828 const Node *CppCodeMarker::resolveTarget(const QString& target, 829 const Tree* tree, 830 const Node* relative, 831 const Node* self) 816 832 { 817 833 if (target.endsWith("()")) { … … 855 871 QStringList path = target.split("::"); 856 872 const Node *node; 873 int flags = Tree::SearchBaseClasses | 874 Tree::SearchEnumValues | 875 Tree::NonFunction; 857 876 if ((node = tree->findNode(path, 858 877 relative, 859 Tree::SearchBaseClasses | 860 Tree::SearchEnumValues | 861 Tree::NonFunction))) 878 flags, 879 self))) 862 880 return node; 863 881 } … … 882 900 static QRegExp multiLineComment("/(?:( )?\\*(?:[^*]+|\\*(?! /))*\\*\\1/)"); 883 901 multiLineComment.setMinimal(true); 884 static QRegExp singleLineComment(" //(?!!)[^!\n]*");902 static QRegExp singleLineComment("[^:]//(?!!)[^!\\n]*"); 885 903 static QRegExp preprocessor("(?:^|\n)(#[ \t]*(?:include|if|elif|endif|error|pragma|define" 886 904 "|warning)(?:(?:\\\\\n|\\n#)[^\n]*)*)"); … … 1068 1086 } 1069 1087 else if (mlpos == -1) { 1070 pos = slpos ;1071 len = singleLineComment.matchedLength() ;1088 pos = slpos + 1; 1089 len = singleLineComment.matchedLength() - 1; 1072 1090 } 1073 1091 else { 1074 1092 if (slpos < mlpos) { 1075 pos = slpos ;1076 len = singleLineComment.matchedLength() ;1093 pos = slpos + 1; 1094 len = singleLineComment.matchedLength() - 1; 1077 1095 } 1078 1096 else { … … 1110 1128 */ 1111 1129 QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, 1112 SynopsisStyle style) 1130 SynopsisStyle style, 1131 const Tree* tree) 1113 1132 { 1114 1133 QList<Section> sections; … … 1117 1136 FastSection qmlproperties(qmlClassNode, 1118 1137 "Properties", 1138 "", 1119 1139 "property", 1120 1140 "properties"); 1121 1141 FastSection qmlattachedproperties(qmlClassNode, 1122 1142 "Attached Properties", 1143 "", 1123 1144 "property", 1124 1145 "properties"); 1125 1146 FastSection qmlsignals(qmlClassNode, 1126 "Signals", 1127 "signal", 1128 "signals"); 1147 "Signals", 1148 "", 1149 "signal", 1150 "signals"); 1129 1151 FastSection qmlattachedsignals(qmlClassNode, 1130 "QML Attached Signals", 1152 "Attached Signals", 1153 "", 1131 1154 "signal", 1132 1155 "signals"); 1133 1156 FastSection qmlmethods(qmlClassNode, 1134 1157 "Methods", 1158 "", 1135 1159 "method", 1136 1160 "methods"); 1137 1161 FastSection qmlattachedmethods(qmlClassNode, 1138 "QML Attached Methods", 1162 "Attached Methods", 1163 "", 1139 1164 "method", 1140 1165 "methods"); … … 1180 1205 } 1181 1206 else if (style == Detailed) { 1182 FastSection qmlproperties(qmlClassNode, "Property Documentation"); 1183 FastSection qmlattachedproperties(qmlClassNode,"Attached Property Documentation"); 1184 FastSection qmlsignals(qmlClassNode,"Signal Documentation"); 1185 FastSection qmlattachedsignals(qmlClassNode,"Attached Signal Documentation"); 1186 FastSection qmlmethods(qmlClassNode,"Method Documentation"); 1187 FastSection qmlattachedmethods(qmlClassNode,"Attached Method Documentation"); 1207 FastSection qmlproperties(qmlClassNode, "Property Documentation","qmlprop","member","members"); 1208 FastSection qmlattachedproperties(qmlClassNode,"Attached Property Documentation","qmlattprop", 1209 "member","members"); 1210 FastSection qmlsignals(qmlClassNode,"Signal Documentation","qmlsig","member","members"); 1211 FastSection qmlattachedsignals(qmlClassNode,"Attached Signal Documentation","qmlattsig", 1212 "member","members"); 1213 FastSection qmlmethods(qmlClassNode,"Method Documentation","qmlmeth","member","members"); 1214 FastSection qmlattachedmethods(qmlClassNode,"Attached Method Documentation","qmlattmeth", 1215 "member","members"); 1188 1216 NodeList::ConstIterator c = qmlClassNode->childNodes().begin(); 1189 1217 while (c != qmlClassNode->childNodes().end()) { … … 1218 1246 append(sections,qmlattachedmethods); 1219 1247 } 1248 else { 1249 FastSection all(qmlClassNode,"","","member","members"); 1250 1251 QStack<const QmlClassNode*> stack; 1252 stack.push(qmlClassNode); 1253 1254 while (!stack.isEmpty()) { 1255 const QmlClassNode* ancestorClass = stack.pop(); 1256 1257 NodeList::ConstIterator c = ancestorClass->childNodes().begin(); 1258 while (c != ancestorClass->childNodes().end()) { 1259 // if ((*c)->access() != Node::Private) 1260 if ((*c)->subType() == Node::QmlPropertyGroup) { 1261 const QmlPropGroupNode* qpgn = static_cast<const QmlPropGroupNode*>(*c); 1262 NodeList::ConstIterator p = qpgn->childNodes().begin(); 1263 while (p != qpgn->childNodes().end()) { 1264 if ((*p)->type() == Node::QmlProperty) { 1265 insert(all,*p,style,Okay); 1266 } 1267 ++p; 1268 } 1269 } 1270 else 1271 insert(all,*c,style,Okay); 1272 ++c; 1273 } 1274 1275 if (!ancestorClass->links().empty()) { 1276 if (ancestorClass->links().contains(Node::InheritsLink)) { 1277 QPair<QString,QString> linkPair; 1278 linkPair = ancestorClass->links()[Node::InheritsLink]; 1279 QStringList strList(linkPair.first); 1280 const Node* n = tree->findNode(strList,Node::Fake); 1281 if (n && n->subType() == Node::QmlClass) { 1282 const QmlClassNode* qcn = static_cast<const QmlClassNode*>(n); 1283 stack.prepend(qcn); 1284 } 1285 } 1286 } 1287 } 1288 append(sections, all); 1289 } 1220 1290 } 1221 1291
Note:
See TracChangeset
for help on using the changeset viewer.