Merge remote-tracking branch 'origin/4.5'

Conflicts:
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp

Change-Id: I726babe61e28db14d06a6a1a5c570e148745b458
This commit is contained in:
Eike Ziller
2017-11-09 14:04:45 +01:00
32 changed files with 12890 additions and 13115 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -61,6 +61,17 @@
\endlist \endlist
The \uicontrol {Application Output} pane displays the status of the
application while it is running. You can select the \uicontrol Run button
in the pane to re-run applications without building them first. This is
useful when developing Qt Quick applications, because the QML files are
interpreted at runtime. Therefore, the application does not need to be
built again if you edited only QML files. This saves time especially if
the application contains large image files that would need to be bundled
into the resource file before running the application.
\image qtcreator-application-output.png
For more information on the options you have, see For more information on the options you have, see
\l{Specifying Run Settings}. \l{Specifying Run Settings}.

View File

@@ -2911,7 +2911,7 @@ class DumperBase:
def display(self, useHex = 1): def display(self, useHex = 1):
if self.type.code == TypeCodeEnum: if self.type.code == TypeCodeEnum:
intval = self.integer() intval = self.integer()
if useHex: if useHex and hasattr(self.type.typeData(), 'enumHexDisplay'):
return self.type.typeData().enumHexDisplay(intval, self.laddress) return self.type.typeData().enumHexDisplay(intval, self.laddress)
return self.type.typeData().enumDisplay(intval, self.laddress) return self.type.typeData().enumDisplay(intval, self.laddress)
simple = self.value() simple = self.value()

View File

@@ -209,6 +209,7 @@ PaletteButton=shadowBackground
PaletteBrightText=ffff3333 PaletteBrightText=ffff3333
PaletteText=text PaletteText=text
PaletteButtonText=text PaletteButtonText=text
PaletteButtonTextDisabled=textDisabled
PaletteToolTipBase=selectedBackground PaletteToolTipBase=selectedBackground
PaletteHighlight=selectedBackground PaletteHighlight=selectedBackground
PaletteDark=shadowBackground PaletteDark=shadowBackground

File diff suppressed because it is too large Load Diff

View File

