Merge remote-tracking branch 'origin/3.1'

Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/plugins/cpptools/cppcompletion_test.cpp

Change-Id: Ic5e75b3ef164de664a1449ffa8579beaf5b02521
This commit is contained in:
Eike Ziller
2014-04-08 11:18:40 +02:00
39 changed files with 305 additions and 169 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

BIN
doc/images/qtcreator-qml-performance-monitor.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 80 KiB

View File

@@ -62,14 +62,13 @@
the QML Profiler immediately begins to collect data. This is indicated by the QML Profiler immediately begins to collect data. This is indicated by
the time running in the \gui Elapsed field. the time running in the \gui Elapsed field.
Data is collected until you select the Data is collected until you select the \gui {Enable Profiling} button. Data
\inlineimage qtcreator-debug-button-stop.png collection
(\gui Stop) button. Data collection
takes time, and therefore, there might be a delay takes time, and therefore, there might be a delay
before the data is displayed. before the data is displayed.
Do not use application commands to exit the application, because data is 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 The application continues to run for some seconds, after which it is stopped
automatically. If you exit the application, the data is not sent. automatically. If you exit the application, the data is not sent.
@@ -114,6 +113,8 @@
\li Signal handling \li Signal handling
\li Executing JavaScript behind bindings and signal handlers
\li Summary of the recorded period \li Summary of the recorded period
\endlist \endlist
@@ -171,14 +172,36 @@
Click the binding to move the cursor in the code editor to the part of the Click the binding to move the cursor in the code editor to the part of the
code where the binding is called. 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 \section1 Viewing Events
The \gui Events view displays the number of times each binding is called The \gui Events view displays the number of times each binding, create,
and the time the calls take. This allows you to examine which events you compile, JavaScript, or signal event is triggered and the average time it
need to optimize. A high number of calls might indicate that a binding is takes. This allows you to examine which events you need to optimize. A high
called unnecessarily. Click on a binding to move to it in the source code 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. 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" \image qtcreator-analyzer-bindings.png "Events view"
The \gui Callers and \gui Callees panes show dependencies between events. 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. 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. 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 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 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 To copy the contents of one view or row to the clipboard, select
\gui {Copy Table} or \gui {Copy Row} in the context menu. \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 \section2 Viewing More Data
The QML JavaScript engine optimizes trivial bindings. The QML Profiler The QML JavaScript engine optimizes trivial bindings. The QML Profiler

View File

@@ -500,6 +500,18 @@ class DumperBase:
self.putType(type) self.putType(type)
self.putNumChild(0) 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("<not callable>")
self.putNumChild(0)
def call(self, value, func, *args):
return self.callHelper(value, func, args)
def putMapName(self, value, index = -1): def putMapName(self, value, index = -1):
ns = self.qtNamespace() ns = self.qtNamespace()
@@ -1025,15 +1037,15 @@ class DumperBase:
addr += 1 addr += 1
return result return result
def generateQListChildren(self, value): def listChildrenGenerator(self, addr, typeName):
base = self.extractPointer(value) innerType = self.lookupType(self.qtNamespace() + typeName)
base = self.extractPointer(addr)
begin = self.extractInt(base + 8) begin = self.extractInt(base + 8)
end = self.extractInt(base + 12) end = self.extractInt(base + 12)
array = base + 16 array = base + 16
if self.qtVersion() < 0x50000: if self.qtVersion() < 0x50000:
array += self.ptrSize() array += self.ptrSize()
size = end - begin size = end - begin
innerType = self.templateArgument(value.type, 0)
innerSize = innerType.sizeof innerSize = innerType.sizeof
stepSize = self.ptrSize() stepSize = self.ptrSize()
addr = array + begin * stepSize addr = array + begin * stepSize
@@ -1072,19 +1084,9 @@ class DumperBase:
# Dynamic properties. # Dynamic properties.
if extraData: if extraData:
propertyNames = extraData + ptrSize names = self.listChildrenGenerator(extraData + ptrSize, "QByteArray")
propertyValues = extraData + 2 * ptrSize values = self.listChildrenGenerator(extraData + 2 * ptrSize, "QVariant")
for (k, v) in zip(names, values):
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)) :
with SubItem(self, propertyCount): with SubItem(self, propertyCount):
self.put('key="%s",' % self.encodeByteArray(k)) self.put('key="%s",' % self.encodeByteArray(k))
self.put('keyencoded="%s",' % Hex2EncodedLatin1) self.put('keyencoded="%s",' % Hex2EncodedLatin1)

View File

@@ -575,7 +575,7 @@ class Dumper(DumperBase):
def parseAndEvaluate(self, exp): def parseAndEvaluate(self, exp):
return gdb.parse_and_eval(exp) return gdb.parse_and_eval(exp)
def call2(self, value, func, args): def callHelper(self, value, func, args):
# args is a tuple. # args is a tuple.
arg = "" arg = ""
for i in range(len(args)): for i in range(len(args)):
@@ -602,9 +602,6 @@ class Dumper(DumperBase):
gdb.parse_and_eval("free(0x%x)" % ptr) gdb.parse_and_eval("free(0x%x)" % ptr)
return result return result
def call(self, value, func, *args):
return self.call2(value, func, args)
def childWithName(self, value, name): def childWithName(self, value, name):
try: try:
return value[name] return value[name]
@@ -1054,11 +1051,6 @@ class Dumper(DumperBase):
i = toInteger(i) i = toInteger(i)
self.putSubItem(i, (base + i).dereference()) 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): def isFunctionType(self, type):
return type.code == MethodCode or type.code == FunctionCode return type.code == MethodCode or type.code == FunctionCode

View File

