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/src/tools/moc/generator.cpp

    r769 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)
     
    174174    fprintf(out, "static const uint qt_meta_data_%s[] = {\n", qualifiedClassNameIdentifier.constData());
    175175    fprintf(out, "\n // content:\n");
    176     fprintf(out, "    %4d,       // revision\n", 4);
     176    fprintf(out, "    %4d,       // revision\n", 5);
    177177    fprintf(out, "    %4d,       // classname\n", strreg(cdef->qualified));
    178178    fprintf(out, "    %4d, %4d, // classinfo\n", cdef->classInfoList.count(), cdef->classInfoList.count() ? index : 0);
     
    483483void Generator::generateProperties()
    484484{
    485     //
    486     // specify get function, for compatibiliy we accept functions
    487     // 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 const
    498                 continue;
    499             if (f.arguments.size()) // and must not take any arguments
    500                 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 type
    511                 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 
    533485    //
    534486    // Create meta data
Note: See TracChangeset for help on using the changeset viewer.