Merge remote-tracking branch 'origin/2.7'

Conflicts:
	share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp

Change-Id: I7f319154d5865c47ccfd5f525f0fd7983733dd0e
This commit is contained in:
Eike Ziller
2013-05-03 09:49:28 +02:00
37 changed files with 178 additions and 84 deletions

1
.gitmodules vendored
View File

@@ -1,3 +1,4 @@
[submodule "qbs"]
path = src/shared/qbs
url = ../../qt-labs/qbs.git
ignore = dirty

View File

@@ -12,6 +12,8 @@
#include <private/qquicktextinput_p.h>
#include <private/qquicktextedit_p.h>
#include <designersupport.h>
namespace QmlDesigner {
namespace Internal {
@@ -499,6 +501,10 @@ void GraphicalNodeInstance::doComponentComplete()
disableTextCursor(quickItem());
#if (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0))
DesignerSupport::emitComponentCompleteSignalForAttachedProperty(quickItem());
#endif
quickItem()->update();
}

View File

@@ -7,6 +7,7 @@ QWidget {
LineEdit {
backendValue: backendValues.%2
baseStateFlag: isBaseState
translation: true
}
}
}

View File

@@ -0,0 +1,24 @@
import QtQuick 2.0
import QtQuick.Controls 1.0
import QtQuick.Window 2.0
ApplicationWindow {
width: 640
height: 480
menuBar: MenuBar {
Menu {
title: qsTr("File")
MenuItem {
text: qsTr("Exit")
onTriggered: Qt.quit();
}
}
}
Button {
text: qsTr("Hello World")
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
}

View File

@@ -0,0 +1,21 @@
/* File generated by Qt Creator, version 2.7.0 */
import QmlProject 1.1
Project {
// QTC_REPLACE main.qml WITH main
mainFile: "main.qml"
/* Include .qml, .js, and image files from current directory and subdirectories */
QmlFiles {
directory: "."
}
JavaScriptFiles {
directory: "."
}
ImageFiles {
directory: "."
}
/* List of plugin directories passed to QML runtime */
// importPaths: [ "../exampleplugin" ]
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<template openeditor="main.qml" priority="2"
featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick, QtSupport.Wizards.FeatureQtQuick.2, QtSupport.Wizards.FeatureQtQuick.Controls"
id="QB.QML Application for Qt Quick 2.0">
<displayname>Qt Quick 2 UI with Controls</displayname>
<description>Creates a Qt Quick 2 UI project with a single QML file that contains the main view and uses Qt Quick Controls.&lt;br/&gt;You can review Qt Quick 2 UI projects in the QML Scene and you need not build them. This project requires that you have installed Qt Quick Controls for your Qt version.&lt;br/&gt;&lt;br/&gt;Requires &lt;b&gt;Qt 5.1&lt;/b&gt; or newer.</description>
</template>

View File

@@ -27,7 +27,7 @@ OTHER_FILES = qmldir
qmldir.files = qmldir
unix {
installPath = $$[QT_INSTALL_IMPORTS]/$$replace(uri, \\., /)
installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /)
qmldir.path = $$installPath
target.path = $$installPath
INSTALLS += target qmldir

View File

@@ -45,10 +45,6 @@
<description><![CDATA[This talk discusses various QML best practices and design patterns for building powerful and scalable Qt Quick applications with QML and C++ code.]]></description>
<tags>qt quick, qml</tags>
</tutorial>
<tutorial imageUrl="images/icons/ddays11.png" difficulty="" projectPath="" name="Meet Qt and Qt Quick" isVideo="true" videoUrl="http://qt-project.org/videos/watch/qt-quick-best-practices-and-design-patterns" videoLength="1:07:43">
<description><![CDATA[Are you fully aware of all you can really accomplish with Qt and Qt Quick? Well take you beyond the benefits of Qt and Qt Quick from a marketing standpoint and dive into the technical aspects of what they are and how they work together.]]></description>
<tags>qt quick, qml</tags>
</tutorial>
<tutorial imageUrl="images/icons/ddays12.png" difficulty="" projectPath="" name="What is New in QtWebKit in 5.0" isVideo="true" videoUrl="http://www.youtube.com/watch?v=xEuapSGxaeU" videoLength="1:01:55">
<description><![CDATA[The web platform continues to evolve at breakneck speed. With our WebKit port to Qt 5 we are bringing these latest web technologies to the Qt world.]]></description>
<tags>qt, webkit</tags>

View File

@@ -280,6 +280,10 @@ bool AndroidManager::ensureIconAttribute(ProjectExplorer::Target *target)
QString AndroidManager::targetSDK(ProjectExplorer::Target *target)
{
QVariant v = target->namedSettings(QLatin1String("AndroidManager.TargetSdk"));
if (v.isValid())
return v.toString();
QString fallback = QLatin1String("android-8");
if (QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(target->kit()))
if (qt->qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0))
@@ -287,6 +291,7 @@ QString AndroidManager::targetSDK(ProjectExplorer::Target *target)
if (!createAndroidTemplatesIfNecessary(target))
return AndroidConfigurations::instance().bestMatch(fallback);
QFile file(defaultPropertiesPath(target).toString());
if (!file.open(QIODevice::ReadOnly))
return AndroidConfigurations::instance().bestMatch(fallback);
@@ -301,6 +306,7 @@ QString AndroidManager::targetSDK(ProjectExplorer::Target *target)
bool AndroidManager::setTargetSDK(ProjectExplorer::Target *target, const QString &sdk)
{
updateTarget(target, sdk, applicationName(target));
target->setNamedSettings(QLatin1String("AndroidManager.TargetSdk"), sdk);
return true;
}

View File

@@ -118,8 +118,6 @@ void AndroidQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::En
if (AndroidConfigurations::instance().config().ndkLocation.isEmpty()
|| AndroidConfigurations::instance().config().sdkLocation.isEmpty())
return;
if (AndroidConfigurations::instance().sdkTargets().isEmpty())
return;
env.set(QLatin1String("ANDROID_NDK_PLATFORM"),
AndroidConfigurations::instance().bestMatch(AndroidManager::targetSDK(target)));

View File

@@ -43,6 +43,7 @@ class CMakeProject;
class CMakeUiCodeModelSupport : public CppTools::UiCodeModelSupport
{
Q_OBJECT
public:
CMakeUiCodeModelSupport(CppTools::CppModelManagerInterface *modelmanager,
CMakeProject *project,

View File

@@ -2215,7 +2215,8 @@ void EditorManager::removeAllSplits()
d->m_splitter->unsplitAll();
if (!editor)
editor = pickUnusedEditor();
activateEditor(editor);
if (editor)
activateEditor(editor);
}
void EditorManager::gotoOtherSplit()

View File

@@ -33,12 +33,14 @@
#include "cpptools_global.h"
#include <QString>
#include <QObject>
namespace CppTools {
class CppModelManagerInterface;
class CPPTOOLS_EXPORT AbstractEditorSupport
class CPPTOOLS_EXPORT AbstractEditorSupport : public QObject
{
Q_OBJECT
public:
explicit AbstractEditorSupport(CppModelManagerInterface *modelmanager);
virtual ~AbstractEditorSupport();

View File

@@ -44,11 +44,12 @@ UiCodeModelSupport::UiCodeModelSupport(CppModelManagerInterface *modelmanager,
: AbstractEditorSupport(modelmanager),
m_sourceName(source),
m_fileName(uiHeaderFile),
m_initialized(false),
m_running(false)
m_state(BARE)
{
if (debug)
qDebug()<<"ctor UiCodeModelSupport for"<<m_sourceName<<uiHeaderFile;
connect(&m_process, SIGNAL(finished(int)),
this, SLOT(finishProcess()));
}
UiCodeModelSupport::~UiCodeModelSupport()
@@ -59,7 +60,8 @@ UiCodeModelSupport::~UiCodeModelSupport()
void UiCodeModelSupport::init() const
{
m_initialized = true;
if (m_state != BARE)
return;
QDateTime sourceTime = QFileInfo(m_sourceName).lastModified();
QFileInfo uiHeaderFileInfo(m_fileName);
QDateTime uiHeaderTime = uiHeaderFileInfo.exists() ? uiHeaderFileInfo.lastModified() : QDateTime();
@@ -71,6 +73,7 @@ void UiCodeModelSupport::init() const
QTextStream stream(&file);
m_contents = stream.readAll().toUtf8();
m_cacheTime = uiHeaderTime;
m_state = FINISHED;
return;
}
}
@@ -91,20 +94,25 @@ void UiCodeModelSupport::init() const
qDebug()<<"uic run wasn't succesfull";
m_cacheTime = QDateTime ();
m_contents = QByteArray();
m_state = FINISHED;
return;
}
} else {
if (debug)
qDebug()<<"Could open "<<m_sourceName<<"needed for the cpp model";
m_contents = QByteArray();
m_state = FINISHED;
}
}
QByteArray UiCodeModelSupport::contents() const
{
if (!m_initialized)
// Check the common case first
if (m_state == FINISHED)
return m_contents;
if (m_state == BARE)
init();
if (m_running)
if (m_state == RUNNING)
finishProcess();
return m_contents;
@@ -120,13 +128,16 @@ void UiCodeModelSupport::setFileName(const QString &name)
if (m_fileName == name && m_cacheTime.isValid())
return;
if (m_state == RUNNING)
finishProcess();
if (debug)
qDebug() << "UiCodeModelSupport::setFileName"<<name;
m_fileName = name;
m_contents.clear();
m_cacheTime = QDateTime();
init();
m_state = BARE;
}
bool UiCodeModelSupport::runUic(const QString &ui) const
@@ -145,19 +156,23 @@ bool UiCodeModelSupport::runUic(const QString &ui) const
if (!m_process.waitForBytesWritten(3000))
goto error;
m_process.closeWriteChannel();
m_running = true;
m_state = RUNNING;
return true;
error:
if (debug)
qDebug() << "failed" << m_process.readAllStandardError();
m_process.kill();
m_running = false;
m_state = FINISHED;
return false;
}
void UiCodeModelSupport::updateFromEditor(const QString &formEditorContents)
{
if (m_state == BARE)
init();
if (m_state == RUNNING)
finishProcess();
if (runUic(formEditorContents))
if (finishProcess())
updateDocument();
@@ -165,23 +180,29 @@ void UiCodeModelSupport::updateFromEditor(const QString &formEditorContents)
bool UiCodeModelSupport::finishProcess() const
{
if (!m_running)
if (m_state != RUNNING)
return false;
if (!m_process.waitForFinished(3000)
&& m_process.exitStatus() != QProcess::NormalExit
&& m_process.exitCode() != 0) {
if (m_state != RUNNING) // waitForFinished can recurse into finishProcess
return false;
if (debug)
qDebug() << "failed" << m_process.readAllStandardError();
m_process.kill();
m_running = false;
m_state = FINISHED;
return false;
}
if (m_state != RUNNING) // waitForFinished can recurse into finishProcess
return true;
m_contents = m_process.readAllStandardOutput();
m_cacheTime = QDateTime::currentDateTime();
if (debug)
qDebug() << "ok" << m_contents.size() << "bytes.";
m_running = false;
m_state = FINISHED;
return true;
}
@@ -189,6 +210,10 @@ void UiCodeModelSupport::updateFromBuild()
{
if (debug)
qDebug()<<"UiCodeModelSupport::updateFromBuild() for file"<<m_sourceName;
if (m_state == BARE)
init();
if (m_state == RUNNING)
finishProcess();
// This is mostly a fall back for the cases when uic couldn't be run
// it pays special attention to the case where a ui_*h was newly created
QDateTime sourceTime = QFileInfo(m_sourceName).lastModified();

View File

@@ -42,6 +42,7 @@ namespace CppTools {
class CPPTOOLS_EXPORT UiCodeModelSupport : public AbstractEditorSupport
{
Q_OBJECT
public:
UiCodeModelSupport(CppTools::CppModelManagerInterface *modelmanager,
const QString &sourceFile,
@@ -57,16 +58,18 @@ protected:
virtual QString uicCommand() const = 0;
virtual QStringList environment() const = 0;
private:
enum State { BARE, RUNNING, FINISHED };
void init() const;
bool runUic(const QString &ui) const;
bool finishProcess() const;
Q_SLOT bool finishProcess() const;
mutable QProcess m_process;
QString m_sourceName;
QString m_fileName;
mutable bool m_initialized;
mutable State m_state;
mutable QByteArray m_contents;
mutable QDateTime m_cacheTime;
mutable bool m_running;
static QList<UiCodeModelSupport *> m_waitingForStart;
};
} // CppTools

View File

@@ -61,7 +61,6 @@ QmlInspectorAgent::QmlInspectorAgent(DebuggerEngine *engine, QObject *parent)
, m_engineQueryId(0)
, m_rootContextQueryId(0)
, m_objectToSelect(-1)
, m_newObjectsCreated(false)
{
m_debugIdToIname.insert(-1, QByteArray("inspect"));
connect(debuggerCore()->action(ShowQmlObjectTree),
@@ -811,11 +810,6 @@ QList<WatchData> QmlInspectorAgent::buildWatchData(const ObjectReference &obj,
// element makes sure we're queried on expansion.
if (obj.needsMoreData())
return list;
// To improve performance, we do not insert data for items
// that have not been previously queried when the object tree is refreshed.
if (m_newObjectsCreated)
append = false;
}
// properties
@@ -886,10 +880,6 @@ void QmlInspectorAgent::clearObjectTree()
m_debugIdToIname.clear();
m_debugIdToIname.insert(-1, QByteArray("inspect"));
m_objectStack.clear();
// reset only for qt > 4.8.3.
if (m_engineClient->objectName() != QLatin1String(QDECLARATIVE_ENGINE))
m_newObjectsCreated = false;
removeAllObjectWatches();
}
} // Internal

View File

@@ -143,7 +143,6 @@ private:
QList<int> m_objectWatches;
QList<int> m_fetchDataIds;
QTimer m_delayQueryTimer;
bool m_newObjectsCreated;
};
} // Internal

View File

@@ -2413,12 +2413,13 @@ void GitClient::handleMergeConflicts(const QString &workingDir, const QString &c
{
QString message = commit.isEmpty() ? tr("Conflicts detected")
: tr("Conflicts detected with commit %1").arg(commit);
QMessageBox mergeOrAbort(QMessageBox::Question, tr("Conflicts Detected"),
message, QMessageBox::Ignore | QMessageBox::Abort);
QMessageBox mergeOrAbort(QMessageBox::Question, tr("Conflicts Detected"), message);
QPushButton *mergeToolButton = mergeOrAbort.addButton(tr("Run &Merge Tool"),
QMessageBox::ActionRole);
QMessageBox::AcceptRole);
mergeOrAbort.addButton(QMessageBox::Ignore);
if (abortCommand == QLatin1String("rebase"))
mergeOrAbort.addButton(tr("&Skip"), QMessageBox::ActionRole);
mergeOrAbort.addButton(tr("&Skip"), QMessageBox::RejectRole);
mergeOrAbort.addButton(QMessageBox::Abort);
switch (mergeOrAbort.exec()) {
case QMessageBox::Abort:
synchronousAbortCommand(workingDir, abortCommand);

View File

@@ -63,6 +63,7 @@ const char DC_COUNT_KEY[] = "ProjectExplorer.Target.DeployConfigurationCount";
const char ACTIVE_RC_KEY[] = "ProjectExplorer.Target.ActiveRunConfiguration";
const char RC_KEY_PREFIX[] = "ProjectExplorer.Target.RunConfiguration.";
const char RC_COUNT_KEY[] = "ProjectExplorer.Target.RunConfigurationCount";
const char PLUGIN_SETTINGS_KEY[] = "ProjectExplorer.Target.PluginSettings";
} // namespace
@@ -92,6 +93,7 @@ public:
RunConfiguration* m_activeRunConfiguration;
DeploymentData m_deploymentData;
BuildTargetInfoList m_appTargets;
QVariantMap m_pluginSettings;
QPixmap m_connectedPixmap;
QPixmap m_readyToUsePixmap;
@@ -517,6 +519,8 @@ QVariantMap Target::toMap() const
for (int i = 0; i < rcs.size(); ++i)
map.insert(QString::fromLatin1(RC_KEY_PREFIX) + QString::number(i), rcs.at(i)->toMap());
map.insert(QLatin1String(PLUGIN_SETTINGS_KEY), d->m_pluginSettings);
return map;
}
@@ -663,6 +667,19 @@ void Target::updateDefaultRunConfigurations()
addRunConfiguration(rc);
}
QVariant Target::namedSettings(const QString &name) const
{
return d->m_pluginSettings.value(name);
}
void Target::setNamedSettings(const QString &name, const QVariant &value)
{
if (value.isNull())
d->m_pluginSettings.remove(name);
else
d->m_pluginSettings.insert(name, value);
}
static QString formatToolTip(const IDevice::DeviceInfo &input)
{
QStringList lines;
@@ -824,6 +841,9 @@ bool Target::fromMap(const QVariantMap &map)
setActiveRunConfiguration(rc);
}
if (map.contains(QLatin1String(PLUGIN_SETTINGS_KEY)))
d->m_pluginSettings = map.value(QLatin1String(PLUGIN_SETTINGS_KEY)).toMap();
return true;
}