@@ -144,7 +144,7 @@ def impl_SBValue__add__(self, offset):
def impl_SBValue__sub__(self, other): def impl_SBValue__sub__(self, other):
if self.GetType().IsPointerType(): if self.GetType().IsPointerType():
if isinstance(other, int) or isinstance(other, long): if isinstance(other, int) or isinstance(other, long):
address = self.GetValueAsUnsigned() - offset.GetValueAsSigned() address = self.GetValueAsUnsigned() - other
address = address & 0xFFFFFFFFFFFFFFFF # Force unsigned address = address & 0xFFFFFFFFFFFFFFFF # Force unsigned
return self.CreateValueFromAddress(None, address, self.GetType()) return self.CreateValueFromAddress(None, address, self.GetType())
if other.GetType().IsPointerType(): if other.GetType().IsPointerType():
@@ -372,7 +372,7 @@ class Dumper(DumperBase):
return ns + "Qt::" + enumType + "(" \ return ns + "Qt::" + enumType + "(" \
+ ns + "Qt::" + enumType + "::" + enumValue + ")" + ns + "Qt::" + enumType + "::" + enumValue + ")"
def call2(self, value, func, args): def callHelper(self, value, func, args):
# args is a tuple. # args is a tuple.
arg = ','.join(args) arg = ','.join(args)
#warn("CALL: %s -> %s(%s)" % (value, func, arg)) #warn("CALL: %s -> %s(%s)" % (value, func, arg))
@@ -398,9 +398,6 @@ class Dumper(DumperBase):
frame = thread.GetFrameAtIndex(0) frame = thread.GetFrameAtIndex(0)
return frame.EvaluateExpression(expr) return frame.EvaluateExpression(expr)
def call(self, value, func, *args):
return self.call2(value, func, args)
def checkPointer(self, p, align = 1): def checkPointer(self, p, align = 1):
if not self.isNull(p): if not self.isNull(p):
p.Dereference() p.Dereference()
@@ -449,13 +446,21 @@ class Dumper(DumperBase):
qtNamespace = name[:name.find('qVersion')] qtNamespace = name[:name.find('qVersion')]
self.qtNamespace = lambda: qtNamespace self.qtNamespace = lambda: qtNamespace
res = "" options = lldb.SBExpressionOptions()
try: res = self.target.EvaluateExpression(name + '()', options)
res = self.parseAndEvaluate(name + '()')
except:
res = self.parseAndEvaluate('((const char*())%s)()' % name)
version = str(res)
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: if version.count('.') != 2:
continue continue
@@ -604,11 +609,6 @@ class Dumper(DumperBase):
addr = int(address) & 0xFFFFFFFFFFFFFFFF addr = int(address) & 0xFFFFFFFFFFFFFFFF
return self.context.CreateValueFromAddress(None, addr, referencedType) 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): def childRange(self):
if self.currentMaxNumChild is None: if self.currentMaxNumChild is None:
return xrange(0, self.currentNumChild) return xrange(0, self.currentNumChild)

View File

