diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-01-15 22:17:52 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-20 13:10:01 +0100 |
commit | b29f51357b4d18f33f5d522994aeff149737b358 (patch) | |
tree | 4c71185e39afc5a30b483b56cc1c96136196396f /tools | |
parent | 6e55d96d899b78d17de022f2e1d93f210ff7a1d0 (diff) |
whitespace fixes
expand tabs, fix indentation, remove trailing whitespace.
Change-Id: Ibec1bbad9e8faff81671ce9d1c7bb4fb9b340bb9
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/dumpcpp/main.cpp | 30 | ||||
-rw-r--r-- | tools/dumpdoc/main.cpp | 22 | ||||
-rw-r--r-- | tools/testcon/ambientproperties.cpp | 4 | ||||
-rw-r--r-- | tools/testcon/changeproperties.cpp | 268 | ||||
-rw-r--r-- | tools/testcon/controlinfo.cpp | 16 | ||||
-rw-r--r-- | tools/testcon/docuwindow.cpp | 14 | ||||
-rw-r--r-- | tools/testcon/invokemethod.cpp | 52 | ||||
-rw-r--r-- | tools/testcon/main.cpp | 12 | ||||
-rw-r--r-- | tools/testcon/mainwindow.cpp | 116 | ||||
-rw-r--r-- | tools/testcon/scripts/javascript.js | 12 | ||||
-rw-r--r-- | tools/testcon/scripts/perlscript.pl | 12 | ||||
-rw-r--r-- | tools/testcon/scripts/vbscript.vbs | 12 | ||||
-rw-r--r-- | tools/testcon/testcon.pro | 6 | ||||
-rw-r--r-- | tools/tools.pro | 2 |
14 files changed, 289 insertions, 289 deletions
diff --git a/tools/dumpcpp/main.cpp b/tools/dumpcpp/main.cpp index 0f90873..3ddb056 100644 --- a/tools/dumpcpp/main.cpp +++ b/tools/dumpcpp/main.cpp @@ -146,7 +146,7 @@ static QByteArray joinParameterNames(const QList<QByteArray> ¶meterNames) QByteArray constRefify(const QByteArray &type) { QByteArray ctype(type); - if (type == "QString" || type == "QPixmap" + if (type == "QString" || type == "QPixmap" || type == "QVariant" || type == "QDateTime" || type == "QColor" || type == "QFont" || type == "QByteArray" || type == "QValueList<QVariant>" @@ -260,7 +260,7 @@ void generateClassDecl(QTextStream &out, const QString &controlID, const QMetaOb QMetaProperty property = mo->property(iprop); if (!property.isReadable()) continue; - + QByteArray propertyName(property.name()); if (propertyName == "control" || propertyName == className) continue; @@ -276,7 +276,7 @@ void generateClassDecl(QTextStream &out, const QString &controlID, const QMetaOb } // Check whether the new function conflicts with any of QAxBase public virtual functions. - // If so, prepend the function name with '<classname>_'. Since all internal metaobject magic + // If so, prepend the function name with '<classname>_'. Since all internal metaobject magic // remains the same, we have to use the original name when used with QObject::connect or QMetaObject QByteArray propertyFunctionName(propertyName); if (axBase_vfuncs.contains(propertyFunctionName)) { @@ -292,7 +292,7 @@ void generateClassDecl(QTextStream &out, const QString &controlID, const QMetaOb out << indent << "inline "; bool foreignNamespace = true; - if (!propertyType.contains("::") && + if (!propertyType.contains("::") && (qax_qualified_usertypes.contains(simplePropType) || qax_qualified_usertypes.contains("enum "+ simplePropType)) ) { propertyType = nameSpace + "::" + propertyType; @@ -339,7 +339,7 @@ void generateClassDecl(QTextStream &out, const QString &controlID, const QMetaOb } functions << propertyName; - + if (property.isWritable()) { QByteArray setter(propertyName); if (isupper(setter.at(0))) { @@ -348,12 +348,12 @@ void generateClassDecl(QTextStream &out, const QString &controlID, const QMetaOb setter[0] = toupper(setter[0]); setter = "set" + setter; } - + out << indent << "inline " << "void "; if (category & OnlyInlines) out << className << "::"; out << setter << "(" << constRefify(propertyType) << " value)"; - + if (!(category & NoInlines)) { if (propertyType.endsWith('*')) { out << "{" << endl; @@ -429,7 +429,7 @@ void generateClassDecl(QTextStream &out, const QString &controlID, const QMetaOb } else { parameterSplit = slotParameters.split(','); } - + for (int i = 0; i < signatureSplit.count(); ++i) { QByteArray parameterType = signatureSplit.at(i); if (!parameterType.contains("::") && namespaceForType.contains(parameterType)) @@ -474,7 +474,7 @@ void generateClassDecl(QTextStream &out, const QString &controlID, const QMetaOb } else { out << endl; out << indent << "{" << endl; - + if (slotType != QByteArrayLiteral("void")) { out << indent << " " << slotType << " qax_result"; if (slotType.endsWith('*')) @@ -902,7 +902,7 @@ bool generateClass(QAxObject *object, const QByteArray &className, const QByteAr if (!nameSpace.isEmpty() && !(category & NoDeclaration)) { QFile outfile(QString::fromLatin1(nameSpace.toLower().constData()) + QLatin1String(".h")); - if (!outfile.open(QIODevice::WriteOnly | QIODevice::Text)) { + if (!outfile.open(QIODevice::WriteOnly | QIODevice::Text)) { qWarning("dumpcpp: Could not open output file '%s'", qPrintable(outfile.fileName())); return false; } @@ -1285,8 +1285,8 @@ bool generateTypeLibrary(const QByteArray &typeLib, const QByteArray &outname, O if (metaObject) { currentTypeInfo = typeinfo; QByteArray className(metaObject->className()); - if (!(typeattr->wTypeFlags & TYPEFLAG_FDUAL) - && (metaObject->propertyCount() - metaObject->propertyOffset()) == 1 + if (!(typeattr->wTypeFlags & TYPEFLAG_FDUAL) + && (metaObject->propertyCount() - metaObject->propertyOffset()) == 1 && className.contains("Events")) { declOut << "// skipping event interface " << className << endl << endl; } else { @@ -1508,10 +1508,10 @@ int main(int argc, char **argv) GetTypeLib } state; state = Default; - + QByteArray outname; QByteArray typeLib; - + for (int a = 1; a < argc; ++a) { QByteArray arg(argv[a]); const char first = arg[0]; @@ -1609,7 +1609,7 @@ int main(int argc, char **argv) if (category == DoNothing) return 0; - + if (typeLib.isEmpty()) { qWarning("dumpcpp: No object class or type library name provided.\n" " Use -h for help."); diff --git a/tools/dumpdoc/main.cpp b/tools/dumpdoc/main.cpp index 7314086..cfa6f12 100644 --- a/tools/dumpdoc/main.cpp +++ b/tools/dumpdoc/main.cpp @@ -58,10 +58,10 @@ int main(int argc, char **argv) OutOption } state; state = Default; - + QByteArray outname; QByteArray object; - + for (int a = 1; a < argc; ++a) { QByteArray arg(argv[a]); const char first = arg[0]; @@ -90,12 +90,12 @@ int main(int argc, char **argv) outname = arg; state = Default; break; - + default: break; } } - + if (object.isEmpty()) { qWarning("dumpdoc: No object name provided.\n" " Use -h for help."); @@ -111,19 +111,19 @@ int main(int argc, char **argv) outfile.open(stdout, QIODevice::WriteOnly); } QTextStream out(&outfile); - + QByteArray subobject = object; int index = subobject.indexOf('/'); if (index != -1) subobject = subobject.left(index); - + QAxObject topobject(QString::fromLatin1(subobject.constData())); - + if (topobject.isNull()) { qWarning("dumpdoc: Could not instantiate COM object '%s'", subobject.data()); return -2; } - + QAxObject *axobject = &topobject; while (index != -1 && axobject) { index++; @@ -131,18 +131,18 @@ int main(int argc, char **argv) if (object.indexOf('/', index) != -1) { int oldindex = index; index = object.indexOf('/', index); - subobject = object.mid(oldindex, index-oldindex); + subobject = object.mid(oldindex, index-oldindex); } else { index = -1; } - + axobject = axobject->querySubObject(subobject); } if (!axobject || axobject->isNull()) { qWarning("dumpdoc: Subobject '%s' does not exist in '%s'", subobject.data(), object.data()); return -3; } - + QString docu = axobject->generateDocumentation(); out << docu; return 0; diff --git a/tools/testcon/ambientproperties.cpp b/tools/testcon/ambientproperties.cpp index 0bf6544..d76753b 100644 --- a/tools/testcon/ambientproperties.cpp +++ b/tools/testcon/ambientproperties.cpp @@ -86,7 +86,7 @@ void AmbientProperties::on_buttonBackground_clicked() p = widget->palette(); p.setColor(widget->backgroundRole(), c); widget->setPalette(p); - } + } } void AmbientProperties::on_buttonForeground_clicked() @@ -113,7 +113,7 @@ void AmbientProperties::on_buttonFont_clicked() bool ok; QFont f = QFontDialog::getFont( &ok, fontSample->font(), this ); if ( !ok ) - return; + return; fontSample->setFont( f ); container->setFont( f ); diff --git a/tools/testcon/changeproperties.cpp b/tools/testcon/changeproperties.cpp index 41936ef..ed56759 100644 --- a/tools/testcon/changeproperties.cpp +++ b/tools/testcon/changeproperties.cpp @@ -75,9 +75,9 @@ void ChangeProperties::on_listProperties_currentItemChanged(QTreeWidgetItem *cur editValue->setEnabled(current != 0); buttonSet->setEnabled(current != 0); valueLabel->setEnabled(current != 0); - + if (!current) - return; + return; editValue->setText(current->text(2)); QString prop = current->text(0); @@ -95,94 +95,94 @@ void ChangeProperties::on_buttonSet_clicked() { QTreeWidgetItem *item = listProperties->currentItem(); if (!item) - return; - + return; + QString prop = item->text(0); QVariant value = activex->property(prop.toLatin1()); QVariant::Type type = value.type(); if (!value.isValid()) { - const QMetaObject *mo = activex->metaObject(); - const QMetaProperty property = mo->property(mo->indexOfProperty(prop.toLatin1())); - type = QVariant::nameToType(property.typeName()); + const QMetaObject *mo = activex->metaObject(); + const QMetaProperty property = mo->property(mo->indexOfProperty(prop.toLatin1())); + type = QVariant::nameToType(property.typeName()); } switch (type) { case QVariant::Color: - { - QColor col; - col.setNamedColor(editValue->text()); - if (col.isValid()) { - value = QVariant::fromValue(col); - } else { - QMessageBox::warning(this, tr("Can't parse input"), - tr("Failed to create a color from %1\n" - "The string has to be a valid color name (e.g. 'red')\n" - "or a RGB triple of format '#rrggbb'." - ).arg(editValue->text())); - } - } - break; + { + QColor col; + col.setNamedColor(editValue->text()); + if (col.isValid()) { + value = QVariant::fromValue(col); + } else { + QMessageBox::warning(this, tr("Can't parse input"), + tr("Failed to create a color from %1\n" + "The string has to be a valid color name (e.g. 'red')\n" + "or a RGB triple of format '#rrggbb'." + ).arg(editValue->text())); + } + } + break; case QVariant::Font: - { - QFont fnt; - if (fnt.fromString(editValue->text())) { - value = QVariant::fromValue(fnt); - } else { - QMessageBox::warning(this, tr("Can't parse input"), - tr("Failed to create a font from %1\n" - "The string has to have a format family,<point size> or\n" - "family,pointsize,stylehint,weight,italic,underline,strikeout,fixedpitch,rawmode." - ).arg(editValue->text())); - } - } - break; + { + QFont fnt; + if (fnt.fromString(editValue->text())) { + value = QVariant::fromValue(fnt); + } else { + QMessageBox::warning(this, tr("Can't parse input"), + tr("Failed to create a font from %1\n" + "The string has to have a format family,<point size> or\n" + "family,pointsize,stylehint,weight,italic,underline,strikeout,fixedpitch,rawmode." + ).arg(editValue->text())); + } + } + break; case QVariant::Pixmap: - { - QString fileName = editValue->text(); - if (fileName.isEmpty()) - fileName = QFileDialog::getOpenFileName(this); - QPixmap pm(fileName); - if (pm.isNull()) - return; + { + QString fileName = editValue->text(); + if (fileName.isEmpty()) + fileName = QFileDialog::getOpenFileName(this); + QPixmap pm(fileName); + if (pm.isNull()) + return; - value = QVariant::fromValue(pm); - } - break; + value = QVariant::fromValue(pm); + } + break; case QVariant::Bool: - { - QString txt = editValue->text().toLower(); - value = QVariant(txt != QLatin1String("0") && txt != QLatin1String("false")); - } - break; + { + QString txt = editValue->text().toLower(); + value = QVariant(txt != QLatin1String("0") && txt != QLatin1String("false")); + } + break; case QVariant::List: - { - QStringList txtList = editValue->text().split(QRegExp(QLatin1String("[,;]"))); - QList<QVariant> varList; - for (int i = 0; i < txtList.count(); ++i) { - QVariant svar(txtList.at(i)); - QString str = svar.toString(); - str = str.trimmed(); - bool ok; - int n = str.toInt(&ok); - if (ok) { - varList << n; - continue; - } - double d = str.toDouble(&ok); - if (ok) { - varList << d; - continue; - } - varList << str; - } - value = varList; - } - break; + { + QStringList txtList = editValue->text().split(QRegExp(QLatin1String("[,;]"))); + QList<QVariant> varList; + for (int i = 0; i < txtList.count(); ++i) { + QVariant svar(txtList.at(i)); + QString str = svar.toString(); + str = str.trimmed(); + bool ok; + int n = str.toInt(&ok); + if (ok) { + varList << n; + continue; + } + double d = str.toDouble(&ok); + if (ok) { + varList << d; + continue; + } + varList << str; + } + value = varList; + } + break; default: - value = editValue->text(); - break; + value = editValue->text(); + break; } - + Q_ASSERT(activex->setProperty(prop.toLatin1(), value)); updateProperties(); listProperties->setCurrentItem(listProperties->findItems(prop, Qt::MatchExactly).at(0)); @@ -191,7 +191,7 @@ void ChangeProperties::on_buttonSet_clicked() void ChangeProperties::on_listEditRequests_itemChanged(QTreeWidgetItem *item) { if (!item) - return; + return; QString property = item->text(0); activex->setPropertyWritable(property.toLatin1(), item->checkState(0) == Qt::Checked); @@ -206,66 +206,66 @@ void ChangeProperties::updateProperties() listProperties->clear(); listEditRequests->clear(); if (hasControl) { - const QMetaObject *mo = activex->metaObject(); - const int numprops = mo->propertyCount(); - for (int i = mo->propertyOffset(); i < numprops; ++i) { - const QMetaProperty property = mo->property(i); - QTreeWidgetItem *item = new QTreeWidgetItem(listProperties); - item->setText(0, QString::fromLatin1(property.name())); - item->setText(1, QString::fromLatin1(property.typeName())); + const QMetaObject *mo = activex->metaObject(); + const int numprops = mo->propertyCount(); + for (int i = mo->propertyOffset(); i < numprops; ++i) { + const QMetaProperty property = mo->property(i); + QTreeWidgetItem *item = new QTreeWidgetItem(listProperties); + item->setText(0, QString::fromLatin1(property.name())); + item->setText(1, QString::fromLatin1(property.typeName())); if (!property.isDesignable()) { item->setTextColor(0, Qt::gray); item->setTextColor(1, Qt::gray); item->setTextColor(2, Qt::gray); } - QVariant var = activex->property(property.name()); - - switch (var.type()) { - case QVariant::Color: - { - QColor col = qvariant_cast<QColor>(var); - item->setText(2, col.name()); - } - break; - case QVariant::Font: - { - QFont fnt = qvariant_cast<QFont>(var); - item->setText(2, fnt.toString()); - } - break; - case QVariant::Bool: - { - item->setText(2, var.toBool() ? QLatin1String("true") : QLatin1String("false")); - } - break; - case QVariant::Pixmap: - { - QPixmap pm = qvariant_cast<QPixmap>(var); - item->setIcon(2, pm); - } - break; - case QVariant::List: - { - QList<QVariant> varList = var.toList(); - QStringList strList; - for (int i = 0; i < varList.count(); ++i) { - QVariant var = varList.at(i); - strList << var.toString(); - } - item->setText(2, strList.join(QLatin1String(", "))); - } - break; - case QVariant::Int: - if (property.isEnumType()) { - const QMetaEnum enumerator = mo->enumerator(mo->indexOfEnumerator(property.typeName())); - item->setText(2, QString::fromLatin1(enumerator.valueToKey(var.toInt()))); - break; - } - //FALLTHROUGH - default: - item->setText(2, var.toString()); - break; - } + QVariant var = activex->property(property.name()); + + switch (var.type()) { + case QVariant::Color: + { + QColor col = qvariant_cast<QColor>(var); + item->setText(2, col.name()); + } + break; + case QVariant::Font: + { + QFont fnt = qvariant_cast<QFont>(var); + item->setText(2, fnt.toString()); + } + break; + case QVariant::Bool: + { + item->setText(2, var.toBool() ? QLatin1String("true") : QLatin1String("false")); + } + break; + case QVariant::Pixmap: + { + QPixmap pm = qvariant_cast<QPixmap>(var); + item->setIcon(2, pm); + } + break; + case QVariant::List: + { + QList<QVariant> varList = var.toList(); + QStringList strList; + for (int i = 0; i < varList.count(); ++i) { + QVariant var = varList.at(i); + strList << var.toString(); + } + item->setText(2, strList.join(QLatin1String(", "))); + } + break; + case QVariant::Int: + if (property.isEnumType()) { + const QMetaEnum enumerator = mo->enumerator(mo->indexOfEnumerator(property.typeName())); + item->setText(2, QString::fromLatin1(enumerator.valueToKey(var.toInt()))); + break; + } + //FALLTHROUGH + default: + item->setText(2, var.toString()); + break; + } bool requesting = false; #if 0 @@ -275,11 +275,11 @@ void ChangeProperties::updateProperties() } #endif if (requesting) { - QTreeWidgetItem *check = new QTreeWidgetItem(listEditRequests); + QTreeWidgetItem *check = new QTreeWidgetItem(listEditRequests); check->setText(0, QString::fromLatin1(property.name())); check->setCheckState(0, activex->propertyWritable(property.name()) ? Qt::Checked : Qt::Unchecked); - } - } + } + } listProperties->setCurrentItem(listProperties->topLevelItem(0)); } else { editValue->clear(); diff --git a/tools/testcon/controlinfo.cpp b/tools/testcon/controlinfo.cpp index bb7e0f2..645595f 100644 --- a/tools/testcon/controlinfo.cpp +++ b/tools/testcon/controlinfo.cpp @@ -68,8 +68,8 @@ void ControlInfo::setControl(QWidget *activex) int i; int count; for (i = mo->classInfoOffset(); i < mo->classInfoCount(); ++i) { - const QMetaClassInfo info = mo->classInfo(i); - item = new QTreeWidgetItem(group); + const QMetaClassInfo info = mo->classInfo(i); + item = new QTreeWidgetItem(group); item->setText(0, QString::fromLatin1(info.name())); item->setText(1, QString::fromLatin1(info.value())); } @@ -78,10 +78,10 @@ void ControlInfo::setControl(QWidget *activex) count = 0; for (i = mo->methodOffset(); i < mo->methodCount(); ++i) { - const QMetaMethod method = mo->method(i); + const QMetaMethod method = mo->method(i); if (method.methodType() == QMetaMethod::Signal) { ++count; - item = new QTreeWidgetItem(group); + item = new QTreeWidgetItem(group); item->setText(0, QString::fromLatin1(method.methodSignature())); } } @@ -92,10 +92,10 @@ void ControlInfo::setControl(QWidget *activex) count = 0; for (i = mo->methodOffset(); i < mo->methodCount(); ++i) { - const QMetaMethod method = mo->method(i); + const QMetaMethod method = mo->method(i); if (method.methodType() == QMetaMethod::Slot) { ++count; - item = new QTreeWidgetItem(group); + item = new QTreeWidgetItem(group); item->setText(0, QString::fromLatin1(method.methodSignature())); } } @@ -107,8 +107,8 @@ void ControlInfo::setControl(QWidget *activex) count = 0; for (i = mo->propertyOffset(); i < mo->propertyCount(); ++i) { ++count; - const QMetaProperty property = mo->property(i); - item = new QTreeWidgetItem(group); + const QMetaProperty property = mo->property(i); + item = new QTreeWidgetItem(group); item->setText(0, QString::fromLatin1(property.name())); item->setText(1, QString::fromLatin1(property.typeName())); if (!property.isDesignable()) { diff --git a/tools/testcon/docuwindow.cpp b/tools/testcon/docuwindow.cpp index cdeee74..54e4ef0 100644 --- a/tools/testcon/docuwindow.cpp +++ b/tools/testcon/docuwindow.cpp @@ -122,13 +122,13 @@ void DocuWindow::save() QString filename = QFileDialog::getSaveFileName(this); if (filename.isEmpty()) - return; + return; QString text = browser->document()->toHtml(); QFile f(filename); if (!f.open(QIODevice::WriteOnly)) { - statusBar()->showMessage(tr("Could not write to %1").arg(filename), 2000); - return; + statusBar()->showMessage(tr("Could not write to %1").arg(filename), 2000); + return; } QTextStream t(&f); @@ -145,14 +145,14 @@ void DocuWindow::print() #else QPrinter printer; if (printer.printerName().isEmpty()) { - statusBar()->showMessage(tr("No printer installed"), 2000); - return; + statusBar()->showMessage(tr("No printer installed"), 2000); + return; } QPrintDialog printDialog(&printer, this); if (!printDialog.exec()) { - statusBar()->showMessage(tr("Printing aborted"), 2000); - return; + statusBar()->showMessage(tr("Printing aborted"), 2000); + return; } browser->document()->print(&printer); diff --git a/tools/testcon/invokemethod.cpp b/tools/testcon/invokemethod.cpp index a3f587e..82673c1 100644 --- a/tools/testcon/invokemethod.cpp +++ b/tools/testcon/invokemethod.cpp @@ -65,32 +65,32 @@ void InvokeMethod::setControl(QAxBase *ax) comboMethods->setEnabled(hasControl); buttonInvoke->setEnabled(hasControl); boxParameters->setEnabled(hasControl); - + comboMethods->clear(); listParameters->clear(); - + if (!hasControl) { - editValue->clear(); - return; + editValue->clear(); + return; } const QMetaObject *mo = activex->metaObject(); if (mo->methodCount()) { - for (int i = mo->methodOffset(); i < mo->methodCount(); ++i) { - const QMetaMethod method = mo->method(i); + for (int i = mo->methodOffset(); i < mo->methodCount(); ++i) { + const QMetaMethod method = mo->method(i); if (method.methodType() == QMetaMethod::Slot) comboMethods->addItem(QString::fromLatin1(method.methodSignature())); - } + } comboMethods->model()->sort(0); - on_comboMethods_activated(comboMethods->currentText()); + on_comboMethods_activated(comboMethods->currentText()); } } void InvokeMethod::on_buttonInvoke_clicked() { if (!activex) - return; + return; on_buttonSet_clicked(); QString method = comboMethods->currentText(); @@ -98,15 +98,15 @@ void InvokeMethod::on_buttonInvoke_clicked() int itemCount = listParameters->topLevelItemCount(); for (int i = 0; i < itemCount; ++i) { - QTreeWidgetItem *parameter = listParameters->topLevelItem(i); - vars << parameter->text(2); + QTreeWidgetItem *parameter = listParameters->topLevelItem(i); + vars << parameter->text(2); } QVariant result = activex->dynamicCall(method.toLatin1(), vars); int v = 0; for (int i = 0; i < itemCount; ++i) { - QTreeWidgetItem *parameter = listParameters->topLevelItem(i); - parameter->setText(2, vars[v++].toString()); + QTreeWidgetItem *parameter = listParameters->topLevelItem(i); + parameter->setText(2, vars[v++].toString()); } QString resString = result.toString(); @@ -117,7 +117,7 @@ void InvokeMethod::on_buttonInvoke_clicked() void InvokeMethod::on_comboMethods_activated(const QString &method) { if (!activex) - return; + return; listParameters->clear(); const QMetaObject *mo = activex->metaObject(); @@ -130,40 +130,40 @@ void InvokeMethod::on_comboMethods_activated(const QString &method) QList<QByteArray> ptypes = slot.parameterTypes(); for (int p = 0; p < ptypes.count(); ++p) { - QString ptype(QString::fromLatin1(ptypes.at(p))); - if (ptype.isEmpty()) - continue; - QString pname(QString::fromLatin1(pnames.at(p).constData())); - if (pname.isEmpty()) - pname = QString::fromLatin1("<unnamed %1>").arg(p); - QTreeWidgetItem *item = new QTreeWidgetItem(listParameters); + QString ptype(QString::fromLatin1(ptypes.at(p))); + if (ptype.isEmpty()) + continue; + QString pname(QString::fromLatin1(pnames.at(p).constData())); + if (pname.isEmpty()) + pname = QString::fromLatin1("<unnamed %1>").arg(p); + QTreeWidgetItem *item = new QTreeWidgetItem(listParameters); item->setText(0, pname); item->setText(1, ptype); } if (listParameters->topLevelItemCount()) - listParameters->setCurrentItem(listParameters->topLevelItem(0)); + listParameters->setCurrentItem(listParameters->topLevelItem(0)); editReturn->setText(QString::fromLatin1(slot.typeName())); } void InvokeMethod::on_listParameters_currentItemChanged(QTreeWidgetItem *item) { if (!activex) - return; + return; editValue->setEnabled(item != 0); buttonSet->setEnabled(item != 0); if (!item) - return; + return; editValue->setText(item->text(2)); } void InvokeMethod::on_buttonSet_clicked() { if (!activex) - return; + return; QTreeWidgetItem *item = listParameters->currentItem(); if (!item) - return; + return; item->setText(2, editValue->text()); } diff --git a/tools/testcon/main.cpp b/tools/testcon/main.cpp index bc3181c..1ecb0b4 100644 --- a/tools/testcon/main.cpp +++ b/tools/testcon/main.cpp @@ -45,15 +45,15 @@ #include <QAxFactory> QAXFACTORY_DEFAULT(MainWindow, - QLatin1String("{5f5ce700-48a8-47b1-9b06-3b7f79e41d7c}"), - QLatin1String("{3fc86f5f-8b15-4428-8f6b-482bae91f1ae}"), - QLatin1String("{02a268cd-24b4-4fd9-88ff-b01b683ef39d}"), - QLatin1String("{4a43e44d-9d1d-47e5-a1e5-58fe6f7be0a4}"), - QLatin1String("{16ee5998-77d2-412f-ad91-8596e29f123f}")) + QLatin1String("{5f5ce700-48a8-47b1-9b06-3b7f79e41d7c}"), + QLatin1String("{3fc86f5f-8b15-4428-8f6b-482bae91f1ae}"), + QLatin1String("{02a268cd-24b4-4fd9-88ff-b01b683ef39d}"), + QLatin1String("{4a43e44d-9d1d-47e5-a1e5-58fe6f7be0a4}"), + QLatin1String("{16ee5998-77d2-412f-ad91-8596e29f123f}")) QT_USE_NAMESPACE -int main( int argc, char **argv ) +int main( int argc, char **argv ) { QApplication app( argc, argv ); diff --git a/tools/testcon/mainwindow.cpp b/tools/testcon/mainwindow.cpp index cb3c00e..4f60d1f 100644 --- a/tools/testcon/mainwindow.cpp +++ b/tools/testcon/mainwindow.cpp @@ -136,12 +136,12 @@ void MainWindow::on_actionFileLoad_triggered() { QString fname = QFileDialog::getOpenFileName(this, tr("Load"), QString(), QLatin1String("*.qax")); if (fname.isEmpty()) - return; + return; QFile file(fname); if (!file.open(QIODevice::ReadOnly)) { - QMessageBox::information(this, tr("Error Loading File"), tr("The file could not be opened for reading.\n%1").arg(fname)); - return; + QMessageBox::information(this, tr("Error Loading File"), tr("The file could not be opened for reading.\n%1").arg(fname)); + return; } QAxWidget *container = new QAxWidget(mdiArea); @@ -164,12 +164,12 @@ void MainWindow::on_actionFileSave_triggered() QString fname = QFileDialog::getSaveFileName(this, tr("Save"), QString(), QLatin1String("*.qax")); if (fname.isEmpty()) - return; + return; QFile file(fname); if (!file.open(QIODevice::WriteOnly)) { - QMessageBox::information(this, tr("Error Saving File"), tr("The file could not be opened for writing.\n%1").arg(fname)); - return; + QMessageBox::information(this, tr("Error Saving File"), tr("The file could not be opened for writing.\n%1").arg(fname)); + return; } QDataStream d(&file); d << *container; @@ -184,7 +184,7 @@ void MainWindow::on_actionContainerSet_triggered() QAxSelect select(this); if (select.exec()) - container->setControl(select.clsid()); + container->setControl(select.clsid()); updateGUI(); } @@ -192,14 +192,14 @@ void MainWindow::on_actionContainerClear_triggered() { QAxWidget *container = activeAxWidget(); if (container) - container->clear(); + container->clear(); updateGUI(); } void MainWindow::on_actionContainerProperties_triggered() { if (!dlgAmbient) { - dlgAmbient = new AmbientProperties(this); + dlgAmbient = new AmbientProperties(this); dlgAmbient->setControl(mdiArea); } dlgAmbient->show(); @@ -224,8 +224,8 @@ void MainWindow::on_actionControlProperties_triggered() return; if (!dlgProperties) { - dlgProperties = new ChangeProperties(this); - connect(container, SIGNAL(propertyChanged(QString)), dlgProperties, SLOT(updateProperties())); + dlgProperties = new ChangeProperties(this); + connect(container, SIGNAL(propertyChanged(QString)), dlgProperties, SLOT(updateProperties())); } dlgProperties->setControl(container); dlgProperties->show(); @@ -238,7 +238,7 @@ void MainWindow::on_actionControlMethods_triggered() return; if (!dlgInvoke) - dlgInvoke = new InvokeMethod(this); + dlgInvoke = new InvokeMethod(this); dlgInvoke->setControl(container); dlgInvoke->show(); } @@ -275,10 +275,10 @@ void MainWindow::on_actionControlDocumentation_triggered() QAxWidget *container = activeAxWidget(); if (!container) return; - + const QString docu = container->generateDocumentation(); if (docu.isEmpty()) - return; + return; DocuWindow *docwindow = new DocuWindow(docu); QMdiSubWindow *subWindow = mdiArea->addSubWindow(docwindow); @@ -303,16 +303,16 @@ void MainWindow::on_actionScriptingRun_triggered() { #ifndef QT_NO_QAXSCRIPT if (!scripts) - return; + return; // If we have only one script loaded we can use the cool dialog QStringList scriptList = scripts->scriptNames(); if (scriptList.count() == 1) { - InvokeMethod scriptInvoke(this); - scriptInvoke.setWindowTitle(tr("Execute Script Function")); - scriptInvoke.setControl(scripts->script(scriptList[0])->scriptEngine()); - scriptInvoke.exec(); - return; + InvokeMethod scriptInvoke(this); + scriptInvoke.setWindowTitle(tr("Execute Script Function")); + scriptInvoke.setControl(scripts->script(scriptList[0])->scriptEngine()); + scriptInvoke.exec(); + return; } bool ok = false; @@ -320,11 +320,11 @@ void MainWindow::on_actionScriptingRun_triggered() QString macro = QInputDialog::getItem(this, tr("Select Macro"), tr("Macro:"), macroList, 0, true, &ok); if (!ok) - return; + return; QVariant result = scripts->call(macro); if (result.isValid()) - logMacros->append(tr("Return value of %1: %2").arg(macro).arg(result.toString())); + logMacros->append(tr("Return value of %1: %2").arg(macro).arg(result.toString())); #endif } @@ -334,11 +334,11 @@ void MainWindow::on_actionScriptingLoad_triggered() QString file = QFileDialog::getOpenFileName(this, tr("Open Script"), QString(), QAxScriptManager::scriptFileFilter()); if (file.isEmpty()) - return; + return; if (!scripts) { - scripts = new QAxScriptManager(this); - scripts->addObject(this); + scripts = new QAxScriptManager(this); + scripts->addObject(this); } foreach (QAxWidget *axWidget, axWidgets()) { @@ -348,13 +348,13 @@ void MainWindow::on_actionScriptingLoad_triggered() QAxScript *script = scripts->load(file, file); if (script) { - connect(script, SIGNAL(error(int,QString,int,QString)), - this, SLOT(logMacro(int,QString,int,QString))); - actionScriptingRun->setEnabled(true); + connect(script, SIGNAL(error(int,QString,int,QString)), + this, SLOT(logMacro(int,QString,int,QString))); + actionScriptingRun->setEnabled(true); } #else QMessageBox::information(this, tr("Function not available"), - tr("QAxScript functionality is not available with this compiler.")); + tr("QAxScript functionality is not available with this compiler.")); #endif } @@ -375,24 +375,24 @@ void MainWindow::updateGUI() actionControlPixmap->setEnabled(hasControl); VerbMenu->setEnabled(hasControl); if (dlgInvoke) - dlgInvoke->setControl(hasControl ? container : 0); + dlgInvoke->setControl(hasControl ? container : 0); if (dlgProperties) - dlgProperties->setControl(hasControl ? container : 0); + dlgProperties->setControl(hasControl ? container : 0); foreach (QAxWidget *container, axWidgets()) { container->disconnect(SIGNAL(signal(QString,int,void*))); - if (actionLogSignals->isChecked()) - connect(container, SIGNAL(signal(QString,int,void*)), this, SLOT(logSignal(QString,int,void*))); - - container->disconnect(SIGNAL(exception(int,QString,QString,QString))); - connect(container, SIGNAL(exception(int,QString,QString,QString)), - this, SLOT(logException(int,QString,QString,QString))); - - container->disconnect(SIGNAL(propertyChanged(QString))); - if (actionLogProperties->isChecked()) - connect(container, SIGNAL(propertyChanged(QString)), this, SLOT(logPropertyChanged(QString))); - container->blockSignals(actionFreezeEvents->isChecked()); - } + if (actionLogSignals->isChecked()) + connect(container, SIGNAL(signal(QString,int,void*)), this, SLOT(logSignal(QString,int,void*))); + + container->disconnect(SIGNAL(exception(int,QString,QString,QString))); + connect(container, SIGNAL(exception(int,QString,QString,QString)), + this, SLOT(logException(int,QString,QString,QString))); + + container->disconnect(SIGNAL(propertyChanged(QString))); + if (actionLogProperties->isChecked()) + connect(container, SIGNAL(propertyChanged(QString)), this, SLOT(logPropertyChanged(QString))); + container->blockSignals(actionFreezeEvents->isChecked()); + } } void MainWindow::logPropertyChanged(const QString &prop) @@ -414,17 +414,17 @@ void MainWindow::logSignal(const QString &signal, int argc, void *argv) QString paramlist; VARIANT *params = (VARIANT*)argv; for (int a = argc-1; a >= 0; --a) { - if (a == argc-1) - paramlist = QLatin1String(" - {"); - QVariant qvar = VARIANTToQVariant(params[a], 0); - paramlist += QLatin1String(" ") + qvar.toString(); - if (a > 0) - paramlist += QLatin1String(","); - else - paramlist += QLatin1String(" "); + if (a == argc-1) + paramlist = QLatin1String(" - {"); + QVariant qvar = VARIANTToQVariant(params[a], 0); + paramlist += QLatin1String(" ") + qvar.toString(); + if (a > 0) + paramlist += QLatin1String(","); + else + paramlist += QLatin1String(" "); } if (argc) - paramlist += QLatin1String("}"); + paramlist += QLatin1String("}"); logSignals->append(container->windowTitle() + QLatin1String(": ") + signal + paramlist); } @@ -436,14 +436,14 @@ void MainWindow::logException(int code, const QString&source, const QString&desc return; QString str = tr("%1: Exception code %2 thrown by %3"). - arg(container->windowTitle()).arg(code).arg(source); + arg(container->windowTitle()).arg(code).arg(source); logDebug->append(str); logDebug->append(tr("\tDescription: %1").arg(desc)); if (!help.isEmpty()) - logDebug->append(tr("\tHelp available at %1").arg(help)); + logDebug->append(tr("\tHelp available at %1").arg(help)); else - logDebug->append(tr("\tNo help available.")); + logDebug->append(tr("\tNo help available.")); } void MainWindow::logMacro(int code, const QString &description, int sourcePosition, const QString &sourceText) @@ -452,12 +452,12 @@ void MainWindow::logMacro(int code, const QString &description, int sourcePositi * that it can be translated in a sane way. */ QString message = tr("Script: "); if (code) - message += QString::number(code) + QLatin1String(" "); + message += QString::number(code) + QLatin1String(" "); message += QLatin1String("'") + description + QLatin1String("'"); if (sourcePosition) - message += tr(" at position ") + QString::number(sourcePosition); + message += tr(" at position ") + QString::number(sourcePosition); if (!sourceText.isEmpty()) - message += QLatin1String(" '") + sourceText + QLatin1String("'"); + message += QLatin1String(" '") + sourceText + QLatin1String("'"); logMacros->append(message); } diff --git a/tools/testcon/scripts/javascript.js b/tools/testcon/scripts/javascript.js index e2bd54b..afa3af9 100644 --- a/tools/testcon/scripts/javascript.js +++ b/tools/testcon/scripts/javascript.js @@ -1,25 +1,25 @@ function QAxWidget2::Click() { - QAxWidget2.lineWidth++; - MainWindow.logMacro(0, "Hello from JavaScript: QAxWidget2::Click", 0, ""); + QAxWidget2.lineWidth++; + MainWindow.logMacro(0, "Hello from JavaScript: QAxWidget2::Click", 0, ""); } function fatLines() { - QAxWidget2.lineWidth = 25; + QAxWidget2.lineWidth = 25; } function thinLines() { - QAxWidget2.lineWidth = 1; + QAxWidget2.lineWidth = 1; } function setLineWidth(width) { - QAxWidget2.lineWidth = width; + QAxWidget2.lineWidth = width; } function getLineWidth() { - return(QAxWidget2.lineWidth) + return(QAxWidget2.lineWidth) } diff --git a/tools/testcon/scripts/perlscript.pl b/tools/testcon/scripts/perlscript.pl index 87c3774..ffc36b8 100644 --- a/tools/testcon/scripts/perlscript.pl +++ b/tools/testcon/scripts/perlscript.pl @@ -40,26 +40,26 @@ ############################################################################# sub QAxWidget2_Click { - $QAxWidget2->{'lineWidth'} = $QAxWidget2->{'lineWidth'} + 1; - $MainWindow->logMacro(0, "Hello from Perl: QAxWidget2_Click", 0, ""); + $QAxWidget2->{'lineWidth'} = $QAxWidget2->{'lineWidth'} + 1; + $MainWindow->logMacro(0, "Hello from Perl: QAxWidget2_Click", 0, ""); } sub fatLines { - $QAxWidget2->{'lineWidth'} = 25; + $QAxWidget2->{'lineWidth'} = 25; } sub thinLines { - $QAxWidget2->{'lineWidth'} = 1; + $QAxWidget2->{'lineWidth'} = 1; } sub setLineWidth(width) { - $QAxWidget2->{'lineWidth'} = width; + $QAxWidget2->{'lineWidth'} = width; } sub getLineWidth() { - return $QAxWidget2->{'lineWidth'}; + return $QAxWidget2->{'lineWidth'}; } diff --git a/tools/testcon/scripts/vbscript.vbs b/tools/testcon/scripts/vbscript.vbs index bd29f19..9554de9 100644 --- a/tools/testcon/scripts/vbscript.vbs +++ b/tools/testcon/scripts/vbscript.vbs @@ -1,20 +1,20 @@ Sub QAxWidget2_Click - QAxWidget2.lineWidth = QAxWidget2.lineWidth + 1 - MainWindow.logMacro 0, "Hello from VBScript: QAxWidget2_Click", 0, "" + QAxWidget2.lineWidth = QAxWidget2.lineWidth + 1 + MainWindow.logMacro 0, "Hello from VBScript: QAxWidget2_Click", 0, "" End Sub Sub fatLines - QAxWidget2.lineWidth = 25 + QAxWidget2.lineWidth = 25 End Sub Sub thinLines - QAxWidget2.lineWidth = 1 + QAxWidget2.lineWidth = 1 End Sub Sub setLineWidth(width) - QAxWidget2.lineWidth = width + QAxWidget2.lineWidth = width End Sub Public Function getLineWidth - getLineWidth = QAxWidget2.lineWidth + getLineWidth = QAxWidget2.lineWidth End Function diff --git a/tools/testcon/testcon.pro b/tools/testcon/testcon.pro index 4c27638..a963c42 100644 --- a/tools/testcon/testcon.pro +++ b/tools/testcon/testcon.pro @@ -3,10 +3,10 @@ TEMPLATE = app CONFIG += qaxserver_no_postlink QT += widgets axserver axcontainer printsupport -SOURCES = main.cpp docuwindow.cpp mainwindow.cpp invokemethod.cpp changeproperties.cpp ambientproperties.cpp controlinfo.cpp -HEADERS = docuwindow.h mainwindow.h invokemethod.h changeproperties.h ambientproperties.h controlinfo.h +SOURCES = main.cpp docuwindow.cpp mainwindow.cpp invokemethod.cpp changeproperties.cpp ambientproperties.cpp controlinfo.cpp +HEADERS = docuwindow.h mainwindow.h invokemethod.h changeproperties.h ambientproperties.h controlinfo.h FORMS = mainwindow.ui invokemethod.ui changeproperties.ui ambientproperties.ui controlinfo.ui -RC_FILE = testcon.rc +RC_FILE = testcon.rc !win32-g++*:QMAKE_POST_LINK = midl $$shell_quote($$shell_path($$PWD/testcon.idl)) && move testcon.tlb $(TARGETDIR) diff --git a/tools/tools.pro b/tools/tools.pro index 5f900a9..4a83738 100644 --- a/tools/tools.pro +++ b/tools/tools.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs -CONFIG += ordered +CONFIG += ordered SUBDIRS = dumpdoc \ dumpcpp \ |