Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/tools/qdoc3/cppcodemarker.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    146146    else {
    147147        QString fullName;
    148         for (;;) {
     148        while (node) {
    149149            fullName.prepend(plainName(node));
    150150            if (node->parent() == relative || node->parent()->name().isEmpty())
     
    483483            FastSection privateFunctions(classe,
    484484                                         "Private Functions",
     485                                         "",
    485486                                         "private function",
    486487                                         "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");
    489490            FastSection protectedFunctions(classe,
    490491                                           "Protected Functions",
     492                                           "",
    491493                                           "protected function",
    492494                                           "protected functions");
    493495            FastSection protectedSlots(classe,
    494496                                       "Protected Slots",
     497                                       "",
    495498                                       "protected slot",
    496499                                       "protected slots");
    497500            FastSection protectedTypes(classe,
    498501                                       "Protected Types",
     502                                       "",
    499503                                       "protected type",
    500504                                       "protected types");
    501505            FastSection protectedVariables(classe,
    502506                                           "Protected Variables",
     507                                           "",
    503508                                           "protected type",
    504509                                           "protected variables");
    505510            FastSection publicFunctions(classe,
    506511                                        "Public Functions",
     512                                        "",
    507513                                        "public function",
    508514                                        "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");
    512518            FastSection publicVariables(classe,
    513519                                        "Public Variables",
    514                                         "public type",
     520                                        "",
     521                                        "public variable",
    515522                                        "public variables");
    516             FastSection properties(classe, "Properties", "property", "properties");
     523            FastSection properties(classe, "Properties", "", "property", "properties");
    517524            FastSection relatedNonMembers(classe,
    518525                                          "Related Non-Members",
     526                                          "",
    519527                                          "related non-member",
    520528                                          "related non-members");
    521529            FastSection staticPrivateMembers(classe,
    522530                                             "Static Private Members",
     531                                             "",
    523532                                             "static private member",
    524533                                             "static private members");
    525534            FastSection staticProtectedMembers(classe,
    526535                                               "Static Protected Members",
     536                                               "",
    527537                                               "static protected member",
    528538                                               "static protected members");
    529539            FastSection staticPublicMembers(classe,
    530540                                            "Static Public Members",
     541                                            "",
    531542                                            "static public member",
    532543                                            "static public members");
    533             FastSection macros(inner, "Macros", "macro", "macros");
     544            FastSection macros(inner, "Macros", "", "macro", "macros");
    534545
    535546            NodeList::ConstIterator r = classe->relatedNodes().begin();
     
    667678        }
    668679        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");
    675686
    676687            NodeList::ConstIterator r = classe->relatedNodes().begin();
     
    718729        }
    719730        else {
    720             FastSection all(classe);
     731            FastSection all(classe,"","","member","members");
    721732
    722733            QStack<const ClassNode *> stack;
     
    748759            FastSection namespaces(inner,
    749760                                   "Namespaces",
     761                                   style == Detailed ? "nmspace" : "",
    750762                                   "namespace",
    751763                                   "namespaces");
    752764            FastSection classes(inner,
    753765                                "Classes",
     766                                style == Detailed ? "classes" : "",
    754767                                "class",
    755768                                "classes");
    756769            FastSection types(inner,
    757                               style == Summary ?
    758                               "Types" : "Type Documentation",
     770                              style == Summary ? "Types" : "Type Documentation",
     771                              style == Detailed ? "types" : "",
    759772                              "type",
    760773                              "types");
     
    762775                                  style == Summary ?
    763776                                  "Functions" : "Function Documentation",
     777                                  style == Detailed ? "func" : "",
    764778                                  "function",
    765779                                  "functions");
     
    767781                               style == Summary ?
    768782                               "Macros" : "Macro Documentation",
     783                               style == Detailed ? "macros" : "",
    769784                               "macro",
    770785                               "macros");
     
    811826}
    812827
    813 const Node *CppCodeMarker::resolveTarget(const QString &target,
    814                                          const Tree *tree,
    815                                          const Node *relative)
     828const Node *CppCodeMarker::resolveTarget(const QString& target,
     829                                         const Tree* tree,
     830                                         const Node* relative,
     831                                         const Node* self)
    816832{
    817833    if (target.endsWith("()")) {
     
    855871        QStringList path = target.split("::");
    856872        const Node *node;
     873        int flags = Tree::SearchBaseClasses |
     874            Tree::SearchEnumValues |
     875            Tree::NonFunction;
    857876        if ((node = tree->findNode(path,
    858877                                   relative,
    859                                    Tree::SearchBaseClasses |
    860                                    Tree::SearchEnumValues |
    861                                    Tree::NonFunction)))
     878                                   flags,
     879                                   self)))
    862880            return node;
    863881    }
     
    882900    static QRegExp multiLineComment("/(?:( )?\\*(?:[^*]+|\\*(?! /))*\\*\\1/)");
    883901    multiLineComment.setMinimal(true);
    884     static QRegExp singleLineComment("//(?!!)[^!\n]*");
     902    static QRegExp singleLineComment("[^:]//(?!!)[^!\\n]*");
    885903    static QRegExp preprocessor("(?:^|\n)(#[ \t]*(?:include|if|elif|endif|error|pragma|define"
    886904                                "|warning)(?:(?:\\\\\n|\\n#)[^\n]*)*)");
     
    10681086        }
    10691087        else if (mlpos == -1) {
    1070             pos = slpos;
    1071             len = singleLineComment.matchedLength();
     1088            pos = slpos + 1;
     1089            len = singleLineComment.matchedLength() - 1;
    10721090        }
    10731091        else {
    10741092            if (slpos < mlpos) {
    1075                 pos = slpos;
    1076                 len = singleLineComment.matchedLength();
     1093                pos = slpos + 1;
     1094                len = singleLineComment.matchedLength() - 1;
    10771095            }
    10781096            else {
     
    11101128 */
    11111129QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
    1112                                           SynopsisStyle style)
     1130                                          SynopsisStyle style,
     1131                                          const Tree* tree)
    11131132{
    11141133    QList<Section> sections;
     
    11171136            FastSection qmlproperties(qmlClassNode,
    11181137                                      "Properties",
     1138                                      "",
    11191139                                      "property",
    11201140                                      "properties");
    11211141            FastSection qmlattachedproperties(qmlClassNode,
    11221142                                              "Attached Properties",
     1143                                              "",
    11231144                                              "property",
    11241145                                              "properties");
    11251146            FastSection qmlsignals(qmlClassNode,
    1126                                 "Signals",
    1127                                 "signal",
    1128                                 "signals");
     1147                                   "Signals",
     1148                                   "",
     1149                                   "signal",
     1150                                   "signals");
    11291151            FastSection qmlattachedsignals(qmlClassNode,
    1130                                            "QML Attached Signals",
     1152                                           "Attached Signals",
     1153                                           "",
    11311154                                           "signal",
    11321155                                           "signals");
    11331156            FastSection qmlmethods(qmlClassNode,
    11341157                                   "Methods",
     1158                                   "",
    11351159                                   "method",
    11361160                                   "methods");
    11371161            FastSection qmlattachedmethods(qmlClassNode,
    1138                                            "QML Attached Methods",
     1162                                           "Attached Methods",
     1163                                           "",
    11391164                                           "method",
    11401165                                           "methods");
     
    11801205        }
    11811206        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");
    11881216            NodeList::ConstIterator c = qmlClassNode->childNodes().begin();
    11891217            while (c != qmlClassNode->childNodes().end()) {
     
    12181246            append(sections,qmlattachedmethods);
    12191247        }
     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        }
    12201290    }
    12211291
Note: See TracChangeset for help on using the changeset viewer.