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:
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:
+16 -3
View File
@@ -151,8 +151,12 @@ macx {
INCLUDEPATH += \
$$IDE_BUILD_TREE/src \ # for <app/app_version.h>
$$IDE_SOURCE_TREE/src/libs \
$$IDE_SOURCE_TREE/tools \
$$IDE_SOURCE_TREE/src/plugins
$$IDE_SOURCE_TREE/tools
QTC_PLUGIN_DIRS += $$IDE_SOURCE_TREE/src/plugins
for (dir, QTC_PLUGIN_DIRS) {
INCLUDEPATH += $$dir
}
CONFIG += depend_includepath
@@ -201,7 +205,16 @@ for(ever) {
break()
done_plugins += $$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)
}
QTC_PLUGIN_DEPENDS = $$unique(QTC_PLUGIN_DEPENDS)
+4
View File
@@ -339,6 +339,10 @@ class DumperBase:
def putByteArrayValue(self, value):
return self.putValue(self.encodeByteArray(value), Hex2EncodedLatin1)
def putByteArrayValueByAddress(self, addr):
self.putValue(self.encodeByteArrayHelper(self.dereference(addr)),
Hex2EncodedLatin1)
def putStringValueByAddress(self, addr):
self.putValue(self.encodeStringHelper(self.dereference(addr)),
Hex4EncodedLittleEndian)
+1
View File
@@ -315,6 +315,7 @@ class Dumper(DumperBase):
if item.name is None:
self.anonNumber += 1
item.name = "#%d" % self.anonNumber
if not item.iname:
item.iname = "%s.%s" % (self.currentIName, item.name)
self.put('{')
#if not item.name is None:
+12 -2
View File
@@ -231,6 +231,17 @@ def qdump__QTime(d, value):
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):
qtVersion = d.qtVersion()
isValid = False
@@ -1626,8 +1637,7 @@ def qdump__QSharedDataPointer(d, value):
d.putPlainChildren(value)
return
d.putBetterType(d.currentType)
d.putItem(gdb.Value(d_ptr.cast(innerType.pointer())).dereference())
# d.putItem(value.dereference())
d.putItem(d_ptr.cast(innerType.pointer()).dereference())
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)
return
head = d.dereferenceValue(value)
impl = value["_M_impl"]
node = impl["_M_node"]
head = d.addressOf(node)
size = 0
pp = d.dereference(head)
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;
if (childItem) {
foreach (QQuickItem *childItem, childItem->childItems())
if (item) {
foreach (QQuickItem *childItem, item->childItems())
{
if (childItem && nodeInstanceServer()->hasInstanceForObject(childItem)) {
instanceList.append(nodeInstanceServer()->instanceForObject(childItem));
@@ -69,7 +69,7 @@ protected:
QRectF boundingRectWithStepChilds(QQuickItem *parentItem) const;
void resetHorizontal();
void resetVertical();
QList<ServerNodeInstance> childItemsForChild(QQuickItem *childItem) const;
QList<ServerNodeInstance> childItemsForChild(QQuickItem *item) const;
void refresh();
static bool anyItemHasContent(QQuickItem *quickItem);
static bool childItemsHaveContent(QQuickItem *quickItem);
@@ -42,6 +42,7 @@ import QtQuick 2.1
import HelperWidgets 2.0
ButtonRow {
enabled: anchorBackend.hasParent
id: buttonRow
ButtonRowButton {
@@ -63,19 +63,22 @@ Controls.TextField {
}
onEditingFinished: {
if (backendValue.value !== text)
backendValue.value = text;
}
onFocusChanged: {
if (focus) {
transaction.start();
if (backendValue.isTranslated) {
backendValue.expression = "qsTr(\"" + trCheckbox.escapeString(text) + "\")"
} else {
transaction.end();
if (lineEdit.backendValue.value !== text)
lineEdit.backendValue.value = text;
}
}
// onFocusChanged: {
// if (focus) {
// transaction.start();
// } else {
// transaction.end();
// }
// }
style: TextFieldStyle {
selectionColor: lineEdit.textColor
selectedTextColor: "black"
@@ -112,12 +115,24 @@ Controls.TextField {
anchors.verticalCenter: parent.verticalCenter
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: {
if (trCheckbox.checked) {
backendValue.expression = "qsTr(\"" + escapeString(lineEdit.text) + "\")"
lineEdit.backendValue.expression = "qsTr(\"" + escapeString(lineEdit.text) + "\")"
} else {
backendValue.value = lineEdit.text
var textValue = lineEdit.text
lineEdit.backendValue.value = textValue
}
colorLogic.evaluate();
}
@@ -137,7 +152,6 @@ Controls.TextField {
style: CheckBoxStyle {
spacing: 8
label: Controls.Label { text: control.text ; color: checkBox.textColor }
indicator: Item {
implicitWidth: 16
implicitHeight: 16
+2 -4
View File
@@ -37,14 +37,12 @@ Rectangle {
CustomizedGridView {
id: grid
y: 82
height: grid.contentHeight
anchors.rightMargin: 38
anchors.leftMargin: 38
anchors.left: parent.left
anchors.right: parent.right
height: scrollView.height - 82
y: scrollView.flickableItem.contentY + 82
contentY: scrollView.flickableItem.contentY
model: examplesModel
}
@@ -38,7 +38,14 @@ GridView {
cellWidth: 216
property int columns: Math.max(Math.floor(width / cellWidth), 1)
delegate: Delegate {
delegate: Loader {
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
@@ -56,4 +63,5 @@ GridView {
videoLength: model.videoLength !== undefined ? model.videoLength : ""
tags: model.tags
}
}
}
@@ -271,9 +271,6 @@ bool AndroidDeployQtStep::init()
pp->setMacroExpander(bc->macroExpander());
pp->setWorkingDirectory(bc->buildDirectory().toString());
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->setCommand(command);
pp->setArguments(Utils::QtcProcess::joinArgs(arguments));
+4 -4
View File
@@ -1264,9 +1264,9 @@ bool AndroidManager::checkKeystorePassword(const QString &keystorePath, const QS
<< keystorePasswd;
QProcess proc;
proc.start(AndroidConfigurations::instance().keytoolPath().toString(), arguments);
if (!proc.waitForStarted(500))
if (!proc.waitForStarted(4000))
return false;
if (!proc.waitForFinished(500)) {
if (!proc.waitForFinished(4000)) {
proc.kill();
proc.waitForFinished();
return false;
@@ -1293,9 +1293,9 @@ bool AndroidManager::checkCertificatePassword(const QString &keystorePath, const
QProcess proc;
proc.start(AndroidConfigurations::instance().keytoolPath().toString(), arguments);
if (!proc.waitForStarted(500))
if (!proc.waitForStarted(4000))
return false;
if (!proc.waitForFinished(500)) {
if (!proc.waitForFinished(4000)) {
proc.kill();
proc.waitForFinished();
return false;
+3 -1
View File
@@ -111,6 +111,8 @@ void StickyNotesPasteProtocol::paste(const QString &text,
const QString &comment,
const QString &description)
{
enum { maxDescriptionLength = 30 }; // Length of description is limited.
Q_UNUSED(username)
Q_UNUSED(comment);
QTC_ASSERT(!m_pasteReply, return);
@@ -124,7 +126,7 @@ void StickyNotesPasteProtocol::paste(const QString &text,
pasteData += expiryParameter(expiryDays);
if (!description.isEmpty()) {
pasteData += "&title=";
pasteData += QUrl::toPercentEncoding(description);
pasteData += QUrl::toPercentEncoding(description.left(maxDescriptionLength));
}
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
= m_modelManager->cppEditorSupport(editor())->snapshotUpdater();
updater->setProjectPart(m_modelManager->projectPartForProjectFile(projectFile));
updater->setEditorDefines(additionalDirectives);
m_preprocessorButton->setProperty("highlightWidget", !additionalDirectives.trimmed().isEmpty());
@@ -1997,6 +1998,7 @@ void CPPEditorWidget::showPreProcessorWidget()
QSharedPointer<SnapshotUpdater> updater
= m_modelManager->cppEditorSupport(editor())->snapshotUpdater();
const QString &additionals = preProcessorDialog.additionalPreProcessorDirectives();
updater->setProjectPart(preProcessorDialog.projectPart());
updater->setEditorDefines(additionals.toUtf8());
updater->update(m_modelManager->workingCopy());
@@ -112,6 +112,11 @@ int CppPreProcessorDialog::exec()
return Accepted;
}
CppTools::ProjectPart::Ptr CppPreProcessorDialog::projectPart() const
{
return m_partAdditions[m_ui->projectComboBox->currentIndex()].projectPart;
}
QString CppPreProcessorDialog::additionalPreProcessorDirectives() const
{
return m_ui->editWidget->toPlainText();
@@ -50,6 +50,8 @@ public:
~CppPreProcessorDialog();
int exec();
CppTools::ProjectPart::Ptr projectPart() const;
QString additionalPreProcessorDirectives() const;
private slots:
+9 -2
View File
@@ -703,12 +703,14 @@ private:
/// Make sure that m_projectMutex is locked when calling this.
void CppModelManager::recalculateFileToProjectParts()
{
m_projectFileToProjectPart.clear();
m_fileToProjectParts.clear();
foreach (const ProjectInfo &projectInfo, m_projectToProjectsInfo) {
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);
}
}
}
}
@@ -788,6 +790,11 @@ QFuture<void> CppModelManager::updateProjectInfo(const ProjectInfo &newProjectIn
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
{
return m_fileToProjectParts.value(fileName);
+3
View File
@@ -74,6 +74,8 @@ public:
virtual ProjectInfo projectInfo(ProjectExplorer::Project *project) const;
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.
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,
@@ -198,6 +200,7 @@ private:
mutable QMutex m_projectMutex;
QMap<ProjectExplorer::Project *, ProjectInfo> m_projectToProjectsInfo;
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
bool m_dirty;
QStringList m_projectFiles;
@@ -233,6 +233,7 @@ public:
virtual QList<ProjectInfo> projectInfos() const = 0;
virtual ProjectInfo projectInfo(ProjectExplorer::Project *project) const = 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> projectPartFromDependencies(const QString &fileName) 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.
showMessage(QString::fromLatin1("NOTE: INFERIOR STILL RUNNING IN STATE %1.").
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 {
notifyInferiorRunOk();
}
@@ -4997,9 +5002,10 @@ void GdbEngine::tryLoadPythonDumpers()
const QByteArray uninstalledData = gdbBinaryFile.absolutePath().toLocal8Bit()
+ "/data-directory/python";
postCommand("python sys.path.insert(1, '" + dumperSourcePath + "')", ConsoleCommand);
postCommand("python sys.path.append('" + uninstalledData + "')", ConsoleCommand);
postCommand("python from gdbbridge import *", ConsoleCommand, CB(handlePythonSetup));
const GdbCommandFlags flags = ConsoleCommand | Immediate;
postCommand("python sys.path.insert(1, '" + dumperSourcePath + "')", flags);
postCommand("python sys.path.append('" + uninstalledData + "')", flags);
postCommand("python from gdbbridge import *", flags, CB(handlePythonSetup));
}
void GdbEngine::reloadDebuggingHelpers()
+3 -1
View File
@@ -201,7 +201,9 @@ IosRunConfigurationWidget::IosRunConfigurationWidget(IosRunConfiguration *runCon
updateValues();
connect(m_ui->argumentsLineEdit, SIGNAL(editingFinished()),
this, SLOT(argumentsLineEditTextEdited()));
SLOT(argumentsLineEditTextEdited()));
connect(runConfiguration->target(), SIGNAL(buildDirectoryChanged()),
SLOT(updateValues()));
}
IosRunConfigurationWidget::~IosRunConfigurationWidget()
+2 -2
View File
@@ -286,8 +286,8 @@ void MacroManager::startMacro()
foreach (IMacroHandler *handler, d->handlers)
handler->startRecording(d->currentMacro);
QString endShortcut = Core::ActionManager::command(Constants::END_MACRO)->defaultKeySequence().toString();
QString executeShortcut = Core::ActionManager::command(Constants::EXECUTE_LAST_MACRO)->defaultKeySequence().toString();
QString endShortcut = Core::ActionManager::command(Constants::END_MACRO)->keySequence().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.")
.arg(endShortcut).arg(executeShortcut);
Core::EditorManager::showEditorStatusBar(
+13 -4
View File
@@ -462,12 +462,12 @@ QString MsvcToolChainFactory::vcVarsBatFor(const QString &basePath, const QStrin
return basePath + QLatin1String("/SetEnv.cmd");
if (toolchainName == QLatin1String("x86"))
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"))
return basePath + QLatin1String("/bin/x86_amd64/vcvarsx86_amd64.bat");
if (toolchainName == QLatin1String("amd64"))
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"))
return basePath + QLatin1String("/bin/x86_arm/vcvarsx86_arm.bat");
if (toolchainName == QLatin1String("arm"))
@@ -567,12 +567,21 @@ QList<ToolChain *> MsvcToolChainFactory::autoDetect()
}
}
if (arch == Utils::HostOsInfo::HostArchitectureX86
|| arch == Utils::HostOsInfo::HostArchitectureAMD64) {
if (arch == Utils::HostOsInfo::HostArchitectureX86) {
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::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) {
if (QFileInfo(vcVarsBatFor(path, QLatin1String("arm"))).isFile())
results.append(new MsvcToolChain(generateDisplayName(vsName, MsvcToolChain::VS, MsvcToolChain::arm),
+3 -1
View File
@@ -177,7 +177,7 @@ void Target::changeRunConfigurationEnabled()
void Target::onBuildDirectoryChanged()
{
BuildConfiguration *bc = qobject_cast<BuildConfiguration *>(sender());
if (bc)
if (bc && activeBuildConfiguration() == bc)
emit buildDirectoryChanged();
}
@@ -238,6 +238,8 @@ void Target::addBuildConfiguration(BuildConfiguration *configuration)
SLOT(changeEnvironment()));
connect(configuration, SIGNAL(enabledChanged()),
this, SLOT(changeBuildConfigurationEnabled()));
connect(configuration, SIGNAL(buildDirectoryChanged()),
SLOT(onBuildDirectoryChanged()));
if (!activeBuildConfiguration())
setActiveBuildConfiguration(configuration);
@@ -65,7 +65,6 @@ QbsBuildConfiguration::QbsBuildConfiguration(ProjectExplorer::Target *target) :
connect(project(), SIGNAL(projectParsingStarted()), this, SIGNAL(enabledChanged()));
connect(project(), SIGNAL(projectParsingDone(bool)), this, SIGNAL(enabledChanged()));
connect(this, SIGNAL(buildDirectoryChanged()), target, SLOT(onBuildDirectoryChanged()));
ProjectExplorer::BuildStepList *bsl
= stepList(Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD));
connect(bsl, SIGNAL(stepInserted(int)), this, SLOT(buildStepInserted(int)));
@@ -179,6 +179,9 @@ void PropertyEditorQmlBackend::createPropertyEditorValue(const QmlObjectNode &qm
qmlObjectNode.modelNode().property(propertyName).isBindingProperty()) {
valueObject->setExpression(qmlObjectNode.modelNode().bindingProperty(propertyName).expression());
} else {
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)));
if (propertyValue) {
propertyValue->setValue(value);
if (!qmlObjectNode.hasBindingProperty(name))
propertyValue->setExpression(value.toString());
else
@@ -34,6 +34,7 @@
#include <nodeproperty.h>
#include <nodemetainfo.h>
#include <qmlobjectnode.h>
#include <bindingproperty.h>
//using namespace QmlDesigner;
@@ -159,7 +160,6 @@ QString PropertyEditorValue::enumeration() const
QString PropertyEditorValue::expression() const
{
return m_expression;
}
@@ -224,17 +224,22 @@ void PropertyEditorValue::setIsValid(bool valid)
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") {
const QmlDesigner::QmlObjectNode objectNode(modelNode());
if (objectNode.isValid() && objectNode.hasBindingProperty(name())) {
//qsTr()
QRegExp rx("qsTr(\"*\")");
//qsTr()
rx.setPatternSyntax(QRegExp::Wildcard);
if (objectNode.propertyAffectedByCurrentState(name())) {
return rx.exactMatch(expression());
} else {
return rx.exactMatch(modelNode().bindingProperty(name()).expression());
}
}
return false;
}
}
return false;
}
@@ -86,7 +86,7 @@ class PropertyEditorValue : public QObject
Q_PROPERTY(bool isInSubState READ isInSubState NOTIFY valueChangedQml FINAL)
Q_PROPERTY(bool isBound READ isBound NOTIFY isBoundChanged 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(PropertyEditorNodeWrapper* complexNode READ complexNode NOTIFY complexNodeChanged FINAL)
@@ -226,6 +226,8 @@ MetaInfo {
Property { name: "width"; type: "int"; value: 360; }
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()
{
return;
QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance();
const QString welcomescreenRootPath = Core::ICore::resourcePath() + QLatin1String("/welcomescreen/welcomescreen.qml");
@@ -57,7 +56,7 @@ void QmlJSTools::Internal::QmlJSToolsPlugin::test_basic()
QVERIFY(context);
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->isWritable(QLatin1String("border")));
QVERIFY(rectangleValue->hasProperty(QLatin1String("border")));
@@ -96,11 +96,10 @@ void QmlProfilerEventsModelProxy::limitToRange(qint64 rangeStart, qint64 rangeEn
void QmlProfilerEventsModelProxy::dataChanged()
{
if (d->modelManager->state() == QmlProfilerDataState::ProcessingData)
loadData();
if (d->modelManager->state() == QmlProfilerDataState::ClearingData)
clear();
else
loadData();
}
QSet<QString> QmlProfilerEventsModelProxy::eventsInBindingLoop() const
@@ -114,9 +114,10 @@ QmlProfilerProcessedModel::~QmlProfilerProcessedModel()
void QmlProfilerProcessedModel::clear()
{
m_detailsRewriter->clearRequests();
// This call emits changed(). Don't emit it again here.
QmlProfilerSimpleModel::clear();
emit changed();
m_emitChanged = false;
}
@@ -155,8 +156,9 @@ void QmlProfilerProcessedModel::complete()
m_detailsRewriter->reloadDocuments();
// This call emits changed(). Don't emit it again here.
QmlProfilerSimpleModel::complete();
emit changed();
m_emitChanged = false;
}
+8 -2
View File
@@ -123,12 +123,18 @@ bool TodoOutputPane::canPrevious() const
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()
{
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)
+1
View File
@@ -48,6 +48,7 @@ TodoOutputTreeView::TodoOutputTreeView(QWidget *parent) :
setFrameStyle(QFrame::NoFrame);
setSortingEnabled(true);
setAttribute(Qt::WA_MacShowFocusRect, false);
setSelectionBehavior(QTreeView::SelectRows);
header()->setResizeMode(QHeaderView::Interactive);
header()->setStretchLastSection(true);
+11 -1
View File
@@ -91,6 +91,9 @@ UpdateInfoPlugin::UpdateInfoPlugin()
UpdateInfoPlugin::~UpdateInfoPlugin()
{
d->lastCheckUpdateInfoTask.cancel();
d->lastCheckUpdateInfoTask.waitForFinished();
delete d;
}
@@ -230,7 +233,14 @@ QDomDocument UpdateInfoPlugin::update()
// start
QProcess updater;
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
QDomDocument updates;
@@ -124,6 +124,7 @@ public:
document->setUtf8Source(preprocessedSource);
QVERIFY(document->parse(parseMode));
document->check();
QVERIFY(document->diagnosticMessages().isEmpty());
snapshot.insert(document);
}
@@ -263,12 +264,14 @@ void tst_CheckSymbols::test_checksymbols_EnumerationUse()
{
const QByteArray source =
"enum E { Red, Green, Blue };\n"
"E e = Red\n";
"E e = Red;\n";
const QList<Use> expectedUses = QList<Use>()
<< Use(1, 6, 1, CppHighlightingSupport::TypeUse)
<< Use(1, 10, 3, CppHighlightingSupport::EnumerationUse)
<< Use(1, 15, 5, CppHighlightingSupport::EnumerationUse)
<< Use(1, 22, 4, CppHighlightingSupport::EnumerationUse)
<< Use(2, 1, 1, CppHighlightingSupport::TypeUse)
<< Use(2, 7, 3, CppHighlightingSupport::EnumerationUse)
;
TestData::check(source, expectedUses);
@@ -313,7 +316,7 @@ void tst_CheckSymbols::test_checksymbols_MacroUse()
{
const QByteArray source =
"#define FOO 1+1\n"
"int f() { FOO }\n";
"int f() { FOO; }\n";
const QList<Use> macroUses = QList<Use>()
<< Use(1, 9, 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"
"};\n"
"}\n"
;
const QList<Use> expectedUses = QList<Use>()
@@ -1477,7 +1480,7 @@ void tst_CheckSymbols::test_checksymbols_QTCREATORBUG9098()
" {\n"
" b.c;\n"
" }\n"
"}\n"
"};\n"
;
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", "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")
<< Data("#include <QDate>\n",
"QDate date;\n"
@@ -5079,6 +5094,17 @@ void tst_Dumpers::dumper_data()
% Check("u32", "68", "uint32_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[])
@@ -116,6 +116,12 @@
#define USE_SHARED_POINTER 0
#endif
#if QT_VERSION >= 0x050200
#define USE_TIMEZONE 1
#else
#define USE_TIMEZONE 0
#endif
void dummyStatement(...) {}
#if USE_CXX11 && defined(__GNUC__) && defined(__STRICT_ANSI__)
@@ -146,6 +152,10 @@ void dummyStatement(...) {}
#include <QSharedPointer>
#endif
#if USE_TIMEZONE
#include <QTimeZone>
#endif
#if USE_GUILIB
#include <QAction>
#include <QApplication> // QWidgets: Separate module as of Qt 5
@@ -158,6 +168,7 @@ void dummyStatement(...) {}
#include <QStandardItemModel>
#include <QTextCursor>
#include <QTextDocument>
#include <QTimeZone>
#endif
#if USE_SCRIPTLIB
@@ -698,6 +709,14 @@ namespace undefined {
namespace qdatetime {
void testQTimeZone()
{
QTimeZone zz;
QTimeZone tz("UTC+05:00");
BREAK_HERE;
dummyStatement(&zz, &tz);
}
void testQDate()
{
QDate date;
@@ -758,6 +777,7 @@ namespace qdatetime {
void testDateTime()
{
testQTimeZone();
testQDate();
testQDateTime();
testQTime();
@@ -5475,6 +5495,7 @@ namespace basic {
void testLongEvaluation1()
{
#if USE_TIMEZONE
QTimeZone tz("UTC+05:00");
QDateTime time = QDateTime::currentDateTime();
const int N = 10000;
@@ -5495,6 +5516,7 @@ namespace basic {
// Continue.
// Note: This is expected to _not_ take up to a minute.
dummyStatement(&bigv);
#endif
}
void testLongEvaluation2()
@@ -7039,6 +7061,7 @@ template <class X> int ffff(X x)
int main(int argc, char *argv[])
{
int z = ffff(3) + ffff(2.0);
Q_UNUSED(z);
#if USE_GUILIB
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.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'}
: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.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'}
@@ -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.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'}
: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'}
: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'}
@@ -98,6 +100,9 @@
: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'}
: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.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'}
@@ -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.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.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.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'}
@@ -133,6 +138,7 @@
: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.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_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'}
@@ -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::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::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::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_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_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_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'}
@@ -157,8 +165,10 @@
: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_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::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.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'}
@@ -176,6 +186,7 @@
: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'}
: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.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'}
@@ -194,6 +205,7 @@
: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_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'}
: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'}
@@ -209,4 +221,8 @@
: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'}
: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'}
:uiDescription_QLineEdit {buddy=':Send to Codepaster.Description:_QLabel' name='uiDescription' type='QLineEdit' visible='1'}
+18 -4
View File
@@ -75,6 +75,13 @@ def placeCursorToLine(editor, line, isRegex=False):
def menuVisibleAtEditor(editor, menuInList):
menuInList[0] = None
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)
if platform.system() == 'Darwin':
menu.activateWindow()
@@ -94,8 +101,6 @@ def widgetContainsPoint(widget, point):
# at the same position where the text cursor is located at
def openContextMenuOnTextCursorPosition(editor):
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)
menuInList = [None]
waitFor("menuVisibleAtEditor(editor, menuInList)", 5000)
@@ -272,8 +277,7 @@ def getEditorForFileSuffix(curFile):
else:
test.log("Trying PlainTextEditor (file suffix: %s)" % suffix)
try:
editor = waitForObject("{type='TextEditor::PlainTextEditorWidget' unnamed='1' "
"visible='1' window=':Qt Creator_Core::Internal::MainWindow'}", 3000)
editor = waitForObject(":Qt Creator_TextEditor::PlainTextEditorWidget", 3000)
except:
test.fatal("Unsupported file suffix for file '%s'" % curFile)
editor = None
@@ -318,8 +322,18 @@ def validateSearchResult(expectedCount):
# this function invokes context menu and command from it
def invokeContextMenuItem(editorArea, command1, command2 = None):
ctxtMenu = openContextMenuOnTextCursorPosition(editorArea)
if platform.system() == 'Darwin':
activateItem(ctxtMenu, command1)
else:
activateItem(waitForObjectItem(objectMap.realName(ctxtMenu), command1, 2000))
if command2:
# 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 not obj == ctxtMenu:
activateItem(obj, command2)
break
else:
activateItem(waitForObjectItem("{title='%s' type='QMenu' visible='1' window=%s}"
% (command1, objectMap.realName(ctxtMenu)), command2, 2000))
+11 -13
View File
@@ -174,16 +174,14 @@ def __selectQtVersionDesktop__(checks, available=None):
clickButton(waitForObject(":Next_QPushButton"))
return checkedTargets
def __createProjectHandleLastPage__(expectedFiles = None):
def __createProjectHandleLastPage__(expectedFiles = None, addToVersionControl = "<None>", addToProject = None):
if expectedFiles != None:
summary = str(waitForObject("{name='filesLabel' text?='<qt>Files to be added in<pre>*</pre>'"
"type='QLabel' visible='1'}").text)
lastIndex = 0
for filename in expectedFiles:
index = summary.find(filename)
test.verify(index > lastIndex, "'" + filename + "' found at index " + str(index))
lastIndex = index
selectFromCombo(":addToVersionControlComboBox_QComboBox", "<None>")
summary = waitForObject("{name='filesLabel' text?='<qt>Files to be added in<pre>*</pre>' "
"type='QLabel' visible='1'}").text
verifyItemOrder(expectedFiles, summary)
if addToProject:
selectFromCombo(":projectComboBox_QComboBox", addToProject)
selectFromCombo(":addToVersionControlComboBox_QComboBox", addToVersionControl)
clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}"))
def __verifyFileCreation__(path, expectedFiles):
@@ -220,7 +218,7 @@ def __modifyAvailableTargets__(available, requiredQt, asStrings=False):
# param path specifies where to create the project
# param projectName is the name for the new project
# 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"
available = __createProjectOrFileSelectType__(" Applications", template)
__createProjectSetNameAndPath__(path, projectName, checks)
@@ -250,7 +248,7 @@ def createProject_Qt_GUI(path, projectName, checks = True):
path = os.path.join(path, projectName)
expectedFiles = [path]
expectedFiles.extend(__sortFilenamesOSDependent__(["main.cpp", cpp_file, h_file, ui_file, pro_file]))
__createProjectHandleLastPage__(expectedFiles)
__createProjectHandleLastPage__(expectedFiles, addToVersionControl)
progressBarWait(20000)
__verifyFileCreation__(path, expectedFiles)
@@ -639,7 +637,7 @@ def compareProjectTree(rootObject, dataset):
return
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:
test.fatal("File must have a name - got None.")
return
@@ -652,7 +650,7 @@ def addCPlusPlusFileToCurrentProject(name, template, forceOverwrite=False):
replaceEditorContent(lineEdit, name)
clickButton(waitForObject(":Next_QPushButton"))
fileExistedBefore = os.path.exists(os.path.join(basePath, name))
__createProjectHandleLastPage__()
__createProjectHandleLastPage__(addToVersionControl = addToVCS)
if (fileExistedBefore):
overwriteDialog = "{type='Core::Internal::PromptOverwriteDialog' unnamed='1' visible='1'}"
waitForObject(overwriteDialog)
+1 -1
View File
@@ -281,7 +281,7 @@ elif platform.system() == 'Darwin':
origSettingsDir = os.path.join(origSettingsDir, "mac")
else:
origSettingsDir = os.path.join(origSettingsDir, "unix")
srcPath = os.getenv("SYSTEST_SRCPATH", sdkPath + "/src")
srcPath = os.getenv("SYSTEST_SRCPATH", os.path.join(sdkPath, "src"))
overrideStartApplication()
+32 -7
View File
@@ -52,19 +52,28 @@ def verifyChecked(objectName):
return object
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:
targetState = Qt.Checked
state = "checked"
else:
targetState = Qt.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,
str(objectName))
test.verify(waitFor("object.checked == shouldBeChecked", 1000))
return object
return widget
# 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
@@ -228,6 +237,14 @@ def invokeMenuItem(menu, item, *subItems):
waitForObject(":Qt Creator.QtCreator.MenuBar_QMenuBar", 2000)
except:
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)
waitFor("menuObject.visible", 1000)
activateItem(menuObject)
@@ -707,3 +724,11 @@ def getQModelIndexStr(property, container):
if (container.startswith(":")):
container = "'%s'" % container
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):
self.__bugs__= {
'QTCREATORBUG-6853':self._workaroundCreator6853_,
'QTCREATORBUG-8735':self._workaroundCreator_MacEditorFocus_
}
# helper function - will be called if no workaround for the requested bug is deposited
def _exitFatal_(self, bugType, number):
@@ -227,7 +226,3 @@ class JIRA:
def _workaroundCreator6853_(self, *args):
if "Release" in args[0] and platform.system() == "Linux":
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
# using a temporary directory won't mess up a potentially existing
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")
if placeCursorToLine(editor, "MouseArea.*", True):
type(editor, '<Up>')
@@ -57,15 +59,21 @@ def main():
invokeMenuItem("File", "Save All")
availableConfigs = iterateBuildConfigs(len(checkedTargets), "Debug")
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.")
else:
performTest(workingDir, projectName, len(checkedTargets), availableConfigs, False)
performTest(workingDir, projectName, len(checkedTargets), availableConfigs, True)
invokeMenuItem("File", "Exit")
def performTest(workingDir, projectName, targetCount, availableConfigs, disableOptimizer):
for kit, config in availableConfigs:
qtVersion = selectBuildConfig(len(checkedTargets), kit, config)[0]
if qtVersion == "4.7.4":
test.xverify(False, "Skipping Qt 4.7.4 to avoid QTCREATORBUG-9185")
continue
qtVersion = selectBuildConfig(targetCount, kit, config)[0]
test.log("Selected kit using Qt %s" % qtVersion)
progressBarWait() # progress bars move buttons
verifyBuildConfig(len(checkedTargets), kit, True, enableQmlDebug=True)
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'}",
@@ -96,18 +104,24 @@ def main():
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 qtVersion.startswith("4.8"):
compareEventsTab(model, "events_qt48.tsv")
if disableOptimizer:
compareEventsTab(model, "events_qt48_nonOptimized.tsv")
else:
compareEventsTab(model, "events_qt47.tsv")
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]:
@@ -117,7 +131,6 @@ def main():
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")
def compareEventsTab(model, file):
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
# 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(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), " xi")
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), "<Return>")
@@ -61,8 +61,6 @@ def main():
"Skipping this file for now.")
continue
if platform.system() == 'Darwin':
JIRA.performWorkaroundForBug(8735, JIRA.Bug.CREATOR, editor)
contentBefore = readFile(currentFile)
popupText = "The file %s was removed. Do you want to save it under a different name, or close the editor?"
os.remove(currentFile)
@@ -91,8 +91,6 @@ def __modifyProFile__():
# re-order some stuff inside header
def __modifyHeader__():
global cppEditorStr, homeShortCut, endShortCut
if platform.system() == "Darwin":
JIRA.performWorkaroundForBug(8735, JIRA.Bug.CREATOR, waitForObject(cppEditorStr, 1000))
if placeCursorToLine(cppEditorStr, "class.+", True):
type(cppEditorStr, homeShortCut)
markText(cppEditorStr, "Down", 5)
@@ -51,8 +51,6 @@ def main():
test.fatal("Could not get the editor for '%s'" % currentFile,
"Skipping this file for now.")
continue
if platform.system() == 'Darwin':
JIRA.performWorkaroundForBug(8735, JIRA.Bug.CREATOR, editor)
for key in ["<Up>", "<Down>", "<Left>", "<Right>"]:
test.log("Selecting everything")
invokeMenuItem("Edit", "Select All")
@@ -52,6 +52,15 @@ def main():
overrideStartApplication()
startApplication("qtcreator" + SettingsPath)
try:
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)
except:
@@ -50,7 +50,7 @@ def main():
["Resources", "musicbrowser.qrc"],
["QML", "musicbrowser.qml"]]:
filenames = ["ABCD" + filename.upper(), "abcd" + filename.lower(), "test", "TEST", filename]
if platform.system() == 'Darwin':
if isQt4Build and platform.system() == 'Darwin':
# avoid QTCREATORBUG-9197
filtered = [filenames[0]]
for i in range(1, len(filenames)):
@@ -61,6 +61,13 @@ def main():
tempFiletype = filetype
if filetype == "QML" and filenames[i - 1][-4:] != ".qml":
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,
filenames[i - 1], filenames[i])
invokeMenuItem("File", "Exit")
@@ -71,8 +78,6 @@ def renameFile(projectDir, proFile, branch, oldname, newname):
oldFileText = readFile(oldFilePath)
itemText = branch + "." + oldname.replace(".", "\\.")
treeview = waitForObject(":Qt Creator_Utils::NavigationTreeView")
if platform.system() == 'Darwin':
JIRA.performWorkaroundForBug(8735, JIRA.Bug.CREATOR, treeview)
try:
openItemContextMenu(treeview, itemText, 5, 5, 0)
except:
+1 -1
View File
@@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false
IMPLICITAUTSTART=0
LANGUAGE=Python
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
WRAPPERS=Qt
@@ -49,6 +49,8 @@ def main():
selectFromCombo(":Send to Codepaster.protocolBox_QComboBox", protocol)
pasteEditor = waitForObject(":stackedWidget.plainTextEdit_QPlainTextEdit")
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())
pastedText = pasteEditor.plainText
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))
clickButton(waitForObject(":CodePaster__Internal__PasteSelectDialog.Cancel_QPushButton"))
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)
clickItem(":CodePaster__Internal__PasteSelectDialog.listWidget_QListWidget", pasteLine, 5, 5, 0, Qt.LeftButton)
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(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(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(StringLiteralPropertyName *ast) { terminal(ast->propertyNameToken); return false; }
virtual bool visit(NumericLiteralPropertyName *ast) { terminal(ast->propertyNameToken); return false; }