Commit a2171c2d authored by Eike Ziller's avatar Eike Ziller
Browse files

Merge remote-tracking branch 'origin/2.7'

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

Change-Id: I7f319154d5865c47ccfd5f525f0fd7983733dd0e
parents 364c9547 6999e3c3
[submodule "qbs"]
path = src/shared/qbs
url = ../../qt-labs/qbs.git
ignore = dirty
......@@ -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();
}
......
......@@ -7,6 +7,7 @@ QWidget {
LineEdit {
backendValue: backendValues.%2
baseStateFlag: isBaseState
translation: true
}
}
}
\ No newline at end of file
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
}
}
/* 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" ]
}
<?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>
......@@ -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
......
......@@ -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? We’ll 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>
......
......@@ -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;
}
......
......@@ -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)));
......
......@@ -43,6 +43,7 @@ class CMakeProject;
class CMakeUiCodeModelSupport : public CppTools::UiCodeModelSupport
{
Q_OBJECT
public:
CMakeUiCodeModelSupport(CppTools::CppModelManagerInterface *modelmanager,
CMakeProject *project,
......
......@@ -2215,7 +2215,8 @@ void EditorManager::removeAllSplits()
d->m_splitter->unsplitAll();
if (!editor)
editor = pickUnusedEditor();
activateEditor(editor);
if (editor)
activateEditor(editor);
}
void EditorManager::gotoOtherSplit()
......
......@@ -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();
......
......@@ -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();
......
......@@ -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
......
......@@ -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
......
......@@ -143,7 +143,6 @@ private:
QList<int> m_objectWatches;
QList<int> m_fetchDataIds;
QTimer m_delayQueryTimer;
bool m_newObjectsCreated;
};
} // Internal
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment