Merge remote-tracking branch 'origin/3.0'

Conflicts:
	share/qtcreator/debugger/stdtypes.py
	src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.cpp

Change-Id: I5d86746d58960e41e01e725ccb2a6c00890f0dfd
This commit is contained in:
Eike Ziller
2013-12-18 11:02:16 +01:00
62 changed files with 552 additions and 202 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
The Qt Creator Manual lists known issues in Qt Creator: The Qt Creator Manual lists known issues in Qt Creator:
http://doc.qt.digia.com/qtcreator-snapshot/creator-known-issues.html http://qt-project.org/doc/qtcreator/creator-known-issues.html
For a complete list of reported issues, see the Qt Bug Tracker: For a complete list of reported issues, see the Qt Bug Tracker:
+16 -3
View File
@@ -151,8 +151,12 @@ macx {
INCLUDEPATH += \ INCLUDEPATH += \
$$IDE_BUILD_TREE/src \ # for <app/app_version.h> $$IDE_BUILD_TREE/src \ # for <app/app_version.h>
$$IDE_SOURCE_TREE/src/libs \ $$IDE_SOURCE_TREE/src/libs \
$$IDE_SOURCE_TREE/tools \ $$IDE_SOURCE_TREE/tools
$$IDE_SOURCE_TREE/src/plugins
QTC_PLUGIN_DIRS += $$IDE_SOURCE_TREE/src/plugins
for (dir, QTC_PLUGIN_DIRS) {
INCLUDEPATH += $$dir
}
CONFIG += depend_includepath CONFIG += depend_includepath
@@ -201,7 +205,16 @@ for(ever) {
break() break()
done_plugins += $$QTC_PLUGIN_DEPENDS done_plugins += $$QTC_PLUGIN_DEPENDS
for(dep, QTC_PLUGIN_DEPENDS) { for(dep, QTC_PLUGIN_DEPENDS) {
include($$PWD/src/plugins/$$dep/$${dep}_dependencies.pri) dependencies_file =
for(dir, QTC_PLUGIN_DIRS) {
exists($$dir/$$dep/$${dep}_dependencies.pri) {
dependencies_file = $$dir/$$dep/$${dep}_dependencies.pri
break()
}
}
isEmpty(dependencies_file): \
error("Plugin dependency $$dep not found")
include($$dependencies_file)
LIBS += -l$$qtLibraryName($$QTC_PLUGIN_NAME) LIBS += -l$$qtLibraryName($$QTC_PLUGIN_NAME)
} }
QTC_PLUGIN_DEPENDS = $$unique(QTC_PLUGIN_DEPENDS) QTC_PLUGIN_DEPENDS = $$unique(QTC_PLUGIN_DEPENDS)
+4
View File
@@ -339,6 +339,10 @@ class DumperBase:
def putByteArrayValue(self, value): def putByteArrayValue(self, value):
return self.putValue(self.encodeByteArray(value), Hex2EncodedLatin1) return self.putValue(self.encodeByteArray(value), Hex2EncodedLatin1)
def putByteArrayValueByAddress(self, addr):
self.putValue(self.encodeByteArrayHelper(self.dereference(addr)),
Hex2EncodedLatin1)
def putStringValueByAddress(self, addr): def putStringValueByAddress(self, addr):
self.putValue(self.encodeStringHelper(self.dereference(addr)), self.putValue(self.encodeStringHelper(self.dereference(addr)),
Hex4EncodedLittleEndian) Hex4EncodedLittleEndian)
+2 -1
View File
@@ -315,7 +315,8 @@ class Dumper(DumperBase):
if item.name is None: if item.name is None:
self.anonNumber += 1 self.anonNumber += 1
item.name = "#%d" % self.anonNumber item.name = "#%d" % self.anonNumber
item.iname = "%s.%s" % (self.currentIName, item.name) if not item.iname:
item.iname = "%s.%s" % (self.currentIName, item.name)
self.put('{') self.put('{')
#if not item.name is None: #if not item.name is None:
if isinstance(item.name, str): if isinstance(item.name, str):
+12 -2
View File
@@ -231,6 +231,17 @@ def qdump__QTime(d, value):
d.putNumChild(0) d.putNumChild(0)
def qdump__QTimeZone(d, value):
base = d.dereferenceValue(value)
if d.isNull(base):
d.putValue("(null)")
d.putNumChild(0)
return
idAddr = base + 2 * d.ptrSize() # [QSharedData] + [vptr]
d.putByteArrayValueByAddress(idAddr)
d.putPlainChildren(value["d"])
def qdump__QDateTime(d, value): def qdump__QDateTime(d, value):
qtVersion = d.qtVersion() qtVersion = d.qtVersion()
isValid = False isValid = False
@@ -1626,8 +1637,7 @@ def qdump__QSharedDataPointer(d, value):
d.putPlainChildren(value) d.putPlainChildren(value)
return return
d.putBetterType(d.currentType) d.putBetterType(d.currentType)
d.putItem(gdb.Value(d_ptr.cast(innerType.pointer())).dereference()) d.putItem(d_ptr.cast(innerType.pointer()).dereference())
# d.putItem(value.dereference())
def qdump__QSharedPointer(d, value): def qdump__QSharedPointer(d, value):
+1 -1
View File
@@ -132,9 +132,9 @@ def qdump__std__list(d, value):
qdump__std__list__QNX(d, value) qdump__std__list__QNX(d, value)
return return
head = d.dereferenceValue(value)
impl = value["_M_impl"] impl = value["_M_impl"]
node = impl["_M_node"] node = impl["_M_node"]
head = d.addressOf(node)
size = 0 size = 0
pp = d.dereference(head) pp = d.dereference(head)
while head != pp and size <= 1001: while head != pp and size <= 1001:
@@ -292,12 +292,12 @@ int GraphicalNodeInstance::penWidth() const
} }
QList<ServerNodeInstance> GraphicalNodeInstance::childItemsForChild(QQuickItem *childItem) const QList<ServerNodeInstance> GraphicalNodeInstance::childItemsForChild(QQuickItem *item) const
{ {
QList<ServerNodeInstance> instanceList; QList<ServerNodeInstance> instanceList;
if (childItem) { if (item) {
foreach (QQuickItem *childItem, childItem->childItems()) foreach (QQuickItem *childItem, item->childItems())
{ {
if (childItem && nodeInstanceServer()->hasInstanceForObject(childItem)) { if (childItem && nodeInstanceServer()->hasInstanceForObject(childItem)) {
instanceList.append(nodeInstanceServer()->instanceForObject(childItem)); instanceList.append(nodeInstanceServer()->instanceForObject(childItem));
@@ -69,7 +69,7 @@ protected:
QRectF boundingRectWithStepChilds(QQuickItem *parentItem) const; QRectF boundingRectWithStepChilds(QQuickItem *parentItem) const;
void resetHorizontal(); void resetHorizontal();
void resetVertical(); void resetVertical();
QList<ServerNodeInstance> childItemsForChild(QQuickItem *childItem) const; QList<ServerNodeInstance> childItemsForChild(QQuickItem *item) const;
void refresh(); void refresh();
static bool anyItemHasContent(QQuickItem *quickItem); static bool anyItemHasContent(QQuickItem *quickItem);
static bool childItemsHaveContent(QQuickItem *quickItem); static bool childItemsHaveContent(QQuickItem *quickItem);
@@ -42,6 +42,7 @@ import QtQuick 2.1
import HelperWidgets 2.0 import HelperWidgets 2.0
ButtonRow { ButtonRow {
enabled: anchorBackend.hasParent
id: buttonRow id: buttonRow
ButtonRowButton { ButtonRowButton {
@@ -35,9 +35,9 @@ import QtQuick.Controls.Styles 1.0
Controls.TextField { Controls.TextField {
Controls.Action { Controls.Action {
//Workaround to avoid that "Delete" deletes the item. //Workaround to avoid that "Delete" deletes the item.
shortcut: "Delete" shortcut: "Delete"
} }
id: lineEdit id: lineEdit
property variant backendValue property variant backendValue
@@ -62,20 +62,23 @@ Controls.TextField {
} }
} }
onEditingFinished: { onEditingFinished: {
if (backendValue.value !== text) if (backendValue.isTranslated) {
backendValue.value = text; backendValue.expression = "qsTr(\"" + trCheckbox.escapeString(text) + "\")"
}
onFocusChanged: {
if (focus) {
transaction.start();
} else { } else {
transaction.end(); if (lineEdit.backendValue.value !== text)
lineEdit.backendValue.value = text;
} }
} }
// onFocusChanged: {
// if (focus) {
// transaction.start();
// } else {
// transaction.end();
// }
// }
style: TextFieldStyle { style: TextFieldStyle {
selectionColor: lineEdit.textColor selectionColor: lineEdit.textColor
selectedTextColor: "black" selectedTextColor: "black"
@@ -112,12 +115,24 @@ Controls.TextField {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
id: trCheckbox id: trCheckbox
checked: backendValue.isTranslated
property bool isTranslated: colorLogic.backendValue.isTranslated
property bool backendValueValue: colorLogic.backendValue.value
onIsTranslatedChanged: {
checked = lineEdit.backendValue.isTranslated
}
onBackendValueValueChanged: {
checked = lineEdit.backendValue.isTranslated
}
onClicked: { onClicked: {
if (trCheckbox.checked) { if (trCheckbox.checked) {
backendValue.expression = "qsTr(\"" + escapeString(lineEdit.text) + "\")" lineEdit.backendValue.expression = "qsTr(\"" + escapeString(lineEdit.text) + "\")"
} else { } else {
backendValue.value = lineEdit.text var textValue = lineEdit.text
lineEdit.backendValue.value = textValue
} }
colorLogic.evaluate(); colorLogic.evaluate();
} }
@@ -137,7 +152,6 @@ Controls.TextField {
style: CheckBoxStyle { style: CheckBoxStyle {
spacing: 8 spacing: 8
label: Controls.Label { text: control.text ; color: checkBox.textColor }
indicator: Item { indicator: Item {
implicitWidth: 16 implicitWidth: 16
implicitHeight: 16 implicitHeight: 16
+2 -4
View File
@@ -37,14 +37,12 @@ Rectangle {
CustomizedGridView { CustomizedGridView {
id: grid id: grid
y: 82
height: grid.contentHeight
anchors.rightMargin: 38 anchors.rightMargin: 38
anchors.leftMargin: 38 anchors.leftMargin: 38
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
height: scrollView.height - 82
y: scrollView.flickableItem.contentY + 82
contentY: scrollView.flickableItem.contentY
model: examplesModel model: examplesModel
} }
@@ -38,22 +38,30 @@ GridView {
cellWidth: 216 cellWidth: 216
property int columns: Math.max(Math.floor(width / cellWidth), 1) property int columns: Math.max(Math.floor(width / cellWidth), 1)
delegate: Delegate { delegate: Loader {
id: delegate property int delegateOffset: cellHeight * Math.floor(index / columns) + 100
property bool isVisible: delegateOffset > scrollView.flickableItem.contentY - cellHeight
&& delegateOffset < scrollView.flickableItem.contentY + scrollView.flickableItem.height
onIsVisibleChanged: active = true
visible: isVisible
active: false
sourceComponent: Delegate {
id: delegate
property bool isHelpImage: model.imageUrl.search(/qthelp/) != -1 property bool isHelpImage: model.imageUrl.search(/qthelp/) != -1
property string sourcePrefix: isHelpImage ? "image://helpimage/" : "" property string sourcePrefix: isHelpImage ? "image://helpimage/" : ""
property string mockupSource: model.imageSource property string mockupSource: model.imageSource
property string helpSource: model.imageUrl !== "" ? sourcePrefix + encodeURI(model.imageUrl) : "" property string helpSource: model.imageUrl !== "" ? sourcePrefix + encodeURI(model.imageUrl) : ""
imageSource: isVideo ? "" : (model.imageSource === undefined ? helpSource : mockupSource) imageSource: isVideo ? "" : (model.imageSource === undefined ? helpSource : mockupSource)
videoSource: isVideo ? (model.imageSource === undefined ? model.imageUrl : mockupSource) : "" videoSource: isVideo ? (model.imageSource === undefined ? model.imageUrl : mockupSource) : ""
caption: model.name; caption: model.name;
description: model.description description: model.description
isVideo: model.isVideo === true isVideo: model.isVideo === true
videoLength: model.videoLength !== undefined ? model.videoLength : "" videoLength: model.videoLength !== undefined ? model.videoLength : ""
tags: model.tags tags: model.tags
}
} }
} }
@@ -271,9 +271,6 @@ bool AndroidDeployQtStep::init()
pp->setMacroExpander(bc->macroExpander()); pp->setMacroExpander(bc->macroExpander());
pp->setWorkingDirectory(bc->buildDirectory().toString()); pp->setWorkingDirectory(bc->buildDirectory().toString());
Utils::Environment env = bc->environment(); Utils::Environment env = bc->environment();
// Force output to english for the parsers. Do this here and not in the toolchain's
// addToEnvironment() to not screw up the users run environment.
env.set(QLatin1String("LC_ALL"), QLatin1String("C"));
pp->setEnvironment(env); pp->setEnvironment(env);
pp->setCommand(command); pp->setCommand(command);
pp->setArguments(Utils::QtcProcess::joinArgs(arguments)); pp->setArguments(Utils::QtcProcess::joinArgs(arguments));
+4 -4
View File
@@ -1264,9 +1264,9 @@ bool AndroidManager::checkKeystorePassword(const QString &keystorePath, const QS
<< keystorePasswd; << keystorePasswd;
QProcess proc; QProcess proc;
proc.start(AndroidConfigurations::instance().keytoolPath().toString(), arguments); proc.start(AndroidConfigurations::instance().keytoolPath().toString(), arguments);
if (!proc.waitForStarted(500)) if (!proc.waitForStarted(4000))
return false; return false;
if (!proc.waitForFinished(500)) { if (!proc.waitForFinished(4000)) {
proc.kill(); proc.kill();
proc.waitForFinished(); proc.waitForFinished();
return false; return false;
@@ -1293,9 +1293,9 @@ bool AndroidManager::checkCertificatePassword(const QString &keystorePath, const
QProcess proc; QProcess proc;
proc.start(AndroidConfigurations::instance().keytoolPath().toString(), arguments); proc.start(AndroidConfigurations::instance().keytoolPath().toString(), arguments);
if (!proc.waitForStarted(500)) if (!proc.waitForStarted(4000))
return false; return false;
if (!proc.waitForFinished(500)) { if (!proc.waitForFinished(4000)) {
proc.kill(); proc.kill();
proc.waitForFinished(); proc.waitForFinished();
return false; return false;
+3 -1
View File
@@ -111,6 +111,8 @@ void StickyNotesPasteProtocol::paste(const QString &text,
const QString &comment, const QString &comment,
const QString &description) const QString &description)
{ {
enum { maxDescriptionLength = 30 }; // Length of description is limited.
Q_UNUSED(username) Q_UNUSED(username)
Q_UNUSED(comment); Q_UNUSED(comment);
QTC_ASSERT(!m_pasteReply, return); QTC_ASSERT(!m_pasteReply, return);
@@ -124,7 +126,7 @@ void StickyNotesPasteProtocol::paste(const QString &text,
pasteData += expiryParameter(expiryDays); pasteData += expiryParameter(expiryDays);
if (!description.isEmpty()) { if (!description.isEmpty()) {
pasteData += "&title="; pasteData += "&title=";
pasteData += QUrl::toPercentEncoding(description); pasteData += QUrl::toPercentEncoding(description.left(maxDescriptionLength));
} }
m_pasteReply = httpPost(m_hostUrl + QLatin1String("api/xml/create"), pasteData); m_pasteReply = httpPost(m_hostUrl + QLatin1String("api/xml/create"), pasteData);
+2
View File
@@ -715,6 +715,7 @@ void CPPEditorWidget::setMimeType(const QString &mt)
QSharedPointer<SnapshotUpdater> updater QSharedPointer<SnapshotUpdater> updater
= m_modelManager->cppEditorSupport(editor())->snapshotUpdater(); = m_modelManager->cppEditorSupport(editor())->snapshotUpdater();
updater->setProjectPart(m_modelManager->projectPartForProjectFile(projectFile));
updater->setEditorDefines(additionalDirectives); updater->setEditorDefines(additionalDirectives);
m_preprocessorButton->setProperty("highlightWidget", !additionalDirectives.trimmed().isEmpty()); m_preprocessorButton->setProperty("highlightWidget", !additionalDirectives.trimmed().isEmpty());
@@ -1997,6 +1998,7 @@ void CPPEditorWidget::showPreProcessorWidget()
QSharedPointer<SnapshotUpdater> updater QSharedPointer<SnapshotUpdater> updater
= m_modelManager->cppEditorSupport(editor())->snapshotUpdater(); = m_modelManager->cppEditorSupport(editor())->snapshotUpdater();
const QString &additionals = preProcessorDialog.additionalPreProcessorDirectives(); const QString &additionals = preProcessorDialog.additionalPreProcessorDirectives();
updater->setProjectPart(preProcessorDialog.projectPart());
updater->setEditorDefines(additionals.toUtf8()); updater->setEditorDefines(additionals.toUtf8());
updater->update(m_modelManager->workingCopy()); updater->update(m_modelManager->workingCopy());
@@ -112,6 +112,11 @@ int CppPreProcessorDialog::exec()
return Accepted; return Accepted;
} }
CppTools::ProjectPart::Ptr CppPreProcessorDialog::projectPart() const
{
return m_partAdditions[m_ui->projectComboBox->currentIndex()].projectPart;
}
QString CppPreProcessorDialog::additionalPreProcessorDirectives() const QString CppPreProcessorDialog::additionalPreProcessorDirectives() const
{ {
return m_ui->editWidget->toPlainText(); return m_ui->editWidget->toPlainText();
@@ -50,6 +50,8 @@ public:
~CppPreProcessorDialog(); ~CppPreProcessorDialog();
int exec(); int exec();
CppTools::ProjectPart::Ptr projectPart() const;
QString additionalPreProcessorDirectives() const; QString additionalPreProcessorDirectives() const;
private slots: private slots:
+9 -2
View File
@@ -703,12 +703,14 @@ private:
/// Make sure that m_projectMutex is locked when calling this. /// Make sure that m_projectMutex is locked when calling this.
void CppModelManager::recalculateFileToProjectParts() void CppModelManager::recalculateFileToProjectParts()
{ {
m_projectFileToProjectPart.clear();
m_fileToProjectParts.clear(); m_fileToProjectParts.clear();
foreach (const ProjectInfo &projectInfo, m_projectToProjectsInfo) { foreach (const ProjectInfo &projectInfo, m_projectToProjectsInfo) {
foreach (const ProjectPart::Ptr &projectPart, projectInfo.projectParts()) { foreach (const ProjectPart::Ptr &projectPart, projectInfo.projectParts()) {
foreach (const ProjectFile &cxxFile, projectPart->files) { m_projectFileToProjectPart[projectPart->projectFile] = projectPart;
foreach (const ProjectFile &cxxFile, projectPart->files)
m_fileToProjectParts[cxxFile.path].append(projectPart); m_fileToProjectParts[cxxFile.path].append(projectPart);
}
} }
} }
} }
@@ -788,6 +790,11 @@ QFuture<void> CppModelManager::updateProjectInfo(const ProjectInfo &newProjectIn
return updateSourceFiles(filesToReindex, ForcedProgressNotification); return updateSourceFiles(filesToReindex, ForcedProgressNotification);
} }
ProjectPart::Ptr CppModelManager::projectPartForProjectFile(const QString &projectFile) const
{
return m_projectFileToProjectPart.value(projectFile);
}
QList<ProjectPart::Ptr> CppModelManager::projectPart(const QString &fileName) const QList<ProjectPart::Ptr> CppModelManager::projectPart(const QString &fileName) const
{ {
return m_fileToProjectParts.value(fileName); return m_fileToProjectParts.value(fileName);
+3
View File
@@ -74,6 +74,8 @@ public:
virtual ProjectInfo projectInfo(ProjectExplorer::Project *project) const; virtual ProjectInfo projectInfo(ProjectExplorer::Project *project) const;
virtual QFuture<void> updateProjectInfo(const ProjectInfo &newProjectInfo); virtual QFuture<void> updateProjectInfo(const ProjectInfo &newProjectInfo);
/// \return The project part with the given project file
virtual ProjectPart::Ptr projectPartForProjectFile(const QString &projectFile) const;
/// \return All project parts that mention the given file name as one of the sources/headers. /// \return All project parts that mention the given file name as one of the sources/headers.
virtual QList<ProjectPart::Ptr> projectPart(const QString &fileName) const; virtual QList<ProjectPart::Ptr> projectPart(const QString &fileName) const;
/// This is a fall-back function: find all files that includes the file directly or indirectly, /// This is a fall-back function: find all files that includes the file directly or indirectly,
@@ -198,6 +200,7 @@ private:
mutable QMutex m_projectMutex; mutable QMutex m_projectMutex;
QMap<ProjectExplorer::Project *, ProjectInfo> m_projectToProjectsInfo; QMap<ProjectExplorer::Project *, ProjectInfo> m_projectToProjectsInfo;
QMap<QString, QList<CppTools::ProjectPart::Ptr> > m_fileToProjectParts; QMap<QString, QList<CppTools::ProjectPart::Ptr> > m_fileToProjectParts;
QMap<QString, CppTools::ProjectPart::Ptr> m_projectFileToProjectPart;
// The members below are cached/(re)calculated from the projects and/or their project parts // The members below are cached/(re)calculated from the projects and/or their project parts
bool m_dirty; bool m_dirty;
QStringList m_projectFiles; QStringList m_projectFiles;
@@ -233,6 +233,7 @@ public:
virtual QList<ProjectInfo> projectInfos() const = 0; virtual QList<ProjectInfo> projectInfos() const = 0;
virtual ProjectInfo projectInfo(ProjectExplorer::Project *project) const = 0; virtual ProjectInfo projectInfo(ProjectExplorer::Project *project) const = 0;
virtual QFuture<void> updateProjectInfo(const ProjectInfo &pinfo) = 0; virtual QFuture<void> updateProjectInfo(const ProjectInfo &pinfo) = 0;
virtual ProjectPart::Ptr projectPartForProjectFile(const QString &projectFile) const = 0;
virtual QList<ProjectPart::Ptr> projectPart(const QString &fileName) const = 0; virtual QList<ProjectPart::Ptr> projectPart(const QString &fileName) const = 0;
virtual QList<ProjectPart::Ptr> projectPartFromDependencies(const QString &fileName) const = 0; virtual QList<ProjectPart::Ptr> projectPartFromDependencies(const QString &fileName) const = 0;
virtual ProjectPart::Ptr fallbackProjectPart() const = 0; virtual ProjectPart::Ptr fallbackProjectPart() const = 0;
+9 -3
View File
@@ -441,6 +441,11 @@ void GdbEngine::handleResponse(const QByteArray &buff)
// We get multiple *running after thread creation and in Windows terminals. // We get multiple *running after thread creation and in Windows terminals.
showMessage(QString::fromLatin1("NOTE: INFERIOR STILL RUNNING IN STATE %1."). showMessage(QString::fromLatin1("NOTE: INFERIOR STILL RUNNING IN STATE %1.").
arg(QLatin1String(DebuggerEngine::stateName(state())))); arg(QLatin1String(DebuggerEngine::stateName(state()))));
} else if (Utils::HostOsInfo::isWindowsHost() && (state() == InferiorStopRequested
|| state() == InferiorShutdownRequested)) {
// FIXME: Breakpoints on Windows are exceptions which are thrown in newly
// created threads so we have to filter out the running threads messages when
// we request a stop.
} else { } else {
notifyInferiorRunOk(); notifyInferiorRunOk();
} }
@@ -4997,9 +5002,10 @@ void GdbEngine::tryLoadPythonDumpers()
const QByteArray uninstalledData = gdbBinaryFile.absolutePath().toLocal8Bit() const QByteArray uninstalledData = gdbBinaryFile.absolutePath().toLocal8Bit()
+ "/data-directory/python"; + "/data-directory/python";
postCommand("python sys.path.insert(1, '" + dumperSourcePath + "')", ConsoleCommand); const GdbCommandFlags flags = ConsoleCommand | Immediate;
postCommand("python sys.path.append('" + uninstalledData + "')", ConsoleCommand); postCommand("python sys.path.insert(1, '" + dumperSourcePath + "')", flags);
postCommand("python from gdbbridge import *", ConsoleCommand, CB(handlePythonSetup)); postCommand("python sys.path.append('" + uninstalledData + "')", flags);
postCommand("python from gdbbridge import *", flags, CB(handlePythonSetup));
} }
void GdbEngine::reloadDebuggingHelpers() void GdbEngine::reloadDebuggingHelpers()
+3 -1
View File
@@ -201,7 +201,9 @@ IosRunConfigurationWidget::IosRunConfigurationWidget(IosRunConfiguration *runCon
updateValues(); updateValues();
connect(m_ui->argumentsLineEdit, SIGNAL(editingFinished()), connect(m_ui->argumentsLineEdit, SIGNAL(editingFinished()),
this, SLOT(argumentsLineEditTextEdited())); SLOT(argumentsLineEditTextEdited()));
connect(runConfiguration->target(), SIGNAL(buildDirectoryChanged()),
SLOT(updateValues()));
} }
IosRunConfigurationWidget::~IosRunConfigurationWidget() IosRunConfigurationWidget::~IosRunConfigurationWidget()
+2 -2
View File
@@ -286,8 +286,8 @@ void MacroManager::startMacro()
foreach (IMacroHandler *handler, d->handlers) foreach (IMacroHandler *handler, d->handlers)
handler->startRecording(d->currentMacro); handler->startRecording(d->currentMacro);
QString endShortcut = Core::ActionManager::command(Constants::END_MACRO)->defaultKeySequence().toString(); QString endShortcut = Core::ActionManager::command(Constants::END_MACRO)->keySequence().toString();
QString executeShortcut = Core::ActionManager::command(Constants::EXECUTE_LAST_MACRO)->defaultKeySequence().toString(); QString executeShortcut = Core::ActionManager::command(Constants::EXECUTE_LAST_MACRO)->keySequence().toString();
QString help = tr("Macro mode. Type \"%1\" to stop recording and \"%2\" to play the macro.") QString help = tr("Macro mode. Type \"%1\" to stop recording and \"%2\" to play the macro.")
.arg(endShortcut).arg(executeShortcut); .arg(endShortcut).arg(executeShortcut);
Core::EditorManager::showEditorStatusBar( Core::EditorManager::showEditorStatusBar(
+13 -4
View File
@@ -462,12 +462,12 @@ QString MsvcToolChainFactory::vcVarsBatFor(const QString &basePath, const QStrin
return basePath + QLatin1String("/SetEnv.cmd"); return basePath + QLatin1String("/SetEnv.cmd");
if (toolchainName == QLatin1String("x86")) if (toolchainName == QLatin1String("x86"))
return basePath + QLatin1String("/bin/vcvars32.bat"); return basePath + QLatin1String("/bin/vcvars32.bat");
if (toolchainName == QLatin1String("amd64_arm"))
return basePath + QLatin1String("/bin/amd64_arm/vcvarsamd64_arm.bat");
if (toolchainName == QLatin1String("x86_amd64")) if (toolchainName == QLatin1String("x86_amd64"))
return basePath + QLatin1String("/bin/x86_amd64/vcvarsx86_amd64.bat"); return basePath + QLatin1String("/bin/x86_amd64/vcvarsx86_amd64.bat");
if (toolchainName == QLatin1String("amd64")) if (toolchainName == QLatin1String("amd64"))
return basePath + QLatin1String("/bin/amd64/vcvars64.bat"); return basePath + QLatin1String("/bin/amd64/vcvars64.bat");
if (toolchainName == QLatin1String("x86_amd64"))
return basePath + QLatin1String("/bin/x86_amd64/vcvarsx86_amd64.bat");
if (toolchainName == QLatin1String("x86_arm")) if (toolchainName == QLatin1String("x86_arm"))
return basePath + QLatin1String("/bin/x86_arm/vcvarsx86_arm.bat"); return basePath + QLatin1String("/bin/x86_arm/vcvarsx86_arm.bat");
if (toolchainName == QLatin1String("arm")) if (toolchainName == QLatin1String("arm"))
@@ -567,12 +567,21 @@ QList<ToolChain *> MsvcToolChainFactory::autoDetect()
} }
} }
if (arch == Utils::HostOsInfo::HostArchitectureX86 if (arch == Utils::HostOsInfo::HostArchitectureX86) {
|| arch == Utils::HostOsInfo::HostArchitectureAMD64) {
if (QFileInfo(vcVarsBatFor(path, QLatin1String("x86_arm"))).isFile()) if (QFileInfo(vcVarsBatFor(path, QLatin1String("x86_arm"))).isFile())
results.append(new MsvcToolChain(generateDisplayName(vsName, MsvcToolChain::VS, MsvcToolChain::arm), results.append(new MsvcToolChain(generateDisplayName(vsName, MsvcToolChain::VS, MsvcToolChain::arm),
findAbiOfMsvc(MsvcToolChain::VS, MsvcToolChain::arm, vsName), findAbiOfMsvc(MsvcToolChain::VS, MsvcToolChain::arm, vsName),
vcvarsAllbat, QLatin1String("x86_arm"), ToolChain::AutoDetection)); vcvarsAllbat, QLatin1String("x86_arm"), ToolChain::AutoDetection));
} else if (arch == Utils::HostOsInfo::HostArchitectureAMD64) {
if (QFileInfo(vcVarsBatFor(path, QLatin1String("amd64_arm"))).isFile()) {
results.append(new MsvcToolChain(generateDisplayName(vsName, MsvcToolChain::VS, MsvcToolChain::arm),
findAbiOfMsvc(MsvcToolChain::VS, MsvcToolChain::arm, vsName),
vcvarsAllbat, QLatin1String("amd64_arm"), ToolChain::AutoDetection));
} else if (QFileInfo(vcVarsBatFor(path, QLatin1String("x86_arm"))).isFile()) {
results.append(new MsvcToolChain(generateDisplayName(vsName, MsvcToolChain::VS, MsvcToolChain::arm),
findAbiOfMsvc(MsvcToolChain::VS, MsvcToolChain::arm, vsName),
vcvarsAllbat, QLatin1String("x86_arm"), ToolChain::AutoDetection));
}
} else if (arch == Utils::HostOsInfo::HostArchitectureArm) { } else if (arch == Utils::HostOsInfo::HostArchitectureArm) {
if (QFileInfo(vcVarsBatFor(path, QLatin1String("arm"))).isFile()) if (QFileInfo(vcVarsBatFor(path, QLatin1String("arm"))).isFile())
results.append(new MsvcToolChain(generateDisplayName(vsName, MsvcToolChain::VS, MsvcToolChain::arm), results.append(new MsvcToolChain(generateDisplayName(vsName, MsvcToolChain::VS, MsvcToolChain::arm),
+3 -1
View File
@@ -177,7 +177,7 @@ void Target::changeRunConfigurationEnabled()
void Target::onBuildDirectoryChanged() void Target::onBuildDirectoryChanged()
{ {
BuildConfiguration *bc = qobject_cast<BuildConfiguration *>(sender()); BuildConfiguration *bc = qobject_cast<BuildConfiguration *>(sender());
if (bc) if (bc && activeBuildConfiguration() == bc)
emit buildDirectoryChanged(); emit buildDirectoryChanged();
} }
@@ -238,6 +238,8 @@ void Target::addBuildConfiguration(BuildConfiguration *configuration)
SLOT(changeEnvironment())); SLOT(changeEnvironment()));
connect(configuration, SIGNAL(enabledChanged()), connect(configuration, SIGNAL(enabledChanged()),
this, SLOT(changeBuildConfigurationEnabled())); this, SLOT(changeBuildConfigurationEnabled()));
connect(configuration, SIGNAL(buildDirectoryChanged()),
SLOT(onBuildDirectoryChanged()));
if (!activeBuildConfiguration()) if (!activeBuildConfiguration())
setActiveBuildConfiguration(configuration); setActiveBuildConfiguration(configuration);
@@ -65,7 +65,6 @@ QbsBuildConfiguration::QbsBuildConfiguration(ProjectExplorer::Target *target) :
connect(project(), SIGNAL(projectParsingStarted()), this, SIGNAL(enabledChanged())); connect(project(), SIGNAL(projectParsingStarted()), this, SIGNAL(enabledChanged()));
connect(project(), SIGNAL(projectParsingDone(bool)), this, SIGNAL(enabledChanged())); connect(project(), SIGNAL(projectParsingDone(bool)), this, SIGNAL(enabledChanged()));
connect(this, SIGNAL(buildDirectoryChanged()), target, SLOT(onBuildDirectoryChanged()));
ProjectExplorer::BuildStepList *bsl ProjectExplorer::BuildStepList *bsl
= stepList(Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)); = stepList(Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD));
connect(bsl, SIGNAL(stepInserted(int)), this, SLOT(buildStepInserted(int))); connect(bsl, SIGNAL(stepInserted(int)), this, SLOT(buildStepInserted(int)));
@@ -179,7 +179,10 @@ void PropertyEditorQmlBackend::createPropertyEditorValue(const QmlObjectNode &qm
qmlObjectNode.modelNode().property(propertyName).isBindingProperty()) { qmlObjectNode.modelNode().property(propertyName).isBindingProperty()) {
valueObject->setExpression(qmlObjectNode.modelNode().bindingProperty(propertyName).expression()); valueObject->setExpression(qmlObjectNode.modelNode().bindingProperty(propertyName).expression());
} else { } else {
valueObject->setExpression(qmlObjectNode.instanceValue(name).toString()); if (qmlObjectNode.hasBindingProperty(propertyName))
valueObject->setExpression(qmlObjectNode.expression(name));
else
valueObject->setExpression(qmlObjectNode.instanceValue(name).toString());
} }
} }
@@ -190,6 +193,7 @@ void PropertyEditorQmlBackend::setValue(const QmlObjectNode & qmlObjectNode, con
PropertyEditorValue *propertyValue = qobject_cast<PropertyEditorValue*>(variantToQObject(m_backendValuesPropertyMap.value(propertyName))); PropertyEditorValue *propertyValue = qobject_cast<PropertyEditorValue*>(variantToQObject(m_backendValuesPropertyMap.value(propertyName)));
if (propertyValue) { if (propertyValue) {
propertyValue->setValue(value); propertyValue->setValue(value);
if (!qmlObjectNode.hasBindingProperty(name)) if (!qmlObjectNode.hasBindingProperty(name))
propertyValue->setExpression(value.toString()); propertyValue->setExpression(value.toString());
else else
@@ -34,6 +34,7 @@
#include <nodeproperty.h> #include <nodeproperty.h>
#include <nodemetainfo.h> #include <nodemetainfo.h>
#include <qmlobjectnode.h> #include <qmlobjectnode.h>
#include <bindingproperty.h>
//using namespace QmlDesigner; //using namespace QmlDesigner;
@@ -159,7 +160,6 @@ QString PropertyEditorValue::enumeration() const
QString PropertyEditorValue::expression() const QString PropertyEditorValue::expression() const
{ {
return m_expression; return m_expression;
} }
@@ -224,17 +224,22 @@ void PropertyEditorValue::setIsValid(bool valid)
bool PropertyEditorValue::isTranslated() const bool PropertyEditorValue::isTranslated() const
{ {
if (modelNode().isValid() && modelNode().metaInfo().isValid() && modelNode().metaInfo().hasProperty(name())) if (modelNode().isValid() && modelNode().metaInfo().isValid() && modelNode().metaInfo().hasProperty(name())) {
if (modelNode().metaInfo().propertyTypeName(name()) == "QString" || modelNode().metaInfo().propertyTypeName(name()) == "string") { if (modelNode().metaInfo().propertyTypeName(name()) == "QString" || modelNode().metaInfo().propertyTypeName(name()) == "string") {
const QmlDesigner::QmlObjectNode objectNode(modelNode()); const QmlDesigner::QmlObjectNode objectNode(modelNode());
if (objectNode.isValid() && objectNode.hasBindingProperty(name())) { if (objectNode.isValid() && objectNode.hasBindingProperty(name())) {
//qsTr()
QRegExp rx("qsTr(\"*\")"); QRegExp rx("qsTr(\"*\")");
//qsTr()
rx.setPatternSyntax(QRegExp::Wildcard); rx.setPatternSyntax(QRegExp::Wildcard);
return rx.exactMatch(expression()); if (objectNode.propertyAffectedByCurrentState(name())) {
return rx.exactMatch(expression());
} else {
return rx.exactMatch(modelNode().bindingProperty(name()).expression());
}
} }
return false; return false;
} }
}
return false; return false;
} }
@@ -86,7 +86,7 @@ class PropertyEditorValue : public QObject
Q_PROPERTY(bool isInSubState READ isInSubState NOTIFY valueChangedQml FINAL) Q_PROPERTY(bool isInSubState READ isInSubState NOTIFY valueChangedQml FINAL)
Q_PROPERTY(bool isBound READ isBound NOTIFY isBoundChanged FINAL) Q_PROPERTY(bool isBound READ isBound NOTIFY isBoundChanged FINAL)
Q_PROPERTY(bool isValid READ isValid NOTIFY isValidChanged FINAL) Q_PROPERTY(bool isValid READ isValid NOTIFY isValidChanged FINAL)
Q_PROPERTY(bool isTranslated READ isTranslated NOTIFY valueChangedQml FINAL) Q_PROPERTY(bool isTranslated READ isTranslated NOTIFY expressionChanged FINAL)
Q_PROPERTY(QString name READ name FINAL) Q_PROPERTY(QString name READ name FINAL)
Q_PROPERTY(PropertyEditorNodeWrapper* complexNode READ complexNode NOTIFY complexNodeChanged FINAL) Q_PROPERTY(PropertyEditorNodeWrapper* complexNode READ complexNode NOTIFY complexNodeChanged FINAL)
@@ -226,6 +226,8 @@ MetaInfo {
Property { name: "width"; type: "int"; value: 360; } Property { name: "width"; type: "int"; value: 360; }
Property { name: "height"; type: "int"; value: 300; } Property { name: "height"; type: "int"; value: 300; }
Property { name: "title"; type: "binding"; value: "qsTr(\"Check Box\")"; }
} }
} }
+1 -2
View File
@@ -42,7 +42,6 @@ using namespace QmlJSTools;
void QmlJSTools::Internal::QmlJSToolsPlugin::test_basic() void QmlJSTools::Internal::QmlJSToolsPlugin::test_basic()
{ {
return;
QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance(); QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance();
const QString welcomescreenRootPath = Core::ICore::resourcePath() + QLatin1String("/welcomescreen/welcomescreen.qml"); const QString welcomescreenRootPath = Core::ICore::resourcePath() + QLatin1String("/welcomescreen/welcomescreen.qml");
@@ -57,7 +56,7 @@ void QmlJSTools::Internal::QmlJSToolsPlugin::test_basic()
QVERIFY(context); QVERIFY(context);
const CppComponentValue *rectangleValue = context->valueOwner()->cppQmlTypes().objectByQualifiedName( const CppComponentValue *rectangleValue = context->valueOwner()->cppQmlTypes().objectByQualifiedName(
QLatin1String("QtQuick"), QLatin1String("QDeclarative1Rectangle"), LanguageUtils::ComponentVersion(1, 0)); QLatin1String("QtQuick"), QLatin1String("QDeclarativeRectangle"), LanguageUtils::ComponentVersion(2, 1));
QVERIFY(rectangleValue); QVERIFY(rectangleValue);
QVERIFY(!rectangleValue->isWritable(QLatin1String("border"))); QVERIFY(!rectangleValue->isWritable(QLatin1String("border")));
QVERIFY(rectangleValue->hasProperty(QLatin1String("border"))); QVERIFY(rectangleValue->hasProperty(QLatin1String("border")));
@@ -96,11 +96,10 @@ void QmlProfilerEventsModelProxy::limitToRange(qint64 rangeStart, qint64 rangeEn
void QmlProfilerEventsModelProxy::dataChanged() void QmlProfilerEventsModelProxy::dataChanged()
{ {
if (d->modelManager->state() == QmlProfilerDataState::ProcessingData)
loadData();
if (d->modelManager->state() == QmlProfilerDataState::ClearingData) if (d->modelManager->state() == QmlProfilerDataState::ClearingData)
clear(); clear();
else
loadData();
} }
QSet<QString> QmlProfilerEventsModelProxy::eventsInBindingLoop() const QSet<QString> QmlProfilerEventsModelProxy::eventsInBindingLoop() const
@@ -114,9 +114,10 @@ QmlProfilerProcessedModel::~QmlProfilerProcessedModel()
void QmlProfilerProcessedModel::clear() void QmlProfilerProcessedModel::clear()
{ {
m_detailsRewriter->clearRequests(); m_detailsRewriter->clearRequests();
// This call emits changed(). Don't emit it again here.
QmlProfilerSimpleModel::clear(); QmlProfilerSimpleModel::clear();
emit changed();
m_emitChanged = false; m_emitChanged = false;
} }
@@ -155,8 +156,9 @@ void QmlProfilerProcessedModel::complete()
m_detailsRewriter->reloadDocuments(); m_detailsRewriter->reloadDocuments();
// This call emits changed(). Don't emit it again here.
QmlProfilerSimpleModel::complete(); QmlProfilerSimpleModel::complete();
emit changed();
m_emitChanged = false; m_emitChanged = false;
} }
+8 -2
View File
@@ -123,12 +123,18 @@ bool TodoOutputPane::canPrevious() const
void TodoOutputPane::goToNext() void TodoOutputPane::goToNext()
{ {
m_todoTreeView->selectionModel()->select(nextModelIndex(), QItemSelectionModel::SelectCurrent); const QModelIndex nextIndex = nextModelIndex();
m_todoTreeView->selectionModel()->setCurrentIndex(nextIndex, QItemSelectionModel::SelectCurrent
| QItemSelectionModel::Rows);
todoTreeViewClicked(nextIndex);
} }
void TodoOutputPane::goToPrev() void TodoOutputPane::goToPrev()
{ {
m_todoTreeView->selectionModel()->select(previousModelIndex(), QItemSelectionModel::SelectCurrent); const QModelIndex prevIndex = previousModelIndex();
m_todoTreeView->selectionModel()->setCurrentIndex(prevIndex, QItemSelectionModel::SelectCurrent
| QItemSelectionModel::Rows);
todoTreeViewClicked(prevIndex);
} }
void TodoOutputPane::setScanningScope(ScanningScope scanningScope) void TodoOutputPane::setScanningScope(ScanningScope scanningScope)
+1
View File
@@ -48,6 +48,7 @@ TodoOutputTreeView::TodoOutputTreeView(QWidget *parent) :
setFrameStyle(QFrame::NoFrame); setFrameStyle(QFrame::NoFrame);
setSortingEnabled(true); setSortingEnabled(true);
setAttribute(Qt::WA_MacShowFocusRect, false); setAttribute(Qt::WA_MacShowFocusRect, false);
setSelectionBehavior(QTreeView::SelectRows);
header()->setResizeMode(QHeaderView::Interactive); header()->setResizeMode(QHeaderView::Interactive);
header()->setStretchLastSection(true); header()->setStretchLastSection(true);
+11 -1
View File
@@ -91,6 +91,9 @@ UpdateInfoPlugin::UpdateInfoPlugin()
UpdateInfoPlugin::~UpdateInfoPlugin() UpdateInfoPlugin::~UpdateInfoPlugin()
{ {
d->lastCheckUpdateInfoTask.cancel();
d->lastCheckUpdateInfoTask.waitForFinished();
delete d; delete d;
} }
@@ -230,7 +233,14 @@ QDomDocument UpdateInfoPlugin::update()
// start // start
QProcess updater; QProcess updater;
updater.start(d->updaterProgram, QStringList() << d->updaterCheckOnlyArgument); updater.start(d->updaterProgram, QStringList() << d->updaterCheckOnlyArgument);
updater.waitForFinished(); while (updater.state() != QProcess::NotRunning) {
if (!updater.waitForFinished(1000)
&& d->lastCheckUpdateInfoTask.isCanceled()) {
updater.kill();
updater.waitForFinished(-1);
return QDomDocument();
}
}
// process return value // process return value
QDomDocument updates; QDomDocument updates;
@@ -124,6 +124,7 @@ public:
document->setUtf8Source(preprocessedSource); document->setUtf8Source(preprocessedSource);
QVERIFY(document->parse(parseMode)); QVERIFY(document->parse(parseMode));
document->check(); document->check();
QVERIFY(document->diagnosticMessages().isEmpty());
snapshot.insert(document); snapshot.insert(document);
} }
@@ -263,12 +264,14 @@ void tst_CheckSymbols::test_checksymbols_EnumerationUse()
{ {
const QByteArray source = const QByteArray source =
"enum E { Red, Green, Blue };\n" "enum E { Red, Green, Blue };\n"
"E e = Red\n"; "E e = Red;\n";
const QList<Use> expectedUses = QList<Use>() const QList<Use> expectedUses = QList<Use>()
<< Use(1, 6, 1, CppHighlightingSupport::TypeUse) << Use(1, 6, 1, CppHighlightingSupport::TypeUse)
<< Use(1, 10, 3, CppHighlightingSupport::EnumerationUse) << Use(1, 10, 3, CppHighlightingSupport::EnumerationUse)
<< Use(1, 15, 5, CppHighlightingSupport::EnumerationUse) << Use(1, 15, 5, CppHighlightingSupport::EnumerationUse)
<< Use(1, 22, 4, CppHighlightingSupport::EnumerationUse) << Use(1, 22, 4, CppHighlightingSupport::EnumerationUse)
<< Use(2, 1, 1, CppHighlightingSupport::TypeUse)
<< Use(2, 7, 3, CppHighlightingSupport::EnumerationUse)
; ;
TestData::check(source, expectedUses); TestData::check(source, expectedUses);
@@ -313,7 +316,7 @@ void tst_CheckSymbols::test_checksymbols_MacroUse()
{ {
const QByteArray source = const QByteArray source =
"#define FOO 1+1\n" "#define FOO 1+1\n"
"int f() { FOO }\n"; "int f() { FOO; }\n";
const QList<Use> macroUses = QList<Use>() const QList<Use> macroUses = QList<Use>()
<< Use(1, 9, 3, CppHighlightingSupport::MacroUse) << Use(1, 9, 3, CppHighlightingSupport::MacroUse)
<< Use(2, 11, 3, CppHighlightingSupport::MacroUse); << Use(2, 11, 3, CppHighlightingSupport::MacroUse);
@@ -877,7 +880,7 @@ void tst_CheckSymbols::test_checksymbols_QTCREATORBUG8974_danglingPointer()
" Singleton<INIManager>::instance().bar();\n" " Singleton<INIManager>::instance().bar();\n"
" Singleton<INIManager>::instance().bar();\n" " Singleton<INIManager>::instance().bar();\n"
" Singleton<INIManager>::instance().bar();\n" " Singleton<INIManager>::instance().bar();\n"
"};\n" "}\n"
; ;
const QList<Use> expectedUses = QList<Use>() const QList<Use> expectedUses = QList<Use>()
@@ -1477,7 +1480,7 @@ void tst_CheckSymbols::test_checksymbols_QTCREATORBUG9098()
" {\n" " {\n"
" b.c;\n" " b.c;\n"
" }\n" " }\n"
"}\n" "};\n"
; ;
const QList<Use> expectedUses = QList<Use>() const QList<Use> expectedUses = QList<Use>()
+26
View File
@@ -1298,6 +1298,21 @@ void tst_Dumpers::dumper_data()
% Check("c", "'x' (120)", "@QChar").setForCdbOnly() % Check("c", "'x' (120)", "@QChar").setForCdbOnly()
% Check("c", "120", "@QChar").setEngines(DumpTestGdbEngine | DumpTestLldbEngine); % Check("c", "120", "@QChar").setEngines(DumpTestGdbEngine | DumpTestLldbEngine);
QTest::newRow("QTimeZone0")
<< Data("#include <QTimeZone>\n",
"QTimeZone tz;\n"
"unused(&tz);\n")
% CoreProfile()
% Check("tz", "(null)", "@QTimeZone");
QTest::newRow("QTimeZone1")
<< Data("#include <QTimeZone>\n",
"QTimeZone tz(\"UTC+05:00\");\n"
"unused(&tz);\n")
% CoreProfile()
% Check("tz", "\"UTC+05:00\"", "@QTimeZone")
% Check("tz.d.m_name", "\"UTC+05:00\"", "@QString");
QTest::newRow("QDate0") QTest::newRow("QDate0")
<< Data("#include <QDate>\n", << Data("#include <QDate>\n",
"QDate date;\n" "QDate date;\n"
@@ -5079,6 +5094,17 @@ void tst_Dumpers::dumper_data()
% Check("u32", "68", "uint32_t") % Check("u32", "68", "uint32_t")
% Check("s32", "69", "int32_t"); % Check("s32", "69", "int32_t");
QTest::newRow("stdlist2")
<< Data("#include <list>\n"
"struct Base { virtual ~Base() {} };\n"
"template<class T>\n"
"struct Derived : public std::list<T>, Base {};\n",
"Derived<int> l;\n"
"l.push_back(1);\n"
"l.push_back(2);\n")
% Check("l.@1.0", "[0]", "1", "int")
% Check("l.@1.1", "[1]", "2", "int");
} }
int main(int argc, char *argv[]) int main(int argc, char *argv[])
@@ -116,6 +116,12 @@
#define USE_SHARED_POINTER 0 #define USE_SHARED_POINTER 0
#endif #endif
#if QT_VERSION >= 0x050200
#define USE_TIMEZONE 1
#else
#define USE_TIMEZONE 0
#endif
void dummyStatement(...) {} void dummyStatement(...) {}
#if USE_CXX11 && defined(__GNUC__) && defined(__STRICT_ANSI__) #if USE_CXX11 && defined(__GNUC__) && defined(__STRICT_ANSI__)
@@ -146,6 +152,10 @@ void dummyStatement(...) {}
#include <QSharedPointer> #include <QSharedPointer>
#endif #endif
#if USE_TIMEZONE
#include <QTimeZone>
#endif
#if USE_GUILIB #if USE_GUILIB
#include <QAction> #include <QAction>
#include <QApplication> // QWidgets: Separate module as of Qt 5 #include <QApplication> // QWidgets: Separate module as of Qt 5
@@ -158,6 +168,7 @@ void dummyStatement(...) {}
#include <QStandardItemModel> #include <QStandardItemModel>
#include <QTextCursor> #include <QTextCursor>
#include <QTextDocument> #include <QTextDocument>
#include <QTimeZone>
#endif #endif
#if USE_SCRIPTLIB #if USE_SCRIPTLIB
@@ -698,6 +709,14 @@ namespace undefined {
namespace qdatetime { namespace qdatetime {
void testQTimeZone()
{
QTimeZone zz;
QTimeZone tz("UTC+05:00");
BREAK_HERE;
dummyStatement(&zz, &tz);
}
void testQDate() void testQDate()
{ {
QDate date; QDate date;
@@ -758,6 +777,7 @@ namespace qdatetime {
void testDateTime() void testDateTime()
{ {
testQTimeZone();
testQDate(); testQDate();
testQDateTime(); testQDateTime();
testQTime(); testQTime();
@@ -5475,6 +5495,7 @@ namespace basic {
void testLongEvaluation1() void testLongEvaluation1()
{ {
#if USE_TIMEZONE
QTimeZone tz("UTC+05:00"); QTimeZone tz("UTC+05:00");
QDateTime time = QDateTime::currentDateTime(); QDateTime time = QDateTime::currentDateTime();
const int N = 10000; const int N = 10000;
@@ -5495,6 +5516,7 @@ namespace basic {
// Continue. // Continue.
// Note: This is expected to _not_ take up to a minute. // Note: This is expected to _not_ take up to a minute.
dummyStatement(&bigv); dummyStatement(&bigv);
#endif
} }
void testLongEvaluation2() void testLongEvaluation2()
@@ -7039,6 +7061,7 @@ template <class X> int ffff(X x)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
int z = ffff(3) + ffff(2.0); int z = ffff(3) + ffff(2.0);
Q_UNUSED(z);
#if USE_GUILIB #if USE_GUILIB
QApplication app(argc, argv); QApplication app(argc, argv);
+17 -1
View File
@@ -64,6 +64,7 @@
:Debugger Toolbar.Continue_QToolButton {container=':DebugModeWidget.Debugger Toolbar_QDockWidget' text='Continue' type='QToolButton' unnamed='1' visible='1'} :Debugger Toolbar.Continue_QToolButton {container=':DebugModeWidget.Debugger Toolbar_QDockWidget' text='Continue' type='QToolButton' unnamed='1' visible='1'}
:Debugger Toolbar.Exit Debugger_QToolButton {container=':DebugModeWidget.Debugger Toolbar_QDockWidget' text='Stop Debugger' type='QToolButton' unnamed='1' visible='1'} :Debugger Toolbar.Exit Debugger_QToolButton {container=':DebugModeWidget.Debugger Toolbar_QDockWidget' text='Stop Debugger' type='QToolButton' unnamed='1' visible='1'}
:Debugger Toolbar.StatusText_Utils::StatusLabel {container=':DebugModeWidget.Debugger Toolbar_QDockWidget' type='Utils::StatusLabel' unnamed='1'} :Debugger Toolbar.StatusText_Utils::StatusLabel {container=':DebugModeWidget.Debugger Toolbar_QDockWidget' type='Utils::StatusLabel' unnamed='1'}
:Description.description_Utils::CompletingTextEdit {container=':splitter.Description_QGroupBox' name='description' type='Utils::CompletingTextEdit' visible='1'}
:Dialog.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Dialog_QmlJSEditor::Internal::ComponentNameDialog'} :Dialog.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Dialog_QmlJSEditor::Internal::ComponentNameDialog'}
:Dialog.componentNameEdit_QLineEdit {name='componentNameEdit' type='Utils::ClassNameValidatingLineEdit' visible='1' window=':Dialog_QmlJSEditor::Internal::ComponentNameDialog'} :Dialog.componentNameEdit_QLineEdit {name='componentNameEdit' type='Utils::ClassNameValidatingLineEdit' visible='1' window=':Dialog_QmlJSEditor::Internal::ComponentNameDialog'}
:Dialog_Debugger::Internal::SymbolPathsDialog {name='Debugger__Internal__SymbolPathsDialog' type='Debugger::Internal::SymbolPathsDialog' visible='1' windowTitle='Dialog'} :Dialog_Debugger::Internal::SymbolPathsDialog {name='Debugger__Internal__SymbolPathsDialog' type='Debugger::Internal::SymbolPathsDialog' visible='1' windowTitle='Dialog'}
@@ -75,6 +76,7 @@
:File has been removed.Close_QPushButton {text='Close' type='QPushButton' unnamed='1' visible='1' window=':File has been removed_QMessageBox'} :File has been removed.Close_QPushButton {text='Close' type='QPushButton' unnamed='1' visible='1' window=':File has been removed_QMessageBox'}
:File has been removed.Save_QPushButton {text='Save' type='QPushButton' unnamed='1' visible='1' window=':File has been removed_QMessageBox'} :File has been removed.Save_QPushButton {text='Save' type='QPushButton' unnamed='1' visible='1' window=':File has been removed_QMessageBox'}
:File has been removed_QMessageBox {text?='The file * removed*. Do you want to save it under a different name, or close the editor?' type='QMessageBox' unnamed='1' visible='1'} :File has been removed_QMessageBox {text?='The file * removed*. Do you want to save it under a different name, or close the editor?' type='QMessageBox' unnamed='1' visible='1'}
:Files.Check all_QCheckBox {container=':splitter.Files_QGroupBox' name='checkAllCheckBox' text='Check all' type='QCheckBox' visible='1'}
:Form.Startup_QGroupBox {container=':qt_tabwidget_stackedwidget.Form_QWidget' name='startupGroupBox' title='Startup' type='QGroupBox' visible='1'} :Form.Startup_QGroupBox {container=':qt_tabwidget_stackedwidget.Form_QWidget' name='startupGroupBox' title='Startup' type='QGroupBox' visible='1'}
:FormEditorStack.CheckBox_QCheckBox {container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack' name='checkBox' text='CheckBox' type='QCheckBox' visible='1'} :FormEditorStack.CheckBox_QCheckBox {container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack' name='checkBox' text='CheckBox' type='QCheckBox' visible='1'}
:FormEditorStack.PushButton_QPushButton {container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack' name='pushButton' text='PushButton' type='QPushButton' visible='1'} :FormEditorStack.PushButton_QPushButton {container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack' name='pushButton' text='PushButton' type='QPushButton' visible='1'}
@@ -98,6 +100,9 @@
:Kits_Or_Compilers_QTreeView {container=':qt_tabwidget_stackedwidget_QWidget' type='QTreeView' unnamed='1' visible='1'} :Kits_Or_Compilers_QTreeView {container=':qt_tabwidget_stackedwidget_QWidget' type='QTreeView' unnamed='1' visible='1'}
:Kits_QtVersion_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' occurrence='5' type='QComboBox' unnamed='1' visible='1'} :Kits_QtVersion_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' occurrence='5' type='QComboBox' unnamed='1' visible='1'}
:Locals and Expressions_Debugger::Internal::WatchTreeView {container=':DebugModeWidget.Locals and Expressions_QDockWidget' name='WatchWindow' type='Debugger::Internal::WatchTreeView' visible='1' windowTitle='Locals and Expressions'} :Locals and Expressions_Debugger::Internal::WatchTreeView {container=':DebugModeWidget.Locals and Expressions_QDockWidget' name='WatchWindow' type='Debugger::Internal::WatchTreeView' visible='1' windowTitle='Locals and Expressions'}
:New Text File.Add to project:_QLabel {name='projectLabel' text='Add to project:' type='QLabel' visible='1' window=':New Text File_Utils::FileWizardDialog'}
:New Text File.nameLineEdit_Utils::FileNameValidatingLineEdit {name='nameLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1' window=':New Text File_Utils::FileWizardDialog'}
:New Text File_Utils::FileWizardDialog {type='Utils::FileWizardDialog' unnamed='1' visible='1' windowTitle='New Text File'}
:New.comboBox_QComboBox {name='comboBox' type='QComboBox' visible='1' window=':New_Core::Internal::NewDialog'} :New.comboBox_QComboBox {name='comboBox' type='QComboBox' visible='1' window=':New_Core::Internal::NewDialog'}
:New.frame_QFrame {name='frame' type='QFrame' visible='1' window=':New_Core::Internal::NewDialog'} :New.frame_QFrame {name='frame' type='QFrame' visible='1' window=':New_Core::Internal::NewDialog'}
:New.templateCategoryView_QTreeView {name='templateCategoryView' type='QTreeView' visible='1' window=':New_Core::Internal::NewDialog'} :New.templateCategoryView_QTreeView {name='templateCategoryView' type='QTreeView' visible='1' window=':New_Core::Internal::NewDialog'}
@@ -124,7 +129,7 @@
:Qt Creator.Go to Help Mode_QToolButton {text='Go to Help Mode' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Go to Help Mode_QToolButton {text='Go to Help Mode' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Help_Search for:_QLineEdit {leftWidget=':Qt Creator.Search for:_QLabel' type='QLineEdit' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Help_Search for:_QLineEdit {leftWidget=':Qt Creator.Search for:_QLabel' type='QLineEdit' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Issues_QListView {type='QListView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Issues'} :Qt Creator.Issues_QListView {type='QListView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Issues'}
:Qt Creator.Project.Menu.File_QMenu {name='Project.Menu.File' type='QMenu' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Project.Menu.File_QMenu {name='Project.Menu.File' type='QMenu'}
:Qt Creator.QtCreator.MenuBar_QMenuBar {name='QtCreator.MenuBar' type='QMenuBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.QtCreator.MenuBar_QMenuBar {name='QtCreator.MenuBar' type='QMenuBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.ReRun_QToolButton {toolTip='Re-run this run-configuration' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.ReRun_QToolButton {toolTip='Re-run this run-configuration' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Replace All_QToolButton {name='replaceAllButton' text='Replace All' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Replace All_QToolButton {name='replaceAllButton' text='Replace All' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
@@ -133,6 +138,7 @@
:Qt Creator.Stop_QToolButton {text='Stop' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Stop_QToolButton {text='Stop' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.replaceEdit_Utils::FilterLineEdit {name='replaceEdit' type='Utils::FilterLineEdit' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.replaceEdit_Utils::FilterLineEdit {name='replaceEdit' type='Utils::FilterLineEdit' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.scrollArea_QScrollArea {name='scrollArea' type='QScrollArea' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.scrollArea_QScrollArea {name='scrollArea' type='QScrollArea' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.splitter_QSplitter {name='splitter' type='QSplitter' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton {occurrence='3' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton {occurrence='3' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Bookmarks_TreeView {type='TreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Bookmarks_TreeView {type='TreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_CloseButton {type='CloseButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_CloseButton {type='CloseButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
@@ -140,11 +146,13 @@
:Qt Creator_Core::Internal::CommandComboBox {type='Core::Internal::CommandComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Core::Internal::CommandComboBox {type='Core::Internal::CommandComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Core::Internal::MainWindow {type='Core::Internal::MainWindow' visible='1' windowTitle?='*Qt Creator'} :Qt Creator_Core::Internal::MainWindow {type='Core::Internal::MainWindow' visible='1' windowTitle?='*Qt Creator'}
:Qt Creator_Core::Internal::NavComboBox {type='Core::Internal::NavComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Core::Internal::NavComboBox {type='Core::Internal::NavComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Core::Internal::OutputPaneManageButton {type='Core::Internal::OutputPaneManageButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Core::Internal::ProgressBar {type='Core::Internal::ProgressBar' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Core::Internal::ProgressBar {type='Core::Internal::ProgressBar' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Core::OutputWindow {type='Core::OutputWindow' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Core::OutputWindow {type='Core::OutputWindow' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_CppEditor::Internal::CPPEditorWidget {type='CppEditor::Internal::CPPEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_CppEditor::Internal::CPPEditorWidget {type='CppEditor::Internal::CPPEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_FilenameQComboBox {type='QComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_FilenameQComboBox {type='QComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Find::Internal::SearchResultTreeView {type='Find::Internal::SearchResultTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Find::Internal::SearchResultTreeView {type='Find::Internal::SearchResultTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Git::Internal::GitEditor {type='Git::Internal::GitEditor' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Help::Internal::HelpViewer {type='Help::Internal::HelpViewer' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Help::Internal::HelpViewer {type='Help::Internal::HelpViewer' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_HelpSelector_QComboBox {occurrence='3' type='QComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_HelpSelector_QComboBox {occurrence='3' type='QComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Issues_Core::Internal::OutputPaneToggleButton {occurrence='1' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Issues_Core::Internal::OutputPaneToggleButton {occurrence='1' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
@@ -157,8 +165,10 @@
:Qt Creator_QmlJSEditor::QmlJSTextEditorWidget {type='QmlJSEditor::QmlJSTextEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_QmlJSEditor::QmlJSTextEditorWidget {type='QmlJSEditor::QmlJSTextEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_SearchResult_Core::Internal::OutputPaneToggleButton {occurrence='2' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_SearchResult_Core::Internal::OutputPaneToggleButton {occurrence='2' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_SystemSettings.Details_Utils::DetailsButton {occurrence='4' text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_SystemSettings.Details_Utils::DetailsButton {occurrence='4' text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_TextEditor::PlainTextEditorWidget {type='TextEditor::PlainTextEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Utils::NavigationTreeView {type='Utils::NavigationTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Utils::NavigationTreeView {type='Utils::NavigationTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Utils::NavigationTreeView::QExpandingLineEdit {container=':Qt Creator_Utils::NavigationTreeView' type='QExpandingLineEdit' unnamed='1' visible='1'} :Qt Creator_Utils::NavigationTreeView::QExpandingLineEdit {container=':Qt Creator_Utils::NavigationTreeView' type='QExpandingLineEdit' unnamed='1' visible='1'}
:Qt Creator_VersionControl_Core::Internal::OutputPaneToggleButton {occurrence='6' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Gui Application.Form file:_QLabel {name='formLabel' text='Form file:' type='QLabel' visible='1' window=':Qt Gui Application_QmakeProjectManager::Internal::GuiAppWizardDialog'} :Qt Gui Application.Form file:_QLabel {name='formLabel' text='Form file:' type='QLabel' visible='1' window=':Qt Gui Application_QmakeProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.Header file:_QLabel {name='headerLabel' text='Header file:' type='QLabel' visible='1' window=':Qt Gui Application_QmakeProjectManager::Internal::GuiAppWizardDialog'} :Qt Gui Application.Header file:_QLabel {name='headerLabel' text='Header file:' type='QLabel' visible='1' window=':Qt Gui Application_QmakeProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.Source file:_QLabel {name='sourceLabel' text='Source file:' type='QLabel' visible='1' window=':Qt Gui Application_QmakeProjectManager::Internal::GuiAppWizardDialog'} :Qt Gui Application.Source file:_QLabel {name='sourceLabel' text='Source file:' type='QLabel' visible='1' window=':Qt Gui Application_QmakeProjectManager::Internal::GuiAppWizardDialog'}
@@ -176,6 +186,7 @@
:RunSettingsUseBuildEnvironment_QLabel {text~='Us(e|ing) <b>Build Environment</b>' type='QLabel' unnamed='1' visible='1'} :RunSettingsUseBuildEnvironment_QLabel {text~='Us(e|ing) <b>Build Environment</b>' type='QLabel' unnamed='1' visible='1'}
:Select signal.signalList_QTreeWidget {container=':Go to slot.Select signal_QGroupBox' name='signalList' type='QTreeWidget' visible='1'} :Select signal.signalList_QTreeWidget {container=':Go to slot.Select signal_QGroupBox' name='signalList' type='QTreeWidget' visible='1'}
:Send to Codepaster.Cancel_QPushButton {text='Cancel' type='QPushButton' unnamed='1' visible='1' window=':Send to Codepaster_CodePaster::PasteView'} :Send to Codepaster.Cancel_QPushButton {text='Cancel' type='QPushButton' unnamed='1' visible='1' window=':Send to Codepaster_CodePaster::PasteView'}
:Send to Codepaster.Description:_QLabel {name='descriptionLabel' text='Description:' type='QLabel' visible='1' window=':Send to Codepaster_CodePaster::PasteView'}
:Send to Codepaster.Paste_QPushButton {text='Paste' type='QPushButton' unnamed='1' visible='1' window=':Send to Codepaster_CodePaster::PasteView'} :Send to Codepaster.Paste_QPushButton {text='Paste' type='QPushButton' unnamed='1' visible='1' window=':Send to Codepaster_CodePaster::PasteView'}
:Send to Codepaster.protocolBox_QComboBox {name='protocolBox' type='QComboBox' visible='1' window=':Send to Codepaster_CodePaster::PasteView'} :Send to Codepaster.protocolBox_QComboBox {name='protocolBox' type='QComboBox' visible='1' window=':Send to Codepaster_CodePaster::PasteView'}
:Send to Codepaster.stackedWidget_QStackedWidget {name='stackedWidget' type='QStackedWidget' visible='1' window=':Send to Codepaster_CodePaster::PasteView'} :Send to Codepaster.stackedWidget_QStackedWidget {name='stackedWidget' type='QStackedWidget' visible='1' window=':Send to Codepaster_CodePaster::PasteView'}
@@ -194,6 +205,7 @@
:headerFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Header file:_QLabel' name='headerFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'} :headerFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Header file:_QLabel' name='headerFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'}
:popupFrame_Proposal_QListView {container=':popupFrame_TextEditor::GenericProposalWidget' type='QListView' unnamed='1' visible='1'} :popupFrame_Proposal_QListView {container=':popupFrame_TextEditor::GenericProposalWidget' type='QListView' unnamed='1' visible='1'}
:popupFrame_TextEditor::GenericProposalWidget {name='m_popupFrame' type='TextEditor::GenericProposalWidget' visible='1'} :popupFrame_TextEditor::GenericProposalWidget {name='m_popupFrame' type='TextEditor::GenericProposalWidget' visible='1'}
:projectComboBox_QComboBox {buddy=':New Text File.Add to project:_QLabel' name='projectComboBox' type='QComboBox' visible='1'}
:qdesigner_internal::WidgetBoxCategoryListView {container=':Widget Box_qdesigner_internal::WidgetBoxTreeWidget' occurrence='3' type='qdesigner_internal::WidgetBoxCategoryListView' unnamed='1' visible='1'} :qdesigner_internal::WidgetBoxCategoryListView {container=':Widget Box_qdesigner_internal::WidgetBoxTreeWidget' occurrence='3' type='qdesigner_internal::WidgetBoxCategoryListView' unnamed='1' visible='1'}
:qmakeCallEdit {container=':Qt Creator.scrollArea_QScrollArea' text?='<b>qmake:</b> qmake*' type='QLabel' unnamed='1' visible='1'} :qmakeCallEdit {container=':Qt Creator.scrollArea_QScrollArea' text?='<b>qmake:</b> qmake*' type='QLabel' unnamed='1' visible='1'}
:qt_tabwidget_stackedwidget.Core__Internal__GeneralSettings_QWidget {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' name='Core__Internal__GeneralSettings' type='QWidget' visible='1'} :qt_tabwidget_stackedwidget.Core__Internal__GeneralSettings_QWidget {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' name='Core__Internal__GeneralSettings' type='QWidget' visible='1'}
@@ -209,4 +221,8 @@
:scrollArea.qmlDebuggingLibraryCheckBox_QCheckBox {name='qmlDebuggingLibraryCheckBox' type='QCheckBox' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :scrollArea.qmlDebuggingLibraryCheckBox_QCheckBox {name='qmlDebuggingLibraryCheckBox' type='QCheckBox' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:scrollArea_QTableView {type='QTableView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :scrollArea_QTableView {type='QTableView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:sourceFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Source file:_QLabel' name='sourceFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'} :sourceFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Source file:_QLabel' name='sourceFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'}
:splitter.Commit File(s)_VcsBase::QActionPushButton {container=':Qt Creator.splitter_QSplitter' text~='(Commit .+/.+ File.*)' type='VcsBase::QActionPushButton' unnamed='1' visible='1'}
:splitter.Description_QGroupBox {container=':Qt Creator.splitter_QSplitter' name='descriptionBox' title='Description' type='QGroupBox' visible='1'}
:splitter.Files_QGroupBox {container=':Qt Creator.splitter_QSplitter' name='groupBox' title='Files' type='QGroupBox' visible='1'}
:stackedWidget.plainTextEdit_QPlainTextEdit {container=':Send to Codepaster.stackedWidget_QStackedWidget' name='plainTextEdit' type='QPlainTextEdit' visible='1'} :stackedWidget.plainTextEdit_QPlainTextEdit {container=':Send to Codepaster.stackedWidget_QStackedWidget' name='plainTextEdit' type='QPlainTextEdit' visible='1'}
:uiDescription_QLineEdit {buddy=':Send to Codepaster.Description:_QLabel' name='uiDescription' type='QLineEdit' visible='1'}
+21 -7
View File
@@ -75,6 +75,13 @@ def placeCursorToLine(editor, line, isRegex=False):
def menuVisibleAtEditor(editor, menuInList): def menuVisibleAtEditor(editor, menuInList):
menuInList[0] = None menuInList[0] = None
try: try:
# Hack for Squish 5.0.1 handling menus of Qt5.2 on Mac (avoids crash) - remove asap
if platform.system() == 'Darwin':
for obj in object.topLevelObjects():
if className(obj) == "QMenu" and obj.visible and widgetContainsPoint(editor, obj.mapToGlobal(QPoint(0, 0))):
menuInList[0] = obj
return True
return False
menu = waitForObject("{type='QMenu' unnamed='1' visible='1'}", 500) menu = waitForObject("{type='QMenu' unnamed='1' visible='1'}", 500)
if platform.system() == 'Darwin': if platform.system() == 'Darwin':
menu.activateWindow() menu.activateWindow()
@@ -94,8 +101,6 @@ def widgetContainsPoint(widget, point):
# at the same position where the text cursor is located at # at the same position where the text cursor is located at
def openContextMenuOnTextCursorPosition(editor): def openContextMenuOnTextCursorPosition(editor):
rect = editor.cursorRect(editor.textCursor()) rect = editor.cursorRect(editor.textCursor())
if platform.system() == 'Darwin':
JIRA.performWorkaroundForBug(8735, JIRA.Bug.CREATOR, editor)
openContextMenu(editor, rect.x+rect.width/2, rect.y+rect.height/2, 0) openContextMenu(editor, rect.x+rect.width/2, rect.y+rect.height/2, 0)
menuInList = [None] menuInList = [None]
waitFor("menuVisibleAtEditor(editor, menuInList)", 5000) waitFor("menuVisibleAtEditor(editor, menuInList)", 5000)
@@ -272,8 +277,7 @@ def getEditorForFileSuffix(curFile):
else: else:
test.log("Trying PlainTextEditor (file suffix: %s)" % suffix) test.log("Trying PlainTextEditor (file suffix: %s)" % suffix)
try: try:
editor = waitForObject("{type='TextEditor::PlainTextEditorWidget' unnamed='1' " editor = waitForObject(":Qt Creator_TextEditor::PlainTextEditorWidget", 3000)
"visible='1' window=':Qt Creator_Core::Internal::MainWindow'}", 3000)
except: except:
test.fatal("Unsupported file suffix for file '%s'" % curFile) test.fatal("Unsupported file suffix for file '%s'" % curFile)
editor = None editor = None
@@ -318,10 +322,20 @@ def validateSearchResult(expectedCount):
# this function invokes context menu and command from it # this function invokes context menu and command from it
def invokeContextMenuItem(editorArea, command1, command2 = None): def invokeContextMenuItem(editorArea, command1, command2 = None):
ctxtMenu = openContextMenuOnTextCursorPosition(editorArea) ctxtMenu = openContextMenuOnTextCursorPosition(editorArea)
activateItem(waitForObjectItem(objectMap.realName(ctxtMenu), command1, 2000)) if platform.system() == 'Darwin':
activateItem(ctxtMenu, command1)
else:
activateItem(waitForObjectItem(objectMap.realName(ctxtMenu), command1, 2000))
if command2: if command2:
activateItem(waitForObjectItem("{title='%s' type='QMenu' visible='1' window=%s}" # Hack for Squish 5.0.1 handling menus of Qt5.2 on Mac (avoids crash) - remove asap
% (command1, objectMap.realName(ctxtMenu)), command2, 2000)) if platform.system() == 'Darwin':
for obj in object.topLevelObjects():
if className(obj) == 'QMenu' and obj.visible and not obj == ctxtMenu:
activateItem(obj, command2)
break
else:
activateItem(waitForObjectItem("{title='%s' type='QMenu' visible='1' window=%s}"
% (command1, objectMap.realName(ctxtMenu)), command2, 2000))
# this function invokes the "Find Usages" item from context menu # this function invokes the "Find Usages" item from context menu
# param editor an editor object # param editor an editor object
+11 -13
View File
@@ -174,16 +174,14 @@ def __selectQtVersionDesktop__(checks, available=None):
clickButton(waitForObject(":Next_QPushButton")) clickButton(waitForObject(":Next_QPushButton"))
return checkedTargets return checkedTargets
def __createProjectHandleLastPage__(expectedFiles = None): def __createProjectHandleLastPage__(expectedFiles = None, addToVersionControl = "<None>", addToProject = None):
if expectedFiles != None: if expectedFiles != None:
summary = str(waitForObject("{name='filesLabel' text?='<qt>Files to be added in<pre>*</pre>'" summary = waitForObject("{name='filesLabel' text?='<qt>Files to be added in<pre>*</pre>' "
"type='QLabel' visible='1'}").text) "type='QLabel' visible='1'}").text
lastIndex = 0 verifyItemOrder(expectedFiles, summary)
for filename in expectedFiles: if addToProject:
index = summary.find(filename) selectFromCombo(":projectComboBox_QComboBox", addToProject)
test.verify(index > lastIndex, "'" + filename + "' found at index " + str(index)) selectFromCombo(":addToVersionControlComboBox_QComboBox", addToVersionControl)
lastIndex = index
selectFromCombo(":addToVersionControlComboBox_QComboBox", "<None>")
clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}")) clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}"))
def __verifyFileCreation__(path, expectedFiles): def __verifyFileCreation__(path, expectedFiles):
@@ -220,7 +218,7 @@ def __modifyAvailableTargets__(available, requiredQt, asStrings=False):
# param path specifies where to create the project # param path specifies where to create the project
# param projectName is the name for the new project # param projectName is the name for the new project
# param checks turns tests in the function on if set to True # param checks turns tests in the function on if set to True
def createProject_Qt_GUI(path, projectName, checks = True): def createProject_Qt_GUI(path, projectName, checks = True, addToVersionControl = "<None>"):
template = "Qt Widgets Application" template = "Qt Widgets Application"
available = __createProjectOrFileSelectType__(" Applications", template) available = __createProjectOrFileSelectType__(" Applications", template)
__createProjectSetNameAndPath__(path, projectName, checks) __createProjectSetNameAndPath__(path, projectName, checks)
@@ -250,7 +248,7 @@ def createProject_Qt_GUI(path, projectName, checks = True):
path = os.path.join(path, projectName) path = os.path.join(path, projectName)
expectedFiles = [path] expectedFiles = [path]
expectedFiles.extend(__sortFilenamesOSDependent__(["main.cpp", cpp_file, h_file, ui_file, pro_file])) expectedFiles.extend(__sortFilenamesOSDependent__(["main.cpp", cpp_file, h_file, ui_file, pro_file]))
__createProjectHandleLastPage__(expectedFiles) __createProjectHandleLastPage__(expectedFiles, addToVersionControl)
progressBarWait(20000) progressBarWait(20000)
__verifyFileCreation__(path, expectedFiles) __verifyFileCreation__(path, expectedFiles)
@@ -639,7 +637,7 @@ def compareProjectTree(rootObject, dataset):
return return
test.passes("No errors found in project tree") test.passes("No errors found in project tree")
def addCPlusPlusFileToCurrentProject(name, template, forceOverwrite=False): def addCPlusPlusFileToCurrentProject(name, template, forceOverwrite=False, addToVCS = "<None>"):
if name == None: if name == None:
test.fatal("File must have a name - got None.") test.fatal("File must have a name - got None.")
return return
@@ -652,7 +650,7 @@ def addCPlusPlusFileToCurrentProject(name, template, forceOverwrite=False):
replaceEditorContent(lineEdit, name) replaceEditorContent(lineEdit, name)
clickButton(waitForObject(":Next_QPushButton")) clickButton(waitForObject(":Next_QPushButton"))
fileExistedBefore = os.path.exists(os.path.join(basePath, name)) fileExistedBefore = os.path.exists(os.path.join(basePath, name))
__createProjectHandleLastPage__() __createProjectHandleLastPage__(addToVersionControl = addToVCS)
if (fileExistedBefore): if (fileExistedBefore):
overwriteDialog = "{type='Core::Internal::PromptOverwriteDialog' unnamed='1' visible='1'}" overwriteDialog = "{type='Core::Internal::PromptOverwriteDialog' unnamed='1' visible='1'}"
waitForObject(overwriteDialog) waitForObject(overwriteDialog)
+1 -1
View File
@@ -281,7 +281,7 @@ elif platform.system() == 'Darwin':
origSettingsDir = os.path.join(origSettingsDir, "mac") origSettingsDir = os.path.join(origSettingsDir, "mac")
else: else:
origSettingsDir = os.path.join(origSettingsDir, "unix") origSettingsDir = os.path.join(origSettingsDir, "unix")
srcPath = os.getenv("SYSTEST_SRCPATH", sdkPath + "/src") srcPath = os.getenv("SYSTEST_SRCPATH", os.path.join(sdkPath, "src"))
overrideStartApplication() overrideStartApplication()
+32 -7
View File
@@ -52,19 +52,28 @@ def verifyChecked(objectName):
return object return object
def ensureChecked(objectName, shouldBeChecked = True, timeout=20000): def ensureChecked(objectName, shouldBeChecked = True, timeout=20000):
object = waitForObject(objectName, timeout)
# synchronize to avoid false positives
waitFor('object.checked == shouldBeChecked', 1000)
if object.checked ^ shouldBeChecked:
clickButton(object)
if shouldBeChecked: if shouldBeChecked:
targetState = Qt.Checked
state = "checked" state = "checked"
else: else:
targetState = Qt.Unchecked
state = "unchecked" state = "unchecked"
widget = waitForObject(objectName, timeout)
try:
# needed for transition Qt::PartiallyChecked -> Qt::Checked -> Qt::Unchecked
clicked = 0
while not waitFor('widget.checkState() == targetState', 1000) and clicked < 2:
clickButton(widget)
clicked += 1
test.verify(waitFor("widget.checkState() == targetState", 1000))
except:
# widgets not derived from QCheckbox don't have checkState()
if not waitFor('widget.checked == shouldBeChecked', 1000):
clickButton(widget)
test.verify(waitFor("widget.checked == shouldBeChecked", 1000))
test.log("New state for QCheckBox: %s" % state, test.log("New state for QCheckBox: %s" % state,
str(objectName)) str(objectName))
test.verify(waitFor("object.checked == shouldBeChecked", 1000)) return widget
return object
# verify that an object is in an expected enable state. Returns the object. # verify that an object is in an expected enable state. Returns the object.
# param objectSpec specifies the object to check. It can either be a string determining an object # param objectSpec specifies the object to check. It can either be a string determining an object
@@ -228,6 +237,14 @@ def invokeMenuItem(menu, item, *subItems):
waitForObject(":Qt Creator.QtCreator.MenuBar_QMenuBar", 2000) waitForObject(":Qt Creator.QtCreator.MenuBar_QMenuBar", 2000)
except: except:
nativeMouseClick(waitForObject(":Qt Creator_Core::Internal::MainWindow", 1000), 20, 20, 0, Qt.LeftButton) nativeMouseClick(waitForObject(":Qt Creator_Core::Internal::MainWindow", 1000), 20, 20, 0, Qt.LeftButton)
# HACK to avoid squish crash using Qt5.2 on Squish 5.0.1 - remove asap
if platform.system() == "Darwin" and not isQt4Build:
if menu == "Tools" and item == "Options...":
nativeType("<Command+,>")
return
if menu == "File" and item == "Exit":
nativeType("<Command+q>")
return
menuObject = waitForObjectItem(":Qt Creator.QtCreator.MenuBar_QMenuBar", menu) menuObject = waitForObjectItem(":Qt Creator.QtCreator.MenuBar_QMenuBar", menu)
waitFor("menuObject.visible", 1000) waitFor("menuObject.visible", 1000)
activateItem(menuObject) activateItem(menuObject)
@@ -707,3 +724,11 @@ def getQModelIndexStr(property, container):
if (container.startswith(":")): if (container.startswith(":")):
container = "'%s'" % container container = "'%s'" % container
return ("{column='0' container=%s %s type='QModelIndex'}" % (container, property)) return ("{column='0' container=%s %s type='QModelIndex'}" % (container, property))
def verifyItemOrder(items, text):
text = str(text)
lastIndex = 0
for item in items:
index = text.find(item)
test.verify(index > lastIndex, "'" + item + "' found at index " + str(index))
lastIndex = index
-5
View File
@@ -216,7 +216,6 @@ class JIRA:
def __initBugDict__(self): def __initBugDict__(self):
self.__bugs__= { self.__bugs__= {
'QTCREATORBUG-6853':self._workaroundCreator6853_, 'QTCREATORBUG-6853':self._workaroundCreator6853_,
'QTCREATORBUG-8735':self._workaroundCreator_MacEditorFocus_
} }
# 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):
@@ -227,7 +226,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 _workaroundCreator_MacEditorFocus_(self, *args):
editor = args[0]
nativeMouseClick(editor.mapToGlobal(QPoint(50, 50)).x, editor.mapToGlobal(QPoint(50, 50)).y, Qt.LeftButton)
+1
View File
@@ -0,0 +1 @@
QT_PLATFORM_PLUGIN=nonesuch
@@ -38,7 +38,9 @@ def main():
return return
# using a temporary directory won't mess up a potentially existing # using a temporary directory won't mess up a potentially existing
workingDir = tempDir() workingDir = tempDir()
checkedTargets, projectName = createNewQtQuickApplication(workingDir) # we need a Qt >= 4.8
analyzerTargets = Targets.desktopTargetClasses() ^ Targets.DESKTOP_474_GCC
checkedTargets, projectName = createNewQtQuickApplication(workingDir, targets=analyzerTargets)
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget") editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
if placeCursorToLine(editor, "MouseArea.*", True): if placeCursorToLine(editor, "MouseArea.*", True):
type(editor, '<Up>') type(editor, '<Up>')
@@ -57,68 +59,79 @@ def main():
invokeMenuItem("File", "Save All") invokeMenuItem("File", "Save All")
availableConfigs = iterateBuildConfigs(len(checkedTargets), "Debug") availableConfigs = iterateBuildConfigs(len(checkedTargets), "Debug")
if not availableConfigs: if not availableConfigs:
test.fatal("Haven't found a suitable Qt version (need Qt 4.7.4) - leaving without debugging.") test.fatal("Haven't found a suitable Qt version (need Qt 4.8) - leaving without debugging.")
for kit, config in availableConfigs: else:
qtVersion = selectBuildConfig(len(checkedTargets), kit, config)[0] performTest(workingDir, projectName, len(checkedTargets), availableConfigs, False)
if qtVersion == "4.7.4": performTest(workingDir, projectName, len(checkedTargets), availableConfigs, True)
test.xverify(False, "Skipping Qt 4.7.4 to avoid QTCREATORBUG-9185")
continue
test.log("Selected kit using Qt %s" % qtVersion)
progressBarWait() # progress bars move buttons
verifyBuildConfig(len(checkedTargets), kit, True, enableQmlDebug=True)
# explicitly build before start debugging for adding the executable as allowed program to WinFW
invokeMenuItem("Build", "Rebuild All")
waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}",
"buildQueueFinished(bool)")
if not checkCompile():
test.fatal("Compile had errors... Skipping current build config")
continue
allowAppThroughWinFW(workingDir, projectName, False)
switchViewTo(ViewConstants.ANALYZE)
selectFromCombo(":Analyzer Toolbar.AnalyzerManagerToolBox_QComboBox", "QML Profiler")
recordButton = waitForObject("{container=':Qt Creator.Analyzer Toolbar_QDockWidget' "
"type='QToolButton' unnamed='1' visible='1' "
"toolTip?='*able profiling'}")
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"))
stopButton = waitForObject(":Qt Creator.Stop_QToolButton")
elapsedLabel = waitForObject(":Analyzer Toolbar.Elapsed:_QLabel", 3000)
waitFor('"Elapsed: 5" in str(elapsedLabel.text)', 20000)
clickButton(stopButton)
if safeClickTab("JavaScript"):
model = findObject(":JavaScript.QmlProfilerEventsTable_QmlProfiler::"
"Internal::QV8ProfilerEventsMainView").model()
test.compare(model.rowCount(), 0)
if safeClickTab("Events"):
colPercent, colTotal, colCalls, colMean, colMedian, colLongest, colShortest = range(2, 9)
model = waitForObject(":Events.QmlProfilerEventsTable_QmlProfiler::"
"Internal::QmlProfilerEventsMainView").model()
if qtVersion.startswith("5."):
compareEventsTab(model, "events_qt50.tsv")
numberOfMsRows = 3
else:
if qtVersion.startswith("4.8"):
compareEventsTab(model, "events_qt48.tsv")
else:
compareEventsTab(model, "events_qt47.tsv")
numberOfMsRows = 2
test.compare(dumpItems(model, column=colPercent)[0], '100.00 %')
for i in [colTotal, colMean, colMedian, colLongest, colShortest]:
for item in dumpItems(model, column=i)[:numberOfMsRows]:
test.verify(item.endswith(' ms'), "Verify that '%s' ends with ' ms'" % item)
for row in range(model.rowCount()):
if str(model.index(row, colCalls).data()) == "1":
for col in [colMedian, colLongest, colShortest]:
test.compare(model.index(row, colMean).data(), model.index(row, col).data(),
"For just one call, no differences in execution time may be shown.")
elif str(model.index(row, colCalls).data()) == "2":
test.compare(model.index(row, colMedian).data(), model.index(row, colLongest).data(),
"For two calls, median and longest time must be the same.")
deleteAppFromWinFW(workingDir, projectName, False)
invokeMenuItem("File", "Exit") invokeMenuItem("File", "Exit")
def performTest(workingDir, projectName, targetCount, availableConfigs, disableOptimizer):
for kit, config in availableConfigs:
qtVersion = selectBuildConfig(targetCount, kit, config)[0]
test.log("Selected kit using Qt %s" % qtVersion)
progressBarWait() # progress bars move buttons
verifyBuildConfig(targetCount, kit, True, enableQmlDebug=True)
if disableOptimizer:
batchEditRunEnvironment(targetCount, kit, ["QML_DISABLE_OPTIMIZER=1"])
switchViewTo(ViewConstants.EDIT)
# explicitly build before start debugging for adding the executable as allowed program to WinFW
invokeMenuItem("Build", "Rebuild All")
waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}",
"buildQueueFinished(bool)")
if not checkCompile():
test.fatal("Compile had errors... Skipping current build config")
continue
allowAppThroughWinFW(workingDir, projectName, False)
switchViewTo(ViewConstants.ANALYZE)
selectFromCombo(":Analyzer Toolbar.AnalyzerManagerToolBox_QComboBox", "QML Profiler")
recordButton = waitForObject("{container=':Qt Creator.Analyzer Toolbar_QDockWidget' "
"type='QToolButton' unnamed='1' visible='1' "
"toolTip?='*able profiling'}")
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"))
stopButton = waitForObject(":Qt Creator.Stop_QToolButton")
elapsedLabel = waitForObject(":Analyzer Toolbar.Elapsed:_QLabel", 3000)
waitFor('"Elapsed: 5" in str(elapsedLabel.text)', 20000)
clickButton(stopButton)
if safeClickTab("JavaScript"):
model = findObject(":JavaScript.QmlProfilerEventsTable_QmlProfiler::"
"Internal::QV8ProfilerEventsMainView").model()
test.compare(model.rowCount(), 0)
if safeClickTab("Events"):
colPercent, colTotal, colCalls, colMean, colMedian, colLongest, colShortest = range(2, 9)
model = waitForObject(":Events.QmlProfilerEventsTable_QmlProfiler::"
"Internal::QmlProfilerEventsMainView").model()
if qtVersion.startswith("5."):
if disableOptimizer:
compareEventsTab(model, "events_qt50_nonOptimized.tsv")
else:
compareEventsTab(model, "events_qt50.tsv")
numberOfMsRows = 3
else:
if disableOptimizer:
compareEventsTab(model, "events_qt48_nonOptimized.tsv")
else:
compareEventsTab(model, "events_qt48.tsv")
numberOfMsRows = 2
test.compare(dumpItems(model, column=colPercent)[0], '100.00 %')
for i in [colTotal, colMean, colMedian, colLongest, colShortest]:
for item in dumpItems(model, column=i)[:numberOfMsRows]:
test.verify(item.endswith(' ms'), "Verify that '%s' ends with ' ms'" % item)
for item in dumpItems(model, column=i):
test.verify(not item.startswith('0.000 '),
"Check for implausible durations (QTCREATORBUG-8996): %s" % item)
for row in range(model.rowCount()):
if str(model.index(row, colCalls).data()) == "1":
for col in [colMedian, colLongest, colShortest]:
test.compare(model.index(row, colMean).data(), model.index(row, col).data(),
"For just one call, no differences in execution time may be shown.")
elif str(model.index(row, colCalls).data()) == "2":
test.compare(model.index(row, colMedian).data(), model.index(row, colLongest).data(),
"For two calls, median and longest time must be the same.")
deleteAppFromWinFW(workingDir, projectName, False)
def compareEventsTab(model, file): def compareEventsTab(model, file):
significantColumns = [0, 1, 4, 9] significantColumns = [0, 1, 4, 9]
@@ -1,4 +0,0 @@
"0" "1" "4" "9"
"<program>" "Binding" "1" "Main Program"
"main.qml:15" "Signal" "2" "triggered(): { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }"
"main.qml:14" "Binding" "2" "running: runCount < 2"
1 0 1 4 9
2 <program> Binding 1 Main Program
3 main.qml:15 Signal 2 triggered(): { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }
4 main.qml:14 Binding 2 running: runCount < 2
@@ -0,0 +1,9 @@
"0" "1" "4" "9"
"<program>" "Binding" "1" "Main Program"
"main.qml:15" "Signal" "2" "triggered(): { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }"
"main.qml:1" "Create" "1" "main.qml"
"main.qml:1" "Compile" "1" "main.qml"
"main.qml:7" "Binding" "1" "text: qsTr(""Hello World"")"
"main.qml:14" "Binding" "3" "running: runCount < 2"
"main.qml:8" "Binding" "1" "centerIn: parent"
"main.qml:27" "Binding" "1" "fill: parent"
1 0 1 4 9
2 <program> Binding 1 Main Program
3 main.qml:15 Signal 2 triggered(): { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }
4 main.qml:1 Create 1 main.qml
5 main.qml:1 Compile 1 main.qml
6 main.qml:7 Binding 1 text: qsTr("Hello World")
7 main.qml:14 Binding 3 running: runCount < 2
8 main.qml:8 Binding 1 centerIn: parent
9 main.qml:27 Binding 1 fill: parent
@@ -0,0 +1,9 @@
"0" "1" "4" "9"
"<program>" "Binding" "1" "Main Program"
"main.qml:1" "Create" "1" "main.qml"
"main.qml:15" "Signal" "2" "triggered(): { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }"
"main.qml:1" "Compile" "1" "main.qml"
"main.qml:7" "Binding" "1" "text: qsTr(""Hello World"")"
"main.qml:14" "Binding" "3" "running: runCount < 2"
"main.qml:8" "Binding" "1" "centerIn: parent"
"main.qml:27" "Binding" "1" "fill: parent"
1 0 1 4 9
2 <program> Binding 1 Main Program
3 main.qml:1 Create 1 main.qml
4 main.qml:15 Signal 2 triggered(): { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }
5 main.qml:1 Compile 1 main.qml
6 main.qml:7 Binding 1 text: qsTr("Hello World")
7 main.qml:14 Binding 3 running: runCount < 2
8 main.qml:8 Binding 1 centerIn: parent
9 main.qml:27 Binding 1 fill: parent
+1
View File
@@ -0,0 +1 @@
QT_PLATFORM_PLUGIN=nonesuch
@@ -63,9 +63,6 @@ def main():
# - Press F2 or select from the menu: Tools / C++ / Follow Symbol under Cursor # - Press F2 or select from the menu: Tools / C++ / Follow Symbol under Cursor
# Creator will show you the declaration of the variable. # Creator will show you the declaration of the variable.
if platform.system() == "Darwin":
JIRA.performWorkaroundForBug(8735, JIRA.Bug.CREATOR, cppwindow)
type(cppwindow, "<Ctrl+F>") type(cppwindow, "<Ctrl+F>")
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), " xi") type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), " xi")
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), "<Return>") type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), "<Return>")
@@ -61,8 +61,6 @@ def main():
"Skipping this file for now.") "Skipping this file for now.")
continue continue
if platform.system() == 'Darwin':
JIRA.performWorkaroundForBug(8735, JIRA.Bug.CREATOR, editor)
contentBefore = readFile(currentFile) contentBefore = readFile(currentFile)
popupText = "The file %s was removed. Do you want to save it under a different name, or close the editor?" popupText = "The file %s was removed. Do you want to save it under a different name, or close the editor?"
os.remove(currentFile) os.remove(currentFile)
@@ -91,8 +91,6 @@ def __modifyProFile__():
# re-order some stuff inside header # re-order some stuff inside header
def __modifyHeader__(): def __modifyHeader__():
global cppEditorStr, homeShortCut, endShortCut global cppEditorStr, homeShortCut, endShortCut
if platform.system() == "Darwin":
JIRA.performWorkaroundForBug(8735, JIRA.Bug.CREATOR, waitForObject(cppEditorStr, 1000))
if placeCursorToLine(cppEditorStr, "class.+", True): if placeCursorToLine(cppEditorStr, "class.+", True):
type(cppEditorStr, homeShortCut) type(cppEditorStr, homeShortCut)
markText(cppEditorStr, "Down", 5) markText(cppEditorStr, "Down", 5)
@@ -51,8 +51,6 @@ def main():
test.fatal("Could not get the editor for '%s'" % currentFile, test.fatal("Could not get the editor for '%s'" % currentFile,
"Skipping this file for now.") "Skipping this file for now.")
continue continue
if platform.system() == 'Darwin':
JIRA.performWorkaroundForBug(8735, JIRA.Bug.CREATOR, editor)
for key in ["<Up>", "<Down>", "<Left>", "<Right>"]: for key in ["<Up>", "<Down>", "<Left>", "<Right>"]:
test.log("Selecting everything") test.log("Selecting everything")
invokeMenuItem("Edit", "Select All") invokeMenuItem("Edit", "Select All")
@@ -52,7 +52,16 @@ def main():
overrideStartApplication() overrideStartApplication()
startApplication("qtcreator" + SettingsPath) startApplication("qtcreator" + SettingsPath)
try: try:
invokeMenuItem(testData.field(lang, "File"), testData.field(lang, "Exit")) if platform.system() == 'Darwin':
# temporary hack for handling wrong menus when using Squish 5.0.1 with Qt5.2
fileMenu = waitForObjectItem(":Qt Creator.QtCreator.MenuBar_QMenuBar",
testData.field(lang, "File"))
activateItem(fileMenu)
waitForObject("{type='QMenu' visible='1'}")
activateItem(fileMenu)
nativeType("<Command+q>")
else:
invokeMenuItem(testData.field(lang, "File"), testData.field(lang, "Exit"))
test.passes("Creator was running in %s translation." % languageName) test.passes("Creator was running in %s translation." % languageName)
except: except:
test.fail("Creator seems to be missing %s translation" % languageName) test.fail("Creator seems to be missing %s translation" % languageName)
@@ -50,7 +50,7 @@ def main():
["Resources", "musicbrowser.qrc"], ["Resources", "musicbrowser.qrc"],
["QML", "musicbrowser.qml"]]: ["QML", "musicbrowser.qml"]]:
filenames = ["ABCD" + filename.upper(), "abcd" + filename.lower(), "test", "TEST", filename] filenames = ["ABCD" + filename.upper(), "abcd" + filename.lower(), "test", "TEST", filename]
if platform.system() == 'Darwin': if isQt4Build and platform.system() == 'Darwin':
# avoid QTCREATORBUG-9197 # avoid QTCREATORBUG-9197
filtered = [filenames[0]] filtered = [filenames[0]]
for i in range(1, len(filenames)): for i in range(1, len(filenames)):
@@ -61,6 +61,13 @@ def main():
tempFiletype = filetype tempFiletype = filetype
if filetype == "QML" and filenames[i - 1][-4:] != ".qml": if filetype == "QML" and filenames[i - 1][-4:] != ".qml":
tempFiletype = "Other files" tempFiletype = "Other files"
# following is necessary due to QTCREATORBUG-10179
# will be fixed when Qt5's MIME type database can be used
if ((filenames[-1] in ("main.cpp", "utility.cpp") and filenames[i - 1][-4:] != ".cpp")
or (filenames[-1] == "utility.h" and filenames[i - 1][-2:].lower() != ".h")
or (filetype == "Resources" and filenames[i - 1][-4:] != ".qrc")):
tempFiletype = "Other files"
# end of handling QTCREATORBUG-10179
renameFile(templateDir, usedProFile, projectName + "." + tempFiletype, renameFile(templateDir, usedProFile, projectName + "." + tempFiletype,
filenames[i - 1], filenames[i]) filenames[i - 1], filenames[i])
invokeMenuItem("File", "Exit") invokeMenuItem("File", "Exit")
@@ -71,8 +78,6 @@ def renameFile(projectDir, proFile, branch, oldname, newname):
oldFileText = readFile(oldFilePath) oldFileText = readFile(oldFilePath)
itemText = branch + "." + oldname.replace(".", "\\.") itemText = branch + "." + oldname.replace(".", "\\.")
treeview = waitForObject(":Qt Creator_Utils::NavigationTreeView") treeview = waitForObject(":Qt Creator_Utils::NavigationTreeView")
if platform.system() == 'Darwin':
JIRA.performWorkaroundForBug(8735, JIRA.Bug.CREATOR, treeview)
try: try:
openItemContextMenu(treeview, itemText, 5, 5, 0) openItemContextMenu(treeview, itemText, 5, 5, 0)
except: except:
+1 -1
View File
@@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false
IMPLICITAUTSTART=0 IMPLICITAUTSTART=0
LANGUAGE=Python LANGUAGE=Python
OBJECTMAP=../objects.map OBJECTMAP=../objects.map
TEST_CASES=tst_codepasting tst_designer_autocomplete tst_designer_goto_slot tst_external_sort tst_git_clone TEST_CASES=tst_codepasting tst_designer_autocomplete tst_designer_goto_slot tst_external_sort tst_git_clone tst_git_local
VERSION=2 VERSION=2
WRAPPERS=Qt WRAPPERS=Qt
@@ -49,6 +49,8 @@ def main():
selectFromCombo(":Send to Codepaster.protocolBox_QComboBox", protocol) selectFromCombo(":Send to Codepaster.protocolBox_QComboBox", protocol)
pasteEditor = waitForObject(":stackedWidget.plainTextEdit_QPlainTextEdit") pasteEditor = waitForObject(":stackedWidget.plainTextEdit_QPlainTextEdit")
test.compare(pasteEditor.plainText, sourceText, "Verify that dialog shows text from the editor") test.compare(pasteEditor.plainText, sourceText, "Verify that dialog shows text from the editor")
description = "Description %s" % datetime.utcnow()
type(waitForObject(":uiDescription_QLineEdit"), description)
typeLines(pasteEditor, "// tst_codepasting %s" % datetime.utcnow()) typeLines(pasteEditor, "// tst_codepasting %s" % datetime.utcnow())
pastedText = pasteEditor.plainText pastedText = pasteEditor.plainText
clickButton(waitForObject(":Send to Codepaster.Paste_QPushButton")) clickButton(waitForObject(":Send to Codepaster.Paste_QPushButton"))
@@ -72,6 +74,9 @@ def main():
test.fail("Could not find id '%s' in list of pastes from %s" % (pasteId, protocol)) test.fail("Could not find id '%s' in list of pastes from %s" % (pasteId, protocol))
clickButton(waitForObject(":CodePaster__Internal__PasteSelectDialog.Cancel_QPushButton")) clickButton(waitForObject(":CodePaster__Internal__PasteSelectDialog.Cancel_QPushButton"))
continue continue
if protocol == "Pastebin.Com":
test.verify(description in pasteLine, "Verify that line in list of pastes contains the description")
pasteLine = pasteLine.replace(".", "\\.")
waitForObjectItem(":CodePaster__Internal__PasteSelectDialog.listWidget_QListWidget", pasteLine) waitForObjectItem(":CodePaster__Internal__PasteSelectDialog.listWidget_QListWidget", pasteLine)
clickItem(":CodePaster__Internal__PasteSelectDialog.listWidget_QListWidget", pasteLine, 5, 5, 0, Qt.LeftButton) clickItem(":CodePaster__Internal__PasteSelectDialog.listWidget_QListWidget", pasteLine, 5, 5, 0, Qt.LeftButton)
clickButton(waitForObject(":CodePaster__Internal__PasteSelectDialog.OK_QPushButton")) clickButton(waitForObject(":CodePaster__Internal__PasteSelectDialog.OK_QPushButton"))
@@ -0,0 +1,97 @@
#############################################################################
##
## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of Qt Creator.
##
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this file in
## accordance with the commercial license agreement provided with the
## Software or, alternatively, in accordance with the terms contained in
## a written agreement between you and Digia. For licensing terms and
## conditions see http://qt.digia.com/licensing. For further information
## use the contact form at http://qt.digia.com/contact-us.
##
## GNU Lesser General Public License Usage
## Alternatively, this file may be used under the terms of the GNU Lesser
## General Public License version 2.1 as published by the Free Software
## Foundation and appearing in the file LICENSE.LGPL included in the
## packaging of this file. Please review the following information to
## ensure the GNU Lesser General Public License version 2.1 requirements
## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
##
## In addition, as a special exception, Digia gives you certain additional
## rights. These rights are described in the Digia Qt LGPL Exception
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
##
#############################################################################
source("../../shared/qtcreator.py")
projectName = "gitProject"
# TODO: Make selecting changes possible
def commit(commitMessage, expectedLogMessage):
ensureChecked(waitForObject(":Qt Creator_VersionControl_Core::Internal::OutputPaneToggleButton"))
clickButton(waitForObject(":*Qt Creator.Clear_QToolButton"))
invokeMenuItem("Tools", "Git", "Local Repository", "Commit...")
replaceEditorContent(waitForObject(":Description.description_Utils::CompletingTextEdit"), commitMessage)
ensureChecked(waitForObject(":Files.Check all_QCheckBox"))
clickButton(waitForObject(":splitter.Commit File(s)_VcsBase::QActionPushButton"))
vcsLog = waitForObject("{type='QPlainTextEdit' unnamed='1' visible='1' "
"window=':Qt Creator_Core::Internal::MainWindow'}").plainText
test.verify(expectedLogMessage in str(vcsLog), "Searching for '%s' in log:\n%s " % (expectedLogMessage, vcsLog))
return commitMessage
def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
createProject_Qt_GUI(srcPath, projectName, addToVersionControl = "Git")
if isQt4Build and not object.exists(":Qt Creator_VersionControl_Core::Internal::OutputPaneToggleButton"):
clickButton(waitForObject(":Qt Creator_Core::Internal::OutputPaneManageButton"))
activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1'}", "Version Control"))
ensureChecked(waitForObject(":Qt Creator_VersionControl_Core::Internal::OutputPaneToggleButton"))
vcsLog = waitForObject("{type='QPlainTextEdit' unnamed='1' visible='1' "
"window=':Qt Creator_Core::Internal::MainWindow'}").plainText
test.verify("Initialized empty Git repository in %s"
% os.path.join(srcPath, projectName, ".git").replace("\\", "/") in str(vcsLog),
"Has initialization of repo been logged:\n%s " % vcsLog)
commitMessages = [commit("Initial Commit", "Committed 5 file(s).")]
clickButton(waitForObject(":*Qt Creator.Clear_QToolButton"))
addCPlusPlusFileToCurrentProject("pointless_header.h", "C++ Header File", addToVCS = "Git")
commitMessages.insert(0, commit("Added pointless header file", "Committed 2 file(s)."))
__createProjectOrFileSelectType__(" General", "Text File", isProject=False)
replaceEditorContent(waitForObject(":New Text File.nameLineEdit_Utils::FileNameValidatingLineEdit"), "README")
clickButton(waitForObject(":Next_QPushButton"))
__createProjectHandleLastPage__(["README.txt"], "Git", "<None>")
replaceEditorContent(waitForObject(":Qt Creator_TextEditor::PlainTextEditorWidget"),
"Some important advice in the README")
invokeMenuItem("File", "Save All")
commitMessages.insert(0, commit("Added README file", "Committed 2 file(s).")) # QTCREATORBUG-11074
invokeMenuItem("File", "Close All")
invokeMenuItem("Tools", "Git", "Local Repository", "Log")
gitEditor = waitForObject(":Qt Creator_Git::Internal::GitEditor")
waitFor("str(gitEditor.plainText) != 'Waiting for data...'", 20000)
verifyItemOrder(commitMessages, gitEditor.plainText)
invokeMenuItem("File", "Close All Projects and Editors")
invokeMenuItem("File", "Exit")
def deleteProject():
path = os.path.join(srcPath, projectName)
if os.path.exists(path):
try:
# Make files in .git writable to remove them
for root, dirs, files in os.walk(path):
for name in files:
os.chmod(os.path.join(root, name), stat.S_IWUSR)
shutil.rmtree(path)
except:
test.warning("Error while removing '%s'" % path)
def init():
deleteProject()
def cleanup():
deleteProject()
+1 -1
View File
@@ -253,7 +253,7 @@ protected: // visiting functions:
virtual bool visit(ObjectLiteral *ast) { terminal(ast->lbraceToken); nonterminal(ast->properties); terminal(ast->rbraceToken); return false; } virtual bool visit(ObjectLiteral *ast) { terminal(ast->lbraceToken); nonterminal(ast->properties); terminal(ast->rbraceToken); return false; }
virtual bool visit(ElementList *ast) { nonterminal(ast->next); terminal(ast->commaToken); nonterminal(ast->elision); nonterminal(ast->expression); return false; } virtual bool visit(ElementList *ast) { nonterminal(ast->next); terminal(ast->commaToken); nonterminal(ast->elision); nonterminal(ast->expression); return false; }
virtual bool visit(Elision *ast) { nonterminal(ast->next); terminal(ast->commaToken); return false; } virtual bool visit(Elision *ast) { nonterminal(ast->next); terminal(ast->commaToken); return false; }
virtual bool visit(PropertyNameAndValueList *ast) { nonterminal(ast->name); terminal(ast->colonToken); nonterminal(ast->value); terminal(ast->commaToken); nonterminal(ast->next); return false; } virtual bool visit(PropertyAssignmentList *ast) { nonterminal(ast->assignment); nonterminal(ast->next); terminal(ast->commaToken); return false; }
virtual bool visit(IdentifierPropertyName *ast) { terminal(ast->propertyNameToken); return false; } virtual bool visit(IdentifierPropertyName *ast) { terminal(ast->propertyNameToken); return false; }
virtual bool visit(StringLiteralPropertyName *ast) { terminal(ast->propertyNameToken); return false; } virtual bool visit(StringLiteralPropertyName *ast) { terminal(ast->propertyNameToken); return false; }
virtual bool visit(NumericLiteralPropertyName *ast) { terminal(ast->propertyNameToken); return false; } virtual bool visit(NumericLiteralPropertyName *ast) { terminal(ast->propertyNameToken); return false; }