@@ -179,6 +179,7 @@ def qdump__QModelIndex(d, value):
% (mm_, row, column, mi_)) % (mm_, row, column, mi_))
d.putItem(mi2) d.putItem(mi2)
i = i + 1 i = i + 1
d.putFields(value)
#d.putCallItem("parent", val, "parent") #d.putCallItem("parent", val, "parent")
#with SubItem(d, "model"): #with SubItem(d, "model"):
# d.putValue(m) # d.putValue(m)
@@ -203,6 +204,7 @@ def qdump__QDate(d, value):
d.enumExpression("DateFormat", "SystemLocaleDate")) d.enumExpression("DateFormat", "SystemLocaleDate"))
d.putCallItem("(Locale)", value, "toString", d.putCallItem("(Locale)", value, "toString",
d.enumExpression("DateFormat", "LocaleDate")) d.enumExpression("DateFormat", "LocaleDate"))
d.putFields(value)
else: else:
d.putValue("(invalid)") d.putValue("(invalid)")
d.putNumChild(0) d.putNumChild(0)
@@ -224,6 +226,7 @@ def qdump__QTime(d, value):
d.enumExpression("DateFormat", "SystemLocaleDate")) d.enumExpression("DateFormat", "SystemLocaleDate"))
d.putCallItem("(Locale)", value, "toString", d.putCallItem("(Locale)", value, "toString",
d.enumExpression("DateFormat", "LocaleDate")) d.enumExpression("DateFormat", "LocaleDate"))
d.putFields(value)
else: else:
d.putValue("(invalid)") d.putValue("(invalid)")
d.putNumChild(0) d.putNumChild(0)
@@ -312,6 +315,7 @@ def qdump__QDateTime(d, value):
d.enumExpression("TimeSpec", "UTC")) d.enumExpression("TimeSpec", "UTC"))
d.putCallItem("toLocalTime", value, "toTimeSpec", d.putCallItem("toLocalTime", value, "toTimeSpec",
d.enumExpression("TimeSpec", "LocalTime")) d.enumExpression("TimeSpec", "LocalTime"))
d.putFields(value)
else: else:
d.putValue("(invalid)") d.putValue("(invalid)")
d.putNumChild(0) d.putNumChild(0)
@@ -404,17 +408,25 @@ def qdump__QDir(d, value):
with SubItem(d, "entryList"): with SubItem(d, "entryList"):
typ = d.lookupType(ns + "QStringList") typ = d.lookupType(ns + "QStringList")
d.putItem(d.createValue(privAddress + filesOffset, typ)) d.putItem(d.createValue(privAddress + filesOffset, typ))
d.putFields(value)
def qdump__QFile(d, value): def qdump__QFile(d, value):
# 9fc0965 changes the layout of the private structure # 9fc0965 changes the layout of the private structure
qtVersion = d.qtVersion() qtVersion = d.qtVersion()
if qtVersion >= 0x050200: is32bit = d.is32bit()
offset = 176 if d.is32bit() else 272 if qtVersion > 0x050200:
if d.isWindowsTarget():
offset = 180 if is32bit else 272
else:
offset = 176 if is32bit else 272
elif qtVersion >= 0x050000: elif qtVersion >= 0x050000:
offset = 180 if d.is32bit() else 280 offset = 176 if is32bit else 280
else: 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()) privAddress = d.extractPointer(d.addressOf(value) + d.ptrSize())
fileNameAddress = privAddress + offset fileNameAddress = privAddress + offset
d.putStringValueByAddress(fileNameAddress) d.putStringValueByAddress(fileNameAddress)
@@ -503,6 +515,7 @@ def qdump__QFileInfo(d, value):
d.putCallItem("created", value, "created") d.putCallItem("created", value, "created")
d.putCallItem("lastModified", value, "lastModified") d.putCallItem("lastModified", value, "lastModified")
d.putCallItem("lastRead", value, "lastRead") d.putCallItem("lastRead", value, "lastRead")
d.putFields(value)
def qdump__QFixed(d, value): def qdump__QFixed(d, value):
@@ -604,13 +617,16 @@ def qdump__QHash(d, value):
d.putNumChild(size) d.putNumChild(size)
if d.isExpanded(): if d.isExpanded():
numBuckets = int(d_ptr.dereference()["numBuckets"]) numBuckets = int(d_ptr.dereference()["numBuckets"])
nodePtr = hashDataFirstNode(d_ptr, numBuckets)
innerType = e_ptr.dereference().type innerType = e_ptr.dereference().type
isCompact = d.isMapCompact(keyType, valueType) isCompact = d.isMapCompact(keyType, valueType)
childType = valueType if isCompact else innerType childType = valueType if isCompact else innerType
with Children(d, size, maxNumChild=1000, childType=childType): with Children(d, size, maxNumChild=1000, childType=childType):
for i in d.childRange(): 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): with SubItem(d, i):
if isCompact: if isCompact:
key = it["key"] key = it["key"]
@@ -623,7 +639,6 @@ def qdump__QHash(d, value):
d.putType(valueType) d.putType(valueType)
else: else:
d.putItem(it) d.putItem(it)
nodePtr = hashDataNextNode(nodePtr, numBuckets)
def qdump__QHashNode(d, value): def qdump__QHashNode(d, value):
@@ -912,6 +927,7 @@ def qdump__QLocale(d, value):
d.putCallItem("zeroDigit", value, "zeroDigit") d.putCallItem("zeroDigit", value, "zeroDigit")
d.putCallItem("groupSeparator", value, "groupSeparator") d.putCallItem("groupSeparator", value, "groupSeparator")
d.putCallItem("negativeSign", value, "negativeSign") d.putCallItem("negativeSign", value, "negativeSign")
d.putFields(value)
def qdump__QMapNode(d, value): def qdump__QMapNode(d, value):
@@ -1676,10 +1692,13 @@ def qdump__QSet(d, value):
hashDataType = d_ptr.type hashDataType = d_ptr.type
nodeTypePtr = d_ptr.dereference()["fakeNext"].type nodeTypePtr = d_ptr.dereference()["fakeNext"].type
numBuckets = int(d_ptr.dereference()["numBuckets"]) numBuckets = int(d_ptr.dereference()["numBuckets"])
node = hashDataFirstNode(d_ptr, numBuckets)
innerType = e_ptr.dereference().type innerType = e_ptr.dereference().type
with Children(d, size, maxNumChild=1000, childType=innerType): with Children(d, size, maxNumChild=1000, childType=innerType):
for i in d.childRange(): for i in d.childRange():
if i == 0:
node = hashDataFirstNode(d_ptr, numBuckets)
else:
node = hashDataNextNode(node, numBuckets)
it = node.dereference().cast(innerType) it = node.dereference().cast(innerType)
with SubItem(d, i): with SubItem(d, i):
key = it["key"] key = it["key"]
@@ -1688,7 +1707,6 @@ def qdump__QSet(d, value):
# for Qt4 optimized int keytype # for Qt4 optimized int keytype
key = it[1]["key"] key = it[1]["key"]
d.putItem(key) d.putItem(key)
node = hashDataNextNode(node, numBuckets)
def qdump__QSharedData(d, value): def qdump__QSharedData(d, value):
@@ -1797,6 +1815,7 @@ def qdump__QTextCodec(d, value):
with Children(d): with Children(d):
d.putCallItem("name", value, "name") d.putCallItem("name", value, "name")
d.putCallItem("mibEnum", value, "mibEnum") d.putCallItem("mibEnum", value, "mibEnum")
d.putFields(value)
def qdump__QTextCursor(d, value): def qdump__QTextCursor(d, value):
@@ -1814,6 +1833,7 @@ def qdump__QTextCursor(d, value):
d.putIntItem("position", d.extractInt(positionAddress)) d.putIntItem("position", d.extractInt(positionAddress))
d.putIntItem("anchor", d.extractInt(positionAddress + d.intSize())) d.putIntItem("anchor", d.extractInt(positionAddress + d.intSize()))
d.putCallItem("selected", value, "selectedText") d.putCallItem("selected", value, "selectedText")
d.putFields(value)
def qdump__QTextDocument(d, value): def qdump__QTextDocument(d, value):
@@ -1826,6 +1846,7 @@ def qdump__QTextDocument(d, value):
d.putCallItem("lineCount", value, "lineCount") d.putCallItem("lineCount", value, "lineCount")
d.putCallItem("revision", value, "revision") d.putCallItem("revision", value, "revision")
d.putCallItem("toPlainText", value, "toPlainText") d.putCallItem("toPlainText", value, "toPlainText")
d.putFields(value)
def qform__QUrl(): def qform__QUrl():
@@ -1854,6 +1875,7 @@ def qdump__QUrl(d, value):
d.putCallItem("query", value, "encodedQuery") d.putCallItem("query", value, "encodedQuery")
d.putCallItem("fragment", value, "fragment") d.putCallItem("fragment", value, "fragment")
d.putCallItem("port", value, "port") d.putCallItem("port", value, "port")
d.putFields(value)
else: else:
# QUrlPrivate: # QUrlPrivate:
# - QAtomicInt ref; # - QAtomicInt ref;

