diff --git a/doc/images/qml-profiler-javascript.png b/doc/images/qml-profiler-javascript.png deleted file mode 100644 index b731eb5290f..00000000000 Binary files a/doc/images/qml-profiler-javascript.png and /dev/null differ diff --git a/doc/images/qtcreator-qml-performance-monitor.png b/doc/images/qtcreator-qml-performance-monitor.png old mode 100755 new mode 100644 index 28c2a143d4d..b3d040f40f6 Binary files a/doc/images/qtcreator-qml-performance-monitor.png and b/doc/images/qtcreator-qml-performance-monitor.png differ diff --git a/doc/src/analyze/qtquick-profiler.qdoc b/doc/src/analyze/qtquick-profiler.qdoc index 4a58f0496c9..f3c5a6b09fc 100644 --- a/doc/src/analyze/qtquick-profiler.qdoc +++ b/doc/src/analyze/qtquick-profiler.qdoc @@ -62,14 +62,13 @@ the QML Profiler immediately begins to collect data. This is indicated by the time running in the \gui Elapsed field. - Data is collected until you select the - \inlineimage qtcreator-debug-button-stop.png - (\gui Stop) button. Data collection + Data is collected until you select the \gui {Enable Profiling} button. Data + collection takes time, and therefore, there might be a delay before the data is displayed. Do not use application commands to exit the application, because data is - sent to the QML Profiler when you select the \gui Stop button. + sent to the QML Profiler when you select the \gui {Enable Profiling} button. The application continues to run for some seconds, after which it is stopped automatically. If you exit the application, the data is not sent. @@ -114,6 +113,8 @@ \li Signal handling + \li Executing JavaScript behind bindings and signal handlers + \li Summary of the recorded period \endlist @@ -171,14 +172,36 @@ Click the binding to move the cursor in the code editor to the part of the code where the binding is called. + \section2 Evaluating JavaScript Events + + On the \gui JavaScript row, you can see the time spent executing the actual + JavaScript behind bindings and signal handlers. It lists all the JavaScript + functions you may be using to evaluate bindings or handle signals. + + This information is displayed for applications that use the V4 engine and + are built with Qt 5.3, or later. + + For applications that use the V8 engine and are built with Qt 5.0 or 5.1, + you can view information about JavaScript events in the \gui JavaScript + view. + \section1 Viewing Events - The \gui Events view displays the number of times each binding is called - and the time the calls take. This allows you to examine which events you - need to optimize. A high number of calls might indicate that a binding is - called unnecessarily. Click on a binding to move to it in the source code + The \gui Events view displays the number of times each binding, create, + compile, JavaScript, or signal event is triggered and the average time it + takes. This allows you to examine which events you need to optimize. A high + number of occurrences might indicate that an event is triggered + unnecessarily. To view the median, longest, and shortest time for the + occurrences, select \gui {Extended Event Statistics} in the context menu. + + Click on an event to move to it in the source code in the code editor. + JavaScript events often duplicate bindings or signals, so you can show and + hide them by selecting \gui {Show JavaScript Events} in the context menu. + To show and hide QML events (\gui Create, \gui Compile, and \gui Signal), + select \gui {Show QML Events}. + \image qtcreator-analyzer-bindings.png "Events view" The \gui Callers and \gui Callees panes show dependencies between events. @@ -188,7 +211,7 @@ The \gui Callees pane summarizes the QML events that a binding triggers. This tells you which QML events are affected if you change a binding. - Click on a binding to move to it in the source code in the code editor. + Click on an event to move to it in the source code in the code editor. When you select an event in the \gui Timeline view, information about it is displayed in the \gui Events view. To view an event range in the \gui Events @@ -198,11 +221,6 @@ To copy the contents of one view or row to the clipboard, select \gui {Copy Table} or \gui {Copy Row} in the context menu. - You can view similar information about JavaScript events in the - \gui JavaScript view. - - \image qml-profiler-javascript.png "JavaScript view" - \section2 Viewing More Data The QML JavaScript engine optimizes trivial bindings. The QML Profiler diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index c4f061f813d..3d9f6bcd793 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -500,6 +500,18 @@ class DumperBase: self.putType(type) self.putNumChild(0) + def putCallItem(self, name, value, func, *args): + try: + result = self.callHelper(value, func, args) + with SubItem(self, name): + self.putItem(result) + except: + with SubItem(self, name): + self.putValue("") + self.putNumChild(0) + + def call(self, value, func, *args): + return self.callHelper(value, func, args) def putMapName(self, value, index = -1): ns = self.qtNamespace() @@ -1025,15 +1037,15 @@ class DumperBase: addr += 1 return result - def generateQListChildren(self, value): - base = self.extractPointer(value) + def listChildrenGenerator(self, addr, typeName): + innerType = self.lookupType(self.qtNamespace() + typeName) + base = self.extractPointer(addr) begin = self.extractInt(base + 8) end = self.extractInt(base + 12) array = base + 16 if self.qtVersion() < 0x50000: array += self.ptrSize() size = end - begin - innerType = self.templateArgument(value.type, 0) innerSize = innerType.sizeof stepSize = self.ptrSize() addr = array + begin * stepSize @@ -1072,19 +1084,9 @@ class DumperBase: # Dynamic properties. if extraData: - propertyNames = extraData + ptrSize - propertyValues = extraData + 2 * ptrSize - - ns = self.qtNamespace() - - typ = self.lookupType(ns + "QList<" + ns + "QByteArray>") - names = self.createValue(propertyNames, typ) - - typ = self.lookupType(ns + "QList<" + ns + "QVariant>") - values = self.createValue(propertyValues, typ) - - for (k, v) in zip(self.generateQListChildren(names), - self.generateQListChildren(values)) : + names = self.listChildrenGenerator(extraData + ptrSize, "QByteArray") + values = self.listChildrenGenerator(extraData + 2 * ptrSize, "QVariant") + for (k, v) in zip(names, values): with SubItem(self, propertyCount): self.put('key="%s",' % self.encodeByteArray(k)) self.put('keyencoded="%s",' % Hex2EncodedLatin1) diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index 3593f8c75bd..5ff97fdbf68 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -575,7 +575,7 @@ class Dumper(DumperBase): def parseAndEvaluate(self, exp): return gdb.parse_and_eval(exp) - def call2(self, value, func, args): + def callHelper(self, value, func, args): # args is a tuple. arg = "" for i in range(len(args)): @@ -602,9 +602,6 @@ class Dumper(DumperBase): gdb.parse_and_eval("free(0x%x)" % ptr) return result - def call(self, value, func, *args): - return self.call2(value, func, args) - def childWithName(self, value, name): try: return value[name] @@ -1054,11 +1051,6 @@ class Dumper(DumperBase): i = toInteger(i) self.putSubItem(i, (base + i).dereference()) - def putCallItem(self, name, value, func, *args): - result = self.call2(value, func, args) - with SubItem(self, name): - self.putItem(result) - def isFunctionType(self, type): return type.code == MethodCode or type.code == FunctionCode diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index feda3ec82b0..fc08421654e 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -144,7 +144,7 @@ def impl_SBValue__add__(self, offset): def impl_SBValue__sub__(self, other): if self.GetType().IsPointerType(): if isinstance(other, int) or isinstance(other, long): - address = self.GetValueAsUnsigned() - offset.GetValueAsSigned() + address = self.GetValueAsUnsigned() - other address = address & 0xFFFFFFFFFFFFFFFF # Force unsigned return self.CreateValueFromAddress(None, address, self.GetType()) if other.GetType().IsPointerType(): @@ -372,7 +372,7 @@ class Dumper(DumperBase): return ns + "Qt::" + enumType + "(" \ + ns + "Qt::" + enumType + "::" + enumValue + ")" - def call2(self, value, func, args): + def callHelper(self, value, func, args): # args is a tuple. arg = ','.join(args) #warn("CALL: %s -> %s(%s)" % (value, func, arg)) @@ -398,9 +398,6 @@ class Dumper(DumperBase): frame = thread.GetFrameAtIndex(0) return frame.EvaluateExpression(expr) - def call(self, value, func, *args): - return self.call2(value, func, args) - def checkPointer(self, p, align = 1): if not self.isNull(p): p.Dereference() @@ -449,13 +446,21 @@ class Dumper(DumperBase): qtNamespace = name[:name.find('qVersion')] self.qtNamespace = lambda: qtNamespace - res = "" - try: - res = self.parseAndEvaluate(name + '()') - except: - res = self.parseAndEvaluate('((const char*())%s)()' % name) - version = str(res) + options = lldb.SBExpressionOptions() + res = self.target.EvaluateExpression(name + '()', options) + if not res.IsValid() or not res.GetType().IsPointerType(): + exp = '((const char*())%s)()' % name + res = self.target.EvaluateExpression(exp, options) + + if not res.IsValid() or not res.GetType().IsPointerType(): + exp = '((const char*())_Z8qVersionv)()' + res = self.target.EvaluateExpression(exp, options) + + if not res.IsValid() or not res.GetType().IsPointerType(): + continue + + version = str(res) if version.count('.') != 2: continue @@ -604,11 +609,6 @@ class Dumper(DumperBase): addr = int(address) & 0xFFFFFFFFFFFFFFFF return self.context.CreateValueFromAddress(None, addr, referencedType) - def putCallItem(self, name, value, func, *args): - result = self.call2(value, func, args) - with SubItem(self, name): - self.putItem(result) - def childRange(self): if self.currentMaxNumChild is None: return xrange(0, self.currentNumChild) diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index 760dded9df9..f05d73845bb 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -179,6 +179,7 @@ def qdump__QModelIndex(d, value): % (mm_, row, column, mi_)) d.putItem(mi2) i = i + 1 + d.putFields(value) #d.putCallItem("parent", val, "parent") #with SubItem(d, "model"): # d.putValue(m) @@ -203,6 +204,7 @@ def qdump__QDate(d, value): d.enumExpression("DateFormat", "SystemLocaleDate")) d.putCallItem("(Locale)", value, "toString", d.enumExpression("DateFormat", "LocaleDate")) + d.putFields(value) else: d.putValue("(invalid)") d.putNumChild(0) @@ -224,6 +226,7 @@ def qdump__QTime(d, value): d.enumExpression("DateFormat", "SystemLocaleDate")) d.putCallItem("(Locale)", value, "toString", d.enumExpression("DateFormat", "LocaleDate")) + d.putFields(value) else: d.putValue("(invalid)") d.putNumChild(0) @@ -312,6 +315,7 @@ def qdump__QDateTime(d, value): d.enumExpression("TimeSpec", "UTC")) d.putCallItem("toLocalTime", value, "toTimeSpec", d.enumExpression("TimeSpec", "LocalTime")) + d.putFields(value) else: d.putValue("(invalid)") d.putNumChild(0) @@ -404,17 +408,25 @@ def qdump__QDir(d, value): with SubItem(d, "entryList"): typ = d.lookupType(ns + "QStringList") d.putItem(d.createValue(privAddress + filesOffset, typ)) + d.putFields(value) def qdump__QFile(d, value): # 9fc0965 changes the layout of the private structure qtVersion = d.qtVersion() - if qtVersion >= 0x050200: - offset = 176 if d.is32bit() else 272 + is32bit = d.is32bit() + if qtVersion > 0x050200: + if d.isWindowsTarget(): + offset = 180 if is32bit else 272 + else: + offset = 176 if is32bit else 272 elif qtVersion >= 0x050000: - offset = 180 if d.is32bit() else 280 + offset = 176 if is32bit else 280 else: - offset = 140 if d.is32bit() else 232 + if d.isWindowsTarget(): + offset = 144 if is32bit else 232 + else: + offset = 140 if is32bit else 232 privAddress = d.extractPointer(d.addressOf(value) + d.ptrSize()) fileNameAddress = privAddress + offset d.putStringValueByAddress(fileNameAddress) @@ -503,6 +515,7 @@ def qdump__QFileInfo(d, value): d.putCallItem("created", value, "created") d.putCallItem("lastModified", value, "lastModified") d.putCallItem("lastRead", value, "lastRead") + d.putFields(value) def qdump__QFixed(d, value): @@ -604,13 +617,16 @@ def qdump__QHash(d, value): d.putNumChild(size) if d.isExpanded(): numBuckets = int(d_ptr.dereference()["numBuckets"]) - nodePtr = hashDataFirstNode(d_ptr, numBuckets) innerType = e_ptr.dereference().type isCompact = d.isMapCompact(keyType, valueType) childType = valueType if isCompact else innerType with Children(d, size, maxNumChild=1000, childType=childType): for i in d.childRange(): - it = nodePtr.dereference().cast(innerType) + if i == 0: + node = hashDataFirstNode(d_ptr, numBuckets) + else: + node = hashDataNextNode(node, numBuckets) + it = node.dereference().cast(innerType) with SubItem(d, i): if isCompact: key = it["key"] @@ -623,7 +639,6 @@ def qdump__QHash(d, value): d.putType(valueType) else: d.putItem(it) - nodePtr = hashDataNextNode(nodePtr, numBuckets) def qdump__QHashNode(d, value): @@ -912,6 +927,7 @@ def qdump__QLocale(d, value): d.putCallItem("zeroDigit", value, "zeroDigit") d.putCallItem("groupSeparator", value, "groupSeparator") d.putCallItem("negativeSign", value, "negativeSign") + d.putFields(value) def qdump__QMapNode(d, value): @@ -1676,10 +1692,13 @@ def qdump__QSet(d, value): hashDataType = d_ptr.type nodeTypePtr = d_ptr.dereference()["fakeNext"].type numBuckets = int(d_ptr.dereference()["numBuckets"]) - node = hashDataFirstNode(d_ptr, numBuckets) innerType = e_ptr.dereference().type with Children(d, size, maxNumChild=1000, childType=innerType): for i in d.childRange(): + if i == 0: + node = hashDataFirstNode(d_ptr, numBuckets) + else: + node = hashDataNextNode(node, numBuckets) it = node.dereference().cast(innerType) with SubItem(d, i): key = it["key"] @@ -1688,7 +1707,6 @@ def qdump__QSet(d, value): # for Qt4 optimized int keytype key = it[1]["key"] d.putItem(key) - node = hashDataNextNode(node, numBuckets) def qdump__QSharedData(d, value): @@ -1797,6 +1815,7 @@ def qdump__QTextCodec(d, value): with Children(d): d.putCallItem("name", value, "name") d.putCallItem("mibEnum", value, "mibEnum") + d.putFields(value) def qdump__QTextCursor(d, value): @@ -1814,6 +1833,7 @@ def qdump__QTextCursor(d, value): d.putIntItem("position", d.extractInt(positionAddress)) d.putIntItem("anchor", d.extractInt(positionAddress + d.intSize())) d.putCallItem("selected", value, "selectedText") + d.putFields(value) def qdump__QTextDocument(d, value): @@ -1826,6 +1846,7 @@ def qdump__QTextDocument(d, value): d.putCallItem("lineCount", value, "lineCount") d.putCallItem("revision", value, "revision") d.putCallItem("toPlainText", value, "toPlainText") + d.putFields(value) def qform__QUrl(): @@ -1854,6 +1875,7 @@ def qdump__QUrl(d, value): d.putCallItem("query", value, "encodedQuery") d.putCallItem("fragment", value, "fragment") d.putCallItem("port", value, "port") + d.putFields(value) else: # QUrlPrivate: # - QAtomicInt ref; diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml index 168925f6fbd..37f9b63266d 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml @@ -138,7 +138,7 @@ Column { onAccepted: { colorEditor.color = textField.text } - Layout.preferredWidth: 80 + Layout.fillWidth: true } ColorCheckButton { id: checkButton diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/LineEdit.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/LineEdit.qml index bcdc246062c..1360264d996 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/LineEdit.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/LineEdit.qml @@ -86,7 +86,7 @@ Controls.TextField { padding.top: 3 padding.bottom: 1 padding.left: 16 - padding.right: 16 + padding.right: lineEdit.showTranslateCheckBox ? 16 : 1 placeholderTextColor: "gray" background: Rectangle { implicitWidth: 100 diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp index 6c507fe2bce..606d39631b8 100644 --- a/src/libs/cplusplus/LookupContext.cpp +++ b/src/libs/cplusplus/LookupContext.cpp @@ -1257,6 +1257,7 @@ void ClassOrNamespace::NestedClassInstantiator::instantiate(ClassOrNamespace *en } } + nestedClassOrNamespaceInstantiation->_parent = enclosingTemplateClassInstantiation; instantiate(nestedClassOrNamespace, nestedClassOrNamespaceInstantiation); enclosingTemplateClassInstantiation->_classOrNamespaces[nestedName] = diff --git a/src/libs/qmldebug/qmlprofilertraceclient.cpp b/src/libs/qmldebug/qmlprofilertraceclient.cpp index 7866b3cfaa0..05ffcab3a55 100644 --- a/src/libs/qmldebug/qmlprofilertraceclient.cpp +++ b/src/libs/qmldebug/qmlprofilertraceclient.cpp @@ -186,7 +186,7 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data) d->maximumTime = qMax(time, d->maximumTime); } } else if (messageType == Complete) { - emit complete(); + emit complete(d->maximumTime); } else if (messageType == SceneGraphFrame) { int sgEventType; int count = 0; diff --git a/src/libs/qmldebug/qmlprofilertraceclient.h b/src/libs/qmldebug/qmlprofilertraceclient.h index 8705207321b..6d38ecd2823 100644 --- a/src/libs/qmldebug/qmlprofilertraceclient.h +++ b/src/libs/qmldebug/qmlprofilertraceclient.h @@ -97,7 +97,7 @@ public slots: void sendRecordingStatus(); signals: - void complete(); + void complete(qint64 maximumTime); void gap(qint64 time); void event(int event, qint64 time); void traceFinished( qint64 time ); diff --git a/src/libs/utils/winutils.cpp b/src/libs/utils/winutils.cpp index 4e75d1eeeee..dfdb0cadd95 100644 --- a/src/libs/utils/winutils.cpp +++ b/src/libs/utils/winutils.cpp @@ -172,4 +172,22 @@ QTCREATOR_UTILS_EXPORT bool is64BitWindowsBinary(const QString &binaryIn) #endif } +WindowsCrashDialogBlocker::WindowsCrashDialogBlocker() +#ifdef Q_OS_WIN + : silenceErrorMode(SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS), + originalErrorMode(SetErrorMode(silenceErrorMode)) +#endif +{ +} + +WindowsCrashDialogBlocker::~WindowsCrashDialogBlocker() +{ +#ifdef Q_OS_WIN + unsigned int errorMode = SetErrorMode(originalErrorMode); + // someone else messed with the error mode in between? Better not touch ... + QTC_ASSERT(errorMode == silenceErrorMode, SetErrorMode(errorMode)); +#endif +} + + } // namespace Utils diff --git a/src/libs/utils/winutils.h b/src/libs/utils/winutils.h index 9b5358791a4..4fa59c67ab4 100644 --- a/src/libs/utils/winutils.h +++ b/src/libs/utils/winutils.h @@ -49,6 +49,23 @@ QTCREATOR_UTILS_EXPORT bool is64BitWindowsSystem(); // Check for a 64bit binary. QTCREATOR_UTILS_EXPORT bool is64BitWindowsBinary(const QString &binary); +// +// RAII class to temporarily prevent windows crash messages from popping up using the +// application-global (!) error mode. +// +// Useful primarily for QProcess launching, since the setting will be inherited. +// +class QTCREATOR_UTILS_EXPORT WindowsCrashDialogBlocker { +public: + WindowsCrashDialogBlocker(); + ~WindowsCrashDialogBlocker(); +#ifdef Q_OS_WIN +private: + const unsigned int silenceErrorMode; + const unsigned int originalErrorMode; +#endif // Q_OS_WIN +}; + } // namespace Utils #endif // WINUTILS_H diff --git a/src/plugins/android/androiddeployqtstep.cpp b/src/plugins/android/androiddeployqtstep.cpp index 55465111d36..3f79bbbf3b5 100644 --- a/src/plugins/android/androiddeployqtstep.cpp +++ b/src/plugins/android/androiddeployqtstep.cpp @@ -529,7 +529,7 @@ QAbstractItemModel *AndroidDeployQtStep::keystoreCertificates() if (!m_keystorePasswd.length()) return 0; params << m_keystorePasswd; - params << QLatin1String("-J\"-Duser.language=en\""); + params << QLatin1String("-J-Duser.language=en"); keytoolProc.start(AndroidConfigurations::currentConfig().keytoolPath().toString(), params); if (!keytoolProc.waitForStarted() || !keytoolProc.waitForFinished()) { QMessageBox::critical(0, tr("Error"), diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp index 4dbf9185735..a0d75a6cbac 100644 --- a/src/plugins/android/androidmanifesteditorwidget.cpp +++ b/src/plugins/android/androidmanifesteditorwidget.cpp @@ -1291,7 +1291,7 @@ void AndroidManifestEditorWidget::setHDPIIcon() void AndroidManifestEditorWidget::defaultPermissionCheckBoxClicked() { if (m_defaultPermissonsCheckBox->checkState() == Qt::PartiallyChecked) - m_defaultPermissonsCheckBox->setChecked(Qt::Checked); + m_defaultPermissonsCheckBox->setChecked(true); setDirty(true); } diff --git a/src/plugins/android/androidpackagecreationstep.cpp b/src/plugins/android/androidpackagecreationstep.cpp index d9a6f66151b..075a89bd95b 100644 --- a/src/plugins/android/androidpackagecreationstep.cpp +++ b/src/plugins/android/androidpackagecreationstep.cpp @@ -364,7 +364,7 @@ QAbstractItemModel *AndroidPackageCreationStep::keystoreCertificates() if (!m_keystorePasswd.length()) return 0; params << m_keystorePasswd; - params << QLatin1String("-J\"-Duser.language=en\""); + params << QLatin1String("-J-Duser.language=en"); keytoolProc.start(AndroidConfigurations::currentConfig().keytoolPath().toString(), params); if (!keytoolProc.waitForStarted() || !keytoolProc.waitForFinished()) { QMessageBox::critical(0, tr("Error"), diff --git a/src/plugins/android/androidqtversion.cpp b/src/plugins/android/androidqtversion.cpp index dc63f0aaaf9..45bfef0152b 100644 --- a/src/plugins/android/androidqtversion.cpp +++ b/src/plugins/android/androidqtversion.cpp @@ -125,6 +125,13 @@ void AndroidQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::En AndroidConfigurations::currentConfig().bestNdkPlatformMatch(AndroidManager::buildTargetSDK(target))); } +Utils::Environment AndroidQtVersion::qmakeRunEnvironment() const +{ + Utils::Environment env = Utils::Environment::systemEnvironment(); + env.set(QLatin1String("ANDROID_NDK_ROOT"), AndroidConfigurations::currentConfig().ndkLocation().toUserOutput()); + return env; +} + QString AndroidQtVersion::description() const { //: Qt Version is meant for Android diff --git a/src/plugins/android/androidqtversion.h b/src/plugins/android/androidqtversion.h index 0d6d7ee52b3..9e9a7b94aa5 100644 --- a/src/plugins/android/androidqtversion.h +++ b/src/plugins/android/androidqtversion.h @@ -53,6 +53,7 @@ public: QList detectQtAbis() const; void addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const; + Utils::Environment qmakeRunEnvironment() const; Core::FeatureSet availableFeatures() const; QString platformName() const; diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.cpp b/src/plugins/coreplugin/actionmanager/actionmanager.cpp index 634a7ff3e6e..1a89b5c51ef 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager.cpp +++ b/src/plugins/coreplugin/actionmanager/actionmanager.cpp @@ -49,6 +49,7 @@ namespace { } static const char kKeyboardSettingsKey[] = "KeyboardShortcuts"; +static const char kKeyboardSettingsTransferredKey[] = "OldSettingsTransferred"; using namespace Core; using namespace Core::Internal; @@ -505,10 +506,16 @@ static const char oldSequenceKey[] = "Keysequence"; void ActionManagerPrivate::initialize() { // TODO remove me after some period after 3.1 + // TODO also remove the old settings after some period after 3.1 + // settings->remove(QLatin1String(oldSettingsGroup)); + // settings->contains(QLatin1String(kKeyboardSettingsKey) + QLatin1Char('/') + // + QLatin1String(kKeyboardSettingsTransferredKey)) // check if settings in old style (pre 3.1) exist QSettings *settings = Core::ICore::settings(); - if (settings->contains(QLatin1String(kKeyboardSettingsKey))) + if (settings->contains(QLatin1String(kKeyboardSettingsKey) + QLatin1Char('/') + + QLatin1String(kKeyboardSettingsTransferredKey))) { return; + } // move old settings style to new settings style QMap shortcutMap; const int shortcuts = settings->beginReadArray(QLatin1String(oldSettingsGroup)); @@ -521,14 +528,13 @@ void ActionManagerPrivate::initialize() settings->endArray(); // write settings in new style settings->beginGroup(QLatin1String(kKeyboardSettingsKey)); + settings->setValue(QLatin1String(kKeyboardSettingsTransferredKey), true); QMapIterator it(shortcutMap); while (it.hasNext()) { it.next(); settings->setValue(it.key().toString(), it.value().toString()); } settings->endGroup(); - // remove old settings - settings->remove(QLatin1String(oldSettingsGroup)); } void ActionManagerPrivate::saveSettings(QSettings *settings) diff --git a/src/plugins/coreplugin/find/findtoolbar.cpp b/src/plugins/coreplugin/find/findtoolbar.cpp index 9d248cdd23f..34061ad6ab0 100644 --- a/src/plugins/coreplugin/find/findtoolbar.cpp +++ b/src/plugins/coreplugin/find/findtoolbar.cpp @@ -337,6 +337,8 @@ void FindToolBar::updateFindAction() m_findInDocumentAction->setEnabled(enabled); m_findNextSelectedAction->setEnabled(enabled); m_findPreviousSelectedAction->setEnabled(enabled); + if (QApplication::clipboard()->supportsFindBuffer()) + m_enterFindStringAction->setEnabled(enabled); } void FindToolBar::updateToolBar() @@ -358,8 +360,6 @@ void FindToolBar::updateToolBar() m_wholeWordAction->setEnabled(enabled); m_regularExpressionAction->setEnabled(enabled); m_preserveCaseAction->setEnabled(replaceEnabled && !hasFindFlag(FindRegularExpression)); - if (QApplication::clipboard()->supportsFindBuffer()) - m_enterFindStringAction->setEnabled(enabled); bool replaceFocus = m_ui.replaceEdit->hasFocus(); m_ui.findEdit->setEnabled(enabled); m_ui.findLabel->setEnabled(enabled); @@ -516,6 +516,7 @@ void FindToolBar::invokeResetIncrementalSearch() void FindToolBar::putSelectionToFindClipboard() { + openFind(false); const QString text = m_currentDocumentFind->currentFindString(); QApplication::clipboard()->setText(text, QClipboard::FindBuffer); setFindText(text); diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp index af8c7d78a9f..878bcf78bea 100644 --- a/src/plugins/cpptools/cppcompletion_test.cpp +++ b/src/plugins/cpptools/cppcompletion_test.cpp @@ -2231,6 +2231,22 @@ void CppToolsPlugin::test_completion_data() " @\n" "}\n" ) << _("double val = d.constBegin()->") << (QStringList()); + + QTest::newRow("nested_class_in_template_class_QTCREATORBUG-11752") << _( + "template \n" + "struct Temp\n" + "{\n" + " struct Nested1 { T t; };\n" + " struct Nested2 { Nested1 n1; };\n" + "};\n" + "struct Foo { int foo; };\n" + "void fun() {\n" + " Temp::Nested2 n2;\n" + " @\n" + "}\n" + ) << _("n2.n1.t.") << (QStringList() + << QLatin1String("foo") + << QLatin1String("Foo")); } void CppToolsPlugin::test_completion_member_access_operator() diff --git a/src/plugins/debugger/debuggerrunconfigurationaspect.cpp b/src/plugins/debugger/debuggerrunconfigurationaspect.cpp index e00f459a37a..b1271d8825c 100644 --- a/src/plugins/debugger/debuggerrunconfigurationaspect.cpp +++ b/src/plugins/debugger/debuggerrunconfigurationaspect.cpp @@ -67,7 +67,7 @@ namespace Internal { // //////////////////////////////////////////////////////////////////////// -class DebuggerRunConfigWidget : public ProjectExplorer::RunConfigWidget +class DebuggerRunConfigWidget : public RunConfigWidget { Q_OBJECT @@ -215,7 +215,7 @@ void DebuggerRunConfigWidget::useMultiProcessToggled(bool on) */ DebuggerRunConfigurationAspect::DebuggerRunConfigurationAspect( - ProjectExplorer::RunConfiguration *rc) : + RunConfiguration *rc) : IRunConfigurationAspect(rc), m_useCppDebugger(AutoEnabledLanguage), m_useQmlDebugger(AutoEnabledLanguage), @@ -292,8 +292,8 @@ void DebuggerRunConfigurationAspect::setUseMultiProcess(bool value) bool DebuggerRunConfigurationAspect::isQmlDebuggingSpinboxSuppressed() const { - ProjectExplorer::Kit *k = runConfiguration()->target()->kit(); - ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceKitInformation::device(k); + Kit *k = runConfiguration()->target()->kit(); + IDevice::ConstPtr dev = DeviceKitInformation::device(k); if (dev.isNull()) return false; return dev->canAutoDetectPorts(); @@ -327,12 +327,12 @@ void DebuggerRunConfigurationAspect::fromMap(const QVariantMap &map) } DebuggerRunConfigurationAspect *DebuggerRunConfigurationAspect::create - (ProjectExplorer::RunConfiguration *runConfiguration) const + (RunConfiguration *runConfiguration) const { return new DebuggerRunConfigurationAspect(runConfiguration); } -ProjectExplorer::RunConfigWidget *DebuggerRunConfigurationAspect::createConfigurationWidget() +RunConfigWidget *DebuggerRunConfigurationAspect::createConfigurationWidget() { return new Internal::DebuggerRunConfigWidget(this); } diff --git a/src/plugins/ios/iosdebugsupport.cpp b/src/plugins/ios/iosdebugsupport.cpp index dfc747b3513..4c4dd9c87c2 100644 --- a/src/plugins/ios/iosdebugsupport.cpp +++ b/src/plugins/ios/iosdebugsupport.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -216,9 +217,7 @@ void IosDebugSupport::handleGotInferiorPid(Q_PID pid, int qmlPort) { if (pid > 0) { //m_runControl->engine()->notifyInferiorPid(pid); -#ifndef Q_OS_WIN // Q_PID might be 64 bit pointer... - m_runControl->engine()->notifyEngineRemoteSetupDone(int(pid), qmlPort); -#endif + m_runControl->engine()->notifyEngineRemoteSetupDone(int(Utils::qPidToPid(pid)), qmlPort); } else { m_runControl->engine()->notifyEngineRemoteSetupFailed( tr("Got an invalid process id.")); diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 81536e7096a..c3ee610cac5 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -1002,7 +1002,7 @@ QtSupport::ProFileReader *QmakeProject::createProFileReader(const QmakeProFileNo // It is important to override the spec file only for the creator evaluator, // and not the qmake buildstep used to build the app (as we use the makefiles). const char IOSQT[] = "Qt4ProjectManager.QtVersion.Ios"; // from Ios::Constants - if (qtVersion->type() == QLatin1String(IOSQT)) + if (qtVersion && qtVersion->type() == QLatin1String(IOSQT)) m_qmakeGlobals->xqmakespec = QLatin1String("macx-xcode"); } ++m_qmakeGlobalsRefCnt; diff --git a/src/plugins/qmldesigner/designercore/exceptions/exception.cpp b/src/plugins/qmldesigner/designercore/exceptions/exception.cpp index c00b52f0246..29d820683d7 100644 --- a/src/plugins/qmldesigner/designercore/exceptions/exception.cpp +++ b/src/plugins/qmldesigner/designercore/exceptions/exception.cpp @@ -39,6 +39,13 @@ #include #include +static void showAsyncWarning(const QString &title, const QString &desciption) +{ + QMessageBox *messageBox = new QMessageBox(QMessageBox::Warning, title, desciption, QMessageBox::Ok, Core::ICore::dialogParent()); + messageBox->setAttribute(Qt::WA_DeleteOnClose); + messageBox->setModal(true); + messageBox->show(); +} /*! \defgroup CoreExceptions @@ -156,7 +163,7 @@ QString Exception::description() const void Exception::showException(const QString &title) const { QString t = title.isEmpty() ? QCoreApplication::translate("QmlDesigner", "Error") : title; - QMessageBox::warning(Core::ICore::dialogParent(), t, description()); + showAsyncWarning(t, description()); } /*! diff --git a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp index ace876168d9..2955832505e 100644 --- a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp @@ -172,8 +172,8 @@ void QmlProfilerClientManager::connectClientSignals() { QTC_ASSERT(d->profilerState, return); if (d->qmlclientplugin) { - connect(d->qmlclientplugin.data(), SIGNAL(complete()), - this, SLOT(qmlComplete())); + connect(d->qmlclientplugin.data(), SIGNAL(complete(qint64)), + this, SLOT(qmlComplete(qint64))); connect(d->qmlclientplugin.data(), SIGNAL(rangedEvent(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation, qint64,qint64,qint64,qint64,qint64)), @@ -354,8 +354,10 @@ void QmlProfilerClientManager::retryMessageBoxFinished(int result) } } -void QmlProfilerClientManager::qmlComplete() +void QmlProfilerClientManager::qmlComplete(qint64 maximumTime) { + if (maximumTime > d->modelManager->traceTime()->endTime()) + d->modelManager->traceTime()->setEndTime(maximumTime); d->qmlDataReady = true; if (!d->v8clientplugin || d->v8clientplugin.data()->status() != QmlDebug::Enabled || d->v8DataReady) { emit dataReadyForProcessing(); diff --git a/src/plugins/qmlprofiler/qmlprofilerclientmanager.h b/src/plugins/qmlprofiler/qmlprofilerclientmanager.h index a1c6791ce15..a96c2a909de 100644 --- a/src/plugins/qmlprofiler/qmlprofilerclientmanager.h +++ b/src/plugins/qmlprofiler/qmlprofilerclientmanager.h @@ -72,7 +72,7 @@ private slots: void connectionStateChanged(); void retryMessageBoxFinished(int result); - void qmlComplete(); + void qmlComplete(qint64 maximumTime); void v8Complete(); void profilerStateChanged(); diff --git a/src/plugins/qnx/qnxtoolchain.cpp b/src/plugins/qnx/qnxtoolchain.cpp index 77372d9bb15..b6e214fb419 100644 --- a/src/plugins/qnx/qnxtoolchain.cpp +++ b/src/plugins/qnx/qnxtoolchain.cpp @@ -106,6 +106,7 @@ QList QnxToolChain::suggestedMkspecList() const { QList mkspecList; mkspecList << Utils::FileName::fromLatin1("qnx-armv7le-qcc"); + mkspecList << Utils::FileName::fromLatin1("qnx-armle-v7-qcc"); mkspecList << Utils::FileName::fromLatin1("qnx-x86-qcc"); mkspecList << Utils::FileName::fromLatin1("blackberry-armv7le-qcc"); mkspecList << Utils::FileName::fromLatin1("blackberry-armle-v7-qcc"); diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 7a405484357..3ded2c6b24b 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -1206,6 +1207,9 @@ static QByteArray runQmakeQuery(const FileName &binary, const Environment &env, const int timeOutMS = 30000; // Might be slow on some machines. + // Prevent e.g. qmake 4.x on MinGW to show annoying errors about missing dll's. + WindowsCrashDialogBlocker crashDialogBlocker; + QProcess process; process.setEnvironment(env.toStringList()); process.start(binary.toString(), QStringList(QLatin1String("-query")), QIODevice::ReadOnly); diff --git a/src/plugins/resourceeditor/resourcenode.cpp b/src/plugins/resourceeditor/resourcenode.cpp index fc3d4f4e9bc..40ddf9759b5 100644 --- a/src/plugins/resourceeditor/resourcenode.cpp +++ b/src/plugins/resourceeditor/resourcenode.cpp @@ -257,6 +257,12 @@ ProjectExplorer::FolderNode::AddNewInformation ResourceTopLevelNode::addNewInfor p = 125; else if (projectNode() == context) p = 150; // steal from our project node + // The ResourceFolderNode '/' defers to us, as otherwise + // two nodes would be responsible for '/' + // Thus also return a high priority for it + if (ResourceFolderNode *rfn = qobject_cast(context)) + if (rfn->prefix() == QLatin1String("/")) + p = 150; } return AddNewInformation(name, p); diff --git a/src/tools/sdktool/addkitoperation.cpp b/src/tools/sdktool/addkitoperation.cpp index 588b33bb8de..5bb87326dbe 100644 --- a/src/tools/sdktool/addkitoperation.cpp +++ b/src/tools/sdktool/addkitoperation.cpp @@ -40,6 +40,8 @@ #include "settings.h" +#include + #include // Qt version file stuff: @@ -298,6 +300,25 @@ bool AddKitOperation::test() const KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); if (!empty.isEmpty()) return false; + // Do not fail if TC is an ABI: + empty = addKit(map, tcMap, qtMap, devMap, + QLatin1String("testId"), QLatin1String("Test Kit"), QLatin1String("/tmp/icon.png"), + QString(), 1, QLatin1String("/usr/bin/gdb-test"), + QByteArray("Desktop"), QLatin1String("{dev-id}"), QString(), + QLatin1String("x86-linux-generic-elf-64bit"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"), + KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); + if (empty.isEmpty()) + return false; + // QTCREATORBUG-11983, mach_o was not covered by the first attempt to fix this. + empty = addKit(map, tcMap, qtMap, devMap, + QLatin1String("testId"), QLatin1String("Test Kit"), QLatin1String("/tmp/icon.png"), + QString(), 1, QLatin1String("/usr/bin/gdb-test"), + QByteArray("Desktop"), QLatin1String("{dev-id}"), QString(), + QLatin1String("x86-macos-generic-mach_o-64bit"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"), + KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); + if (empty.isEmpty()) + return false; + // Fail if Qt is not there: empty = addKit(map, tcMap, qtMap, devMap, QLatin1String("testId"), QLatin1String("Test Kit"), QLatin1String("/tmp/icon.png"), @@ -498,6 +519,14 @@ QVariantMap AddKitOperation::addKit(const QVariantMap &map, const QVariantMap &t return QVariantMap(); } + if (!tc.isEmpty() && !AddToolChainOperation::exists(tcMap, tc)) { + QRegExp abiRegExp = QRegExp(QLatin1String("[a-z0-9_]+-[a-z0-9_]+-[a-z0-9_]+-[a-z0-9_]+-(8|16|32|64|128)bit")); + if (!abiRegExp.exactMatch(tc)) { + std::cerr << "Error: Toolchain " << qPrintable(tc) << " does not exist." << std::endl; + return QVariantMap(); + } + } + QString qtId = qt; if (!qtId.isEmpty() && !qtId.startsWith(QLatin1String("SDK."))) qtId = QString::fromLatin1("SDK.") + qt; diff --git a/tests/auto/debugger/README.txt b/tests/auto/debugger/README.txt index 7e1a7702d59..b5c151a786c 100644 --- a/tests/auto/debugger/README.txt +++ b/tests/auto/debugger/README.txt @@ -8,8 +8,12 @@ conditions by using environment variables as follows: QTC_QMAKE_PATH_FOR_TEST - path to a Qt version + QTC_MAKE_PATH_FOR_TEST - path to a "make". + Used for GDB only, defaults to "make" except on Windows, + where it defaults to "mingw32-make" + QTC_USE_GLIBCXXDEBUG_FOR_TEST - (0/1) to switch between GCC's - "normal" standard library, and the "debug" version + "normal" standard library, and the "debug" version (this will add DEFINES += _GLIBCXX_DEBUG) to the .pro (QTC_MSVC_ENV_BAT - to set up MSVC) diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 61d0defc135..dbfa29126d8 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -811,7 +811,22 @@ void tst_Dumpers::initTestCase() extractGdbVersion(version, &m_gdbVersion, &m_gdbBuildVersion, &m_isMacGdb, &m_isQnxGdb); m_env = QProcessEnvironment::systemEnvironment(); - m_makeBinary = QLatin1String("make"); + m_makeBinary = QString::fromLocal8Bit(qgetenv("QTC_MAKE_PATH_FOR_TEST")); +#ifdef Q_OS_WIN + if (m_makeBinary.isEmpty()) { + m_makeBinary = QLatin1String("mingw32-make"); + // if qmake is not in PATH make sure the correct libs for inferior are prepended to PATH + if (m_qmakeBinary != "qmake") { + Utils::Environment env = Utils::Environment::systemEnvironment(); + env.prependOrSetPath(QDir::toNativeSeparators(QFileInfo(QLatin1String(m_qmakeBinary)).absolutePath())); + m_env = env.toProcessEnvironment(); + } +#else + if (m_makeBinary.isEmpty()) { + m_makeBinary = QLatin1String("make"); +#endif + } + qDebug() << "Make path : " << m_makeBinary; qDebug() << "Gdb version : " << m_gdbVersion; } else if (m_debuggerEngine == CdbEngine) { setupCdb(&m_makeBinary, &m_env); @@ -1088,7 +1103,11 @@ void tst_Dumpers::dumper() QByteArray nograb = "-nograb"; cmds = "set confirm off\n" +#ifdef Q_OS_WIN + "file debug/doit\n" +#else "file doit\n" +#endif "set print object on\n" "set auto-load python-scripts off\n"; diff --git a/tests/auto/debugger/tst_offsets.cpp b/tests/auto/debugger/tst_offsets.cpp index 40f8909bbc2..3abba3aa3c8 100644 --- a/tests/auto/debugger/tst_offsets.cpp +++ b/tests/auto/debugger/tst_offsets.cpp @@ -78,11 +78,23 @@ void tst_offsets::offsets_data() QTestData &data = QTest::newRow("QFilePrivate::fileName") << int((char *)&p->fileName - (char *)p); if (qtVersion > 0x50200) +#ifdef Q_OS_WIN +# ifdef Q_CC_MSVC + data << 184 << 272; +# else // MinGW + data << 180 << 272; +# endif +#else data << 176 << 272; +#endif else if (qtVersion >= 0x50000) data << 176 << 280; else +#ifdef Q_OS_WIN + data << 144 << 232; +#else data << 140 << 232; +#endif } { diff --git a/tests/manual/debugger/simple/simple_test_app.cpp b/tests/manual/debugger/simple/simple_test_app.cpp index f054b39bda4..3a8449d8a81 100644 --- a/tests/manual/debugger/simple/simple_test_app.cpp +++ b/tests/manual/debugger/simple/simple_test_app.cpp @@ -4285,8 +4285,9 @@ namespace qthread { Q_DECLARE_METATYPE(QHostAddress) Q_DECLARE_METATYPE(QList) Q_DECLARE_METATYPE(QStringList) -#define COMMA , -Q_DECLARE_METATYPE(QMap) + +typedef QMap QMapUIntQStringList; +Q_DECLARE_METATYPE(QMapUIntQStringList) namespace qvariant { diff --git a/tests/system/shared/workarounds.py b/tests/system/shared/workarounds.py index 26441bf418b..44074ed0dac 100644 --- a/tests/system/shared/workarounds.py +++ b/tests/system/shared/workarounds.py @@ -260,7 +260,6 @@ class JIRA: def __initBugDict__(self): self.__bugs__= { 'QTCREATORBUG-6853':self._workaroundCreator6853_, - 'QTCREATORBUG-11548':self._workaroundCreator11548_ } # helper function - will be called if no workaround for the requested bug is deposited def _exitFatal_(self, bugType, number): @@ -271,56 +270,3 @@ class JIRA: def _workaroundCreator6853_(self, *args): if "Release" in args[0] and platform.system() == "Linux": snooze(2) - - def _workaroundCreator11548_(self, *args): - if len(args) != 3: - test.fatal("Need 3 arguments (project directory, project name, path to the file to " - "be added to the qrc file) to perform workaround.") - raise JIRA.JiraException("Wrong invocation of _workaroundCreator11548_().") - (pDir, pName, fPath) = args - try: - selectFromCombo(":Qt Creator_Core::Internal::NavComboBox", "Projects") - navigator = waitForObject(":Qt Creator_Utils::NavigationTreeView") - try: - openItemContextMenu(navigator, "%s.Resources.qml\.qrc" % pName, 5, 5, 0) - except: - treeElement = addBranchWildcardToRoot("%s.Resources.qml\.qrc" % pName) - openItemContextMenu(navigator, treeElement, 5, 5, 0) - if platform.system() == 'Darwin': - waitFor("macHackActivateContextMenuItem('Add Existing Files...')", 6000) - else: - activateItem(waitForObjectItem(":Qt Creator.Project.Menu.Folder_QMenu", - "Add Existing Files...")) - selectFromFileDialog(fPath) - # handle version control if necessary - try: - dlg = ("{name='Core__Internal__AddToVcsDialog' type='Core::Internal::AddToVcsDialog' " - "visible='1' windowTitle='Add to Version Control'}") - waitForObject(dlg, 3000) - clickButton(waitForObject("{text='No' type='QPushButton' unnamed='1' " - "visible='1' window=%s}" % dlg)) - except: - pass - try: - openItemContextMenu(navigator, "%s.Resources.qml\.qrc" % pName, 5, 5, 0) - except: - treeElement = addBranchWildcardToRoot("%s.Resources.qml\.qrc" % pName) - openItemContextMenu(navigator, treeElement, 5, 5, 0) - if platform.system() == 'Darwin': - waitFor("macHackActivateContextMenuItem('Open in Editor')", 6000) - else: - activateItem(waitForObjectItem(":Qt Creator.Project.Menu.Folder_QMenu", - "Open in Editor")) - resourceEditorView = waitForObject("{type='ResourceEditor::Internal::ResourceView' " - "unnamed='1' visible='1'}") - fileName = os.path.basename(fPath) - doubleClick(waitForObjectItem(resourceEditorView, "/.qml/%s" - % fileName.replace(".", "\\.").replace("_", "\\_"))) - mainWindow = waitForObject(":Qt Creator_Core::Internal::MainWindow") - if not waitFor("fileName in str(mainWindow.windowTitle)", 3000): - raise JIRA.Exception("Could not open %s." % fileName) - else: - test.passes("%s has been added to the qrc file." % fileName) - except: - test.fatal("Failed to perform workaround for QTCREATORBUG-11548") - raise JIRA.JiraException("Failed to perform workaround for QTCREATORBUG-11548") diff --git a/tests/system/suite_QMLS/tst_QMLS04/test.py b/tests/system/suite_QMLS/tst_QMLS04/test.py index 59011f90c19..2c57f9b368b 100644 --- a/tests/system/suite_QMLS/tst_QMLS04/test.py +++ b/tests/system/suite_QMLS/tst_QMLS04/test.py @@ -57,7 +57,6 @@ def main(): else: test.fail("Refactoring of Text to MyComponent failed in source file. Content of editor:\n%s" % codeText) myCompTE = "SampleApp.Resources.qml\\.qrc./.qml/MyComponent\\.qml" - filePath = os.path.join(projectDir, "SampleApp", "qml", "MyComponent.qml") # there should be new QML file generated with name "MyComponent.qml" try: waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", myCompTE, 3000) @@ -65,23 +64,18 @@ def main(): try: waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", addBranchWildcardToRoot(myCompTE), 1000) except: - test.xverify(False, "Refactoring failed - file MyComponent.qml was not generated " - "properly in project explorer (QTCREATORBUG-11548") - try: - JIRA.performWorkaroundForBug(11548, JIRA.Bug.CREATOR, projectDir, "SampleApp", filePath) - except JIRA.JiraException: - #save and exit - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") - return -# following section is done by the workaround for 11548 already - uncomment when removing workaround -# test.passes("Refactoring - file MyComponent.qml was generated properly in project explorer") -# # open MyComponent.qml file for verification -# if not openDocument(myCompTE): -# test.fatal("Could not open MyComponent.qml.") -# invokeMenuItem("File", "Save All") -# invokeMenuItem("File", "Exit") -# return + test.fail("Refactoring failed - file MyComponent.qml was not generated properly in project explorer") + #save and exit + invokeMenuItem("File", "Save All") + invokeMenuItem("File", "Exit") + return + test.passes("Refactoring - file MyComponent.qml was generated properly in project explorer") + # open MyComponent.qml file for verification + if not openDocument(myCompTE): + test.fatal("Could not open MyComponent.qml.") + invokeMenuItem("File", "Save All") + invokeMenuItem("File", "Exit") + return editorArea = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget") codeText = str(editorArea.plainText) # there should be Text item in new file @@ -92,6 +86,6 @@ def main(): #save and exit invokeMenuItem("File", "Save All") # check if new file was created in file system - test.verify(os.path.exists(filePath), + test.verify(os.path.exists(os.path.join(projectDir, "SampleApp", "qml", "MyComponent.qml")), "Verifying if MyComponent.qml exists in file system after save") invokeMenuItem("File", "Exit") diff --git a/tests/system/suite_debugger/tst_simple_analyze/test.py b/tests/system/suite_debugger/tst_simple_analyze/test.py index 4490d0320dd..9ac28b149bd 100644 --- a/tests/system/suite_debugger/tst_simple_analyze/test.py +++ b/tests/system/suite_debugger/tst_simple_analyze/test.py @@ -66,6 +66,9 @@ def main(): invokeMenuItem("File", "Exit") def performTest(workingDir, projectName, targetCount, availableConfigs, disableOptimizer): + def __elapsedTime__(elapsedTimeLabelText): + return float(re.search("Elapsed:\s+(-?\d+\.\d+) s", elapsedTimeLabelText).group(1)) + for kit, config in availableConfigs: # switching from MSVC to MinGW build will fail on the clean step of 'Rebuild All' because # of differences between MSVC's and MinGW's Makefile (so clean before switching kits) @@ -91,11 +94,19 @@ def performTest(workingDir, projectName, targetCount, availableConfigs, disableO if not test.verify(recordButton.checked, "Verifying recording is enabled."): test.log("Enabling recording for the test run") clickButton(recordButton) - clickButton(waitForObject(":Analyzer Toolbar.Start_QToolButton")) + startButton = waitForObject(":Analyzer Toolbar.Start_QToolButton") + clickButton(startButton) stopButton = waitForObject(":Qt Creator.Stop_QToolButton") elapsedLabel = waitForObject(":Analyzer Toolbar.Elapsed:_QLabel", 3000) waitFor('"Elapsed: 5" in str(elapsedLabel.text)', 20000) clickButton(stopButton) + test.verify(waitFor("not stopButton.enabled", 5000), "stopButton should be disabled") + test.verify(waitFor("startButton.enabled", 2000), "startButton should be enabled") + try: + test.verify(waitFor("__elapsedTime__(str(elapsedLabel.text)) > 0", 2000), + "Elapsed time should be positive in string '%s'" % str(elapsedLabel.text)) + except: + test.fatal("Could not read elapsed time from '%s'" % str(elapsedLabel.text)) if safeClickTab("JavaScript"): model = findObject(":JavaScript.QmlProfilerEventsTable_QmlProfiler::" "Internal::QV8ProfilerEventsMainView").model()