summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2019-06-13 14:03:02 +0200
committerEike Ziller <eike.ziller@qt.io>2019-06-13 14:03:02 +0200
commitf3011f057c7c07b41dbd699fea21abbbe5c35deb (patch)
treebdf86e1b36ad9eac2c0b83c65e7fac008f6dd843 /src/plugins
parent646c984ffa1f892a38e31167ed12f3154073f50e (diff)
parent0b2b21bb22549a21f83233a92ca0a7e7e415173c (diff)
downloadqt-creator-f3011f057c7c07b41dbd699fea21abbbe5c35deb.tar.gz
Merge remote-tracking branch 'origin/4.10'
Conflicts: src/plugins/debugger/cdb/cdbengine.cpp Change-Id: Idcfd19292730d2b0e67816715f7aa2cc0eb71c48
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/autotest/testresultmodel.cpp1
-rw-r--r--src/plugins/clangtools/clangtoolspreconfiguredsessiontests.cpp6
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeproject.cpp3
-rw-r--r--src/plugins/coreplugin/messageoutputwindow.cpp2
-rw-r--r--src/plugins/coreplugin/outputwindow.cpp37
-rw-r--r--src/plugins/coreplugin/outputwindow.h6
-rw-r--r--src/plugins/debugger/cdb/cdbengine.cpp11
-rw-r--r--src/plugins/debugger/cdb/cdbengine.h9
-rw-r--r--src/plugins/languageclient/LanguageClient.json.in1
-rw-r--r--src/plugins/projectexplorer/appoutputpane.cpp5
-rw-r--r--src/plugins/projectexplorer/compileoutputwindow.cpp5
-rw-r--r--src/plugins/projectexplorer/importwidget.cpp14
-rw-r--r--src/plugins/projectexplorer/importwidget.h2
-rw-r--r--src/plugins/projectexplorer/projectmodels.cpp5
-rw-r--r--src/plugins/projectexplorer/projectmodels.h1
-rw-r--r--src/plugins/projectexplorer/projecttreewidget.cpp7
-rw-r--r--src/plugins/projectexplorer/projecttreewidget.h1
-rw-r--r--src/plugins/projectexplorer/targetsettingspanel.cpp2
-rw-r--r--src/plugins/projectexplorer/targetsetuppage.cpp5
-rw-r--r--src/plugins/projectexplorer/targetsetuppage.h1
-rw-r--r--src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp2
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp64
-rw-r--r--src/plugins/studiowelcome/qml/splashscreen/NoShowCheckbox.qml1
-rw-r--r--src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml3
-rw-r--r--src/plugins/studiowelcome/qml/welcomepage/main.qml2
-rw-r--r--src/plugins/valgrind/callgrind/callgrindparser.cpp7
26 files changed, 131 insertions, 72 deletions
diff --git a/src/plugins/autotest/testresultmodel.cpp b/src/plugins/autotest/testresultmodel.cpp
index f07bc5f008..a3c6ec28a8 100644
--- a/src/plugins/autotest/testresultmodel.cpp
+++ b/src/plugins/autotest/testresultmodel.cpp
@@ -116,7 +116,6 @@ void TestResultItem::updateDescription(const QString &description)
static bool isSignificant(ResultType type)
{
switch (type) {
- case ResultType::Skip:
case ResultType::Benchmark:
case ResultType::MessageInfo:
case ResultType::MessageInternal:
diff --git a/src/plugins/clangtools/clangtoolspreconfiguredsessiontests.cpp b/src/plugins/clangtools/clangtoolspreconfiguredsessiontests.cpp
index 86dc36e186..d4b4e03272 100644
--- a/src/plugins/clangtools/clangtoolspreconfiguredsessiontests.cpp
+++ b/src/plugins/clangtools/clangtoolspreconfiguredsessiontests.cpp
@@ -43,7 +43,7 @@
#include <utils/fileutils.h>
#include <QSignalSpy>
-#include <QTimer>
+#include <QElapsedTimer>
#include <QtTest>
#include <QVariant>
@@ -54,10 +54,10 @@ using namespace ProjectExplorer;
static bool processEventsUntil(const std::function<bool()> condition, int timeOutInMs = 30000)
{
- QTime t;
+ QElapsedTimer t;
t.start();
- forever {
+ while (true) {
if (t.elapsed() > timeOutInMs)
return false;
diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
index e823ed43a0..e85976093b 100644
--- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
@@ -360,9 +360,8 @@ void CMakeProject::updateProjectData(CMakeBuildConfiguration *bc)
void CMakeProject::updateQmlJSCodeModel()
{
QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance();
- QTC_ASSERT(modelManager, return);
- if (!activeTarget() || !activeTarget()->activeBuildConfiguration())
+ if (!modelManager || !activeTarget() || !activeTarget()->activeBuildConfiguration())
return;
QmlJS::ModelManagerInterface::ProjectInfo projectInfo =
diff --git a/src/plugins/coreplugin/messageoutputwindow.cpp b/src/plugins/coreplugin/messageoutputwindow.cpp
index 6009282953..7aabaefbbc 100644
--- a/src/plugins/coreplugin/messageoutputwindow.cpp
+++ b/src/plugins/coreplugin/messageoutputwindow.cpp
@@ -53,8 +53,6 @@ MessageOutputWindow::MessageOutputWindow()
QColor activeHighlightedText = p.color(QPalette::Active, QPalette::HighlightedText);
p.setColor(QPalette::HighlightedText, activeHighlightedText);
m_widget->setPalette(p);
- m_widget->setHighlightBgColor(p.color(QPalette::Highlight));
- m_widget->setHighlightTextColor(p.color(QPalette::HighlightedText));
connect(this, &IOutputPane::zoomIn, m_widget, &Core::OutputWindow::zoomIn);
connect(this, &IOutputPane::zoomOut, m_widget, &Core::OutputWindow::zoomOut);
diff --git a/src/plugins/coreplugin/outputwindow.cpp b/src/plugins/coreplugin/outputwindow.cpp
index 0ed7542ee1..9e20482113 100644
--- a/src/plugins/coreplugin/outputwindow.cpp
+++ b/src/plugins/coreplugin/outputwindow.cpp
@@ -59,8 +59,6 @@ public:
IContext *outputWindowContext = nullptr;
Utils::OutputFormatter *formatter = nullptr;
- QColor highlightBgColor;
- QColor highlightTextColor;
QString settingsKey;
bool enforceNewline = false;
@@ -273,16 +271,6 @@ void OutputWindow::setWheelZoomEnabled(bool enabled)
d->zoomEnabled = enabled;
}
-void OutputWindow::setHighlightBgColor(const QColor &bgColor)
-{
- d->highlightBgColor = bgColor;
-}
-
-void OutputWindow::setHighlightTextColor(const QColor &textColor)
-{
- d->highlightTextColor = textColor;
-}
-
void OutputWindow::updateFilterProperties(const QString &filterText,
Qt::CaseSensitivity caseSensitivity, bool isRegexp)
{
@@ -297,21 +285,22 @@ void OutputWindow::updateFilterProperties(const QString &filterText,
d->filterText = filterText;
// Update textedit's background color
- if (filterText.isEmpty()) {
+ if (filterText.isEmpty() && !filterTextWasEmpty) {
setPalette(d->originalPalette);
setReadOnly(d->originalReadOnly);
- } else {
- if (filterTextWasEmpty) {
- d->originalReadOnly = isReadOnly();
- d->originalPalette = palette();
- }
- QPalette pal;
- pal.setColor(QPalette::Active, QPalette::Base, d->highlightBgColor);
- pal.setColor(QPalette::Inactive, QPalette::Base, d->highlightBgColor.darker(120));
- pal.setColor(QPalette::Active, QPalette::Text, d->highlightTextColor);
- pal.setColor(QPalette::Inactive, QPalette::Text, d->highlightTextColor.darker(120));
- setPalette(pal);
+ }
+ if (!filterText.isEmpty() && filterTextWasEmpty) {
+ d->originalReadOnly = isReadOnly();
setReadOnly(true);
+ const auto newBgColor = [this] {
+ const QColor currentColor = palette().color(QPalette::Base);
+ const int factor = 120;
+ return currentColor.value() < 128 ? currentColor.lighter(factor)
+ : currentColor.darker(factor);
+ };
+ QPalette p = palette();
+ p.setColor(QPalette::Base, newBgColor());
+ setPalette(p);
}
}
d->filterMode = flags;
diff --git a/src/plugins/coreplugin/outputwindow.h b/src/plugins/coreplugin/outputwindow.h
index 03760cbce3..88692d5ab7 100644
--- a/src/plugins/coreplugin/outputwindow.h
+++ b/src/plugins/coreplugin/outputwindow.h
@@ -30,9 +30,9 @@
#include <utils/outputformat.h>
+#include <QElapsedTimer>
#include <QPlainTextEdit>
#include <QTimer>
-#include <QTime>
namespace Utils { class OutputFormatter; }
@@ -76,8 +76,6 @@ public:
float fontZoom() const;
void setFontZoom(float zoom);
void setWheelZoomEnabled(bool enabled);
- void setHighlightBgColor(const QColor &bgColor);
- void setHighlightTextColor(const QColor &textColor);
void updateFilterProperties(const QString &filterText, Qt::CaseSensitivity caseSensitivity, bool regexp);
@@ -100,7 +98,7 @@ protected:
private:
using QPlainTextEdit::setFont; // call setBaseFont instead, which respects the zoom factor
QTimer m_scrollTimer;
- QTime m_lastMessage;
+ QElapsedTimer m_lastMessage;
void enableUndoRedo();
QString doNewlineEnforcement(const QString &out);
void filterNewContent();
diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp
index 95935cc514..b4314d355e 100644
--- a/src/plugins/debugger/cdb/cdbengine.cpp
+++ b/src/plugins/debugger/cdb/cdbengine.cpp
@@ -295,12 +295,9 @@ QString CdbEngine::extensionLibraryName(bool is64Bit)
return rc;
}
-int CdbEngine::elapsedLogTime() const
+int CdbEngine::elapsedLogTime()
{
- const int elapsed = m_logTime.elapsed();
- const int delta = elapsed - m_elapsedLogTime;
- m_elapsedLogTime = elapsed;
- return delta;
+ return m_logTimer.restart();
}
void CdbEngine::createFullBacktrace()
@@ -323,8 +320,8 @@ void CdbEngine::setupEngine()
qDebug(">setupEngine");
init();
- if (!m_logTime.elapsed())
- m_logTime.start();
+ if (!m_logTimer.elapsed())
+ m_logTimer.start();
// Console: Launch the stub with the suspended application and attach to it
// CDB in theory has a command line option '-2' that launches a
diff --git a/src/plugins/debugger/cdb/cdbengine.h b/src/plugins/debugger/cdb/cdbengine.h
index 29f7ccc4d6..1c454d6d51 100644
--- a/src/plugins/debugger/cdb/cdbengine.h
+++ b/src/plugins/debugger/cdb/cdbengine.h
@@ -32,14 +32,12 @@
#include <projectexplorer/devicesupport/idevice.h>
-#include <QTime>
+#include <QElapsedTimer>
namespace Debugger {
namespace Internal {
class CdbCommand;
-struct MemoryViewCookie;
-class StringInputStream;
class CdbEngine : public CppDebuggerEngine
{
@@ -195,7 +193,7 @@ private:
NormalizedSourceFileName sourceMapNormalizeFileNameFromDebugger(const QString &f);
void doUpdateLocals(const UpdateParameters &params) override;
void updateAll() override;
- int elapsedLogTime() const;
+ int elapsedLogTime();
unsigned parseStackTrace(const GdbMi &data, bool sourceStepInto);
void mergeStartParametersSourcePathMap();
@@ -223,8 +221,7 @@ private:
wow64Stack32Bit,
wow64Stack64Bit
} m_wow64State = wow64Uninitialized;
- QTime m_logTime;
- mutable int m_elapsedLogTime = 0;
+ QElapsedTimer m_logTimer;
QString m_extensionMessageBuffer;
bool m_sourceStepInto = false;
int m_watchPointX = 0;
diff --git a/src/plugins/languageclient/LanguageClient.json.in b/src/plugins/languageclient/LanguageClient.json.in
index c48a74c937..8eea5c88cc 100644
--- a/src/plugins/languageclient/LanguageClient.json.in
+++ b/src/plugins/languageclient/LanguageClient.json.in
@@ -2,7 +2,6 @@
\"Name\" : \"LanguageClient\",
\"Version\" : \"$$QTCREATOR_VERSION\",
\"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\",
- \"Experimental\" : true,
\"Vendor\" : \"The Qt Company Ltd\",
\"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\",
\"License\" : [ \"Commercial Usage\",
diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp
index 948780aabc..7631f26cac 100644
--- a/src/plugins/projectexplorer/appoutputpane.cpp
+++ b/src/plugins/projectexplorer/appoutputpane.cpp
@@ -426,7 +426,6 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc)
}
// Create new
static int counter = 0;
- const TextEditor::FontSettings &fs = TextEditor::TextEditorSettings::fontSettings();
Core::Id contextId = Core::Id(C_APP_OUTPUT).withSuffix(counter++);
Core::Context context(contextId);
Core::OutputWindow *ow = new Core::OutputWindow(context, SETTINGS_KEY, m_tabWidget);
@@ -434,10 +433,6 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc)
ow->setWindowIcon(Icons::WINDOW.icon());
ow->setWordWrapEnabled(m_settings.wrapOutput);
ow->setMaxCharCount(m_settings.maxCharCount);
- ow->setHighlightBgColor(fs.toTextCharFormat(TextEditor::C_SEARCH_RESULT)
- .background().color());
- ow->setHighlightTextColor(fs.toTextCharFormat(TextEditor::C_SEARCH_RESULT)
- .foreground().color());
auto updateFontSettings = [ow] {
ow->setBaseFont(TextEditor::TextEditorSettings::fontSettings().font());
diff --git a/src/plugins/projectexplorer/compileoutputwindow.cpp b/src/plugins/projectexplorer/compileoutputwindow.cpp
index 3d19bd9514..91cc2fb22c 100644
--- a/src/plugins/projectexplorer/compileoutputwindow.cpp
+++ b/src/plugins/projectexplorer/compileoutputwindow.cpp
@@ -172,11 +172,6 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) :
updateFontSettings();
updateZoomEnabled();
- const TextEditor::FontSettings &fs = TextEditor::TextEditorSettings::fontSettings();
- m_outputWindow->setHighlightBgColor(fs.toTextCharFormat(TextEditor::C_SEARCH_RESULT)
- .background().color());
- m_outputWindow->setHighlightTextColor(fs.toTextCharFormat(TextEditor::C_SEARCH_RESULT)
- .foreground().color());
setupFilterUi("CompileOutputPane.Filter");
setFilteringEnabled(true);
diff --git a/src/plugins/projectexplorer/importwidget.cpp b/src/plugins/projectexplorer/importwidget.cpp
index 369e59b60b..eac2c44c94 100644
--- a/src/plugins/projectexplorer/importwidget.cpp
+++ b/src/plugins/projectexplorer/importwidget.cpp
@@ -29,6 +29,7 @@
#include <utils/pathchooser.h>
#include <QPushButton>
+#include <QTimer>
#include <QVBoxLayout>
namespace ProjectExplorer {
@@ -60,6 +61,14 @@ ImportWidget::ImportWidget(QWidget *parent) :
layout->addWidget(importButton);
connect(importButton, &QAbstractButton::clicked, this, &ImportWidget::handleImportRequest);
+ connect(m_pathChooser->lineEdit(), &QLineEdit::returnPressed, this, [this] {
+ if (m_pathChooser->isValid()) {
+ handleImportRequest();
+
+ // The next return should trigger the "Configure" button.
+ QTimer::singleShot(0, this, QOverload<>::of(&QWidget::setFocus));
+ }
+ });
detailsWidget->setWidget(widget);
}
@@ -70,6 +79,11 @@ void ImportWidget::setCurrentDirectory(const Utils::FilePath &dir)
m_pathChooser->setFileName(dir);
}
+bool ImportWidget::lineEditHasFocus() const
+{
+ return m_pathChooser->lineEdit()->hasFocus();
+}
+
void ImportWidget::handleImportRequest()
{
Utils::FilePath dir = m_pathChooser->fileName();
diff --git a/src/plugins/projectexplorer/importwidget.h b/src/plugins/projectexplorer/importwidget.h
index b9ecdd16ac..8999bc117d 100644
--- a/src/plugins/projectexplorer/importwidget.h
+++ b/src/plugins/projectexplorer/importwidget.h
@@ -44,6 +44,8 @@ public:
void setCurrentDirectory(const Utils::FilePath &dir);
+ bool lineEditHasFocus() const;
+
signals:
void importFrom(const Utils::FilePath &dir);
diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp
index cfacd27ab6..c2c02b1d02 100644
--- a/src/plugins/projectexplorer/projectmodels.cpp
+++ b/src/plugins/projectexplorer/projectmodels.cpp
@@ -780,6 +780,11 @@ bool FlatModel::generatedFilesFilterEnabled()
return m_filterGeneratedFiles;
}
+bool FlatModel::trimEmptyDirectoriesEnabled()
+{
+ return m_trimEmptyDirectories;
+}
+
Node *FlatModel::nodeForIndex(const QModelIndex &index) const
{
WrapperNode *flatNode = itemForIndex(index);
diff --git a/src/plugins/projectexplorer/projectmodels.h b/src/plugins/projectexplorer/projectmodels.h
index aa044fc0f0..78753bf1da 100644
--- a/src/plugins/projectexplorer/projectmodels.h
+++ b/src/plugins/projectexplorer/projectmodels.h
@@ -78,6 +78,7 @@ public:
bool projectFilterEnabled();
bool generatedFilesFilterEnabled();
+ bool trimEmptyDirectoriesEnabled();
void setProjectFilterEnabled(bool filter);
void setGeneratedFilesFilterEnabled(bool filter);
void setTrimEmptyDirectories(bool filter);
diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp
index 70d3dc976a..5e4b19f8c9 100644
--- a/src/plugins/projectexplorer/projecttreewidget.cpp
+++ b/src/plugins/projectexplorer/projecttreewidget.cpp
@@ -569,6 +569,11 @@ bool ProjectTreeWidget::generatedFilesFilter()
return m_model->generatedFilesFilterEnabled();
}
+bool ProjectTreeWidget::trimEmptyDirectoriesFilter()
+{
+ return m_model->trimEmptyDirectoriesEnabled();
+}
+
bool ProjectTreeWidget::projectFilter()
{
return m_model->projectFilterEnabled();
@@ -611,6 +616,7 @@ void ProjectTreeWidgetFactory::saveSettings(QSettings *settings, int position, Q
const QString baseKey = QLatin1String("ProjectTreeWidget.") + QString::number(position);
settings->setValue(baseKey + QLatin1String(".ProjectFilter"), ptw->projectFilter());
settings->setValue(baseKey + QLatin1String(".GeneratedFilter"), ptw->generatedFilesFilter());
+ settings->setValue(baseKey + QLatin1String(".TrimEmptyDirsFilter"), ptw->trimEmptyDirectoriesFilter());
settings->setValue(baseKey + QLatin1String(".SyncWithEditor"), ptw->autoSynchronization());
}
@@ -621,5 +627,6 @@ void ProjectTreeWidgetFactory::restoreSettings(QSettings *settings, int position
const QString baseKey = QLatin1String("ProjectTreeWidget.") + QString::number(position);
ptw->setProjectFilter(settings->value(baseKey + QLatin1String(".ProjectFilter"), false).toBool());
ptw->setGeneratedFilesFilter(settings->value(baseKey + QLatin1String(".GeneratedFilter"), true).toBool());
+ ptw->setTrimEmptyDirectories(settings->value(baseKey + QLatin1String(".TrimEmptyDirsFilter"), true).toBool());
ptw->setAutoSynchronization(settings->value(baseKey + QLatin1String(".SyncWithEditor"), true).toBool());
}
diff --git a/src/plugins/projectexplorer/projecttreewidget.h b/src/plugins/projectexplorer/projecttreewidget.h
index 3ab73eeef9..c4b729f097 100644
--- a/src/plugins/projectexplorer/projecttreewidget.h
+++ b/src/plugins/projectexplorer/projecttreewidget.h
@@ -56,6 +56,7 @@ public:
void setAutoSynchronization(bool sync);
bool projectFilter();
bool generatedFilesFilter();
+ bool trimEmptyDirectoriesFilter();
QToolButton *toggleSync();
Node *currentNode();
void sync(ProjectExplorer::Node *node);
diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp
index c8e707a549..91dee3dd6d 100644
--- a/src/plugins/projectexplorer/targetsettingspanel.cpp
+++ b/src/plugins/projectexplorer/targetsettingspanel.cpp
@@ -95,6 +95,8 @@ protected:
void keyPressEvent(QKeyEvent *event) override
{
+ if (m_targetSetupPage && m_targetSetupPage->importLineEditHasFocus())
+ return;
if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) {
event->accept();
if (m_targetSetupPage)
diff --git a/src/plugins/projectexplorer/targetsetuppage.cpp b/src/plugins/projectexplorer/targetsetuppage.cpp
index ab7d13a76e..0a750199fe 100644
--- a/src/plugins/projectexplorer/targetsetuppage.cpp
+++ b/src/plugins/projectexplorer/targetsetuppage.cpp
@@ -328,6 +328,11 @@ void TargetSetupPage::setProjectImporter(ProjectImporter *importer)
initializePage();
}
+bool TargetSetupPage::importLineEditHasFocus() const
+{
+ return m_importWidget->lineEditHasFocus();
+}
+
void TargetSetupPage::setNoteText(const QString &text)
{
m_ui->descriptionLabel->setText(text);
diff --git a/src/plugins/projectexplorer/targetsetuppage.h b/src/plugins/projectexplorer/targetsetuppage.h
index cbd0305c04..102ffbd57c 100644
--- a/src/plugins/projectexplorer/targetsetuppage.h
+++ b/src/plugins/projectexplorer/targetsetuppage.h
@@ -70,6 +70,7 @@ public:
void setPreferredKitPredicate(const ProjectExplorer::Kit::Predicate &predicate);
void setProjectPath(const QString &dir);
void setProjectImporter(ProjectImporter *importer);
+ bool importLineEditHasFocus() const;
/// Sets whether the targetsetupage uses a scrollarea
/// to host the widgets from the factories
diff --git a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
index f26e035442..9f6d3e9cd8 100644
--- a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
+++ b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
@@ -109,7 +109,7 @@ void FormEditorItem::updateGeometry()
m_boundingRect = m_paintedBoundingRect.united(m_selectionBoundingRect);
setTransform(qmlItemNode().instanceTransformWithContentTransform());
//the property for zValue is called z in QGraphicsObject
- if (qmlItemNode().instanceValue("z").isValid())
+ if (qmlItemNode().instanceValue("z").isValid() && !qmlItemNode().isRootModelNode())
setZValue(qmlItemNode().instanceValue("z").toDouble());
}
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
index 39baecbaad..12f12ed2bc 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
@@ -408,18 +408,44 @@ QString PropertyEditorQmlBackend::templateGeneration(const NodeMetaInfo &type,
if (!templateConfiguration() || !templateConfiguration()->isValid())
return QString();
+ const auto nodes = templateConfiguration()->children();
+
+ QStringList sectorTypes;
+
+ for (const QmlJS::SimpleReaderNode::Ptr &node : nodes) {
+ if (node->propertyNames().contains("separateSection"))
+ sectorTypes.append(variantToStringList(node->property("typeNames")));
+ }
+
QStringList imports = variantToStringList(templateConfiguration()->property(QStringLiteral("imports")));
QString qmlTemplate = imports.join(QLatin1Char('\n')) + QLatin1Char('\n');
- qmlTemplate += QStringLiteral("Section {\n");
- qmlTemplate += QStringLiteral("caption: \"%1\"\n").arg(QString::fromUtf8(type.simplifiedTypeName()));
- qmlTemplate += QStringLiteral("SectionLayout {\n");
+
+ qmlTemplate += "Column {\n";
+ qmlTemplate += "anchors.left: parent.left\n";
+ qmlTemplate += "anchors.right: parent.right\n";
QList<PropertyName> orderedList = type.propertyNames();
- Utils::sort(orderedList);
+ Utils::sort(orderedList, [type, &sectorTypes](const PropertyName &left, const PropertyName &right){
+ const QString typeNameLeft = QString::fromLatin1(type.propertyTypeName(left));
+ const QString typeNameRight = QString::fromLatin1(type.propertyTypeName(right));
+ if (typeNameLeft == typeNameRight)
+ return left > right;
+
+ if (sectorTypes.contains(typeNameLeft)) {
+ if (sectorTypes.contains(typeNameRight))
+ return left > right;
+ return true;
+ } else if (sectorTypes.contains(typeNameRight)) {
+ return false;
+ }
+ return left > right;
+ });
bool emptyTemplate = true;
+ bool sectionStarted = false;
+
foreach (const PropertyName &name, orderedList) {
if (name.startsWith("__"))
@@ -433,15 +459,35 @@ QString PropertyEditorQmlBackend::templateGeneration(const NodeMetaInfo &type,
if (typeName == "alias" && node.isValid())
typeName = node.instanceType(name);
+ auto nodes = templateConfiguration()->children();
+
if (!superType.hasProperty(name) && type.propertyIsWritable(name) && !name.contains(".")) {
- foreach (const QmlJS::SimpleReaderNode::Ptr &node, templateConfiguration()->children())
+
+ foreach (const QmlJS::SimpleReaderNode::Ptr &node, nodes)
if (variantToStringList(node->property(QStringLiteral("typeNames"))).contains(QString::fromLatin1(typeName))) {
const QString fileName = propertyTemplatesPath() + node->property(QStringLiteral("sourceFile")).toString();
QFile file(fileName);
if (file.open(QIODevice::ReadOnly)) {
QString source = QString::fromUtf8(file.readAll());
file.close();
+ const bool section = node->propertyNames().contains("separateSection");
+ if (section) {
+ qmlTemplate += "Section {\n";
+ qmlTemplate += "anchors.left: parent.left\n";
+ qmlTemplate += "anchors.right: parent.right\n";
+ qmlTemplate += QString("caption: \"%1\"\n").arg(QString::fromUtf8(properName));
+ } else if (!sectionStarted) {
+ qmlTemplate += QStringLiteral("Section {\n");
+ qmlTemplate += QStringLiteral("caption: \"%1\"\n").arg(QString::fromUtf8(type.simplifiedTypeName()));
+ qmlTemplate += "anchors.left: parent.left\n";
+ qmlTemplate += "anchors.right: parent.right\n";
+ qmlTemplate += QStringLiteral("SectionLayout {\n");
+ sectionStarted = true;
+ }
+
qmlTemplate += source.arg(QString::fromUtf8(name)).arg(QString::fromUtf8(properName));
+ if (section)
+ qmlTemplate += "}\n";
emptyTemplate = false;
} else {
qWarning().nospace() << "template definition source file not found:" << fileName;
@@ -449,8 +495,12 @@ QString PropertyEditorQmlBackend::templateGeneration(const NodeMetaInfo &type,
}
}
}
- qmlTemplate += QStringLiteral("}\n"); //Section
- qmlTemplate += QStringLiteral("}\n"); //SectionLayout
+ if (sectionStarted) {
+ qmlTemplate += QStringLiteral("}\n"); //Section
+ qmlTemplate += QStringLiteral("}\n"); //SectionLayout
+ }
+
+ qmlTemplate += "}\n";
if (emptyTemplate)
return QString();
diff --git a/src/plugins/studiowelcome/qml/splashscreen/NoShowCheckbox.qml b/src/plugins/studiowelcome/qml/splashscreen/NoShowCheckbox.qml
index d2f7454f09..2b714a4784 100644
--- a/src/plugins/studiowelcome/qml/splashscreen/NoShowCheckbox.qml
+++ b/src/plugins/studiowelcome/qml/splashscreen/NoShowCheckbox.qml
@@ -26,7 +26,6 @@
import QtQuick 2.7
import QtQuick.Timeline 1.0
import QtQuick.Controls 2.12
-import welcome 1.0
CheckBox {
id: do_not_show_checkBox
diff --git a/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml b/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml
index fa90cd8a65..c00bde1ce8 100644
--- a/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml
+++ b/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml
@@ -27,6 +27,7 @@ import QtQuick 2.7
import QtQuick.Controls 2.3
import StudioFonts 1.0
import QtQuick.Layouts 1.0
+import projectmodel 1.0
Image {
id: welcome_splash
@@ -243,7 +244,7 @@ Image {
color: "#ffffff"
text: qsTr("Community Edition")
font.pixelSize: 13
- font.family: Constants.titilliumWeb_light
+ font.family: StudioFonts.titilliumWeb_light
visible: projectModel.communityVersion
ProjectModel {
id: projectModel
diff --git a/src/plugins/studiowelcome/qml/welcomepage/main.qml b/src/plugins/studiowelcome/qml/welcomepage/main.qml
index 288321c2d9..759ac45923 100644
--- a/src/plugins/studiowelcome/qml/welcomepage/main.qml
+++ b/src/plugins/studiowelcome/qml/welcomepage/main.qml
@@ -196,7 +196,7 @@ Item {
anchors.rightMargin: 23
font.weight: Font.Light
font.pixelSize: 14
- font.family: Constants.titilliumWeb_regular
+ font.family: StudioFonts.titilliumWeb_regular
renderType: Text.NativeRendering
visible: projectModel.communityVersion
}
diff --git a/src/plugins/valgrind/callgrind/callgrindparser.cpp b/src/plugins/valgrind/callgrind/callgrindparser.cpp
index 153fa866db..c80a30b99b 100644
--- a/src/plugins/valgrind/callgrind/callgrindparser.cpp
+++ b/src/plugins/valgrind/callgrind/callgrindparser.cpp
@@ -283,6 +283,10 @@ void Parser::Private::parseHeader(QIODevice *device)
while (!device->atEnd()) {
QByteArray line = device->readLine();
+ // last character will be ignored anyhow, but we might have CRLF; if so cut the last one
+ if (line.endsWith("\r\n"))
+ line.chop(1);
+
// now that we're done checking if we're done (heh) with the header, parse the address
// and cost column descriptions. speed is unimportant here.
if (line.startsWith('#')) {
@@ -352,8 +356,9 @@ Parser::Private::NamePair Parser::Private::parseName(const char *begin, const ch
void Parser::Private::dispatchLine(const QByteArray &line)
{
+ int lineEnding = line.endsWith("\r\n") ? 2 : 1;
const char *const begin = line.constData();
- const char *const end = begin + line.length() - 1; // we're not interested in the '\n'
+ const char *const end = begin + line.length() - lineEnding; // we're not interested in the '\n'
const char *current = begin;
// shortest possible line is "1 1" - a cost item line