View File

@@ -138,7 +138,7 @@ Column {
onAccepted: { onAccepted: {
colorEditor.color = textField.text colorEditor.color = textField.text
} }
Layout.preferredWidth: 80 Layout.fillWidth: true
} }
ColorCheckButton { ColorCheckButton {
id: checkButton id: checkButton

View File

@@ -86,7 +86,7 @@ Controls.TextField {
padding.top: 3 padding.top: 3
padding.bottom: 1 padding.bottom: 1
padding.left: 16 padding.left: 16
padding.right: 16 padding.right: lineEdit.showTranslateCheckBox ? 16 : 1
placeholderTextColor: "gray" placeholderTextColor: "gray"
background: Rectangle { background: Rectangle {
implicitWidth: 100 implicitWidth: 100

View File

@@ -1257,6 +1257,7 @@ void ClassOrNamespace::NestedClassInstantiator::instantiate(ClassOrNamespace *en
} }
} }
nestedClassOrNamespaceInstantiation->_parent = enclosingTemplateClassInstantiation;
instantiate(nestedClassOrNamespace, nestedClassOrNamespaceInstantiation); instantiate(nestedClassOrNamespace, nestedClassOrNamespaceInstantiation);
enclosingTemplateClassInstantiation->_classOrNamespaces[nestedName] = enclosingTemplateClassInstantiation->_classOrNamespaces[nestedName] =

View File

@@ -186,7 +186,7 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
d->maximumTime = qMax(time, d->maximumTime); d->maximumTime = qMax(time, d->maximumTime);
} }
} else if (messageType == Complete) { } else if (messageType == Complete) {
emit complete(); emit complete(d->maximumTime);
} else if (messageType == SceneGraphFrame) { } else if (messageType == SceneGraphFrame) {
int sgEventType; int sgEventType;
int count = 0; int count = 0;

View File

@@ -97,7 +97,7 @@ public slots:
void sendRecordingStatus(); void sendRecordingStatus();
signals: signals:
void complete(); void complete(qint64 maximumTime);
void gap(qint64 time); void gap(qint64 time);
void event(int event, qint64 time); void event(int event, qint64 time);
void traceFinished( qint64 time ); void traceFinished( qint64 time );

View File

@@ -172,4 +172,22 @@ QTCREATOR_UTILS_EXPORT bool is64BitWindowsBinary(const QString &binaryIn)
#endif #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 } // namespace Utils

View File

@@ -49,6 +49,23 @@ QTCREATOR_UTILS_EXPORT bool is64BitWindowsSystem();
// Check for a 64bit binary. // Check for a 64bit binary.
QTCREATOR_UTILS_EXPORT bool is64BitWindowsBinary(const QString &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 } // namespace Utils
#endif // WINUTILS_H #endif // WINUTILS_H

View File

@@ -529,7 +529,7 @@ QAbstractItemModel *AndroidDeployQtStep::keystoreCertificates()
if (!m_keystorePasswd.length()) if (!m_keystorePasswd.length())
return 0; return 0;
params << m_keystorePasswd; params << m_keystorePasswd;
params << QLatin1String("-J\"-Duser.language=en\""); params << QLatin1String("-J-Duser.language=en");
keytoolProc.start(AndroidConfigurations::currentConfig().keytoolPath().toString(), params); keytoolProc.start(AndroidConfigurations::currentConfig().keytoolPath().toString(), params);
if (!keytoolProc.waitForStarted() || !keytoolProc.waitForFinished()) { if (!keytoolProc.waitForStarted() || !keytoolProc.waitForFinished()) {
QMessageBox::critical(0, tr("Error"), QMessageBox::critical(0, tr("Error"),

View File

@@ -1291,7 +1291,7 @@ void AndroidManifestEditorWidget::setHDPIIcon()
void AndroidManifestEditorWidget::defaultPermissionCheckBoxClicked() void AndroidManifestEditorWidget::defaultPermissionCheckBoxClicked()
{ {
if (m_defaultPermissonsCheckBox->checkState() == Qt::PartiallyChecked) if (m_defaultPermissonsCheckBox->checkState() == Qt::PartiallyChecked)
m_defaultPermissonsCheckBox->setChecked(Qt::Checked); m_defaultPermissonsCheckBox->setChecked(true);
setDirty(true); setDirty(true);
} }

View File

@@ -364,7 +364,7 @@ QAbstractItemModel *AndroidPackageCreationStep::keystoreCertificates()
if (!m_keystorePasswd.length()) if (!m_keystorePasswd.length())
return 0; return 0;
params << m_keystorePasswd; params << m_keystorePasswd;
params << QLatin1String("-J\"-Duser.language=en\""); params << QLatin1String("-J-Duser.language=en");
keytoolProc.start(AndroidConfigurations::currentConfig().keytoolPath().toString(), params); keytoolProc.start(AndroidConfigurations::currentConfig().keytoolPath().toString(), params);
if (!keytoolProc.waitForStarted() || !keytoolProc.waitForFinished()) { if (!keytoolProc.waitForStarted() || !keytoolProc.waitForFinished()) {
QMessageBox::critical(0, tr("Error"), QMessageBox::critical(0, tr("Error"),

View File

@@ -125,6 +125,13 @@ void AndroidQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::En
AndroidConfigurations::currentConfig().bestNdkPlatformMatch(AndroidManager::buildTargetSDK(target))); 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 QString AndroidQtVersion::description() const
{ {
//: Qt Version is meant for Android //: Qt Version is meant for Android

View File

@@ -53,6 +53,7 @@ public:
QList<ProjectExplorer::Abi> detectQtAbis() const; QList<ProjectExplorer::Abi> detectQtAbis() const;
void addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const; void addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const;
Utils::Environment qmakeRunEnvironment() const;
Core::FeatureSet availableFeatures() const; Core::FeatureSet availableFeatures() const;
QString platformName() const; QString platformName() const;

View File

@@ -49,6 +49,7 @@ namespace {
} }
static const char kKeyboardSettingsKey[] = "KeyboardShortcuts"; static const char kKeyboardSettingsKey[] = "KeyboardShortcuts";
static const char kKeyboardSettingsTransferredKey[] = "OldSettingsTransferred";
using namespace Core; using namespace Core;
using namespace Core::Internal; using namespace Core::Internal;
@@ -505,10 +506,16 @@ static const char oldSequenceKey[] = "Keysequence";
void ActionManagerPrivate::initialize() void ActionManagerPrivate::initialize()
{ {
// TODO remove me after some period after 3.1 // 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 // check if settings in old style (pre 3.1) exist
QSettings *settings = Core::ICore::settings(); QSettings *settings = Core::ICore::settings();
if (settings->contains(QLatin1String(kKeyboardSettingsKey))) if (settings->contains(QLatin1String(kKeyboardSettingsKey) + QLatin1Char('/')
+ QLatin1String(kKeyboardSettingsTransferredKey))) {
return; return;
}
// move old settings style to new settings style // move old settings style to new settings style
QMap<Id, QKeySequence> shortcutMap; QMap<Id, QKeySequence> shortcutMap;
const int shortcuts = settings->beginReadArray(QLatin1String(oldSettingsGroup)); const int shortcuts = settings->beginReadArray(QLatin1String(oldSettingsGroup));
@@ -521,14 +528,13 @@ void ActionManagerPrivate::initialize()
settings->endArray(); settings->endArray();
// write settings in new style // write settings in new style
settings->beginGroup(QLatin1String(kKeyboardSettingsKey)); settings->beginGroup(QLatin1String(kKeyboardSettingsKey));
settings->setValue(QLatin1String(kKeyboardSettingsTransferredKey), true);
QMapIterator<Id, QKeySequence> it(shortcutMap); QMapIterator<Id, QKeySequence> it(shortcutMap);
while (it.hasNext()) { while (it.hasNext()) {
it.next(); it.next();
settings->setValue(it.key().toString(), it.value().toString()); settings->setValue(it.key().toString(), it.value().toString());
} }
settings->endGroup(); settings->endGroup();
// remove old settings
settings->remove(QLatin1String(oldSettingsGroup));
} }
void ActionManagerPrivate::saveSettings(QSettings *settings) void ActionManagerPrivate::saveSettings(QSettings *settings)

View File

@@ -337,6 +337,8 @@ void FindToolBar::updateFindAction()
m_findInDocumentAction->setEnabled(enabled); m_findInDocumentAction->setEnabled(enabled);
m_findNextSelectedAction->setEnabled(enabled); m_findNextSelectedAction->setEnabled(enabled);
m_findPreviousSelectedAction->setEnabled(enabled); m_findPreviousSelectedAction->setEnabled(enabled);
if (QApplication::clipboard()->supportsFindBuffer())
m_enterFindStringAction->setEnabled(enabled);
} }
void FindToolBar::updateToolBar() void FindToolBar::updateToolBar()
@@ -358,8 +360,6 @@ void FindToolBar::updateToolBar()
m_wholeWordAction->setEnabled(enabled); m_wholeWordAction->setEnabled(enabled);
m_regularExpressionAction->setEnabled(enabled); m_regularExpressionAction->setEnabled(enabled);
m_preserveCaseAction->setEnabled(replaceEnabled && !hasFindFlag(FindRegularExpression)); m_preserveCaseAction->setEnabled(replaceEnabled && !hasFindFlag(FindRegularExpression));
if (QApplication::clipboard()->supportsFindBuffer())
m_enterFindStringAction->setEnabled(enabled);
bool replaceFocus = m_ui.replaceEdit->hasFocus(); bool replaceFocus = m_ui.replaceEdit->hasFocus();
m_ui.findEdit->setEnabled(enabled); m_ui.findEdit->setEnabled(enabled);
m_ui.findLabel->setEnabled(enabled); m_ui.findLabel->setEnabled(enabled);
@@ -516,6 +516,7 @@ void FindToolBar::invokeResetIncrementalSearch()
void FindToolBar::putSelectionToFindClipboard() void FindToolBar::putSelectionToFindClipboard()
{ {
openFind(false);
const QString text = m_currentDocumentFind->currentFindString(); const QString text = m_currentDocumentFind->currentFindString();
QApplication::clipboard()->setText(text, QClipboard::FindBuffer); QApplication::clipboard()->setText(text, QClipboard::FindBuffer);
setFindText(text); setFindText(text);

View File

@@ -2231,6 +2231,22 @@ void CppToolsPlugin::test_completion_data()
" @\n" " @\n"
"}\n" "}\n"
) << _("double val = d.constBegin()->") << (QStringList()); ) << _("double val = d.constBegin()->") << (QStringList());
QTest::newRow("nested_class_in_template_class_QTCREATORBUG-11752") << _(
"template <typename T>\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<Foo>::Nested2 n2;\n"
" @\n"
"}\n"
) << _("n2.n1.t.") << (QStringList()
<< QLatin1String("foo")
<< QLatin1String("Foo"));
} }
void CppToolsPlugin::test_completion_member_access_operator() void CppToolsPlugin::test_completion_member_access_operator()

View File

@@ -67,7 +67,7 @@ namespace Internal {
// //
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
class DebuggerRunConfigWidget : public ProjectExplorer::RunConfigWidget class DebuggerRunConfigWidget : public RunConfigWidget
{ {
Q_OBJECT Q_OBJECT
@@ -215,7 +215,7 @@ void DebuggerRunConfigWidget::useMultiProcessToggled(bool on)
*/ */
DebuggerRunConfigurationAspect::DebuggerRunConfigurationAspect( DebuggerRunConfigurationAspect::DebuggerRunConfigurationAspect(
ProjectExplorer::RunConfiguration *rc) : RunConfiguration *rc) :
IRunConfigurationAspect(rc), IRunConfigurationAspect(rc),
m_useCppDebugger(AutoEnabledLanguage), m_useCppDebugger(AutoEnabledLanguage),
m_useQmlDebugger(AutoEnabledLanguage), m_useQmlDebugger(AutoEnabledLanguage),
@@ -292,8 +292,8 @@ void DebuggerRunConfigurationAspect::setUseMultiProcess(bool value)
bool DebuggerRunConfigurationAspect::isQmlDebuggingSpinboxSuppressed() const bool DebuggerRunConfigurationAspect::isQmlDebuggingSpinboxSuppressed() const
{ {
ProjectExplorer::Kit *k = runConfiguration()->target()->kit(); Kit *k = runConfiguration()->target()->kit();
ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceKitInformation::device(k); IDevice::ConstPtr dev = DeviceKitInformation::device(k);
if (dev.isNull()) if (dev.isNull())
return false; return false;
return dev->canAutoDetectPorts(); return dev->canAutoDetectPorts();
@@ -327,12 +327,12 @@ void DebuggerRunConfigurationAspect::fromMap(const QVariantMap &map)
} }
DebuggerRunConfigurationAspect *DebuggerRunConfigurationAspect::create DebuggerRunConfigurationAspect *DebuggerRunConfigurationAspect::create
(ProjectExplorer::RunConfiguration *runConfiguration) const (RunConfiguration *runConfiguration) const
{ {
return new DebuggerRunConfigurationAspect(runConfiguration); return new DebuggerRunConfigurationAspect(runConfiguration);
} }
ProjectExplorer::RunConfigWidget *DebuggerRunConfigurationAspect::createConfigurationWidget() RunConfigWidget *DebuggerRunConfigurationAspect::createConfigurationWidget()
{ {
return new Internal::DebuggerRunConfigWidget(this); return new Internal::DebuggerRunConfigWidget(this);
} }

View File

@@ -47,6 +47,7 @@
#include <qmakeprojectmanager/qmakeproject.h> #include <qmakeprojectmanager/qmakeproject.h>
#include <qtsupport/qtkitinformation.h> #include <qtsupport/qtkitinformation.h>
#include <utils/fileutils.h> #include <utils/fileutils.h>
#include <utils/qtcprocess.h>
#include <QDir> #include <QDir>
#include <QTcpServer> #include <QTcpServer>
@@ -216,9 +217,7 @@ void IosDebugSupport::handleGotInferiorPid(Q_PID pid, int qmlPort)
{ {
if (pid > 0) { if (pid > 0) {
//m_runControl->engine()->notifyInferiorPid(pid); //m_runControl->engine()->notifyInferiorPid(pid);
#ifndef Q_OS_WIN // Q_PID might be 64 bit pointer... m_runControl->engine()->notifyEngineRemoteSetupDone(int(Utils::qPidToPid(pid)), qmlPort);
m_runControl->engine()->notifyEngineRemoteSetupDone(int(pid), qmlPort);
#endif
} else { } else {
m_runControl->engine()->notifyEngineRemoteSetupFailed( m_runControl->engine()->notifyEngineRemoteSetupFailed(
tr("Got an invalid process id.")); tr("Got an invalid process id."));

View File

@@ -1002,7 +1002,7 @@ QtSupport::ProFileReader *QmakeProject::createProFileReader(const QmakeProFileNo
// It is important to override the spec file only for the creator evaluator, // 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). // and not the qmake buildstep used to build the app (as we use the makefiles).
const char IOSQT[] = "Qt4ProjectManager.QtVersion.Ios"; // from Ios::Constants 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_qmakeGlobals->xqmakespec = QLatin1String("macx-xcode");
} }
++m_qmakeGlobalsRefCnt; ++m_qmakeGlobalsRefCnt;

View File

@@ -39,6 +39,13 @@
#include <QCoreApplication> #include <QCoreApplication>
#include <QMessageBox> #include <QMessageBox>
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 \defgroup CoreExceptions
@@ -156,7 +163,7 @@ QString Exception::description() const
void Exception::showException(const QString &title) const void Exception::showException(const QString &title) const
{ {
QString t = title.isEmpty() ? QCoreApplication::translate("QmlDesigner", "Error") : title; QString t = title.isEmpty() ? QCoreApplication::translate("QmlDesigner", "Error") : title;
QMessageBox::warning(Core::ICore::dialogParent(), t, description()); showAsyncWarning(t, description());
} }
/*! /*!

View File

@@ -172,8 +172,8 @@ void QmlProfilerClientManager::connectClientSignals()
{ {
QTC_ASSERT(d->profilerState, return); QTC_ASSERT(d->profilerState, return);
if (d->qmlclientplugin) { if (d->qmlclientplugin) {
connect(d->qmlclientplugin.data(), SIGNAL(complete()), connect(d->qmlclientplugin.data(), SIGNAL(complete(qint64)),
this, SLOT(qmlComplete())); this, SLOT(qmlComplete(qint64)));
connect(d->qmlclientplugin.data(), connect(d->qmlclientplugin.data(),
SIGNAL(rangedEvent(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation, SIGNAL(rangedEvent(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation,
qint64,qint64,qint64,qint64,qint64)), 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; d->qmlDataReady = true;
if (!d->v8clientplugin || d->v8clientplugin.data()->status() != QmlDebug::Enabled || d->v8DataReady) { if (!d->v8clientplugin || d->v8clientplugin.data()->status() != QmlDebug::Enabled || d->v8DataReady) {
emit dataReadyForProcessing(); emit dataReadyForProcessing();

View File

@@ -72,7 +72,7 @@ private slots:
void connectionStateChanged(); void connectionStateChanged();
void retryMessageBoxFinished(int result); void retryMessageBoxFinished(int result);
void qmlComplete(); void qmlComplete(qint64 maximumTime);
void v8Complete(); void v8Complete();
void profilerStateChanged(); void profilerStateChanged();

View File

@@ -106,6 +106,7 @@ QList<Utils::FileName> QnxToolChain::suggestedMkspecList() const
{ {
QList<Utils::FileName> mkspecList; QList<Utils::FileName> mkspecList;
mkspecList << Utils::FileName::fromLatin1("qnx-armv7le-qcc"); 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("qnx-x86-qcc");
mkspecList << Utils::FileName::fromLatin1("blackberry-armv7le-qcc"); mkspecList << Utils::FileName::fromLatin1("blackberry-armv7le-qcc");
mkspecList << Utils::FileName::fromLatin1("blackberry-armle-v7-qcc"); mkspecList << Utils::FileName::fromLatin1("blackberry-armle-v7-qcc");

View File

@@ -48,6 +48,7 @@
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/runextensions.h> #include <utils/runextensions.h>
#include <utils/synchronousprocess.h> #include <utils/synchronousprocess.h>
#include <utils/winutils.h>
#include <QDir> #include <QDir>
#include <QUrl> #include <QUrl>
@@ -1206,6 +1207,9 @@ static QByteArray runQmakeQuery(const FileName &binary, const Environment &env,
const int timeOutMS = 30000; // Might be slow on some machines. 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; QProcess process;
process.setEnvironment(env.toStringList()); process.setEnvironment(env.toStringList());
process.start(binary.toString(), QStringList(QLatin1String("-query")), QIODevice::ReadOnly); process.start(binary.toString(), QStringList(QLatin1String("-query")), QIODevice::ReadOnly);

View File

@@ -257,6 +257,12 @@ ProjectExplorer::FolderNode::AddNewInformation ResourceTopLevelNode::addNewInfor
p = 125; p = 125;
else if (projectNode() == context) else if (projectNode() == context)
p = 150; // steal from our project node 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<ResourceFolderNode *>(context))
if (rfn->prefix() == QLatin1String("/"))
p = 150;
} }
return AddNewInformation(name, p); return AddNewInformation(name, p);

View File

@@ -40,6 +40,8 @@
#include "settings.h" #include "settings.h"
#include <QRegExp>
#include <iostream> #include <iostream>
// Qt version file stuff: // Qt version file stuff:
@@ -298,6 +300,25 @@ bool AddKitOperation::test() const
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
if (!empty.isEmpty()) if (!empty.isEmpty())
return false; 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: // Fail if Qt is not there:
empty = addKit(map, tcMap, qtMap, devMap, empty = addKit(map, tcMap, qtMap, devMap,
QLatin1String("testId"), QLatin1String("Test Kit"), QLatin1String("/tmp/icon.png"), QLatin1String("testId"), QLatin1String("Test Kit"), QLatin1String("/tmp/icon.png"),
@@ -498,6 +519,14 @@ QVariantMap AddKitOperation::addKit(const QVariantMap &map, const QVariantMap &t
return QVariantMap(); 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; QString qtId = qt;
if (!qtId.isEmpty() && !qtId.startsWith(QLatin1String("SDK."))) if (!qtId.isEmpty() && !qtId.startsWith(QLatin1String("SDK.")))
qtId = QString::fromLatin1("SDK.") + qt; qtId = QString::fromLatin1("SDK.") + qt;

View File

@@ -8,8 +8,12 @@ conditions by using environment variables as follows:
QTC_QMAKE_PATH_FOR_TEST - path to a Qt version 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 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 (this will add DEFINES += _GLIBCXX_DEBUG) to the .pro
(QTC_MSVC_ENV_BAT - to set up MSVC) (QTC_MSVC_ENV_BAT - to set up MSVC)

View File

@@ -811,7 +811,22 @@ void tst_Dumpers::initTestCase()
extractGdbVersion(version, &m_gdbVersion, extractGdbVersion(version, &m_gdbVersion,
&m_gdbBuildVersion, &m_isMacGdb, &m_isQnxGdb); &m_gdbBuildVersion, &m_isMacGdb, &m_isQnxGdb);
m_env = QProcessEnvironment::systemEnvironment(); 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; qDebug() << "Gdb version : " << m_gdbVersion;
} else if (m_debuggerEngine == CdbEngine) { } else if (m_debuggerEngine == CdbEngine) {
setupCdb(&m_makeBinary, &m_env); setupCdb(&m_makeBinary, &m_env);
@@ -1088,7 +1103,11 @@ void tst_Dumpers::dumper()
QByteArray nograb = "-nograb"; QByteArray nograb = "-nograb";
cmds = "set confirm off\n" cmds = "set confirm off\n"
#ifdef Q_OS_WIN
"file debug/doit\n"
#else
"file doit\n" "file doit\n"
#endif
"set print object on\n" "set print object on\n"
"set auto-load python-scripts off\n"; "set auto-load python-scripts off\n";

View File

@@ -78,11 +78,23 @@ void tst_offsets::offsets_data()
QTestData &data = QTest::newRow("QFilePrivate::fileName") QTestData &data = QTest::newRow("QFilePrivate::fileName")
<< int((char *)&p->fileName - (char *)p); << int((char *)&p->fileName - (char *)p);
if (qtVersion > 0x50200) if (qtVersion > 0x50200)
#ifdef Q_OS_WIN
# ifdef Q_CC_MSVC
data << 184 << 272;
# else // MinGW
data << 180 << 272;
# endif
#else
data << 176 << 272; data << 176 << 272;
#endif
else if (qtVersion >= 0x50000) else if (qtVersion >= 0x50000)
data << 176 << 280; data << 176 << 280;
else else
#ifdef Q_OS_WIN
data << 144 << 232;
#else
data << 140 << 232; data << 140 << 232;
#endif
} }
{ {

View File

@@ -4285,8 +4285,9 @@ namespace qthread {
Q_DECLARE_METATYPE(QHostAddress) Q_DECLARE_METATYPE(QHostAddress)
Q_DECLARE_METATYPE(QList<int>) Q_DECLARE_METATYPE(QList<int>)
Q_DECLARE_METATYPE(QStringList) Q_DECLARE_METATYPE(QStringList)
#define COMMA ,
Q_DECLARE_METATYPE(QMap<uint COMMA QStringList>) typedef QMap<uint, QStringList> QMapUIntQStringList;
Q_DECLARE_METATYPE(QMapUIntQStringList)
namespace qvariant { namespace qvariant {

View File

@@ -260,7 +260,6 @@ class JIRA:
def __initBugDict__(self): def __initBugDict__(self):
self.__bugs__= { self.__bugs__= {
'QTCREATORBUG-6853':self._workaroundCreator6853_, 'QTCREATORBUG-6853':self._workaroundCreator6853_,
'QTCREATORBUG-11548':self._workaroundCreator11548_
} }
# helper function - will be called if no workaround for the requested bug is deposited # helper function - will be called if no workaround for the requested bug is deposited
def _exitFatal_(self, bugType, number): def _exitFatal_(self, bugType, number):
@@ -271,56 +270,3 @@ class JIRA:
def _workaroundCreator6853_(self, *args): def _workaroundCreator6853_(self, *args):
if "Release" in args[0] and platform.system() == "Linux": if "Release" in args[0] and platform.system() == "Linux":
snooze(2) 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")

View File

@@ -57,7 +57,6 @@ def main():
else: else:
test.fail("Refactoring of Text to MyComponent failed in source file. Content of editor:\n%s" % codeText) 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" 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" # there should be new QML file generated with name "MyComponent.qml"
try: try:
waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", myCompTE, 3000) waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", myCompTE, 3000)
@@ -65,23 +64,18 @@ def main():
try: try:
waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", addBranchWildcardToRoot(myCompTE), 1000) waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", addBranchWildcardToRoot(myCompTE), 1000)
except: except:
test.xverify(False, "Refactoring failed - file MyComponent.qml was not generated " test.fail("Refactoring failed - file MyComponent.qml was not generated properly in project explorer")
"properly in project explorer (QTCREATORBUG-11548") #save and exit
try: invokeMenuItem("File", "Save All")
JIRA.performWorkaroundForBug(11548, JIRA.Bug.CREATOR, projectDir, "SampleApp", filePath) invokeMenuItem("File", "Exit")
except JIRA.JiraException: return
#save and exit test.passes("Refactoring - file MyComponent.qml was generated properly in project explorer")
invokeMenuItem("File", "Save All") # open MyComponent.qml file for verification
invokeMenuItem("File", "Exit") if not openDocument(myCompTE):
return test.fatal("Could not open MyComponent.qml.")
# following section is done by the workaround for 11548 already - uncomment when removing workaround invokeMenuItem("File", "Save All")
# test.passes("Refactoring - file MyComponent.qml was generated properly in project explorer") invokeMenuItem("File", "Exit")
# # open MyComponent.qml file for verification return
# 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") editorArea = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
codeText = str(editorArea.plainText) codeText = str(editorArea.plainText)
# there should be Text item in new file # there should be Text item in new file
@@ -92,6 +86,6 @@ def main():
#save and exit #save and exit
invokeMenuItem("File", "Save All") invokeMenuItem("File", "Save All")
# check if new file was created in file system # 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") "Verifying if MyComponent.qml exists in file system after save")
invokeMenuItem("File", "Exit") invokeMenuItem("File", "Exit")

View File

@@ -66,6 +66,9 @@ def main():
invokeMenuItem("File", "Exit") invokeMenuItem("File", "Exit")
def performTest(workingDir, projectName, targetCount, availableConfigs, disableOptimizer): 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: for kit, config in availableConfigs:
# switching from MSVC to MinGW build will fail on the clean step of 'Rebuild All' because # 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) # 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."): if not test.verify(recordButton.checked, "Verifying recording is enabled."):
test.log("Enabling recording for the test run") test.log("Enabling recording for the test run")
clickButton(recordButton) clickButton(recordButton)
clickButton(waitForObject(":Analyzer Toolbar.Start_QToolButton")) startButton = waitForObject(":Analyzer Toolbar.Start_QToolButton")
clickButton(startButton)
stopButton = waitForObject(":Qt Creator.Stop_QToolButton") stopButton = waitForObject(":Qt Creator.Stop_QToolButton")
elapsedLabel = waitForObject(":Analyzer Toolbar.Elapsed:_QLabel", 3000) elapsedLabel = waitForObject(":Analyzer Toolbar.Elapsed:_QLabel", 3000)
waitFor('"Elapsed: 5" in str(elapsedLabel.text)', 20000) waitFor('"Elapsed: 5" in str(elapsedLabel.text)', 20000)
clickButton(stopButton) 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"): if safeClickTab("JavaScript"):
model = findObject(":JavaScript.QmlProfilerEventsTable_QmlProfiler::" model = findObject(":JavaScript.QmlProfilerEventsTable_QmlProfiler::"
"Internal::QV8ProfilerEventsMainView").model() "Internal::QV8ProfilerEventsMainView").model()