Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/tools/uic3/form.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the tools applications of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    186186        if (!(*it).isEmpty()) {
    187187            QString header = fixHeaderName(*it);
    188             out << "#include <" << header << ">" << endl;
     188            out << "#include <" << header << '>' << endl;
    189189        }
    190190    }
     
    193193        if (!(*it).isEmpty()) {
    194194            QString header = fixHeaderName(*it);
    195             out << "#include \"" << header << "\"" << endl;
     195            out << "#include \"" << header << '\"' << endl;
    196196        }
    197197    }
     
    217217    for (it = typeDefs.constBegin(); it != typeDefs.constEnd(); ++it) {
    218218        if (!(*it).isEmpty())
    219             out << "typedef " << *it << ";" << endl;
     219            out << "typedef " << *it << ';' << endl;
    220220    }
    221221
     
    237237                ++ns;
    238238            }
    239             out << "class " << forwardName << ";" << endl;
     239            out << "class " << forwardName << ';' << endl;
    240240            for (int i = 0; i < (int) forwardNamespaces.count(); i++)
    241                 out << "}" << endl;
     241                out << '}' << endl;
    242242        }
    243243    }
     
    246246        QString fd = *it;
    247247        fd = fd.trimmed();
    248         if (!fd.endsWith(QLatin1String(";")))
    249             fd += QLatin1String(";");
     248        if (!fd.endsWith(QLatin1Char(';')))
     249            fd += QLatin1Char(';');
    250250        out << fd << endl;
    251251    }
     
    280280    out << "#define " << protector << endl;
    281281    out << endl;
    282     out << "#include \"" << convertedUiFile << "\"" << endl;
     282    out << "#include \"" << convertedUiFile << '\"' << endl;
    283283
    284284    createWrapperDeclContents(e);
     
    310310    out << "class ";
    311311    if (!exportMacro.isEmpty())
    312         out << exportMacro << " ";
    313     out << bareNameOfClass << " : public " << objClass << ", public Ui::" << bareNameOfClass << endl << "{" << endl;
     312        out << exportMacro << ' ';
     313    out << bareNameOfClass << " : public " << objClass << ", public Ui::" << bareNameOfClass << endl << '{' << endl;
    314314
    315315    /* qmake ignore Q_OBJECT */
     
    363363        QString returnType = n.attribute(QLatin1String("returnType"), QLatin1String("void"));
    364364        QString functionName = n.firstChild().toText().data().trimmed();
    365         if (functionName.endsWith(QLatin1String(";")))
    366             functionName = functionName.left(functionName.length() - 1);
     365        if (functionName.endsWith(QLatin1Char(';')))
     366            functionName.chop(1);
    367367        QString specifier = n.attribute(QLatin1String("specifier"));
    368368        QString access = n.attribute(QLatin1String("access"));
     
    395395        QString returnType = n.attribute(QLatin1String("returnType"), QLatin1String("void"));
    396396        QString functionName = n.firstChild().toText().data().trimmed();
    397         if (functionName.endsWith(QLatin1String(";")))
    398             functionName = functionName.left(functionName.length() - 1);
     397        if (functionName.endsWith(QLatin1Char(';')))
     398            functionName.chop(1);
    399399        QString specifier = n.attribute(QLatin1String("specifier"));
    400400        QString access = n.attribute(QLatin1String("access"));
     
    424424        QString access = n.attribute(QLatin1String("access"), QLatin1String("protected"));
    425425        QString var = fixDeclaration(n.firstChild().toText().data().trimmed());
    426         if (!var.endsWith(QLatin1String(";")))
    427             var += QLatin1String(";");
     426        if (!var.endsWith(QLatin1Char(';')))
     427            var += QLatin1Char(';');
    428428        if (access == QLatin1String("public"))
    429429            publicVars += var;
     
    459459            continue;
    460460        QString sigName = n.firstChild().toText().data().trimmed();
    461         if (sigName.endsWith(QLatin1String(";")))
     461        if (sigName.endsWith(QLatin1Char(';')))
    462462            sigName = sigName.left(sigName.length() - 1);
    463463        extraSignals += fixDeclaration(sigName);
     
    468468        out << "signals:" << endl;
    469469        for (it = extraSignals.constBegin(); it != extraSignals.constEnd(); ++it)
    470             out << "    void " << (*it) << ";" << endl;
     470            out << "    void " << (*it) << ';' << endl;
    471471        out << endl;
    472472    }
     
    514514    out << "};" << endl;
    515515    for (i = 0; i < (int) namespaces.count(); i++)
    516         out << "}" << endl;
     516        out << '}' << endl;
    517517
    518518    out << endl;
     
    544544        signature = fixDeclaration(signature);
    545545        type = fixType(type);
    546         out << "    " << specifier << type << " " << signature << pure << ";" << endl;
     546        out << "    " << specifier << type << ' ' << signature << pure << ';' << endl;
    547547    }
    548548    out << endl;
     
    584584            continue;
    585585        QString functionName = n.firstChild().toText().data().trimmed();
    586         if (functionName.endsWith(QLatin1String(";")))
    587             functionName = functionName.left(functionName.length() - 1);
     586        if (functionName.endsWith(QLatin1Char(';')))
     587            functionName.chop(1);
    588588        extraFuncts += functionName;
    589589        extraFunctTyp += n.attribute(QLatin1String("returnType"), QLatin1String("void"));
     
    599599            continue;
    600600        QString functionName = n.firstChild().toText().data().trimmed();
    601         if (functionName.endsWith(QLatin1String(";")))
    602             functionName = functionName.left(functionName.length() - 1);
     601        if (functionName.endsWith(QLatin1Char(';')))
     602            functionName.chop(1);
    603603        extraFuncts += functionName;
    604604        extraFunctTyp += n.attribute(QLatin1String("returnType"), QLatin1String("void"));
     
    664664    for (it = globalIncludes.begin(); it != globalIncludes.end(); ++it) {
    665665        if (!(*it).isEmpty())
    666             out << "#include <" << fixHeaderName(*it) << ">" << endl;
     666            out << "#include <" << fixHeaderName(*it) << '>' << endl;
    667667    }
    668668
     
    678678    for (it = localIncludes.begin(); it != localIncludes.end(); ++it) {
    679679        if (!(*it).isEmpty() && *it != QFileInfo(fileName + QLatin1String(".h")).fileName())
    680             out << "#include \"" << fixHeaderName(*it) << "\"" << endl;
     680            out << "#include \"" << fixHeaderName(*it) << '\"' << endl;
    681681    }
    682682
     
    685685        if (!outputFileName.isEmpty())
    686686            uiDotH = QString::fromUtf8(combinePath(uiDotH.ascii(), outputFileName.ascii()));
    687         out << "#include \"" << uiDotH << "\"" << endl;
     687        out << "#include \"" << uiDotH << '\"' << endl;
    688688        writeFunctImpl = false;
    689689    }
     
    703703        out << " *" << endl;
    704704        out << " *  The " << objClass.mid(1).toLower() << " will by default be modeless, unless you set 'modal' to" << endl;
    705         out << " *  true to construct a modal " << objClass.mid(1).toLower() << "." << endl;
     705        out << " *  true to construct a modal " << objClass.mid(1).toLower() << '.' << endl;
    706706        out << " */" << endl;
    707707        out << nameOfClass << "::" << bareNameOfClass << "(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)" << endl;
     
    734734    out << endl;
    735735
    736     out << "{" << endl;
     736    out << '{' << endl;
    737737
    738738//
     
    776776
    777777    // end of constructor
    778     out << "}" << endl;
     778    out << '}' << endl;
    779779    out << endl;
    780780
     
    784784    out << " */" << endl;
    785785    out << nameOfClass << "::~" << bareNameOfClass << "()" << endl;
    786     out << "{" << endl;
     786    out << '{' << endl;
    787787    if (extraFuncts.contains(QLatin1String("destroy()")))
    788788        out << indent << "destroy();" << endl;
    789789    out << indent << "// no need to delete child widgets, Qt does it all for us" << endl;
    790     out << "}" << endl;
     790    out << '}' << endl;
    791791    out << endl;
    792792
     
    817817    out << " */" << endl;
    818818    out << "void " << nameOfClass << "::languageChange()" << endl;
    819     out << "{" << endl;
     819    out << '{' << endl;
    820820    out << "    retranslateUi(this);" << endl;
    821     out << "}" << endl;
     821    out << '}' << endl;
    822822    out << endl;
    823823
     
    834834            QString fname = fixDeclaration(Parser::cleanArgs(*it));
    835835            if (!(*it3).startsWith(QLatin1String("pure"))) { // "pure virtual" or "pureVirtual"
    836                 out << type << " " << nameOfClass << "::" << fname << endl;
    837                 out << "{" << endl;
     836                out << type << ' ' << nameOfClass << "::" << fname << endl;
     837                out << '{' << endl;
    838838                if (*it != QLatin1String("init()") && *it != QLatin1String("destroy()")) {
    839839                    QRegExp numeric(QLatin1String("^(?:signed|unsigned|u?char|u?short|u?int"
     
    869869                        if (type == QLatin1String("bool")) {
    870870                            retVal = QLatin1String("false");
    871                         } else if (isBasicNumericType || type.endsWith(QLatin1String("*"))) {
     871                        } else if (isBasicNumericType || type.endsWith(QLatin1Char('*'))) {
    872872                            retVal = QLatin1String("0");
    873                         } else if (type.endsWith(QLatin1String("&"))) {
     873                        } else if (type.endsWith(QLatin1Char('&'))) {
    874874                            do {
    875875                                type.chop(1);
    876                             } while (type.endsWith(QLatin1String(" ")));
     876                            } while (type.endsWith(QLatin1Char(' ')));
    877877                            retVal = QLatin1String("uic_temp_var");
    878                             out << indent << "static " << type << " " << retVal << ";" << endl;
     878                            out << indent << "static " << type << ' ' << retVal << ';' << endl;
    879879                        } else {
    880880                            retVal = type + QLatin1String("()");
     
    884884                    out << indent << "qWarning(\"" << nameOfClass << "::" << fname << ": Not implemented yet\");" << endl;
    885885                    if (!retVal.isEmpty())
    886                         out << indent << "return " << retVal << ";" << endl;
     886                        out << indent << "return " << retVal << ';' << endl;
    887887                }
    888                 out << "}" << endl;
     888                out << '}' << endl;
    889889                out << endl;
    890890            }
Note: See TracChangeset for help on using the changeset viewer.