View File

@@ -116,6 +116,8 @@ public:
void updateDefaultDeployConfigurations();
void updateDefaultRunConfigurations();
QVariant namedSettings(const QString &name) const;
void setNamedSettings(const QString &name, const QVariant &value);
signals:
void targetEnabled(bool);
void iconChanged();

View File

@@ -256,8 +256,7 @@ MetaInfo {
version: "1.0"
requiredImport: "QtQuick.Controls"
Property { name: "width"; type: "int"; value: 360; }
Property { name: "height"; type: "int"; value: 50; }
}
}
@@ -288,9 +287,6 @@ MetaInfo {
libraryIcon: ":/desktopplugin/images/toolbar.png"
version: "1.0"
requiredImport: "QtQuick.Controls"
Property { name: "width"; type: "int"; value: 360; }
Property { name: "height"; type: "int"; value: 50; }
}
}

View File

@@ -77,7 +77,7 @@ using namespace QmlJS;
typedef QPair<PropertyName, TypeName> PropertyInfo;
QList<PropertyInfo> getObjectTypes(const ObjectValue *ov, const ContextPtr &context, bool local = false);
QList<PropertyInfo> getObjectTypes(const ObjectValue *ov, const ContextPtr &context, bool local = false, int rec = 0);
static TypeName resolveTypeName(const ASTPropertyReference *ref, const ContextPtr &context, QList<PropertyInfo> &dotProperties)
{
@@ -219,7 +219,7 @@ QStringList prototypes(const ObjectValue *ov, const ContextPtr &context, bool ve
return list;
}
QList<PropertyInfo> getQmlTypes(const CppComponentValue *objectValue, const ContextPtr &context, bool local = false)
QList<PropertyInfo> getQmlTypes(const CppComponentValue *objectValue, const ContextPtr &context, bool local = false, int rec = 0)
{
QList<PropertyInfo> propertyList;
@@ -228,6 +228,9 @@ QList<PropertyInfo> getQmlTypes(const CppComponentValue *objectValue, const Cont
if (objectValue->className().isEmpty())
return propertyList;
if (rec > 2)
return propertyList;
PropertyMemberProcessor processor(context);
objectValue->processMembers(&processor);
@@ -239,7 +242,7 @@ QList<PropertyInfo> getQmlTypes(const CppComponentValue *objectValue, const Cont
//dot property
const CppComponentValue * qmlValue = value_cast<CppComponentValue>(objectValue->lookupMember(name, context));
if (qmlValue) {
QList<PropertyInfo> dotProperties = getQmlTypes(qmlValue, context);
QList<PropertyInfo> dotProperties = getQmlTypes(qmlValue, context, false, rec + 1);
foreach (const PropertyInfo &propertyInfo, dotProperties) {
PropertyName dotName = propertyInfo.first;
TypeName type = propertyInfo.second;
@@ -251,7 +254,7 @@ QList<PropertyInfo> getQmlTypes(const CppComponentValue *objectValue, const Cont
if (isValueType(objectValue->propertyType(name))) {
const ObjectValue *dotObjectValue = value_cast<ObjectValue>(objectValue->lookupMember(name, context));
if (dotObjectValue) {
QList<PropertyInfo> dotProperties = getObjectTypes(dotObjectValue, context);
QList<PropertyInfo> dotProperties = getObjectTypes(dotObjectValue, context, false, rec + 1);
foreach (const PropertyInfo &propertyInfo, dotProperties) {
PropertyName dotName = propertyInfo.first;
TypeName type = propertyInfo.second;
@@ -272,9 +275,9 @@ QList<PropertyInfo> getQmlTypes(const CppComponentValue *objectValue, const Cont
const CppComponentValue * qmlObjectValue = value_cast<CppComponentValue>(prototype);
if (qmlObjectValue)
propertyList.append(getQmlTypes(qmlObjectValue, context));
propertyList.append(getQmlTypes(qmlObjectValue, context, false, rec + 1));
else
propertyList.append(getObjectTypes(prototype, context));
propertyList.append(getObjectTypes(prototype, context, false, rec + 1));
}
return propertyList;
@@ -320,7 +323,7 @@ QList<PropertyInfo> getTypes(const ObjectValue *objectValue, const ContextPtr &c
return propertyList;
}
QList<PropertyInfo> getObjectTypes(const ObjectValue *objectValue, const ContextPtr &context, bool local)
QList<PropertyInfo> getObjectTypes(const ObjectValue *objectValue, const ContextPtr &context, bool local, int rec)
{
QList<PropertyInfo> propertyList;
@@ -329,6 +332,9 @@ QList<PropertyInfo> getObjectTypes(const ObjectValue *objectValue, const Context
if (objectValue->className().isEmpty())
return propertyList;
if (rec > 2)
return propertyList;
PropertyMemberProcessor processor(context);
objectValue->processMembers(&processor);
@@ -343,9 +349,9 @@ QList<PropertyInfo> getObjectTypes(const ObjectValue *objectValue, const Context
const CppComponentValue * qmlObjectValue = value_cast<CppComponentValue>(prototype);
if (qmlObjectValue)
propertyList.append(getQmlTypes(qmlObjectValue, context));
propertyList.append(getQmlTypes(qmlObjectValue, context, local, rec + 1));
else
propertyList.append(getObjectTypes(prototype, context));
propertyList.append(getObjectTypes(prototype, context, local, rec + 1));
}
return propertyList;

View File

@@ -101,7 +101,7 @@ static inline bool checkIfDerivedFromItem(const QString &fileName)
snapshot.insert(document);
QmlJS::Link link(snapshot, QStringList(), QmlJS::ModelManagerInterface::instance()->builtins(document));
QmlJS::Link link(snapshot, modelManager->importPaths(), QmlJS::ModelManagerInterface::instance()->builtins(document));
QList<QmlJS::DiagnosticMessage> diagnosticLinkMessages;
QmlJS::ContextPtr context = link(document, &diagnosticLinkMessages);
@@ -116,15 +116,7 @@ static inline bool checkIfDerivedFromItem(const QString &fileName)
if (!definition)
return false;
QString fullTypeName;
for (QmlJS::AST::UiQualifiedId *iter = definition->qualifiedTypeNameId; iter; iter = iter->next)
if (!iter->name.isEmpty())
fullTypeName += iter->name.toString() + QLatin1Char('.');
if (fullTypeName.endsWith(QLatin1Char('.')))
fullTypeName.chop(1);
const QmlJS::ObjectValue *objectValue = context->lookupType(document.data(), fullTypeName.split('.'));
const QmlJS::ObjectValue *objectValue = context->lookupType(document.data(), definition->qualifiedTypeNameId);
QList<const QmlJS::ObjectValue *> prototypes = QmlJS::PrototypeIterator(objectValue, context).all();

View File

@@ -76,7 +76,6 @@ QtcPlugin {
"qml/RangeMover.qml",
"qml/SelectionRange.qml",
"qml/SelectionRangeDetails.qml",
"qml/StatusDisplay.qml",
"qml/TimeDisplay.qml",
"qml/TimeMarks.qml",
"qml/qmlprofiler.qrc",

View File

@@ -42,6 +42,7 @@ namespace Internal {
class Qt4UiCodeModelSupport : public CppTools::UiCodeModelSupport
{
Q_OBJECT
public:
Qt4UiCodeModelSupport(CppTools::CppModelManagerInterface *modelmanager,
Qt4Project *project,

View File

@@ -716,7 +716,7 @@ bool ExamplesListModelFilter::filterAcceptsRow(int sourceRow, const QModelIndex
if (!m_showTutorialsOnly) {
int type = sourceModel()->index(sourceRow, 0, sourceParent).data(Type).toInt();
if (type != Example)
if (type != Example && type != Demo)
return false;
}

View File

@@ -160,8 +160,7 @@ def selectBuildConfig(targetCount, currentTarget, configName):
switchViewTo(ViewConstants.PROJECTS)
switchToBuildOrRunSettingsFor(targetCount, currentTarget, ProjectSettings.BUILD)
if selectFromCombo(":scrollArea.Edit build configuration:_QComboBox", configName):
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}",
"sourceFilesRefreshed(QStringList)")
progressBarWait(30000)
return getQtInformationForBuildSettings(targetCount, True, ViewConstants.EDIT)
# This will not trigger a rebuild. If needed, caller has to do this.

View File

@@ -175,7 +175,7 @@ def createProject_Qt_GUI(path, projectName, checks = True):
expectedFiles.extend(__sortFilenamesOSDependent__(["main.cpp", cpp_file, h_file, ui_file, pro_file]))
__createProjectHandleLastPage__(expectedFiles)
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 20000)
progressBarWait(20000)
__verifyFileCreation__(path, expectedFiles)
return checkedTargets
@@ -199,7 +199,7 @@ def createProject_Qt_Console(path, projectName, checks = True):
expectedFiles.extend(__sortFilenamesOSDependent__([cpp_file, pro_file]))
__createProjectHandleLastPage__(expectedFiles)
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 10000)
progressBarWait(10000)
__verifyFileCreation__(path, expectedFiles)
return checkedTargets
@@ -224,7 +224,7 @@ def createNewQtQuickApplication(workingDir, projectName = None, templateFile = N
clickButton(nextButton)
__createProjectHandleLastPage__()
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 10000)
progressBarWait(10000)
return checkedTargets, projectName
def createNewQtQuickUI(workingDir):

View File

@@ -609,9 +609,9 @@ def checkIfObjectExists(name, shouldExist = True, timeout = 3000, verboseOnFail
return result
# wait for progress bar(s) to appear and disappear
def progressBarWait():
def progressBarWait(timeout=60000):
checkIfObjectExists("{type='Core::Internal::ProgressBar' unnamed='1'}", True, 2000)
checkIfObjectExists("{type='Core::Internal::ProgressBar' unnamed='1'}", False, 60000)
checkIfObjectExists("{type='Core::Internal::ProgressBar' unnamed='1'}", False, timeout)
def readFile(filename):
f = open(filename, "r")

View File

@@ -19,7 +19,7 @@ def main():
openQmakeProject(examplePath)
installLazySignalHandler("{type='Core::FutureProgress' unnamed='1'}", "finished()", "__handleFutureProgress__")
# wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
progressBarWait(30000)
# open .cpp file in editor
if not openDocument("propertyanimation.Sources.main\\.cpp"):
test.fatal("Could not open main.cpp")

View File

@@ -17,7 +17,7 @@ def main():
# open example project
openQmakeProject(examplePath)
# wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
progressBarWait(30000)
# open .cpp file in editor
if not openDocument("propertyanimation.Sources.main\\.cpp"):
test.fatal("Could not open main.cpp")

View File

@@ -28,8 +28,7 @@ def main():
# select "Create Project" and try to create a new project.
# create Qt Quick application from "Welcome" page -> "Develop" tab
createNewQtQuickApplication(tempDir(), "SampleApp", fromWelcome = True)
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}",
"sourceFilesRefreshed(QStringList)")
progressBarWait(30000)
test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"
" text~='SampleApp( \(.*\))?' type='QModelIndex'}"),
"Verifying: The project is opened in 'Edit' mode after configuring.")
@@ -42,8 +41,7 @@ def main():
examplePath = os.path.join(prepareTemplate(sourceExample), "propertyanimation.pro")
# open example project from "Welcome" page -> "Develop" tab
openQmakeProject(examplePath, fromWelcome = True)
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}",
"sourceFilesRefreshed(QStringList)")
progressBarWait(30000)
test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"
" text~='propertyanimation( \(.*\))?' type='QModelIndex'}"),
"Verifying: The project is opened in 'Edit' mode after configuring.")

View File

@@ -19,9 +19,8 @@ def main():
overrideInstallLazySignalHandler()
installLazySignalHandler(":Qt Creator_CppEditor::Internal::CPPEditorWidget", "textChanged()",
"__handleTextChanged__")
prepareForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
openQmakeProject(proFile)
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 20000)
progressBarWait(20000)
selectFromLocator("dummy.cpp")
## Waiting for a solution from Froglogic to make the below work.

View File

@@ -21,7 +21,7 @@ def main():
if platform.system() in ('Windows', 'Microsoft'):
suitableKits |= Targets.DESKTOP_474_MSVC2008
checkedTargets = openQmakeProject(SpeedCrunchPath, suitableKits)
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
progressBarWait(30000)
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")

View File

@@ -21,7 +21,7 @@ def main():
test.fatal("Could not open/create cmake project - leaving test")
invokeMenuItem("File", "Exit")
return
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
progressBarWait(30000)
# Invoke a rebuild of the application
invokeMenuItem("Build", "Rebuild All")

View File

@@ -12,10 +12,10 @@ def main():
openQmakeProject(pathSpeedcrunch)
# Wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
progressBarWait(30000)
openQmakeProject(pathCreator)
# Wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 300000)
progressBarWait(300000)
naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='%s' type='QModelIndex'}"
compareProjectTree(naviTreeView % "speedcrunch( \(\S+\))?", "projecttree_speedcrunch.tsv")

View File

@@ -7,7 +7,7 @@ def main():
# using a temporary directory won't mess up a potentially existing
createNewQmlExtension(tempDir())
# wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
progressBarWait(30000)
test.log("Building project")
invokeMenuItem("Build","Build All")
waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)")