forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.12'
Change-Id: Ia8254720b2ba6e3e7b859017e1c2b6e289bed771
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#BINARY_ARTIFACTS_BRANCH = master
|
||||
#PROJECT_USER_FILE_EXTENSION = .user
|
||||
|
||||
set(IDE_VERSION "4.11.83") # The IDE version.
|
||||
set(IDE_VERSION_COMPAT "4.11.83") # The IDE Compatibility version.
|
||||
set(IDE_VERSION_DISPLAY "4.12.0-beta2") # The IDE display version.
|
||||
set(IDE_VERSION "4.11.84") # The IDE version.
|
||||
set(IDE_VERSION_COMPAT "4.11.84") # The IDE Compatibility version.
|
||||
set(IDE_VERSION_DISPLAY "4.12.0-rc1") # The IDE display version.
|
||||
set(IDE_COPYRIGHT_YEAR "2020") # The IDE current copyright year.
|
||||
|
||||
set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation.
|
||||
|
@@ -381,7 +381,7 @@
|
||||
Copyright (C) 2010-2015 three.js authors\br
|
||||
share/qtcreator/templates/wizards/projects/qmake/qtcanvas3dapplication
|
||||
|
||||
\li \b{OpenSSL toolkit. Version 1.0.2j}
|
||||
\li \b{OpenSSL toolkit}
|
||||
|
||||
The OpenSSL toolkit stays under a double license, i.e. both the conditions of
|
||||
the OpenSSL License and the original SSLeay license apply to the toolkit.
|
||||
@@ -391,7 +391,7 @@
|
||||
OpenSSL License
|
||||
====================================================================
|
||||
|
||||
Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved.
|
||||
Copyright (c) 1998-2019 The OpenSSL Project. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
|
@@ -4,16 +4,16 @@ import qbs.FileInfo
|
||||
import "qtc.js" as HelperFunctions
|
||||
|
||||
Module {
|
||||
property string qtcreator_display_version: '4.12.0-beta2'
|
||||
property string qtcreator_display_version: '4.12.0-rc1'
|
||||
property string ide_version_major: '4'
|
||||
property string ide_version_minor: '11'
|
||||
property string ide_version_release: '83'
|
||||
property string ide_version_release: '84'
|
||||
property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.'
|
||||
+ ide_version_release
|
||||
|
||||
property string ide_compat_version_major: '4'
|
||||
property string ide_compat_version_minor: '11'
|
||||
property string ide_compat_version_release: '83'
|
||||
property string ide_compat_version_release: '84'
|
||||
property string qtcreator_compat_version: ide_compat_version_major + '.'
|
||||
+ ide_compat_version_minor + '.' + ide_compat_version_release
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
QTCREATOR_VERSION = 4.11.83
|
||||
QTCREATOR_COMPAT_VERSION = 4.11.83
|
||||
QTCREATOR_DISPLAY_VERSION = 4.12.0-beta2
|
||||
QTCREATOR_VERSION = 4.11.84
|
||||
QTCREATOR_COMPAT_VERSION = 4.11.84
|
||||
QTCREATOR_DISPLAY_VERSION = 4.12.0-rc1
|
||||
QTCREATOR_COPYRIGHT_YEAR = 2020
|
||||
BINARY_ARTIFACTS_BRANCH = master
|
||||
BINARY_ARTIFACTS_BRANCH = 4.12
|
||||
|
||||
IDE_DISPLAY_NAME = Qt Creator
|
||||
IDE_ID = qtcreator
|
||||
|
@@ -180,7 +180,10 @@ void AndroidPlugin::kitsRestored()
|
||||
AndroidConfigurations::registerNewToolChains();
|
||||
AndroidConfigurations::updateAutomaticKitList();
|
||||
connect(QtSupport::QtVersionManager::instance(), &QtSupport::QtVersionManager::qtVersionsChanged,
|
||||
AndroidConfigurations::instance(), &AndroidConfigurations::updateAutomaticKitList);
|
||||
AndroidConfigurations::instance(), []() {
|
||||
AndroidConfigurations::registerNewToolChains();
|
||||
AndroidConfigurations::updateAutomaticKitList();
|
||||
});
|
||||
disconnect(KitManager::instance(), &KitManager::kitsLoaded,
|
||||
this, &AndroidPlugin::kitsRestored);
|
||||
}
|
||||
|
@@ -169,11 +169,6 @@ AndroidToolChainFactory::AndroidToolChainFactory()
|
||||
setToolchainConstructor([] { return new AndroidToolChain; });
|
||||
}
|
||||
|
||||
ToolChainList AndroidToolChainFactory::autoDetect(const ToolChainList &alreadyKnown)
|
||||
{
|
||||
return autodetectToolChains(alreadyKnown);
|
||||
}
|
||||
|
||||
static FilePath clangPlusPlusPath(const FilePath &clangPath)
|
||||
{
|
||||
return clangPath.parentDir().pathAppended(
|
||||
|
@@ -67,8 +67,6 @@ class AndroidToolChainFactory : public ProjectExplorer::ToolChainFactory
|
||||
public:
|
||||
AndroidToolChainFactory();
|
||||
|
||||
ToolChainList autoDetect(const ToolChainList &alreadyKnown) override;
|
||||
|
||||
class AndroidToolChainInformation
|
||||
{
|
||||
public:
|
||||
|
@@ -1793,8 +1793,8 @@ void BreakpointItem::destroyMarker()
|
||||
FilePath BreakpointItem::markerFileName() const
|
||||
{
|
||||
// Some heuristics to find a "good" file name.
|
||||
if (!m_parameters.fileName.exists())
|
||||
return FilePath::fromString(m_parameters.fileName.toFileInfo().absolutePath());
|
||||
if (m_parameters.fileName.exists())
|
||||
return FilePath::fromString(m_parameters.fileName.toFileInfo().absoluteFilePath());
|
||||
|
||||
const FilePath origFileName = requestedParameters().fileName;
|
||||
if (m_parameters.fileName.endsWith(origFileName.fileName()))
|
||||
@@ -2268,7 +2268,7 @@ void GlobalBreakpointItem::updateFileName(const FilePath &fileName)
|
||||
FilePath GlobalBreakpointItem::markerFileName() const
|
||||
{
|
||||
// Some heuristics to find a "good" file name.
|
||||
if (!m_params.fileName.exists())
|
||||
if (m_params.fileName.exists())
|
||||
return FilePath::fromString(m_params.fileName.toFileInfo().absoluteFilePath());
|
||||
return m_params.fileName;
|
||||
}
|
||||
|
@@ -378,6 +378,7 @@ void BreakpointParameters::updateFromGdbOutput(const GdbMi &bkpt)
|
||||
QString name;
|
||||
if (!fullName.isEmpty()) {
|
||||
name = cleanupFullName(fullName);
|
||||
fileName = Utils::FilePath::fromString(name);
|
||||
//if (data->markerFileName().isEmpty())
|
||||
// data->setMarkerFileName(name);
|
||||
} else {
|
||||
|
@@ -440,11 +440,12 @@ void CdbEngine::setupEngine()
|
||||
inferiorEnvironment.set(qtLoggingToConsoleKey, "0");
|
||||
|
||||
static const char cdbExtensionPathVariableC[] = "_NT_DEBUGGER_EXTENSION_PATH";
|
||||
inferiorEnvironment.prependOrSet(cdbExtensionPathVariableC, extensionFi.absolutePath());
|
||||
inferiorEnvironment.prependOrSet(cdbExtensionPathVariableC, extensionFi.absolutePath(), {";"});
|
||||
const QByteArray oldCdbExtensionPath = qgetenv(cdbExtensionPathVariableC);
|
||||
if (!oldCdbExtensionPath.isEmpty()) {
|
||||
inferiorEnvironment.appendOrSet(cdbExtensionPathVariableC,
|
||||
QString::fromLocal8Bit(oldCdbExtensionPath));
|
||||
QString::fromLocal8Bit(oldCdbExtensionPath),
|
||||
{";"});
|
||||
}
|
||||
|
||||
m_process.setEnvironment(inferiorEnvironment);
|
||||
|
@@ -334,16 +334,22 @@ McuSupportOptions::McuSupportOptions(QObject *parent)
|
||||
: QObject(parent)
|
||||
, qtForMCUsSdkPackage(Sdk::createQtForMCUsPackage())
|
||||
{
|
||||
Sdk::hardcodedTargetsAndPackages(qtForMCUsSdkPackage, &packages, &mcuTargets);
|
||||
|
||||
packages.append(qtForMCUsSdkPackage);
|
||||
for (auto package : packages)
|
||||
connect(package, &McuPackage::changed, [this](){
|
||||
emit changed();
|
||||
});
|
||||
connect(qtForMCUsSdkPackage, &McuPackage::changed,
|
||||
this, &McuSupportOptions::populatePackagesAndTargets);
|
||||
}
|
||||
|
||||
McuSupportOptions::~McuSupportOptions()
|
||||
{
|
||||
deletePackagesAndTargets();
|
||||
delete qtForMCUsSdkPackage;
|
||||
}
|
||||
|
||||
void McuSupportOptions::populatePackagesAndTargets()
|
||||
{
|
||||
setQulDir(Utils::FilePath::fromUserInput(qtForMCUsSdkPackage->path()));
|
||||
}
|
||||
|
||||
void McuSupportOptions::deletePackagesAndTargets()
|
||||
{
|
||||
qDeleteAll(packages);
|
||||
packages.clear();
|
||||
@@ -351,6 +357,19 @@ McuSupportOptions::~McuSupportOptions()
|
||||
mcuTargets.clear();
|
||||
}
|
||||
|
||||
void McuSupportOptions::setQulDir(const Utils::FilePath &dir)
|
||||
{
|
||||
deletePackagesAndTargets();
|
||||
Sdk::hardcodedTargetsAndPackages(dir, &packages, &mcuTargets);
|
||||
//packages.append(qtForMCUsSdkPackage);
|
||||
for (auto package : packages) {
|
||||
connect(package, &McuPackage::changed, [this](){
|
||||
emit changed();
|
||||
});
|
||||
}
|
||||
emit changed();
|
||||
}
|
||||
|
||||
static bool mcuTargetIsDesktop(const McuTarget* mcuTarget)
|
||||
{
|
||||
return mcuTarget->qulPlatform() == "Qt";
|
||||
|
@@ -35,6 +35,7 @@ class Id;
|
||||
}
|
||||
|
||||
namespace Utils {
|
||||
class FilePath;
|
||||
class PathChooser;
|
||||
class InfoLabel;
|
||||
}
|
||||
@@ -158,10 +159,16 @@ public:
|
||||
QVector<McuTarget*> mcuTargets;
|
||||
McuPackage *qtForMCUsSdkPackage = nullptr;
|
||||
|
||||
void setQulDir(const Utils::FilePath &dir);
|
||||
|
||||
QString kitName(const McuTarget* mcuTarget) const;
|
||||
|
||||
QList<ProjectExplorer::Kit *> existingKits(const McuTarget *mcuTargt);
|
||||
ProjectExplorer::Kit *newKit(const McuTarget *mcuTarget);
|
||||
void populatePackagesAndTargets();
|
||||
|
||||
private:
|
||||
void deletePackagesAndTargets();
|
||||
|
||||
signals:
|
||||
void changed();
|
||||
|
@@ -62,6 +62,7 @@ public:
|
||||
private:
|
||||
void apply() final;
|
||||
|
||||
void populateMcuTargetsComboBox();
|
||||
void showEvent(QShowEvent *event) final;
|
||||
|
||||
QString m_armGccPath;
|
||||
@@ -108,14 +109,12 @@ McuSupportOptionsWidget::McuSupportOptionsWidget()
|
||||
m_mcuTargetsGroupBox->setFlat(true);
|
||||
mainLayout->addWidget(m_mcuTargetsGroupBox);
|
||||
m_mcuTargetsComboBox = new QComboBox;
|
||||
m_mcuTargetsComboBox->addItems(
|
||||
Utils::transform<QStringList>(m_options.mcuTargets, [this](McuTarget *t){
|
||||
return m_options.kitName(t);
|
||||
}));
|
||||
auto layout = new QVBoxLayout(m_mcuTargetsGroupBox);
|
||||
layout->addWidget(m_mcuTargetsComboBox);
|
||||
connect(m_mcuTargetsComboBox, &QComboBox::currentTextChanged,
|
||||
this, &McuSupportOptionsWidget::showMcuTargetPackages);
|
||||
connect(m_options.qtForMCUsSdkPackage, &McuPackage::changed,
|
||||
this, &McuSupportOptionsWidget::populateMcuTargetsComboBox);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -147,15 +146,13 @@ McuSupportOptionsWidget::McuSupportOptionsWidget()
|
||||
void McuSupportOptionsWidget::updateStatus()
|
||||
{
|
||||
const McuTarget *mcuTarget = currentMcuTarget();
|
||||
if (!mcuTarget)
|
||||
return;
|
||||
|
||||
const bool cMakeAvailable = !CMakeProjectManager::CMakeToolManager::cmakeTools().isEmpty();
|
||||
|
||||
// Page elements
|
||||
{
|
||||
m_qtForMCUsSdkGroupBox->setVisible(cMakeAvailable);
|
||||
const bool ready = cMakeAvailable &&
|
||||
const bool ready = cMakeAvailable && mcuTarget &&
|
||||
m_options.qtForMCUsSdkPackage->status() == McuPackage::ValidPackage;
|
||||
m_mcuTargetsGroupBox->setVisible(ready);
|
||||
m_packagesGroupBox->setVisible(ready && !mcuTarget->packages().isEmpty());
|
||||
@@ -163,7 +160,7 @@ void McuSupportOptionsWidget::updateStatus()
|
||||
}
|
||||
|
||||
// Kit creation status
|
||||
{
|
||||
if (mcuTarget) {
|
||||
const bool mcuTargetValid = mcuTarget->isValid();
|
||||
m_kitCreationInfoLabel->setType(mcuTargetValid ? Utils::InfoLabel::Ok
|
||||
: Utils::InfoLabel::NotOk);
|
||||
@@ -213,13 +210,15 @@ void McuSupportOptionsWidget::showMcuTargetPackages()
|
||||
McuTarget *McuSupportOptionsWidget::currentMcuTarget() const
|
||||
{
|
||||
const int mcuTargetIndex = m_mcuTargetsComboBox->currentIndex();
|
||||
return m_options.mcuTargets.isEmpty() ? nullptr : m_options.mcuTargets.at(mcuTargetIndex);
|
||||
return (mcuTargetIndex == -1 || m_options.mcuTargets.isEmpty())
|
||||
? nullptr
|
||||
: m_options.mcuTargets.at(mcuTargetIndex);
|
||||
}
|
||||
|
||||
void McuSupportOptionsWidget::showEvent(QShowEvent *event)
|
||||
{
|
||||
Q_UNUSED(event)
|
||||
updateStatus();
|
||||
populateMcuTargetsComboBox();
|
||||
}
|
||||
|
||||
void McuSupportOptionsWidget::apply()
|
||||
@@ -241,6 +240,17 @@ void McuSupportOptionsWidget::apply()
|
||||
m_options.newKit(mcuTarget);
|
||||
}
|
||||
|
||||
void McuSupportOptionsWidget::populateMcuTargetsComboBox()
|
||||
{
|
||||
m_options.populatePackagesAndTargets();
|
||||
m_mcuTargetsComboBox->clear();
|
||||
m_mcuTargetsComboBox->addItems(
|
||||
Utils::transform<QStringList>(m_options.mcuTargets, [this](McuTarget *t){
|
||||
return m_options.kitName(t);
|
||||
}));
|
||||
updateStatus();
|
||||
}
|
||||
|
||||
McuSupportOptionsPage::McuSupportOptionsPage()
|
||||
{
|
||||
setId(Core::Id(Constants::SETTINGS_ID));
|
||||
|
@@ -158,8 +158,8 @@ static McuPackage *createSeggerJLinkPackage()
|
||||
return result;
|
||||
}
|
||||
|
||||
void hardcodedTargetsAndPackages(const McuPackage* qtForMCUsSdkPackage,
|
||||
QVector<McuPackage *> *packages, QVector<McuTarget *> *mcuTargets)
|
||||
void hardcodedTargetsAndPackages(const Utils::FilePath &dir, QVector<McuPackage *> *packages,
|
||||
QVector<McuTarget *> *mcuTargets)
|
||||
{
|
||||
McuToolChainPackage* armGccPackage = Sdk::createArmGccPackage();
|
||||
McuPackage* stm32CubeFwF7SdkPackage = Sdk::createStm32CubeFwF7SdkPackage();
|
||||
@@ -171,6 +171,8 @@ void hardcodedTargetsAndPackages(const McuPackage* qtForMCUsSdkPackage,
|
||||
armGccPackage, stm32CubeProgrammerPackage};
|
||||
QVector<McuPackage*> nxpEvalPackages = {
|
||||
armGccPackage, seggerJLinkPackage};
|
||||
QVector<McuPackage*> renesasEvalPackages = {
|
||||
armGccPackage, seggerJLinkPackage};
|
||||
QVector<McuPackage*> desktopPackages = {};
|
||||
*packages = {
|
||||
armGccPackage, stm32CubeFwF7SdkPackage, stm32CubeProgrammerPackage, evkbImxrt1050SdkPackage,
|
||||
@@ -179,28 +181,42 @@ void hardcodedTargetsAndPackages(const McuPackage* qtForMCUsSdkPackage,
|
||||
const QString vendorStm = "STM";
|
||||
const QString vendorNxp = "NXP";
|
||||
const QString vendorQt = "Qt";
|
||||
const QString vendorRenesas = "Renesas";
|
||||
|
||||
// STM
|
||||
auto mcuTarget = new McuTarget(vendorStm, "STM32F7508-DISCOVERY", stmEvalPackages,
|
||||
armGccPackage);
|
||||
mcuTarget->setColorDepth(32);
|
||||
mcuTargets->append(mcuTarget);
|
||||
const struct {
|
||||
const QString &vendor;
|
||||
const QString qulPlatform;
|
||||
const QVector<McuPackage*> &packages;
|
||||
McuToolChainPackage *toolchainPackage;
|
||||
const QVector<int> colorDepths;
|
||||
} targets[] = {
|
||||
{vendorNxp, {"MIMXRT1050-EVK"}, nxpEvalPackages, armGccPackage, {16}},
|
||||
{vendorNxp, {"MIMXRT1064-EVK"}, nxpEvalPackages, armGccPackage, {16}},
|
||||
{vendorQt, {"Qt"}, desktopPackages, nullptr, {32}},
|
||||
{vendorRenesas, {"RH850-D1M1A"}, renesasEvalPackages, armGccPackage, {32}},
|
||||
{vendorStm, {"STM32F469I-DISCOVERY"}, stmEvalPackages, armGccPackage, {24}},
|
||||
{vendorStm, {"STM32F7508-DISCOVERY"}, stmEvalPackages, armGccPackage, {32, 16}},
|
||||
{vendorStm, {"STM32F769I-DISCOVERY"}, stmEvalPackages, armGccPackage, {32}},
|
||||
{vendorStm, {"STM32H750B-DISCOVERY"}, stmEvalPackages, armGccPackage, {32}},
|
||||
{vendorStm, {"STM32L4R9I-DISCOVERY"}, stmEvalPackages, armGccPackage, {24}},
|
||||
{vendorStm, {"STM32L4R9I-EVAL"}, stmEvalPackages, armGccPackage, {24}}
|
||||
};
|
||||
|
||||
mcuTarget = new McuTarget(vendorStm, "STM32F7508-DISCOVERY", stmEvalPackages, armGccPackage);
|
||||
mcuTarget->setColorDepth(16);
|
||||
mcuTargets->append(mcuTarget);
|
||||
|
||||
mcuTarget = new McuTarget(vendorStm, "STM32F769I-DISCOVERY", stmEvalPackages, armGccPackage);
|
||||
mcuTargets->append(mcuTarget);
|
||||
|
||||
// NXP
|
||||
mcuTarget = new McuTarget(vendorNxp, "MIMXRT1050-EVK", nxpEvalPackages, armGccPackage);
|
||||
mcuTargets->append(mcuTarget);
|
||||
|
||||
// Desktop (Qt)
|
||||
mcuTarget = new McuTarget(vendorQt, "Qt", desktopPackages, nullptr);
|
||||
mcuTarget->setColorDepth(32);
|
||||
const QString QulTargetTemplate =
|
||||
dir.toString() + "/lib/cmake/Qul/QulTargets/QulTargets_%1_%2.cmake";
|
||||
for (auto target : targets) {
|
||||
for (int colorDepth : target.colorDepths) {
|
||||
const QString QulTarget =
|
||||
QulTargetTemplate.arg(target.qulPlatform, QString::number(colorDepth));
|
||||
if (!Utils::FilePath::fromUserInput(QulTarget).exists())
|
||||
continue;
|
||||
auto mcuTarget = new McuTarget(target.vendor, target.qulPlatform, target.packages,
|
||||
target.toolchainPackage);
|
||||
if (target.colorDepths.count() > 1)
|
||||
mcuTarget->setColorDepth(colorDepth);
|
||||
mcuTargets->append(mcuTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Sdk
|
||||
|
@@ -37,7 +37,7 @@ namespace Sdk {
|
||||
McuPackage *createQtForMCUsPackage();
|
||||
|
||||
// Legacy: List of targets supported by Qt for MCUs 1.0
|
||||
void hardcodedTargetsAndPackages(const McuPackage* const qtForMCUsSdkPackage,
|
||||
void hardcodedTargetsAndPackages(const Utils::FilePath &qulDir,
|
||||
QVector<McuPackage*> *packages, QVector<McuTarget*> *mcuTargets);
|
||||
|
||||
} // namespace Sdk
|
||||
|
@@ -384,6 +384,8 @@ QVariant QmakeProFileNode::data(Core::Id role) const
|
||||
|
||||
if (role == Android::Constants::AndroidTargets)
|
||||
return {};
|
||||
if (role == Android::Constants::AndroidApk)
|
||||
return {};
|
||||
|
||||
// We can not use AppMan headers even at build time.
|
||||
if (role == "AppmanPackageDir")
|
||||
|
@@ -106,13 +106,6 @@ QToolBar *CurveEditor::createToolBar(CurveEditorModel *model)
|
||||
Q_UNUSED(tangentStepAction);
|
||||
Q_UNUSED(tangentDefaultAction);
|
||||
|
||||
auto *valueBox = new QHBoxLayout;
|
||||
valueBox->addWidget(new QLabel(tr("Value")));
|
||||
valueBox->addWidget(new QDoubleSpinBox);
|
||||
auto *valueWidget = new QWidget;
|
||||
valueWidget->setLayout(valueBox);
|
||||
bar->addWidget(valueWidget);
|
||||
|
||||
auto *durationBox = new QHBoxLayout;
|
||||
auto *startSpin = new QSpinBox;
|
||||
auto *endSpin = new QSpinBox;
|
||||
|
@@ -108,7 +108,6 @@ void CurveEditorModel::reset(const std::vector<TreeItem *> &items)
|
||||
|
||||
endResetModel();
|
||||
|
||||
if (!pinned.empty())
|
||||
graphicsView()->reset(pinned);
|
||||
|
||||
if (SelectionModel *sm = selectionModel())
|
||||
|
@@ -150,7 +150,18 @@ CurveSegment::CurveSegment(const Keyframe &left, const Keyframe &right)
|
||||
|
||||
bool CurveSegment::isValid() const
|
||||
{
|
||||
return m_left.position() != m_right.position();
|
||||
if (m_left.position() == m_right.position())
|
||||
return false;
|
||||
|
||||
if (interpolation() == Keyframe::Interpolation::Undefined)
|
||||
return false;
|
||||
|
||||
if (interpolation() == Keyframe::Interpolation::Easing
|
||||
|| interpolation() == Keyframe::Interpolation::Bezier) {
|
||||
if (qFuzzyCompare(m_left.position().y(), m_right.position().y()))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CurveSegment::containsX(double x) const
|
||||
@@ -224,6 +235,23 @@ QPainterPath CurveSegment::path() const
|
||||
return path;
|
||||
}
|
||||
|
||||
void CurveSegment::extendWithEasingCurve(QPainterPath &path, const QEasingCurve &curve) const
|
||||
{
|
||||
auto mapEasing = [](const QPointF &start, const QPointF &end, const QPointF &pos) {
|
||||
QPointF slope(end.x() - start.x(), end.y() - start.y());
|
||||
return QPointF(start.x() + slope.x() * pos.x(), start.y() + slope.y() * pos.y());
|
||||
};
|
||||
|
||||
QVector<QPointF> points = curve.toCubicSpline();
|
||||
int numSegments = points.count() / 3;
|
||||
for (int i = 0; i < numSegments; i++) {
|
||||
QPointF p1 = mapEasing(m_left.position(), m_right.position(), points.at(i * 3));
|
||||
QPointF p2 = mapEasing(m_left.position(), m_right.position(), points.at(i * 3 + 1));
|
||||
QPointF p3 = mapEasing(m_left.position(), m_right.position(), points.at(i * 3 + 2));
|
||||
path.cubicTo(p1, p2, p3);
|
||||
}
|
||||
}
|
||||
|
||||
void CurveSegment::extend(QPainterPath &path) const
|
||||
{
|
||||
if (interpolation() == Keyframe::Interpolation::Linear) {
|
||||
@@ -232,23 +260,11 @@ void CurveSegment::extend(QPainterPath &path) const
|
||||
path.lineTo(QPointF(m_right.position().x(), m_left.position().y()));
|
||||
path.lineTo(m_right.position());
|
||||
} else if (interpolation() == Keyframe::Interpolation::Bezier) {
|
||||
path.cubicTo(m_left.rightHandle(), m_right.leftHandle(), m_right.position());
|
||||
extendWithEasingCurve(path, easingCurve());
|
||||
} else if (interpolation() == Keyframe::Interpolation::Easing) {
|
||||
auto mapEasing = [](const QPointF &start, const QPointF &end, const QPointF &pos) {
|
||||
QPointF slope(end.x() - start.x(), end.y() - start.y());
|
||||
return QPointF(start.x() + slope.x() * pos.x(), start.y() + slope.y() * pos.y());
|
||||
};
|
||||
|
||||
QVariant data = m_right.data();
|
||||
if (data.isValid() && data.type() == static_cast<int>(QMetaType::QEasingCurve)) {
|
||||
QVector<QPointF> points = data.value<QEasingCurve>().toCubicSpline();
|
||||
int numSegments = points.count() / 3;
|
||||
for (int i = 0; i < numSegments; i++) {
|
||||
QPointF p1 = mapEasing(m_left.position(), m_right.position(), points.at(i * 3));
|
||||
QPointF p2 = mapEasing(m_left.position(), m_right.position(), points.at(i * 3 + 1));
|
||||
QPointF p3 = mapEasing(m_left.position(), m_right.position(), points.at(i * 3 + 2));
|
||||
path.cubicTo(p1, p2, p3);
|
||||
}
|
||||
extendWithEasingCurve(path, data.value<QEasingCurve>());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -258,6 +274,10 @@ QEasingCurve CurveSegment::easingCurve() const
|
||||
auto mapPosition = [this](const QPointF &position) {
|
||||
QPointF min = m_left.position();
|
||||
QPointF max = m_right.position();
|
||||
if (qFuzzyCompare(min.y(), max.y()))
|
||||
return QPointF((position.x() - min.x()) / (max.x() - min.x()),
|
||||
(position.y() - min.y()) / (max.y()));
|
||||
|
||||
return QPointF((position.x() - min.x()) / (max.x() - min.x()),
|
||||
(position.y() - min.y()) / (max.y() - min.y()));
|
||||
};
|
||||
@@ -265,8 +285,7 @@ QEasingCurve CurveSegment::easingCurve() const
|
||||
QEasingCurve curve;
|
||||
curve.addCubicBezierSegment(mapPosition(m_left.rightHandle()),
|
||||
mapPosition(m_right.leftHandle()),
|
||||
mapPosition(m_right.position()));
|
||||
|
||||
QPointF(1., 1.));
|
||||
return curve;
|
||||
}
|
||||
|
||||
|
@@ -61,6 +61,8 @@ public:
|
||||
|
||||
void extend(QPainterPath &path) const;
|
||||
|
||||
void extendWithEasingCurve(QPainterPath &path, const QEasingCurve &curve) const;
|
||||
|
||||
QEasingCurve easingCurve() const;
|
||||
|
||||
std::vector<QPointF> extrema() const;
|
||||
|
@@ -564,7 +564,6 @@ void GraphicsView::drawRangeBar(QPainter *painter, const QRectF &rect)
|
||||
QRectF activeRect = QRectF(QPointF(mapTimeToX(m_model->minimumTime()), tTick),
|
||||
QPointF(mapTimeToX(m_model->maximumTime()), bTick));
|
||||
|
||||
QColor rangeColor = m_style.rangeBarColor;
|
||||
painter->fillRect(activeRect, m_style.rangeBarColor);
|
||||
|
||||
QColor handleColor(m_style.rangeBarCapsColor);
|
||||
|
@@ -30,8 +30,8 @@
|
||||
#include "qmltimeline.h"
|
||||
|
||||
#include <bindingproperty.h>
|
||||
#include <variantproperty.h>
|
||||
#include <theme.h>
|
||||
#include <variantproperty.h>
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
@@ -204,8 +204,16 @@ std::vector<DesignTools::Keyframe> resolveSmallCurves(
|
||||
for (auto &&frame : frames) {
|
||||
if (frame.hasData() && !out.empty()) {
|
||||
QEasingCurve curve = frame.data().toEasingCurve();
|
||||
// One-segment-curve: Since (0,0) is implicit => 3
|
||||
if (curve.toCubicSpline().count() == 3) {
|
||||
DesignTools::Keyframe &previous = out.back();
|
||||
#if 0
|
||||
// Do not resolve when two adjacent keyframes have the same value.
|
||||
if (qFuzzyCompare(previous.position().y(), frame.position().y())) {
|
||||
out.push_back(frame);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
DesignTools::AnimationCurve acurve(curve, previous.position(), frame.position());
|
||||
previous.setRightHandle(acurve.keyframeAt(0).rightHandle());
|
||||
out.push_back(acurve.keyframeAt(1));
|
||||
|
@@ -355,6 +355,7 @@ void TimelineWidget::updateAnimationCurve(DesignTools::PropertyTreeItem *item)
|
||||
if (previous.isValid()) {
|
||||
if (frame.interpolation() == DesignTools::Keyframe::Interpolation::Bezier) {
|
||||
DesignTools::CurveSegment segment(previous, frame);
|
||||
if (segment.isValid())
|
||||
attachEasingCurve(pos.x(), segment.easingCurve(), group);
|
||||
} else if (frame.interpolation()
|
||||
== DesignTools::Keyframe::Interpolation::Easing) {
|
||||
|
@@ -1089,7 +1089,7 @@ ChangeValuesCommand NodeInstanceView::createChangeValueCommand(const QList<Varia
|
||||
{
|
||||
QVector<PropertyValueContainer> containerList;
|
||||
|
||||
const bool reflectionFlag = m_puppetTransaction.isValid();
|
||||
const bool reflectionFlag = m_puppetTransaction.isValid() && (!currentTimeline().isValid() || !currentTimeline().isRecording());
|
||||
|
||||
foreach (const VariantProperty &property, propertyList) {
|
||||
ModelNode node = property.parentModelNode();
|
||||
@@ -1245,10 +1245,10 @@ void NodeInstanceView::valuesModified(const ValuesModifiedCommand &command)
|
||||
if (hasInstanceForId(container.instanceId())) {
|
||||
NodeInstance instance = instanceForId(container.instanceId());
|
||||
if (instance.isValid()) {
|
||||
ModelNode node = instance.modelNode();
|
||||
VariantProperty property = instance.modelNode().variantProperty(container.name());
|
||||
if (property.value() != container.value())
|
||||
property.setValue(container.value());
|
||||
// QmlVisualNode is needed so timeline and state are updated
|
||||
QmlVisualNode node = instance.modelNode();
|
||||
if (node.instanceValue(container.name()) != container.value())
|
||||
node.setVariantProperty(container.name(), container.value());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@ VcsOutputFormatter::VcsOutputFormatter() :
|
||||
m_regexp(
|
||||
"(https?://\\S*)" // https://codereview.org/c/1234
|
||||
"|(v[0-9]+\\.[0-9]+\\.[0-9]+[\\-A-Za-z0-9]*)" // v0.1.2-beta3
|
||||
"|([0-9a-f]{6,}(?:\\.\\.[0-9a-f]{6,})?)") // 789acf or 123abc..456cde
|
||||
"|([0-9a-f]{6,}(?:\\.\\.[0-9a-f]{6,}|\\^)?)") // 789acf^ or 123abc..456cde
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -88,7 +88,7 @@ def switchSession(toSession):
|
||||
sessionView = ("{name='sessionView' type='ProjectExplorer::Internal::SessionView' visible='1' "
|
||||
"window=':Session Manager_ProjectExplorer::Internal::SessionDialog'}")
|
||||
mouseClick(waitForObjectItem(sessionView, toSession))
|
||||
clickButton(waitForObject("{name='btSwitch' text='Switch to' type='QPushButton' visible='1' "
|
||||
clickButton(waitForObject("{name='btSwitch' type='QPushButton' visible='1' "
|
||||
"window=':Session Manager_ProjectExplorer::Internal::SessionDialog'}"))
|
||||
|
||||
def createAndSwitchToSession(toSession):
|
||||
|
Reference in New Issue
Block a user