Changeset 561 for trunk/src/tools/uic3/form.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/tools/uic3/form.cpp
r2 r561 2 2 ** 3 3 ** 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) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 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. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** 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. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 186 186 if (!(*it).isEmpty()) { 187 187 QString header = fixHeaderName(*it); 188 out << "#include <" << header << ">"<< endl;188 out << "#include <" << header << '>' << endl; 189 189 } 190 190 } … … 193 193 if (!(*it).isEmpty()) { 194 194 QString header = fixHeaderName(*it); 195 out << "#include \"" << header << "\""<< endl;195 out << "#include \"" << header << '\"' << endl; 196 196 } 197 197 } … … 217 217 for (it = typeDefs.constBegin(); it != typeDefs.constEnd(); ++it) { 218 218 if (!(*it).isEmpty()) 219 out << "typedef " << *it << ";"<< endl;219 out << "typedef " << *it << ';' << endl; 220 220 } 221 221 … … 237 237 ++ns; 238 238 } 239 out << "class " << forwardName << ";"<< endl;239 out << "class " << forwardName << ';' << endl; 240 240 for (int i = 0; i < (int) forwardNamespaces.count(); i++) 241 out << "}"<< endl;241 out << '}' << endl; 242 242 } 243 243 } … … 246 246 QString fd = *it; 247 247 fd = fd.trimmed(); 248 if (!fd.endsWith(QLatin1 String(";")))249 fd += QLatin1 String(";");248 if (!fd.endsWith(QLatin1Char(';'))) 249 fd += QLatin1Char(';'); 250 250 out << fd << endl; 251 251 } … … 280 280 out << "#define " << protector << endl; 281 281 out << endl; 282 out << "#include \"" << convertedUiFile << "\""<< endl;282 out << "#include \"" << convertedUiFile << '\"' << endl; 283 283 284 284 createWrapperDeclContents(e); … … 310 310 out << "class "; 311 311 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; 314 314 315 315 /* qmake ignore Q_OBJECT */ … … 363 363 QString returnType = n.attribute(QLatin1String("returnType"), QLatin1String("void")); 364 364 QString functionName = n.firstChild().toText().data().trimmed(); 365 if (functionName.endsWith(QLatin1 String(";")))366 functionName = functionName.left(functionName.length() -1);365 if (functionName.endsWith(QLatin1Char(';'))) 366 functionName.chop(1); 367 367 QString specifier = n.attribute(QLatin1String("specifier")); 368 368 QString access = n.attribute(QLatin1String("access")); … … 395 395 QString returnType = n.attribute(QLatin1String("returnType"), QLatin1String("void")); 396 396 QString functionName = n.firstChild().toText().data().trimmed(); 397 if (functionName.endsWith(QLatin1 String(";")))398 functionName = functionName.left(functionName.length() -1);397 if (functionName.endsWith(QLatin1Char(';'))) 398 functionName.chop(1); 399 399 QString specifier = n.attribute(QLatin1String("specifier")); 400 400 QString access = n.attribute(QLatin1String("access")); … … 424 424 QString access = n.attribute(QLatin1String("access"), QLatin1String("protected")); 425 425 QString var = fixDeclaration(n.firstChild().toText().data().trimmed()); 426 if (!var.endsWith(QLatin1 String(";")))427 var += QLatin1 String(";");426 if (!var.endsWith(QLatin1Char(';'))) 427 var += QLatin1Char(';'); 428 428 if (access == QLatin1String("public")) 429 429 publicVars += var; … … 459 459 continue; 460 460 QString sigName = n.firstChild().toText().data().trimmed(); 461 if (sigName.endsWith(QLatin1 String(";")))461 if (sigName.endsWith(QLatin1Char(';'))) 462 462 sigName = sigName.left(sigName.length() - 1); 463 463 extraSignals += fixDeclaration(sigName); … … 468 468 out << "signals:" << endl; 469 469 for (it = extraSignals.constBegin(); it != extraSignals.constEnd(); ++it) 470 out << " void " << (*it) << ";"<< endl;470 out << " void " << (*it) << ';' << endl; 471 471 out << endl; 472 472 } … … 514 514 out << "};" << endl; 515 515 for (i = 0; i < (int) namespaces.count(); i++) 516 out << "}"<< endl;516 out << '}' << endl; 517 517 518 518 out << endl; … … 544 544 signature = fixDeclaration(signature); 545 545 type = fixType(type); 546 out << " " << specifier << type << " " << signature << pure << ";"<< endl;546 out << " " << specifier << type << ' ' << signature << pure << ';' << endl; 547 547 } 548 548 out << endl; … … 584 584 continue; 585 585 QString functionName = n.firstChild().toText().data().trimmed(); 586 if (functionName.endsWith(QLatin1 String(";")))587 functionName = functionName.left(functionName.length() -1);586 if (functionName.endsWith(QLatin1Char(';'))) 587 functionName.chop(1); 588 588 extraFuncts += functionName; 589 589 extraFunctTyp += n.attribute(QLatin1String("returnType"), QLatin1String("void")); … … 599 599 continue; 600 600 QString functionName = n.firstChild().toText().data().trimmed(); 601 if (functionName.endsWith(QLatin1 String(";")))602 functionName = functionName.left(functionName.length() -1);601 if (functionName.endsWith(QLatin1Char(';'))) 602 functionName.chop(1); 603 603 extraFuncts += functionName; 604 604 extraFunctTyp += n.attribute(QLatin1String("returnType"), QLatin1String("void")); … … 664 664 for (it = globalIncludes.begin(); it != globalIncludes.end(); ++it) { 665 665 if (!(*it).isEmpty()) 666 out << "#include <" << fixHeaderName(*it) << ">"<< endl;666 out << "#include <" << fixHeaderName(*it) << '>' << endl; 667 667 } 668 668 … … 678 678 for (it = localIncludes.begin(); it != localIncludes.end(); ++it) { 679 679 if (!(*it).isEmpty() && *it != QFileInfo(fileName + QLatin1String(".h")).fileName()) 680 out << "#include \"" << fixHeaderName(*it) << "\""<< endl;680 out << "#include \"" << fixHeaderName(*it) << '\"' << endl; 681 681 } 682 682 … … 685 685 if (!outputFileName.isEmpty()) 686 686 uiDotH = QString::fromUtf8(combinePath(uiDotH.ascii(), outputFileName.ascii())); 687 out << "#include \"" << uiDotH << "\""<< endl;687 out << "#include \"" << uiDotH << '\"' << endl; 688 688 writeFunctImpl = false; 689 689 } … … 703 703 out << " *" << endl; 704 704 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; 706 706 out << " */" << endl; 707 707 out << nameOfClass << "::" << bareNameOfClass << "(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)" << endl; … … 734 734 out << endl; 735 735 736 out << "{"<< endl;736 out << '{' << endl; 737 737 738 738 // … … 776 776 777 777 // end of constructor 778 out << "}"<< endl;778 out << '}' << endl; 779 779 out << endl; 780 780 … … 784 784 out << " */" << endl; 785 785 out << nameOfClass << "::~" << bareNameOfClass << "()" << endl; 786 out << "{"<< endl;786 out << '{' << endl; 787 787 if (extraFuncts.contains(QLatin1String("destroy()"))) 788 788 out << indent << "destroy();" << endl; 789 789 out << indent << "// no need to delete child widgets, Qt does it all for us" << endl; 790 out << "}"<< endl;790 out << '}' << endl; 791 791 out << endl; 792 792 … … 817 817 out << " */" << endl; 818 818 out << "void " << nameOfClass << "::languageChange()" << endl; 819 out << "{"<< endl;819 out << '{' << endl; 820 820 out << " retranslateUi(this);" << endl; 821 out << "}"<< endl;821 out << '}' << endl; 822 822 out << endl; 823 823 … … 834 834 QString fname = fixDeclaration(Parser::cleanArgs(*it)); 835 835 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; 838 838 if (*it != QLatin1String("init()") && *it != QLatin1String("destroy()")) { 839 839 QRegExp numeric(QLatin1String("^(?:signed|unsigned|u?char|u?short|u?int" … … 869 869 if (type == QLatin1String("bool")) { 870 870 retVal = QLatin1String("false"); 871 } else if (isBasicNumericType || type.endsWith(QLatin1 String("*"))) {871 } else if (isBasicNumericType || type.endsWith(QLatin1Char('*'))) { 872 872 retVal = QLatin1String("0"); 873 } else if (type.endsWith(QLatin1 String("&"))) {873 } else if (type.endsWith(QLatin1Char('&'))) { 874 874 do { 875 875 type.chop(1); 876 } while (type.endsWith(QLatin1 String(" ")));876 } while (type.endsWith(QLatin1Char(' '))); 877 877 retVal = QLatin1String("uic_temp_var"); 878 out << indent << "static " << type << " " << retVal << ";"<< endl;878 out << indent << "static " << type << ' ' << retVal << ';' << endl; 879 879 } else { 880 880 retVal = type + QLatin1String("()"); … … 884 884 out << indent << "qWarning(\"" << nameOfClass << "::" << fname << ": Not implemented yet\");" << endl; 885 885 if (!retVal.isEmpty()) 886 out << indent << "return " << retVal << ";"<< endl;886 out << indent << "return " << retVal << ';' << endl; 887 887 } 888 out << "}"<< endl;888 out << '}' << endl; 889 889 out << endl; 890 890 }
Note:
See TracChangeset
for help on using the changeset viewer.