@@ -331,38 +331,40 @@ static QString firstTestCaseTarget(const TestConfiguration *config)
return TestRunner::tr("<unknown>"); return TestRunner::tr("<unknown>");
} }
static bool askUserForRunConfiguration(TestConfiguration *config) static ProjectExplorer::RunConfiguration *getRunConfiguration(const QString &dialogDetail)
{ {
using namespace ProjectExplorer; using namespace ProjectExplorer;
RunConfigurationSelectionDialog dialog(firstTestCaseTarget(config), const Project *project = SessionManager::startupProject();
Core::ICore::dialogParent()); if (!project)
return nullptr;
const Target *target = project->activeTarget();
if (!target)
return nullptr;
RunConfiguration *runConfig = nullptr;
const QList<RunConfiguration *> runConfigurations
= Utils::filtered(target->runConfigurations(), [] (const RunConfiguration *rc) {
if (!rc->runnable().is<StandardRunnable>())
return false;
return !rc->runnable().as<StandardRunnable>().executable.isEmpty();
});
if (runConfigurations.size() == 1)
return runConfigurations.first();
RunConfigurationSelectionDialog dialog(dialogDetail, Core::ICore::dialogParent());
if (dialog.exec() == QDialog::Accepted) { if (dialog.exec() == QDialog::Accepted) {
const QString dName = dialog.displayName(); const QString dName = dialog.displayName();
if (dName.isEmpty()) if (dName.isEmpty())
return false; return nullptr;
// run configuration has been selected - fill config based on this one.. // run configuration has been selected - fill config based on this one..
const QString exe = dialog.executable(); const QString exe = dialog.executable();
// paranoia... can the current startup project have changed meanwhile? runConfig = Utils::findOr(runConfigurations, nullptr, [&dName, &exe] (const RunConfiguration *rc) {
if (auto project = SessionManager::startupProject()) {
if (auto target = project->activeTarget()) {
RunConfiguration *runConfig
= Utils::findOr(target->runConfigurations(), nullptr,
[&dName, &exe] (const RunConfiguration *rc) {
if (rc->displayName() != dName) if (rc->displayName() != dName)
return false; return false;
if (!rc->runnable().is<StandardRunnable>()) return rc->runnable().as<StandardRunnable>().executable == exe;
return false;
StandardRunnable runnable = rc->runnable().as<StandardRunnable>();
return runnable.executable == exe;
}); });
if (runConfig) {
config->setOriginalRunConfiguration(runConfig);
return true;
} }
} return runConfig;
}
}
return false;
} }
void TestRunner::runTests() void TestRunner::runTests()
@@ -370,10 +372,13 @@ void TestRunner::runTests()
QList<TestConfiguration *> toBeRemoved; QList<TestConfiguration *> toBeRemoved;
for (TestConfiguration *config : m_selectedTests) { for (TestConfiguration *config : m_selectedTests) {
config->completeTestInformation(TestRunMode::Run); config->completeTestInformation(TestRunMode::Run);
if (!config->hasExecutable()) if (!config->hasExecutable()) {
if (!askUserForRunConfiguration(config)) if (auto rc = getRunConfiguration(firstTestCaseTarget(config)))
config->setOriginalRunConfiguration(rc);
else
toBeRemoved.append(config); toBeRemoved.append(config);
} }
}
for (TestConfiguration *config : toBeRemoved) for (TestConfiguration *config : toBeRemoved)
m_selectedTests.removeOne(config); m_selectedTests.removeOne(config);
qDeleteAll(toBeRemoved); qDeleteAll(toBeRemoved);
@@ -427,8 +432,8 @@ void TestRunner::debugTests()
TestConfiguration *config = m_selectedTests.first(); TestConfiguration *config = m_selectedTests.first();
config->completeTestInformation(TestRunMode::Debug); config->completeTestInformation(TestRunMode::Debug);
if (!config->hasExecutable()) { if (!config->hasExecutable()) {
if (askUserForRunConfiguration(config)) if (auto *rc = getRunConfiguration(firstTestCaseTarget(config)))
config->completeTestInformation(config->originalRunConfiguration(), TestRunMode::Debug); config->completeTestInformation(rc, TestRunMode::Debug);
} }
if (!config->runConfiguration()) { if (!config->runConfiguration()) {

View File

@@ -54,16 +54,16 @@ const char LAST_PLATFORM_KEY[] = "Core/NewDialog/LastPlatform";
class WizardFactoryContainer class WizardFactoryContainer
{ {
public: public:
WizardFactoryContainer() : wizard(0), wizardOption(0) {} WizardFactoryContainer() : wizard(nullptr), wizardOption(0) {}
WizardFactoryContainer(Core::IWizardFactory *w, int i): wizard(w), wizardOption(i) {} WizardFactoryContainer(Core::IWizardFactory *w, int i): wizard(w), wizardOption(i) {}
Core::IWizardFactory *wizard; Core::IWizardFactory *wizard;
int wizardOption; int wizardOption;
}; };
inline Core::IWizardFactory *factoryOfItem(const QStandardItem *item = 0) inline Core::IWizardFactory *factoryOfItem(const QStandardItem *item = nullptr)
{ {
if (!item) if (!item)
return 0; return nullptr;
return item->data(Qt::UserRole).value<WizardFactoryContainer>().wizard; return item->data(Qt::UserRole).value<WizardFactoryContainer>().wizard;
} }
@@ -71,7 +71,7 @@ class PlatformFilterProxyModel : public QSortFilterProxyModel
{ {
// Q_OBJECT // Q_OBJECT
public: public:
PlatformFilterProxyModel(QObject *parent = 0): QSortFilterProxyModel(parent) {} PlatformFilterProxyModel(QObject *parent = nullptr): QSortFilterProxyModel(parent) {}
void setPlatform(Core::Id platform) void setPlatform(Core::Id platform)
{ {
@@ -99,7 +99,7 @@ class TwoLevelProxyModel : public QAbstractProxyModel
{ {
// Q_OBJECT // Q_OBJECT
public: public:
TwoLevelProxyModel(QObject *parent = 0): QAbstractProxyModel(parent) {} TwoLevelProxyModel(QObject *parent = nullptr): QAbstractProxyModel(parent) {}
QModelIndex index(int row, int column, const QModelIndex &parent) const override QModelIndex index(int row, int column, const QModelIndex &parent) const override
{ {
@@ -145,7 +145,7 @@ public:
class FancyTopLevelDelegate : public QItemDelegate class FancyTopLevelDelegate : public QItemDelegate
{ {
public: public:
FancyTopLevelDelegate(QObject *parent = 0) FancyTopLevelDelegate(QObject *parent = nullptr)
: QItemDelegate(parent) {} : QItemDelegate(parent) {}
void drawDisplay(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect, const QString &text) const override void drawDisplay(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect, const QString &text) const override
@@ -394,7 +394,7 @@ static QIcon iconWithText(const QIcon &icon, const QString &text)
void NewDialog::addItem(QStandardItem *topLevelCategoryItem, IWizardFactory *factory) void NewDialog::addItem(QStandardItem *topLevelCategoryItem, IWizardFactory *factory)
{ {
const QString categoryName = factory->category(); const QString categoryName = factory->category();
QStandardItem *categoryItem = 0; QStandardItem *categoryItem = nullptr;
for (int i = 0; i < topLevelCategoryItem->rowCount(); i++) { for (int i = 0; i < topLevelCategoryItem->rowCount(); i++) {
if (topLevelCategoryItem->child(i, 0)->data(Qt::UserRole) == categoryName) if (topLevelCategoryItem->child(i, 0)->data(Qt::UserRole) == categoryName)
categoryItem = topLevelCategoryItem->child(i, 0); categoryItem = topLevelCategoryItem->child(i, 0);

View File

@@ -668,12 +668,14 @@ void DebuggerEngine::notifyEngineSetupOk()
if (isMasterEngine() && runTool()) if (isMasterEngine() && runTool())
runTool()->reportStarted(); runTool()->reportStarted();
setState(InferiorSetupRequested);
showMessage("CALL: SETUP INFERIOR"); showMessage("CALL: SETUP INFERIOR");
d->m_progress.setProgressValue(250); d->m_progress.setProgressValue(250);
if (isMasterEngine()) if (isMasterEngine()) {
// Slaves will get called setupSlaveInferior() below.
setState(InferiorSetupRequested);
setupInferior(); setupInferior();
} }
}
void DebuggerEngine::setupSlaveInferior() void DebuggerEngine::setupSlaveInferior()
{ {

View File

@@ -457,7 +457,7 @@ void QmlCppEngine::slaveEngineStateChanged
break; break;
} }
case EngineSetupFailed: { case EngineSetupFailed: {
qmlEngine()->quitDebugger(); m_qmlEngine->quitDebugger();
notifyEngineSetupFailed(); notifyEngineSetupFailed();
break; break;
} }
@@ -471,7 +471,7 @@ void QmlCppEngine::slaveEngineStateChanged
break; break;
} }
case InferiorSetupFailed: { case InferiorSetupFailed: {
qmlEngine()->quitDebugger(); m_qmlEngine->quitDebugger();
notifyInferiorSetupFailed(); notifyInferiorSetupFailed();
break; break;
} }
@@ -484,12 +484,12 @@ void QmlCppEngine::slaveEngineStateChanged
break; break;
} }
case EngineRunFailed: { case EngineRunFailed: {
qmlEngine()->quitDebugger(); m_qmlEngine->quitDebugger();
notifyEngineRunFailed(); notifyEngineRunFailed();
break; break;
} }
case InferiorUnrunnable: { case InferiorUnrunnable: {
qmlEngine()->quitDebugger(); m_qmlEngine->quitDebugger();
notifyEngineRunOkAndInferiorUnrunnable(); notifyEngineRunOkAndInferiorUnrunnable();
break; break;
} }
@@ -509,7 +509,7 @@ void QmlCppEngine::slaveEngineStateChanged
else else
QTC_ASSERT(false, qDebug() << state()); QTC_ASSERT(false, qDebug() << state());
if (qmlEngine()->state() == InferiorStopOk) { if (m_qmlEngine->state() == InferiorStopOk) {
// track qml engine again // track qml engine again
setState(InferiorStopRequested); setState(InferiorStopRequested);
notifyInferiorStopOk(); notifyInferiorStopOk();
@@ -518,7 +518,7 @@ void QmlCppEngine::slaveEngineStateChanged
break; break;
} }
case InferiorRunFailed: { case InferiorRunFailed: {
qmlEngine()->quitDebugger(); m_qmlEngine->quitDebugger();
notifyInferiorRunFailed(); notifyInferiorRunFailed();
break; break;
} }
@@ -605,7 +605,7 @@ void QmlCppEngine::slaveEngineStateChanged
// might be set by queueShutdownInferior() already // might be set by queueShutdownInferior() already
CHECK_STATE(InferiorShutdownRequested); CHECK_STATE(InferiorShutdownRequested);
} }
qmlEngine()->quitDebugger(); m_qmlEngine->quitDebugger();
break; break;
} }
case InferiorShutdownFailed: { case InferiorShutdownFailed: {
@@ -656,7 +656,7 @@ void QmlCppEngine::slaveEngineStateChanged
notifyInferiorStopOk(); notifyInferiorStopOk();
// otherwise we're probably inside notifyInferiorStopOk already // otherwise we're probably inside notifyInferiorStopOk already
} else { } else {
if (m_activeEngine != qmlEngine()) { if (m_activeEngine != m_qmlEngine) {
showStatusMessage(tr("QML debugger activated")); showStatusMessage(tr("QML debugger activated"));
setActiveEngine(m_qmlEngine); setActiveEngine(m_qmlEngine);
} }
@@ -670,7 +670,7 @@ void QmlCppEngine::slaveEngineStateChanged
} }
} else if (newState == InferiorRunOk) { } else if (newState == InferiorRunOk) {
if (m_activeEngine == qmlEngine()) { if (m_activeEngine == m_qmlEngine) {
CHECK_STATE(InferiorRunRequested); CHECK_STATE(InferiorRunRequested);
notifyInferiorRunOk(); notifyInferiorRunOk();
} }
@@ -700,11 +700,6 @@ void QmlCppEngine::debugLastCommand()
m_cppEngine->debugLastCommand(); m_cppEngine->debugLastCommand();
} }
DebuggerEngine *QmlCppEngine::qmlEngine() const
{
return m_qmlEngine;
}
void QmlCppEngine::setRunTool(DebuggerRunTool *runTool) void QmlCppEngine::setRunTool(DebuggerRunTool *runTool)
{ {
DebuggerEngine::setRunTool(runTool); DebuggerEngine::setRunTool(runTool);

View File

@@ -79,7 +79,6 @@ public:
const QString &expr, const QVariant &value) override; const QString &expr, const QVariant &value) override;
DebuggerEngine *cppEngine() override { return m_cppEngine; } DebuggerEngine *cppEngine() override { return m_cppEngine; }
DebuggerEngine *qmlEngine() const;
DebuggerEngine *activeEngine() override { return m_activeEngine; } DebuggerEngine *activeEngine() override { return m_activeEngine; }
void setRunTool(DebuggerRunTool *runTool) override; void setRunTool(DebuggerRunTool *runTool) override;

View File

@@ -87,6 +87,7 @@
# define XSDEBUG(s) qDebug() << s # define XSDEBUG(s) qDebug() << s
#define CB(callback) [this](const QVariantMap &r) { callback(r); } #define CB(callback) [this](const QVariantMap &r) { callback(r); }
#define CHECK_STATE(s) do { checkState(s, __FILE__, __LINE__); } while (0)
using namespace Core; using namespace Core;
using namespace ProjectExplorer; using namespace ProjectExplorer;
@@ -559,6 +560,7 @@ void QmlEngine::stopApplicationLauncher()
void QmlEngine::shutdownInferior() void QmlEngine::shutdownInferior()
{ {
CHECK_STATE(InferiorShutdownRequested);
// End session. // End session.
// { "seq" : <number>, // { "seq" : <number>,
// "type" : "request", // "type" : "request",
@@ -1030,7 +1032,8 @@ void QmlEngine::quitDebugger()
{ {
d->automaticConnect = false; d->automaticConnect = false;
d->retryOnConnectFail = false; d->retryOnConnectFail = false;
shutdownInferior(); stopApplicationLauncher();
closeConnection();
} }
void QmlEngine::doUpdateLocals(const UpdateParameters &params) void QmlEngine::doUpdateLocals(const UpdateParameters &params)

View File

@@ -194,6 +194,7 @@ void ProjectImporter::markKitAsTemporary(Kit *k) const
void ProjectImporter::makePersistent(Kit *k) const void ProjectImporter::makePersistent(Kit *k) const
{ {
QTC_ASSERT(k, return);
if (!k->hasValue(KIT_IS_TEMPORARY)) if (!k->hasValue(KIT_IS_TEMPORARY))
return; return;
@@ -231,6 +232,7 @@ void ProjectImporter::makePersistent(Kit *k) const
void ProjectImporter::cleanupKit(Kit *k) const void ProjectImporter::cleanupKit(Kit *k) const
{ {
QTC_ASSERT(k, return);
foreach (const TemporaryInformationHandler &tih, m_temporaryHandlers) { foreach (const TemporaryInformationHandler &tih, m_temporaryHandlers) {
const Core::Id fid = fullId(tih.id); const Core::Id fid = fullId(tih.id);
const QVariantList temporaryValues const QVariantList temporaryValues
@@ -250,6 +252,7 @@ void ProjectImporter::cleanupKit(Kit *k) const
void ProjectImporter::addProject(Kit *k) const void ProjectImporter::addProject(Kit *k) const
{ {
QTC_ASSERT(k, return);
if (!k->hasValue(KIT_IS_TEMPORARY)) if (!k->hasValue(KIT_IS_TEMPORARY))
return; return;
@@ -261,6 +264,7 @@ void ProjectImporter::addProject(Kit *k) const
void ProjectImporter::removeProject(Kit *k) const void ProjectImporter::removeProject(Kit *k) const
{ {
QTC_ASSERT(k, return);
if (!k->hasValue(KIT_IS_TEMPORARY)) if (!k->hasValue(KIT_IS_TEMPORARY))
return; return;
@@ -278,6 +282,7 @@ void ProjectImporter::removeProject(Kit *k) const
bool ProjectImporter::isTemporaryKit(Kit *k) const bool ProjectImporter::isTemporaryKit(Kit *k) const
{ {
QTC_ASSERT(k, return false);
return k->hasValue(KIT_IS_TEMPORARY); return k->hasValue(KIT_IS_TEMPORARY);
} }
@@ -347,6 +352,7 @@ void ProjectImporter::useTemporaryKitInformation(Core::Id id,
void ProjectImporter::addTemporaryData(Core::Id id, const QVariant &cleanupData, Kit *k) const void ProjectImporter::addTemporaryData(Core::Id id, const QVariant &cleanupData, Kit *k) const
{ {
QTC_ASSERT(k, return);
QTC_ASSERT(findTemporaryHandler(id), return); QTC_ASSERT(findTemporaryHandler(id), return);
const Core::Id fid = fullId(id); const Core::Id fid = fullId(id);

View File

@@ -289,7 +289,7 @@ void TargetSetupPage::reset()
} }
m_widgets.clear(); m_widgets.clear();
m_firstWidget = 0; m_firstWidget = nullptr;
m_ui->allKitsCheckBox->setChecked(false); m_ui->allKitsCheckBox->setChecked(false);
} }
@@ -407,7 +407,7 @@ void TargetSetupPage::selectAtLeastOneKit()
widget->setKitSelected(true); widget->setKitSelected(true);
kitSelectionChanged(); kitSelectionChanged();
} }
m_firstWidget = 0; m_firstWidget = nullptr;
} }
emit completeChanged(); // Is this necessary? emit completeChanged(); // Is this necessary?
} }
@@ -528,7 +528,7 @@ void TargetSetupPage::removeWidget(Kit *k)
if (!widget) if (!widget)
return; return;
if (widget == m_firstWidget) if (widget == m_firstWidget)
m_firstWidget = 0; m_firstWidget = nullptr;
widget->deleteLater(); widget->deleteLater();
m_widgets.remove(k->id()); m_widgets.remove(k->id());
kitSelectionChanged(); kitSelectionChanged();
@@ -537,17 +537,17 @@ void TargetSetupPage::removeWidget(Kit *k)
TargetSetupWidget *TargetSetupPage::addWidget(Kit *k) TargetSetupWidget *TargetSetupPage::addWidget(Kit *k)
{ {
if (!k || (m_requiredPredicate && !m_requiredPredicate(k))) if (!k || (m_requiredPredicate && !m_requiredPredicate(k)))
return 0; return nullptr;
IBuildConfigurationFactory *factory IBuildConfigurationFactory *factory
= IBuildConfigurationFactory::find(k, m_projectPath); = IBuildConfigurationFactory::find(k, m_projectPath);
if (!factory) if (!factory)
return 0; return nullptr;
QList<BuildInfo *> infoList = factory->availableSetups(k, m_projectPath); QList<BuildInfo *> infoList = factory->availableSetups(k, m_projectPath);
TargetSetupWidget *widget = infoList.isEmpty() ? nullptr : new TargetSetupWidget(k, m_projectPath, infoList); TargetSetupWidget *widget = infoList.isEmpty() ? nullptr : new TargetSetupWidget(k, m_projectPath, infoList);
if (!widget) if (!widget)
return 0; return nullptr;
m_baseLayout->removeWidget(m_importWidget); m_baseLayout->removeWidget(m_importWidget);
foreach (QWidget *widget, m_potentialWidgets) foreach (QWidget *widget, m_potentialWidgets)
@@ -594,7 +594,7 @@ bool TargetSetupPage::setupProject(Project *project)
toSetUp.clear(); toSetUp.clear();
Target *activeTarget = 0; Target *activeTarget = nullptr;
if (m_importer) if (m_importer)
activeTarget = m_importer->preferredTarget(project->targets()); activeTarget = m_importer->preferredTarget(project->targets());
if (activeTarget) if (activeTarget)

View File

@@ -51,6 +51,15 @@ QPixmap QmlDesignerIconProvider::requestPixmap(const QString &id, QSize *size, c
{ {
Q_UNUSED(requestedSize) Q_UNUSED(requestedSize)
QPixmap result = getPixmap(id);
if (size)
*size = result.size();
return result;
}
QPixmap QmlDesignerIconProvider::getPixmap(const QString &id)
{
using namespace Utils; using namespace Utils;
QPixmap result; QPixmap result;
@@ -180,8 +189,6 @@ QPixmap QmlDesignerIconProvider::requestPixmap(const QString &id, QSize *size, c
else else
qWarning() << Q_FUNC_INFO << "Image not found:" << id; qWarning() << Q_FUNC_INFO << "Image not found:" << id;
if (size)
*size = result.size();
return result; return result;
} }

View File

@@ -34,6 +34,7 @@ class QmlDesignerIconProvider : public QQuickImageProvider
public: public:
QmlDesignerIconProvider(); QmlDesignerIconProvider();
QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) override; QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) override;
static QPixmap getPixmap(const QString &id);
}; };
} // namespace QmlDesigner } // namespace QmlDesigner

View File

@@ -96,7 +96,7 @@ Theme *Theme::instance()
QString Theme::replaceCssColors(const QString &input) QString Theme::replaceCssColors(const QString &input)
{ {
const QMap<QString, QColor> &map = instance()->m_derivedColors; const QMap<QString, QColor> &map = instance()->m_derivedColors;
QRegExp rx("creatorTheme\\.(\\w+);"); QRegExp rx("creatorTheme\\.(\\w+)");
int pos = 0; int pos = 0;
QString output = input; QString output = input;
@@ -126,6 +126,16 @@ void Theme::setupTheme(QQmlEngine *engine)
engine->addImageProvider(QLatin1String("icons"), new QmlDesignerIconProvider()); engine->addImageProvider(QLatin1String("icons"), new QmlDesignerIconProvider());
} }
QColor Theme::getColor(Theme::Color role)
{
return instance()->color(role);
}
QPixmap Theme::getPixmap(const QString &id)
{
return QmlDesignerIconProvider::getPixmap(id);
}
QColor Theme::qmlDesignerBackgroundColorDarker() const QColor Theme::qmlDesignerBackgroundColorDarker() const
{ {
return m_derivedColors.value("QmlDesignerBackgroundColorDarker"); return m_derivedColors.value("QmlDesignerBackgroundColorDarker");

View File

@@ -45,6 +45,8 @@ public:
static Theme *instance(); static Theme *instance();
static QString replaceCssColors(const QString &input); static QString replaceCssColors(const QString &input);
static void setupTheme(QQmlEngine *engine); static void setupTheme(QQmlEngine *engine);
static QColor getColor(Color role);
static QPixmap getPixmap(const QString &id);
Q_INVOKABLE QColor qmlDesignerBackgroundColorDarker() const; Q_INVOKABLE QColor qmlDesignerBackgroundColorDarker() const;
Q_INVOKABLE QColor qmlDesignerBackgroundColorDarkAlternate() const; Q_INVOKABLE QColor qmlDesignerBackgroundColorDarkAlternate() const;
@@ -52,7 +54,6 @@ public:
Q_INVOKABLE QColor qmlDesignerTabDark() const; Q_INVOKABLE QColor qmlDesignerTabDark() const;
Q_INVOKABLE QColor qmlDesignerButtonColor() const; Q_INVOKABLE QColor qmlDesignerButtonColor() const;
Q_INVOKABLE QColor qmlDesignerBorderColor() const; Q_INVOKABLE QColor qmlDesignerBorderColor() const;
private: private:
Theme(Utils::Theme *originTheme, QObject *parent); Theme(Utils::Theme *originTheme, QObject *parent);
QColor evaluateColorAtThemeInstance(const QString &themeColorName); QColor evaluateColorAtThemeInstance(const QString &themeColorName);

View File

@@ -59,6 +59,7 @@ public:
QList<ModelNode> allTargets() const; QList<ModelNode> allTargets() const;
QList<QmlTimelineFrames> framesForTarget(const ModelNode &target) const; QList<QmlTimelineFrames> framesForTarget(const ModelNode &target) const;
void destroyFramesForTarget(const ModelNode &target);
private: private:
void addFramesIfNotExists(const ModelNode &node, const PropertyName &propertyName); void addFramesIfNotExists(const ModelNode &node, const PropertyName &propertyName);

View File

@@ -36,6 +36,9 @@
#include "bindingproperty.h" #include "bindingproperty.h"
#include "nodelistproperty.h" #include "nodelistproperty.h"
#include "nodeinstanceview.h" #include "nodeinstanceview.h"
#include <qmltimelinemutator.h>
#ifndef QMLDESIGNER_TEST #ifndef QMLDESIGNER_TEST
#include <qmldesignerplugin.h> #include <qmldesignerplugin.h>
#endif #endif
@@ -348,9 +351,17 @@ void QmlObjectNode::destroy()
removeAliasExports(modelNode()); removeAliasExports(modelNode());
foreach (QmlModelStateOperation stateOperation, allAffectingStatesOperations()) { for (QmlModelStateOperation stateOperation : allAffectingStatesOperations()) {
stateOperation.modelNode().destroy(); //remove of belonging StatesOperations stateOperation.modelNode().destroy(); //remove of belonging StatesOperations
} }
for (const ModelNode &mutatorNode : view()->allModelNodes()) {
if (QmlTimelineMutator::isValidQmlTimelineMutator(mutatorNode)) {
QmlTimelineMutator mutator(mutatorNode);
mutator.destroyFramesForTarget(modelNode());
}
}
removeStateOperationsForChildren(modelNode()); removeStateOperationsForChildren(modelNode());
modelNode().destroy(); modelNode().destroy();
} }

View File

@@ -186,6 +186,12 @@ QList<QmlTimelineFrames> QmlTimelineMutator::framesForTarget(const ModelNode &ta
return result; return result;
} }
void QmlTimelineMutator::destroyFramesForTarget(const ModelNode &target)
{
for (QmlTimelineFrames frames : framesForTarget(target))
frames.destroy();
}
void QmlTimelineMutator::addFramesIfNotExists(const ModelNode &node, const PropertyName &propertyName) void QmlTimelineMutator::addFramesIfNotExists(const ModelNode &node, const PropertyName &propertyName)
{ {
if (!isValid()) if (!isValid())

View File

@@ -441,10 +441,22 @@ static QWidget *createbottomSideBarWidget(const QList<WidgetInfo> &widgetInfos)
topWidgetInfos.append(widgetInfo); topWidgetInfos.append(widgetInfo);
} }
if (topWidgetInfos.count() == 1) QWidget *widget = topWidgetInfos.first().widget;
return topWidgetInfos.first().widget; if (topWidgetInfos.count() > 1) {
else QWidget *background = new QWidget();
return createWidgetsInTabWidget(topWidgetInfos); background->setProperty("designerBackgroundColor", true);
QString sheet = QString::fromUtf8(Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css"));
sheet.prepend("QWidget[designerBackgroundColor=\"true\"] {background-color: creatorTheme.QmlDesignerBackgroundColorDarkAlternate;}");
background->setStyleSheet(Theme::replaceCssColors(sheet));
background->setLayout(new QVBoxLayout);
background->layout()->setContentsMargins(0, 0, 0, 0);
background->layout()->addWidget(createWidgetsInTabWidget(topWidgetInfos));
widget = background;
}
return widget;
} }
static Core::MiniSplitter *createCentralSplitter(const QList<WidgetInfo> &widgetInfos) static Core::MiniSplitter *createCentralSplitter(const QList<WidgetInfo> &widgetInfos)
@@ -455,9 +467,6 @@ static Core::MiniSplitter *createCentralSplitter(const QList<WidgetInfo> &widget
outputPlaceholderSplitter->setStretchFactor(1, 0); outputPlaceholderSplitter->setStretchFactor(1, 0);
outputPlaceholderSplitter->setOrientation(Qt::Vertical); outputPlaceholderSplitter->setOrientation(Qt::Vertical);
QString sheet = QString::fromUtf8(Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css"));
outputPlaceholderSplitter->setStyleSheet(Theme::replaceCssColors(sheet));
SwitchSplitTabWidget *switchSplitTabWidget = new SwitchSplitTabWidget(); SwitchSplitTabWidget *switchSplitTabWidget = new SwitchSplitTabWidget();
foreach (const WidgetInfo &widgetInfo, widgetInfos) { foreach (const WidgetInfo &widgetInfo, widgetInfos) {

View File

@@ -31,7 +31,6 @@
#include <QVector> #include <QVector>
#include <QBoxLayout> #include <QBoxLayout>
#include <QTabWidget>
#include <QTabBar> #include <QTabBar>
#include <QToolButton> #include <QToolButton>
#include <QSplitter> #include <QSplitter>

View File

@@ -110,6 +110,10 @@ void QmlProfilerClientManager::createClients()
m_clientPlugin.data(), [this]() { m_clientPlugin.data(), [this]() {
m_clientPlugin->setRecording(m_profilerState->clientRecording()); m_clientPlugin->setRecording(m_profilerState->clientRecording());
}); });
QObject::connect(this, &QmlDebug::QmlDebugConnectionManager::connectionClosed,
m_clientPlugin.data(), [this]() {
m_profilerState->setServerRecording(false);
});
} }
void QmlProfilerClientManager::destroyClients() void QmlProfilerClientManager::destroyClients()

View File

@@ -430,5 +430,29 @@ void QmlProfilerClientManagerTest::testStopRecording()
// Delete while still connected, for added fun // Delete while still connected, for added fun
} }
void QmlProfilerClientManagerTest::testConnectionDrop()
{
QUrl socketUrl = Utils::urlFromLocalSocket();
QmlProfilerClientManager clientManager;
{
clientManager.setRetryParams(10, 10);
clientManager.setProfilerStateManager(&stateManager);
clientManager.setModelManager(&modelManager);
clientManager.connectToServer(socketUrl);
QScopedPointer<QLocalSocket> socket(new QLocalSocket(this));
socket->connectToServer(socketUrl.path());
QVERIFY(socket->isOpen());
fakeDebugServer(socket.data());
// Fake a trace. We want to test that this is reset when the connection drops.
stateManager.setServerRecording(true);
QTRY_VERIFY(clientManager.isConnected());
}
QTRY_VERIFY(!stateManager.serverRecording());
}
} // namespace Internal } // namespace Internal
} // namespace QmlProfiler } // namespace QmlProfiler

View File

@@ -54,6 +54,7 @@ private slots:
void testInvalidData(); void testInvalidData();
void testStopRecording(); void testStopRecording();
void testConnectionDrop();
private: private:
QmlProfilerClientManager clientManager; QmlProfilerClientManager clientManager;

View File

@@ -42,6 +42,7 @@
#include <QMenu> #include <QMenu>
#include <QMessageBox> #include <QMessageBox>
#include <QMetaEnum> #include <QMetaEnum>
#include <QPointer>
#include <QProcessEnvironment> #include <QProcessEnvironment>
#include <QTimer> #include <QTimer>
#include <QtPlugin> #include <QtPlugin>
@@ -68,7 +69,7 @@ public:
{ } { }
QString m_maintenanceTool; QString m_maintenanceTool;
ShellCommand *m_checkUpdatesCommand = 0; QPointer<ShellCommand> m_checkUpdatesCommand;
QString m_collectedOutput; QString m_collectedOutput;
QTimer *m_checkUpdatesTimer = 0; QTimer *m_checkUpdatesTimer = 0;

View File

@@ -6925,7 +6925,7 @@ void tst_Dumpers::dumper_data()
"{\n" "{\n"
" char *first;\n" " char *first;\n"
" const char *second = \"second\";\n" " const char *second = \"second\";\n"
" const char third[6] = {'t','h','i','r','d','\0'};\n" " const char third[6] = {'t','h','i','r','d','\\0'};\n"
" QtcDumperTest_String()\n" " QtcDumperTest_String()\n"
" {\n" " {\n"
" first = new char[6];\n" " first = new char[6];\n"

View File

@@ -54,7 +54,7 @@ Fourth - you'll have to provide some additional repositories (and for the hookin
These additional repositories are located inside ~/squish-data or C:\Users\<user>\squish-data (depending on the OS you're on). These additional repositories are located inside ~/squish-data or C:\Users\<user>\squish-data (depending on the OS you're on).
You can also just provide them inside a different folder and specify the folder with the environment variable SYSTEST_SRCPATH. You can also just provide them inside a different folder and specify the folder with the environment variable SYSTEST_SRCPATH.
This folder must contain the following: This folder must contain the following:
* a QtCreator repository (or source copy) of tag v4.2.2 named 'creator' including the submodule src/shared/qbs * a QtCreator repository (or source copy) of tag v4.4.1 named 'creator' including the submodule src/shared/qbs
* a subfolder called 'creator-test-data' * a subfolder called 'creator-test-data'
* a speedcrunch 0.11 repository (or source copy) inside 'creator-test-data' named 'speedcrunch' * a speedcrunch 0.11 repository (or source copy) inside 'creator-test-data' named 'speedcrunch'
* additional Squish versions for hooking into subprocesses inside different folders inside 'creator-test-data' following the information below * additional Squish versions for hooking into subprocesses inside different folders inside 'creator-test-data' following the information below

View File

@@ -66,8 +66,8 @@ def main():
generalMessages = str(waitForObject(":Qt Creator_Core::OutputWindow").plainText) generalMessages = str(waitForObject(":Qt Creator_Core::OutputWindow").plainText)
test.compare(generalMessages.count("Project MESSAGE: Cannot build Qt Creator with Qt version 5.3.1."), 1, test.compare(generalMessages.count("Project MESSAGE: Cannot build Qt Creator with Qt version 5.3.1."), 1,
"Warning about outdated Qt shown?") "Warning about outdated Qt shown?")
test.compare(generalMessages.count("Project ERROR: Use at least Qt 5.6.0."), 1, test.compare(generalMessages.count("Project ERROR: Use at least Qt 5.6.2."), 2,
"Minimum Qt version shown?") "Minimum Qt version shown (once when parsing with default kit, once with selected)?")
# Verify that qmljs.g is in the project even when we don't know where (QTCREATORBUG-17609) # Verify that qmljs.g is in the project even when we don't know where (QTCREATORBUG-17609)
selectFromLocator("p qmljs.g", "qmljs.g") selectFromLocator("p qmljs.g", "qmljs.g")