Merge remote-tracking branch 'origin/4.12'

Conflicts:
	src/plugins/qmldesigner/designmodewidget.cpp

Change-Id: I94a94a15df433d6caa8922fccaa69918b5e4e365
This commit is contained in:
Eike Ziller
2020-03-11 07:29:47 +01:00
73 changed files with 642 additions and 266 deletions

54
dist/changes-4.11.2.md vendored Normal file
View File

@@ -0,0 +1,54 @@
Qt Creator 4.11.2
=================
Qt Creator version 4.11.2 contains bug fixes.
The most important changes are listed in this document. For a complete
list of changes, see the Git log for the Qt Creator sources that
you can check out from the public Git repository. For example:
git clone git://code.qt.io/qt-creator/qt-creator.git
git log --cherry-pick --pretty=oneline origin/v4.11.1..v4.11.2
Editing
-------
* Improved performance of highlighting (QTCREATORBUG-23281)
* Fixed that `Rewrap Paragraph` split on non-breaking space (QTCREATORBUG-23643)
* Fixed freeze with block selection (QTCREATORBUG-23622)
* Fixed high CPU usage after scrolling horizontally (QTCREATORBUG-23647)
* Fixed scroll position after splitting if text cursor is not visible
* Fixed position of markers in scrollbar for long documents (QTCREATORBUG-23660)
### Python
* Fixed warnings in files generated by Python file wizard
### Language Client
* Fixed issue with server restart after server crash (QTCREATORBUG-23648)
Projects
--------
* Fixed wrong default project for adding files via wizards (QTCREATORBUG-23603)
Platforms
---------
### macOS
* Fixed issues with notarization of binary package
Credits for these changes go to:
--------------------------------
André Pönitz
Andy Shaw
Christian Kandeler
David Schulz
Eike Ziller
Leena Miettinen
Orgad Shaneh
Richard Weickelt
Tobias Hunger

View File

@@ -744,6 +744,8 @@ class Dumper(DumperBase):
return None
def callHelper(self, rettype, value, function, args):
if self.isWindowsTarget():
raise Exception("gdb crashes when calling functions on Windows")
# args is a tuple.
arg = ''
for i in range(len(args)):

View File

@@ -494,7 +494,10 @@ def qdump__QDir(d, value):
with Children(d):
if not d.isMsvcTarget():
ns = d.qtNamespace()
d.call('int', value, 'count') # Fill cache.
try:
d.call('int', value, 'count') # Fill cache.
except:
pass
#d.putCallItem('absolutePath', '@QString', value, 'absolutePath')
#d.putCallItem('canonicalPath', '@QString', value, 'canonicalPath')
with SubItem(d, 'absolutePath'):
@@ -1083,9 +1086,6 @@ qqLocalesCount = None
def qdump__QLocale(d, value):
if d.isMsvcTarget(): # as long as this dumper relies on calling functions skip it for cdb
return
# Check for uninitialized 'index' variable. Retrieve size of
# QLocale data array from variable in qlocale.cpp.
# Default is 368 in Qt 4.8, 438 in Qt 5.0.1, the last one
@@ -1119,7 +1119,10 @@ def qdump__QLocale(d, value):
= d.split('2s{short}2s'
+ '{QChar}{QChar}{short}{QChar}{QChar}'
+ '{QChar}{QChar}{QChar}', data)
d.putStringValue(d.call('const char *', value, 'name'))
try:
d.putStringValue(d.call('const char *', value, 'name'))
except:
pass
d.putNumChild(1)
if d.isExpanded():
with Children(d):

View File

@@ -50,7 +50,7 @@ Model {
id: defaultMaterial
emissiveColor: cameraFrustum.selected ? "#FF0000" : "#555555"
lighting: DefaultMaterial.NoLighting
cullingMode: Material.DisableCulling
cullMode: Material.NoCulling
}
]

View File

@@ -65,15 +65,8 @@ Item {
onGlobalOrientationChanged: _generalHelper.storeToolState(sceneId, "globalOrientation", globalOrientation)
onActiveSceneChanged: updateActiveScene()
function updateActiveScene()
function createEditView()
{
if (editView) {
// Destroy is async, so make sure we don't get any more updates for the old editView
_generalHelper.enableItemUpdate(editView, false);
editView.destroy();
}
// importScene cannot be updated after initial set, so we need to reconstruct entire View3D
var component = Qt.createComponent("SceneView3D.qml");
if (component.status === Component.Ready) {
editView = component.createObject(viewRect,
@@ -87,7 +80,21 @@ Item {
editView.cameraZoomFactor = Qt.binding(function() {return cameraControl._zoomFactor;});
selectionBoxes.length = 0;
return true;
}
return false;
}
function updateActiveScene()
{
if (editView) {
// Destroy is async, so make sure we don't get any more updates for the old editView
_generalHelper.enableItemUpdate(editView, false);
editView.destroy();
}
// importScene cannot be updated after initial set, so we need to reconstruct entire View3D
if (createEditView()) {
if (activeScene) {
var toolStates = _generalHelper.getToolStates(sceneId);
if (Object.keys(toolStates).length > 0)
@@ -381,10 +388,11 @@ Item {
}
}
// Work-around the fact that the projection matrix for the camera is not calculated until
// the first frame is rendered, so any initial calls to mapFrom3DScene() will fail.
Component.onCompleted: {
createEditView();
selectObjects([]);
// Work-around the fact that the projection matrix for the camera is not calculated until
// the first frame is rendered, so any initial calls to mapFrom3DScene() will fail.
_generalHelper.requestOverlayUpdate();
}
@@ -396,10 +404,10 @@ Item {
PerspectiveCamera {
id: overlayPerspectiveCamera
clipFar: viewRoot.editView ? viewRoot.editView.perpectiveCamera.clipFar : 1000
clipNear: viewRoot.editView ? viewRoot.editView.perpectiveCamera.clipNear : 1
position: viewRoot.editView ? viewRoot.editView.perpectiveCamera.position : Qt.vector3d(0, 0, 0)
rotation: viewRoot.editView ? viewRoot.editView.perpectiveCamera.rotation : Qt.quaternion(1, 0, 0, 0)
clipFar: viewRoot.editView ? viewRoot.editView.perspectiveCamera.clipFar : 1000
clipNear: viewRoot.editView ? viewRoot.editView.perspectiveCamera.clipNear : 1
position: viewRoot.editView ? viewRoot.editView.perspectiveCamera.position : Qt.vector3d(0, 0, 0)
rotation: viewRoot.editView ? viewRoot.editView.perspectiveCamera.rotation : Qt.quaternion(1, 0, 0, 0)
}
OrthographicCamera {
@@ -495,7 +503,7 @@ Item {
DefaultMaterial {
id: lineMat
lighting: DefaultMaterial.NoLighting
cullingMode: Material.DisableCulling
cullMode: Material.NoCulling
emissiveColor: pivotLine.color
}
]
@@ -538,7 +546,7 @@ Item {
View3D {
id: overlayView
anchors.fill: parent
camera: usePerspective ? overlayPerspectiveCamera : overlayOrthoCamera
camera: viewRoot.usePerspective ? overlayPerspectiveCamera : overlayOrthoCamera
importScene: overlayScene
z: 2
}

View File

@@ -49,7 +49,7 @@ Node {
id: mainGridMaterial
emissiveColor: "#aaaaaa"
lighting: DefaultMaterial.NoLighting
cullingMode: Material.DisableCulling
cullMode: Material.NoCulling
}
]
}
@@ -67,7 +67,7 @@ Node {
id: subGridMaterial
emissiveColor: mainGridMaterial.emissiveColor
lighting: DefaultMaterial.NoLighting
cullingMode: Material.DisableCulling
cullMode: Material.NoCulling
}
]
}
@@ -84,7 +84,7 @@ Node {
id: vCenterLineMaterial
emissiveColor: "#00a1d2"
lighting: DefaultMaterial.NoLighting
cullingMode: Material.DisableCulling
cullMode: Material.NoCulling
}
]
}
@@ -101,7 +101,7 @@ Node {
id: hCenterLineMaterial
emissiveColor: "#cb211a"
lighting: DefaultMaterial.NoLighting
cullingMode: Material.DisableCulling
cullMode: Material.NoCulling
}
]
}

View File

@@ -43,7 +43,7 @@ Node {
DefaultMaterial {
id: lineMat
lighting: DefaultMaterial.NoLighting
cullingMode: Material.DisableCulling
cullMode: Material.NoCulling
}
]
}

View File

@@ -54,7 +54,7 @@ Model {
id: gizmoMaterial
emissiveColor: "white"
lighting: DefaultMaterial.NoLighting
cullingMode: Material.DisableCulling
cullMode: Material.NoCulling
}
materials: gizmoMaterial

View File

@@ -33,7 +33,7 @@ View3D {
property bool usePerspective: false
property bool showSceneLight: false
property alias sceneHelpers: sceneHelpers
property alias perpectiveCamera: scenePerspectiveCamera
property alias perspectiveCamera: scenePerspectiveCamera
property alias orthoCamera: sceneOrthoCamera
property double cameraZoomFactor: .55;

View File

@@ -58,7 +58,7 @@ Node {
DefaultMaterial {
emissiveColor: "#fff600"
lighting: DefaultMaterial.NoLighting
cullingMode: Material.DisableCulling
cullMode: Material.NoCulling
}
]
}

View File

@@ -818,6 +818,14 @@ void Qt5InformationNodeInstanceServer::setup3DEditView(const QList<ServerNodeIns
}
}
if (toolStates.contains({})) {
// Update tool state to an existing no-scene state before updating the active scene to
// ensure the previous state is inherited properly in all cases.
QMetaObject::invokeMethod(m_editView3DRootItem, "updateToolStates", Qt::QueuedConnection,
Q_ARG(QVariant, toolStates[{}]),
Q_ARG(QVariant, QVariant::fromValue(false)));
}
updateActiveSceneToEditView3D();
createCameraAndLightGizmos(instanceList);

View File

@@ -39,8 +39,9 @@ Rectangle {
property int delegateStateImageSize
property bool delegateHasWhenCondition
property string delegateWhenConditionString
readonly property bool isDefaultState: isDefault
color: baseColor
color: (isDefaultState || (isBaseState && !modelHasDefaultState)) ? Qt.lighter(baseColor, 1.5) : baseColor
border.color: Theme.qmlDesignerBorderColor()
function autoComplete(text, pos, explicitComplete, filter) {
@@ -85,7 +86,7 @@ Rectangle {
Image {
id: whenButton
visible: !isBaseState && expanded
visible: !isBaseState || (isBaseState && modelHasDefaultState)
width: 14
height: 14
x: 4
@@ -108,6 +109,7 @@ Rectangle {
id: contextMenu
MenuItem {
visible: !isBaseState
text: qsTr("Set when Condition")
onTriggered: {
var x = whenButton.mapToGlobal(0,0).x + 4
@@ -116,20 +118,32 @@ Rectangle {
bindingEditor.text = delegateWhenConditionString
bindingEditor.prepareBindings()
}
}
MenuItem {
visible: delegateHasWhenCondition
visible: !isBaseState && delegateHasWhenCondition
text: qsTr("Reset when Condition")
onTriggered: {
statesEditorModel.resetWhenCondition(internalNodeId)
}
}
MenuItem {
visible: !isBaseState && !isDefaultState
text: qsTr("Set as Default")
onTriggered: {
statesEditorModel.setStateAsDefault(internalNodeId)
}
}
MenuItem {
visible: (!isBaseState && isDefaultState) || (isBaseState && modelHasDefaultState)
text: qsTr("Reset Default")
onTriggered: {
statesEditorModel.resetDefaultState()
}
}
}
}
TextField {

View File

@@ -88,7 +88,7 @@ FocusScope {
Item {
id: addStateItem
property int buttonLeftSpacing: 0
property int buttonLeftSpacing: 8 * (expanded ? 1 : 2)
anchors.right: parent.right
width: delegateHeight / 2 + buttonLeftSpacing

View File

@@ -98,6 +98,7 @@ namespace ADS
bool m_autorestoreLastWorkspace; // This option is set in the Workspace Manager!
QSettings *m_settings = nullptr;
QString m_workspacePresetsPath;
bool m_modeChangeState;
/**
* Private data constructor
@@ -576,6 +577,9 @@ namespace ADS
bool DockManager::save()
{
if (isModeChangeState())
return false;
emit aboutToSaveWorkspace();
bool result = write(activeWorkspace(), saveState(), parentWidget());
@@ -836,6 +840,16 @@ namespace ADS
return result;
}
void DockManager::setModeChangeState(bool value)
{
d->m_modeChangeState = value;
}
bool DockManager::isModeChangeState() const
{
return d->m_modeChangeState;
}
bool DockManager::write(const QString &workspace, const QByteArray &data, QString *errorString) const
{
Utils::FilePath filename = workspaceNameToFileName(workspace);
@@ -895,7 +909,13 @@ namespace ADS
// Copy all missing workspace presets over to the local workspace folder
QDir presetsDir(d->m_workspacePresetsPath);
QDir workspaceDir(QFileInfo(d->m_settings->fileName()).path() + QLatin1String("/workspaces"));
QDir workspaceDir(QFileInfo(d->m_settings->fileName()).path() + QLatin1Char('/') + m_dirName);
// Try do create the 'workspaces' directory if it doesn't exist already
workspaceDir.mkpath(workspaceDir.absolutePath());
if (!workspaceDir.exists()) {
qCInfo(adsLog) << QString("Could not make directory '%1')").arg(workspaceDir.absolutePath());
return;
}
for (const auto &preset : presets) {
QString filename = preset;
@@ -906,7 +926,10 @@ namespace ADS
QFile file(filePath);
if (file.exists()) {
file.copy(workspaceDir.filePath(filename));
if (!file.copy(workspaceDir.filePath(filename))) {
qCInfo(adsLog) << QString("Could not copy '%1' to '%2' error: %3").arg(
filePath, workspaceDir.filePath(filename), file.errorString());
}
d->m_workspaceListDirty = true;
}
}

View File

@@ -151,8 +151,8 @@ public:
using Super = DockContainerWidget;
/**
* These global configuration flags configure some global dock manager
* settings.
* These global configuration flags configure some global dock manager settings.
* Set the dock manager flags, before you create the dock manager instance.
*/
enum eConfigFlag {
ActiveTabHasCloseButton
@@ -238,12 +238,14 @@ public:
/**
* Sets the global configuration flags for the whole docking system.
* Call this function before you create your first dock widget.
* Call this function before you create the dock manager and before
* your create the first dock widget.
*/
static void setConfigFlags(const ConfigFlags flags);
/**
* Set a certain config flag
* \see setConfigFlags()
*/
static void setConfigFlag(eConfigFlag flag, bool on = true);
@@ -473,6 +475,9 @@ public:
bool isWorkspacePreset(const QString &workspace) const;
void setModeChangeState(bool value);
bool isModeChangeState() const;
signals:
void aboutToUnloadWorkspace(QString workspaceName);
void aboutToLoadWorkspace(QString workspaceName);

View File

@@ -68,6 +68,7 @@ namespace ADS
DockContainerWidget *m_dropContainer = nullptr;
bool m_hidden = false;
QPixmap m_contentPreviewPixmap;
bool m_canceled = false;
/**
* Private data constructor
@@ -86,6 +87,7 @@ namespace ADS
*/
void cancelDragging()
{
m_canceled = true;
emit q->draggingCanceled();
m_dockManager->containerOverlay()->hideOverlay();
m_dockManager->dockAreaOverlay()->hideOverlay();
@@ -149,6 +151,12 @@ namespace ADS
}
} else {
dockAreaOverlay->hideOverlay();
// If there is only one single visible dock area in a container, then
// it does not make sense to show a dock overlay because the dock area
// would be removed and inserted at the same position
if (visibleDockAreas <= 1)
containerOverlay->hide();
if (dockArea == m_contentSourceArea && InvalidDockWidgetArea == containerDropArea)
m_dropContainer = nullptr;
}
@@ -195,9 +203,9 @@ namespace ADS
&QApplication::applicationStateChanged,
this,
&FloatingDragPreview::onApplicationStateChanged);
// The focused object will receive key press events and therefore we install
// the event filter on it to receive escape key press for drag canceling
QApplication::focusObject()->installEventFilter(this);
// The only safe way to receive escape key presses is to install an event
// filter for the application object
QApplication::instance()->installEventFilter(this);
}
FloatingDragPreview::FloatingDragPreview(DockWidget *content)
@@ -329,7 +337,7 @@ namespace ADS
bool FloatingDragPreview::eventFilter(QObject *watched, QEvent *event)
{
if (event->type() == QEvent::KeyPress) {
if (!d->m_canceled && event->type() == QEvent::KeyPress) {
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
if (keyEvent->key() == Qt::Key_Escape) {
watched->removeEventFilter(this);

View File

@@ -166,7 +166,14 @@ QHash<int, QByteArray> WorkspaceModel::roleNames() const
{PresetWorkspaceRole, "presetWorkspace"},
{LastWorkspaceRole, "activeWorkspace"},
{ActiveWorkspaceRole, "lastWorkspace"}};
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
auto defaultRoles = QAbstractTableModel::roleNames();
defaultRoles.insert(extraRoles);
return defaultRoles;
#else
return QAbstractTableModel::roleNames().unite(extraRoles);
#endif
}
void WorkspaceModel::sort(int column, Qt::SortOrder order)

View File

@@ -337,6 +337,9 @@ bool BoostTestTreeItem::enabled() const
if (m_state & Disabled)
return false;
if (type() == Root)
return true;
const TestTreeItem *parent = parentItem();
if (parent && parent->type() == TestSuite) // take test suites into account
return static_cast<const BoostTestTreeItem *>(parent)->enabled();

View File

@@ -198,7 +198,7 @@ NewDialog::NewDialog(QWidget *parent) :
m_ui->templateCategoryView->setModel(m_filterProxyModel);
m_ui->templateCategoryView->setEditTriggers(QAbstractItemView::NoEditTriggers);
m_ui->templateCategoryView->setItemDelegate(new FancyTopLevelDelegate);
m_ui->templateCategoryView->setItemDelegate(new FancyTopLevelDelegate(this));
m_ui->templatesView->setModel(m_filterProxyModel);
m_ui->templatesView->setIconSize(QSize(ICON_SIZE, ICON_SIZE));

View File

@@ -857,7 +857,11 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
}
}
break;
case CE_ToolButtonLabel:
// Directly use QCommonStyle to circumvent funny painting in QMacStyle
// which ignores the palette and adds an alpha
QCommonStyle::drawControl(element, option, painter, widget);
break;
default:
QProxyStyle::drawControl(element, option, painter, widget);
break;

View File

@@ -341,19 +341,17 @@ void CompilerOptionsBuilder::addHeaderPathOptions()
void CompilerOptionsBuilder::addPrecompiledHeaderOptions(UsePrecompiledHeaders usePrecompiledHeaders)
{
for (const QString &pchFile : m_projectPart.precompiledHeaders) {
// Bail if build system precomiple header artifacts exists
// Bail if build system precompiled header artifacts exists.
// Clang cannot handle foreign PCH files.
if (QFile::exists(pchFile + ".gch") || QFile::exists(pchFile + ".pch")) {
if (QFile::exists(pchFile + ".gch") || QFile::exists(pchFile + ".pch"))
usePrecompiledHeaders = UsePrecompiledHeaders::No;
// In case of Clang compilers, remove the pch-inclusion arguments
remove({"-Xclang", "-include-pch", "-Xclang", pchFile + ".gch"});
remove({"-Xclang", "-include-pch", "-Xclang", pchFile + ".pch"});
}
if (usePrecompiledHeaders == UsePrecompiledHeaders::No) {
// CMake PCH will already have force included the header file in
// command line options, remove it if exists.
// In case of Clang compilers, also remove the pch-inclusion arguments.
remove({"-Xclang", "-include-pch", "-Xclang", pchFile + ".gch"});
remove({"-Xclang", "-include-pch", "-Xclang", pchFile + ".pch"});
remove({isClStyle() ? QLatin1String(includeFileOptionCl)
: QLatin1String(includeFileOptionGcc), pchFile});
} else if (QFile::exists(pchFile)) {

View File

@@ -238,8 +238,8 @@ void DisassemblerAgent::setLocation(const Location &loc)
// Refresh when not displaying a function and there is not sufficient
// context left past the address.
if (d->cache.at(index).first.endAddress - loc.address() < 24) {
index = -1;
d->cache.removeAt(index);
index = -1;
}
}
if (index != -1) {

View File

@@ -462,11 +462,10 @@ McuSupportOptions::McuSupportOptions(QObject *parent)
McuPackage* seggerJLinkPackage = createSeggerJLinkPackage();
QVector<McuPackage*> stmEvalPackages = {
armGccPackage, stm32CubeProgrammerPackage, qtForMCUsSdkPackage};
armGccPackage, stm32CubeProgrammerPackage};
QVector<McuPackage*> nxpEvalPackages = {
armGccPackage, seggerJLinkPackage, qtForMCUsSdkPackage};
QVector<McuPackage*> desktopPackages = {
qtForMCUsSdkPackage};
armGccPackage, seggerJLinkPackage};
QVector<McuPackage*> desktopPackages = {};
packages = {
armGccPackage, stm32CubeFwF7SdkPackage, stm32CubeProgrammerPackage, evkbImxrt1050SdkPackage,
seggerJLinkPackage, qtForMCUsSdkPackage};
@@ -564,13 +563,20 @@ static void setKitDevice(ProjectExplorer::Kit *k)
ProjectExplorer::DeviceTypeKitAspect::setDeviceTypeId(k, Constants::DEVICE_TYPE);
}
static void setKitEnvironment(ProjectExplorer::Kit *k, const McuTarget* mcuTarget)
static void setKitEnvironment(ProjectExplorer::Kit *k, const McuTarget* mcuTarget,
McuPackage *qtForMCUsSdkPackage)
{
using namespace ProjectExplorer;
Utils::EnvironmentItems changes;
QStringList pathAdditions;
for (auto package : mcuTarget->packages()) {
QVector<McuPackage *> packagesIncludingSdk;
packagesIncludingSdk.reserve(mcuTarget->packages().size() + 1);
packagesIncludingSdk.append(mcuTarget->packages());
packagesIncludingSdk.append(qtForMCUsSdkPackage);
for (auto package : packagesIncludingSdk) {
if (package->addToPath())
pathAdditions.append(QDir::toNativeSeparators(package->path()));
if (!package->environmentVariableName().isEmpty())
@@ -646,7 +652,7 @@ ProjectExplorer::Kit *McuSupportOptions::newKit(const McuTarget *mcuTarget)
setKitDebugger(k, mcuTarget->toolChainPackage());
setKitDevice(k);
}
setKitEnvironment(k, mcuTarget);
setKitEnvironment(k, mcuTarget, qtForMCUsSdkPackage);
setKitCMakeOptions(k, mcuTarget, qtForMCUsSdkPackage->path());
k->setup();

View File

@@ -48,11 +48,6 @@
namespace McuSupport {
namespace Internal {
static bool cMakeAvailable()
{
return !CMakeProjectManager::CMakeToolManager::cmakeTools().isEmpty();
}
class McuSupportOptionsWidget : public Core::IOptionsPageWidget
{
Q_DECLARE_TR_FUNCTIONS(McuSupport::Internal::McuSupportOptionsWidget)
@@ -74,48 +69,77 @@ private:
QMap <McuPackage*, QWidget*> m_packageWidgets;
QMap <McuTarget*, QWidget*> m_mcuTargetPacketWidgets;
QFormLayout *m_packagesLayout = nullptr;
Utils::InfoLabel *m_infoLabel = nullptr;
QComboBox *m_mcuTargetComboBox = nullptr;
QGroupBox *m_qtForMCUsSdkGroupBox = nullptr;
QGroupBox *m_packagesGroupBox = nullptr;
QGroupBox *m_mcuTargetsGroupBox = nullptr;
QComboBox *m_mcuTargetsComboBox = nullptr;
QGroupBox *m_kitCreationGroupBox = nullptr;
Utils::InfoLabel *m_kitCreationInfoLabel = nullptr;
Utils::InfoLabel *m_statusInfoLabel = nullptr;
};
McuSupportOptionsWidget::McuSupportOptionsWidget()
{
auto mainLayout = new QVBoxLayout(this);
auto mcuTargetChooserlayout = new QHBoxLayout;
auto mcuTargetChooserLabel = new QLabel(tr("Target:"));
mcuTargetChooserlayout->addWidget(mcuTargetChooserLabel);
m_mcuTargetComboBox = new QComboBox;
mcuTargetChooserLabel->setBuddy(m_mcuTargetComboBox);
mcuTargetChooserLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
m_mcuTargetComboBox->addItems(
Utils::transform<QStringList>(m_options.mcuTargets, [this](McuTarget *t){
return m_options.kitName(t);
}));
mcuTargetChooserlayout->addWidget(m_mcuTargetComboBox);
mainLayout->addLayout(mcuTargetChooserlayout);
{
m_statusInfoLabel = new Utils::InfoLabel;
m_statusInfoLabel->setElideMode(Qt::ElideNone);
m_statusInfoLabel->setOpenExternalLinks(false);
mainLayout->addWidget(m_statusInfoLabel);
connect(m_statusInfoLabel, &QLabel::linkActivated, this, []{
Core::ICore::showOptionsDialog(
CMakeProjectManager::Constants::CMAKE_SETTINGSPAGE_ID,
Core::ICore::mainWindow());
});
}
auto m_packagesGroupBox = new QGroupBox(tr("Packages"));
mainLayout->addWidget(m_packagesGroupBox);
m_packagesLayout = new QFormLayout;
m_packagesGroupBox->setLayout(m_packagesLayout);
{
m_qtForMCUsSdkGroupBox = new QGroupBox(m_options.qtForMCUsSdkPackage->label());
m_qtForMCUsSdkGroupBox->setFlat(true);
auto layout = new QVBoxLayout(m_qtForMCUsSdkGroupBox);
layout->addWidget(m_options.qtForMCUsSdkPackage->widget());
mainLayout->addWidget(m_qtForMCUsSdkGroupBox);
}
{
m_mcuTargetsGroupBox = new QGroupBox(tr("Targets supported by the %1")
.arg(m_qtForMCUsSdkGroupBox->title()));
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);
}
{
m_packagesGroupBox = new QGroupBox(tr("Requirements"));
m_packagesGroupBox->setFlat(true);
mainLayout->addWidget(m_packagesGroupBox);
m_packagesLayout = new QFormLayout;
m_packagesGroupBox->setLayout(m_packagesLayout);
}
{
m_kitCreationGroupBox = new QGroupBox(tr("Create a Kit"));
m_kitCreationGroupBox->setFlat(true);
mainLayout->addWidget(m_kitCreationGroupBox);
m_kitCreationInfoLabel = new Utils::InfoLabel;
m_kitCreationInfoLabel->setElideMode(Qt::ElideNone);
m_kitCreationInfoLabel->setWordWrap(true);
auto layout = new QVBoxLayout(m_kitCreationGroupBox);
layout->addWidget(m_kitCreationInfoLabel);
}
mainLayout->addStretch();
m_infoLabel = new Utils::InfoLabel;
m_infoLabel->setOpenExternalLinks(false);
m_infoLabel->setElideMode(Qt::ElideNone);
m_infoLabel->setWordWrap(true);
mainLayout->addWidget(m_infoLabel);
connect(&m_options, &McuSupportOptions::changed, this, &McuSupportOptionsWidget::updateStatus);
connect(m_mcuTargetComboBox, &QComboBox::currentTextChanged,
this, &McuSupportOptionsWidget::showMcuTargetPackages);
connect(m_infoLabel, &QLabel::linkActivated, this, []{
Core::ICore::showOptionsDialog(
CMakeProjectManager::Constants::CMAKE_SETTINGSPAGE_ID,
Core::ICore::mainWindow());
});
showMcuTargetPackages();
}
@@ -126,21 +150,41 @@ void McuSupportOptionsWidget::updateStatus()
if (!mcuTarget)
return;
m_infoLabel->setType(cMakeAvailable() && mcuTarget->isValid()
? Utils::InfoLabel::Ok : Utils::InfoLabel::NotOk);
const bool cMakeAvailable = !CMakeProjectManager::CMakeToolManager::cmakeTools().isEmpty();
QStringList errorStrings;
if (!mcuTarget->isValid())
errorStrings << "Provide the package paths in order to create a kit for your target.";
if (!cMakeAvailable())
errorStrings << "No CMake tool was detected. Add a CMake tool in the "
"<a href=\"cmake\">CMake options</a> and press Apply.";
// Page elements
{
m_qtForMCUsSdkGroupBox->setVisible(cMakeAvailable);
const bool ready = cMakeAvailable &&
m_options.qtForMCUsSdkPackage->status() == McuPackage::ValidPackage;
m_mcuTargetsGroupBox->setVisible(ready);
m_packagesGroupBox->setVisible(ready && !mcuTarget->packages().isEmpty());
m_kitCreationGroupBox->setVisible(ready);
}
m_infoLabel->setText(errorStrings.isEmpty()
? QString::fromLatin1("A kit <b>%1</b> for the selected target can be generated. "
"Press Apply to generate it.").arg(m_options.kitName(
mcuTarget))
: errorStrings.join("<br/>"));
// Kit creation status
{
const bool mcuTargetValid = mcuTarget->isValid();
m_kitCreationInfoLabel->setType(mcuTargetValid ? Utils::InfoLabel::Ok
: Utils::InfoLabel::NotOk);
m_kitCreationInfoLabel->setText(
mcuTargetValid ? QString::fromLatin1(
"A kit <b>%1</b> for the selected target can be "
"generated. Press Apply to generate it.")
.arg(m_options.kitName(mcuTarget))
: "Provide the package paths in order to create a kit "
"for your target.");
}
// Status label in the bottom
{
m_statusInfoLabel->setVisible(!cMakeAvailable);
if (m_statusInfoLabel->isVisible()) {
m_statusInfoLabel->setType(Utils::InfoLabel::NotOk);
m_statusInfoLabel->setText("No CMake tool was detected. Add a CMake tool in the "
"<a href=\"cmake\">CMake options</a> and press Apply.");
}
}
}
void McuSupportOptionsWidget::showMcuTargetPackages()
@@ -168,7 +212,7 @@ void McuSupportOptionsWidget::showMcuTargetPackages()
McuTarget *McuSupportOptionsWidget::currentMcuTarget() const
{
const int mcuTargetIndex = m_mcuTargetComboBox->currentIndex();
const int mcuTargetIndex = m_mcuTargetsComboBox->currentIndex();
return m_options.mcuTargets.isEmpty() ? nullptr : m_options.mcuTargets.at(mcuTargetIndex);
}
@@ -185,7 +229,7 @@ void McuSupportOptionsWidget::apply()
QTC_ASSERT(m_options.qtForMCUsSdkPackage, return);
if (!isVisible() || !cMakeAvailable())
if (!isVisible())
return;
const McuTarget *mcuTarget = currentMcuTarget();

View File

@@ -49,6 +49,7 @@ static char KEY_SELECTED_PROJECT[] = "SelectedProject";
static char KEY_SELECTED_NODE[] = "SelectedFolderNode";
static char KEY_IS_SUBPROJECT[] = "IsSubproject";
static char KEY_VERSIONCONTROL[] = "VersionControl";
static char KEY_QT_KEYWORDS_ENABLED[] = "QtKeywordsEnabled";
namespace ProjectExplorer {
@@ -105,6 +106,7 @@ void JsonSummaryPage::initializePage()
m_wizard->setValue(QLatin1String(KEY_SELECTED_NODE), QVariant());
m_wizard->setValue(QLatin1String(KEY_IS_SUBPROJECT), false);
m_wizard->setValue(QLatin1String(KEY_VERSIONCONTROL), QString());
m_wizard->setValue(QLatin1String(KEY_QT_KEYWORDS_ENABLED), false);
connect(m_wizard, &JsonWizard::filesReady, this, &JsonSummaryPage::triggerCommit);
connect(m_wizard, &JsonWizard::filesReady, this, &JsonSummaryPage::addToProject);
@@ -270,7 +272,7 @@ void JsonSummaryPage::updateProjectData(FolderNode *node)
projectNode = projectNode->parentProjectNode();
}
}
m_wizard->setValue("QtKeywordsEnabled", qtKeyWordsEnabled);
m_wizard->setValue(QLatin1String(KEY_QT_KEYWORDS_ENABLED), qtKeyWordsEnabled);
updateFileList();
}

View File

@@ -886,7 +886,9 @@ static RawProjectParts generateProjectParts(
rpp.setFlagsForC({cToolChain.get(), cFlags});
rpp.setFlagsForCxx({cxxToolChain.get(), cxxFlags});
rpp.setMacros(transform<QVector>(arrayToStringList(props.value("cpp.defines")),
const QStringList defines = arrayToStringList(props.value("cpp.defines"))
+ arrayToStringList(props.value("cpp.platformDefines"));
rpp.setMacros(transform<QVector>(defines,
[](const QString &s) { return Macro::fromKeyValue(s); }));
ProjectExplorer::HeaderPaths grpHeaderPaths;

View File

@@ -392,6 +392,7 @@ void QbsSession::insertRequestedModuleProperties(QJsonObject &request)
"cpp.minimumDarwinVersionCompilerFlag",
"cpp.platformCommonCompilerFlags",
"cpp.platformDriverFlags",
"cpp.platformDefines",
"cpp.positionIndependentCode",
"cpp.systemFrameworkPaths",
"cpp.systemIncludePaths",

View File

@@ -85,7 +85,7 @@ ConnectionViewWidget::ConnectionViewWidget(QWidget *parent) :
ui->setupUi(this);
QStyle *style = QStyleFactory::create("fusion");
setStyle(style);
ui->stackedWidget->setStyle(style);
//ui->tabWidget->tabBar()->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
@@ -96,6 +96,11 @@ ConnectionViewWidget::ConnectionViewWidget(QWidget *parent) :
ui->tabBar->addTab(tr("Bindings", "Title of connection view"));
ui->tabBar->addTab(tr("Properties", "Title of dynamic properties view"));
const QList<QToolButton*> buttons = createToolBarWidgets();
for (auto toolButton : buttons)
ui->toolBar->addWidget(toolButton);
auto settings = QmlDesignerPlugin::instance()->settings();
if (!settings.value(DesignerSettingsKey::STANDALONE_MODE).toBool())

View File

@@ -29,6 +29,9 @@
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QTabBar" name="tabBar" native="true"/>
</item>
<item row="1" column="0">
<widget class="QWidget" name="widgetSpacer" native="true">
<property name="sizePolicy">
@@ -51,10 +54,7 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QTabBar" name="tabBar" native="true"/>
</item>
<item row="2" column="0">
<item row="3" column="0">
<widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex">
<number>3</number>
@@ -255,10 +255,14 @@
</widget>
</widget>
</item>
<item row="2" column="0">
<widget class="QToolBar" name="toolBar" native="true"/>
</item>
</layout>
<zorder>stackedWidget</zorder>
<zorder>tabBar</zorder>
<zorder>widgetSpacer</zorder>
<zorder>toolBar</zorder>
</widget>
<customwidgets>
<customwidget>

View File

@@ -72,57 +72,9 @@ namespace QmlDesigner {
NavigatorView::NavigatorView(QObject* parent) :
AbstractView(parent),
m_blockSelectionChangedSignal(false),
m_widget(new NavigatorWidget(this)),
m_treeModel(new NavigatorTreeModel(this))
m_blockSelectionChangedSignal(false)
{
#ifndef QMLDESIGNER_TEST
auto navigatorContext = new Internal::NavigatorContext(m_widget.data());
Core::ICore::addContextObject(navigatorContext);
#endif
m_treeModel->setView(this);
m_widget->setTreeModel(m_treeModel.data());
m_currentModelInterface = m_treeModel;
connect(treeWidget()->selectionModel(), &QItemSelectionModel::selectionChanged, this, &NavigatorView::changeSelection);
connect(m_widget.data(), &NavigatorWidget::leftButtonClicked, this, &NavigatorView::leftButtonClicked);
connect(m_widget.data(), &NavigatorWidget::rightButtonClicked, this, &NavigatorView::rightButtonClicked);
connect(m_widget.data(), &NavigatorWidget::downButtonClicked, this, &NavigatorView::downButtonClicked);
connect(m_widget.data(), &NavigatorWidget::upButtonClicked, this, &NavigatorView::upButtonClicked);
connect(m_widget.data(), &NavigatorWidget::filterToggled, this, &NavigatorView::filterToggled);
#ifndef QMLDESIGNER_TEST
auto idDelegate = new NameItemDelegate(this);
IconCheckboxItemDelegate *showDelegate =
new IconCheckboxItemDelegate(this,
Utils::Icons::EYE_OPEN_TOOLBAR.icon(),
Utils::Icons::EYE_CLOSED_TOOLBAR.icon());
IconCheckboxItemDelegate *exportDelegate =
new IconCheckboxItemDelegate(this,
Icons::EXPORT_CHECKED.icon(),
Icons::EXPORT_UNCHECKED.icon());
#ifdef _LOCK_ITEMS_
IconCheckboxItemDelegate *lockDelegate =
new IconCheckboxItemDelegate(this,
Utils::Icons::LOCKED_TOOLBAR.icon(),
Utils::Icons::UNLOCKED_TOOLBAR.icon());
#endif
treeWidget()->setItemDelegateForColumn(0, idDelegate);
#ifdef _LOCK_ITEMS_
treeWidget()->setItemDelegateForColumn(1,lockDelegate);
treeWidget()->setItemDelegateForColumn(2,showDelegate);
#else
treeWidget()->setItemDelegateForColumn(1, exportDelegate);
treeWidget()->setItemDelegateForColumn(2, showDelegate);
#endif
#endif //QMLDESIGNER_TEST
}
NavigatorView::~NavigatorView()
@@ -138,6 +90,9 @@ bool NavigatorView::hasWidget() const
WidgetInfo NavigatorView::widgetInfo()
{
if (!m_widget)
setupWidget();
return createWidgetInfo(m_widget.data(),
new WidgetInfo::ToolBarWidgetDefaultFactory<NavigatorWidget>(m_widget.data()),
QStringLiteral("Navigator"),
@@ -519,4 +474,58 @@ void NavigatorView::reparentAndCatch(NodeAbstractProperty property, const ModelN
}
}
void NavigatorView::setupWidget()
{
m_widget = new NavigatorWidget(this);
m_treeModel = new NavigatorTreeModel(this);
#ifndef QMLDESIGNER_TEST
auto navigatorContext = new Internal::NavigatorContext(m_widget.data());
Core::ICore::addContextObject(navigatorContext);
#endif
m_treeModel->setView(this);
m_widget->setTreeModel(m_treeModel.data());
m_currentModelInterface = m_treeModel;
connect(treeWidget()->selectionModel(), &QItemSelectionModel::selectionChanged, this, &NavigatorView::changeSelection);
connect(m_widget.data(), &NavigatorWidget::leftButtonClicked, this, &NavigatorView::leftButtonClicked);
connect(m_widget.data(), &NavigatorWidget::rightButtonClicked, this, &NavigatorView::rightButtonClicked);
connect(m_widget.data(), &NavigatorWidget::downButtonClicked, this, &NavigatorView::downButtonClicked);
connect(m_widget.data(), &NavigatorWidget::upButtonClicked, this, &NavigatorView::upButtonClicked);
connect(m_widget.data(), &NavigatorWidget::filterToggled, this, &NavigatorView::filterToggled);
#ifndef QMLDESIGNER_TEST
auto idDelegate = new NameItemDelegate(this);
IconCheckboxItemDelegate *showDelegate =
new IconCheckboxItemDelegate(this,
Utils::Icons::EYE_OPEN_TOOLBAR.icon(),
Utils::Icons::EYE_CLOSED_TOOLBAR.icon());
IconCheckboxItemDelegate *exportDelegate =
new IconCheckboxItemDelegate(this,
Icons::EXPORT_CHECKED.icon(),
Icons::EXPORT_UNCHECKED.icon());
#ifdef _LOCK_ITEMS_
IconCheckboxItemDelegate *lockDelegate =
new IconCheckboxItemDelegate(this,
Utils::Icons::LOCKED_TOOLBAR.icon(),
Utils::Icons::UNLOCKED_TOOLBAR.icon());
#endif
treeWidget()->setItemDelegateForColumn(0, idDelegate);
#ifdef _LOCK_ITEMS_
treeWidget()->setItemDelegateForColumn(1,lockDelegate);
treeWidget()->setItemDelegateForColumn(2,showDelegate);
#else
treeWidget()->setItemDelegateForColumn(1, exportDelegate);
treeWidget()->setItemDelegateForColumn(2, showDelegate);
#endif
#endif //QMLDESIGNER_TEST
}
} // namespace QmlDesigner

View File

@@ -110,6 +110,7 @@ protected: //functions
bool blockSelectionChangedSignal(bool block);
void expandRecursively(const QModelIndex &index);
void reparentAndCatch(NodeAbstractProperty property, const ModelNode &modelNode);
void setupWidget();
private:
bool m_blockSelectionChangedSignal;

View File

@@ -61,6 +61,11 @@ NavigatorWidget::NavigatorWidget(NavigatorView *view)
layout->setSpacing(0);
layout->setContentsMargins(0, 0, 0, 0);
QWidget *toolBar = createToolBar();
toolBar->setParent(this);
layout->addWidget(toolBar);
layout->addWidget(m_treeView);
setLayout(layout);
@@ -124,8 +129,10 @@ QList<QToolButton *> NavigatorWidget::createToolBarWidgets()
auto filterMenu = new QMenu(filter);
auto objectAction = new QAction(tr("Show only visible items."), nullptr);
objectAction->setCheckable(true);
objectAction->setChecked(
DesignerSettings::getValue(DesignerSettingsKey::NAVIGATOR_SHOW_ONLY_VISIBLE_ITEMS).toBool());
bool filterFlag = DesignerSettings::getValue(DesignerSettingsKey::NAVIGATOR_SHOW_ONLY_VISIBLE_ITEMS).toBool();
objectAction->setChecked(filterFlag);
connect(objectAction, &QAction::toggled, this, &NavigatorWidget::filterToggled);
filterMenu->addAction(objectAction);
filter->setMenu(filterMenu);
@@ -134,6 +141,17 @@ QList<QToolButton *> NavigatorWidget::createToolBarWidgets()
return buttons;
}
QToolBar *NavigatorWidget::createToolBar()
{
const QList<QToolButton*> buttons = createToolBarWidgets();
auto toolBar = new QToolBar();
for (auto toolButton : buttons)
toolBar->addWidget(toolButton);
return toolBar;
}
void NavigatorWidget::contextHelp(const Core::IContext::HelpCallback &callback) const
{
if (navigatorView())

View File

@@ -32,6 +32,7 @@
#include "navigatortreeview.h"
QT_FORWARD_DECLARE_CLASS(QToolBar)
QT_FORWARD_DECLARE_CLASS(QToolButton)
QT_FORWARD_DECLARE_CLASS(QAbstractItemModel)
@@ -48,6 +49,7 @@ public:
void setTreeModel(QAbstractItemModel *model);
QTreeView *treeView() const;
QList<QToolButton *> createToolBarWidgets();
QToolBar *createToolBar();
void contextHelp(const Core::IContext::HelpCallback &callback) const;
void disableNavigator();

View File

@@ -130,6 +130,17 @@ QVariant StatesEditorModel::data(const QModelIndex &index, int role) const
return QString();
}
case IsDefault: {
QmlModelState modelState(stateNode);
if (modelState.isValid())
return modelState.isDefault();
return false;
}
case ModelHasDefaultState: {
return hasDefaultState();
}
}
return QVariant();
@@ -142,7 +153,9 @@ QHash<int, QByteArray> StatesEditorModel::roleNames() const
{StateImageSourceRole, "stateImageSource"},
{InternalNodeId, "internalNodeId"},
{HasWhenCondition, "hasWhenCondition"},
{WhenConditionString, "whenConditionString"}
{WhenConditionString, "whenConditionString"},
{IsDefault, "isDefault"},
{ModelHasDefaultState, "modelHasDefaultState"}
};
return roleNames;
}
@@ -221,4 +234,19 @@ QVariant StatesEditorModel::stateModelNode()
return QVariant::fromValue(m_statesEditorView->currentStateNode());
}
void StatesEditorModel::setStateAsDefault(int internalNodeId)
{
m_statesEditorView->setStateAsDefault(internalNodeId);
}
void StatesEditorModel::resetDefaultState()
{
m_statesEditorView->resetDefaultState();
}
bool StatesEditorModel::hasDefaultState() const
{
return m_statesEditorView->hasDefaultState();
}
} // namespace QmlDesigner

View File

@@ -42,7 +42,9 @@ class StatesEditorModel : public QAbstractListModel
StateImageSourceRole = Qt::UserRole,
InternalNodeId,
HasWhenCondition,
WhenConditionString
WhenConditionString,
IsDefault,
ModelHasDefaultState
};
public:
@@ -62,6 +64,9 @@ public:
Q_INVOKABLE void resetWhenCondition(int internalNodeId);
Q_INVOKABLE QStringList autoComplete(const QString &text, int pos, bool explicitComplete);
Q_INVOKABLE QVariant stateModelNode();
Q_INVOKABLE void setStateAsDefault(int internalNodeId);
Q_INVOKABLE void resetDefaultState();
Q_INVOKABLE bool hasDefaultState() const;
void reset();

View File

@@ -304,6 +304,50 @@ void StatesEditorView::resetWhenCondition(int internalNodeId)
m_block = false;
}
void StatesEditorView::setStateAsDefault(int internalNodeId)
{
if (m_block)
return;
m_block = true;
if (hasModelNodeForInternalId(internalNodeId)) {
QmlModelState state(modelNodeForInternalId(internalNodeId));
try {
if (state.isValid())
state.setAsDefault();
} catch (const RewritingException &e) {
e.showException();
}
}
m_block = false;
}
void StatesEditorView::resetDefaultState()
{
if (m_block)
return;
m_block = true;
try {
if (rootModelNode().hasProperty("state"))
rootModelNode().removeProperty("state");
} catch (const RewritingException &e) {
e.showException();
}
m_block = false;
}
bool StatesEditorView::hasDefaultState() const
{
return rootModelNode().hasProperty("state");
}
void StatesEditorView::modelAttached(Model *model)
{
if (model == AbstractView::model())

View File

@@ -44,6 +44,9 @@ public:
void renameState(int internalNodeId,const QString &newName);
void setWhenCondition(int internalNodeId, const QString &condition);
void resetWhenCondition(int internalNodeId);
void setStateAsDefault(int internalNodeId);
void resetDefaultState();
bool hasDefaultState() const;
bool validStateName(const QString &name) const;
QString currentStateName() const;
void setCurrentState(const QmlModelState &state);

View File

@@ -103,10 +103,10 @@ QAction *createAction(const Core::Id &id,
TimelineToolBar::TimelineToolBar(QWidget *parent)
: QToolBar(parent)
, m_grp()
, m_dialog(Core::ICore::dialogParent())
, m_dialog(new AnimationCurveDialog(Core::ICore::dialogParent()))
, m_curveModel(new AnimationCurveEditorModel(0., 500.))
{
m_dialog.setModel(m_curveModel);
m_dialog->setModel(m_curveModel);
connect(m_curveModel,
&AnimationCurveEditorModel::currentFrameChanged,
this,
@@ -248,9 +248,9 @@ void TimelineToolBar::openAnimationCurveEditor()
timeline = tlv->timelineForState(tlv->currentState());
}
m_dialog.refresh();
m_dialog->refresh();
m_curveModel->setTimeline(timeline);
m_dialog.show();
m_dialog->show();
}
void TimelineToolBar::updateCurve(DesignTools::PropertyTreeItem *item)

View File

@@ -105,7 +105,7 @@ private:
QList<QObject *> m_grp;
AnimationCurveDialog m_dialog;
AnimationCurveDialog *m_dialog = nullptr;
AnimationCurveEditorModel *m_curveModel = nullptr;

View File

@@ -69,6 +69,9 @@ public:
static ModelNode createQmlState(AbstractView *view, const PropertyListType &propertyList);
void setAsDefault();
bool isDefault() const;
protected:
void addChangeSetIfNotExists(const ModelNode &node);
static QmlModelState createBaseState(const AbstractView *view);

View File

@@ -289,6 +289,24 @@ ModelNode QmlModelState::createQmlState(AbstractView *view, const PropertyListTy
return view->createModelNode("QtQuick.State", 1, 0, propertyList);
}
void QmlModelState::setAsDefault()
{
if ((!isBaseState()) && (modelNode().isValid())) {
view()->rootModelNode().variantProperty("state").setValue(name());
}
}
bool QmlModelState::isDefault() const
{
if ((!isBaseState()) && (modelNode().isValid())) {
if (view()->rootModelNode().hasProperty("state")) {
return (view()->rootModelNode().variantProperty("state").value() == name());
}
}
return false;
}
QmlModelState QmlModelState::createBaseState(const AbstractView *view)
{
QmlModelState qmlModelState(view->rootModelNode());

View File

@@ -42,6 +42,7 @@
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actionmanager_p.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/modemanager.h>
#include <qmldesigner/qmldesignerconstants.h>
#include <coreplugin/outputpane.h>
@@ -242,18 +243,25 @@ void DesignModeWidget::setup()
m_dockManager->setStyleSheet(Theme::replaceCssColors(sheet));
// Setup Actions and Menus
Core::ActionContainer *mwindow = Core::ActionManager::actionContainer(Core::Constants::M_WINDOW);
Core::ActionContainer *mview = Core::ActionManager::actionContainer(Core::Constants::M_VIEW);
// Window > Views
Core::ActionContainer *mviews = Core::ActionManager::createMenu(Core::Constants::M_VIEW_VIEWS);
mviews->menu()->addSeparator();
// Window > Workspaces
Core::ActionContainer *mworkspaces = Core::ActionManager::createMenu(QmlDesigner::Constants::M_WINDOW_WORKSPACES);
mwindow->addMenu(mworkspaces, Core::Constants::G_VIEW_VIEWS);
mview->addMenu(mworkspaces, Core::Constants::G_VIEW_VIEWS);
mworkspaces->menu()->setTitle(tr("&Workspaces"));
mworkspaces->setOnAllDisabledBehavior(Core::ActionContainer::Show); // TODO what does it exactly do?!
// Connect opening of the 'window' menu with creation of the workspaces menu
connect(mwindow->menu(), &QMenu::aboutToShow, this, &DesignModeWidget::aboutToShowWorkspaces);
mworkspaces->setOnAllDisabledBehavior(Core::ActionContainer::Show);
// Connect opening of the 'workspaces' menu with creation of the workspaces menu
connect(mworkspaces->menu(), &QMenu::aboutToShow, this, &DesignModeWidget::aboutToShowWorkspaces);
// Disable workspace menu when context is different to C_DESIGN_MODE
connect(Core::ICore::instance(), &Core::ICore::contextChanged,
this, [mworkspaces](const Core::Context &context){
if (context.contains(Core::Constants::C_DESIGN_MODE))
mworkspaces->menu()->setEnabled(true);
else
mworkspaces->menu()->setEnabled(false);
});
// Create a DockWidget for each QWidget and add them to the DockManager
const Core::Context designContext(Core::Constants::C_DESIGN_MODE);
@@ -374,6 +382,23 @@ void DesignModeWidget::setup()
setupNavigatorHistory(currentDesignDocument()->textEditor());
m_dockManager->initialize();
connect(Core::ModeManager::instance(), &Core::ModeManager::currentModeChanged,
this, [this](Core::Id mode, Core::Id oldMode) {
if (mode == Core::Constants::MODE_DESIGN) {
m_dockManager->reloadActiveWorkspace();
m_dockManager->setModeChangeState(false);
}
if (oldMode == Core::Constants::MODE_DESIGN
&& mode != Core::Constants::MODE_DESIGN) {
m_dockManager->save();
m_dockManager->setModeChangeState(true);
for (auto floatingWidget : m_dockManager->floatingWidgets())
floatingWidget->hide();
}
});
viewManager().enableWidgets();
readSettings();
show();

View File

@@ -30,24 +30,24 @@ locations. On Linux/macOS this is ~/Qt5.x.1 and on Windows this is C:\Qt\Qt5.x.1
use installations of the official opensource Qt packages. Just install the Qt version for the
respective toolchain with the components (if available):
- (Desktop) <toolchain> <bitness>, e.g. Desktop gcc 64-bit
- Qt Quick Controls
- Qt Quick Controls (if available)
- Qt Script
The exact versions and toolchains are:
Linux:
Qt 5.4.1 (gcc)
Qt 5.6.1-1 (gcc)
Qt 5.10.1 (gcc)
Qt 5.14.1 (gcc)
macOS:
Qt 5.6.1-1 (clang)
Qt 5.10.1 (clang)
Qt 5.14.1 (clang)
Windows:
Qt 5.4.1 (gcc)
Qt 5.6.1-1 (MSVC2013, 32 bit)
Qt 5.10.1 (MSVC2015, 32 bit)
Qt 5.14.1 (MSVC2017, 64 bit)
Fourth - you'll have to provide some additional repositories.
These additional repositories are located inside ~/squish-data or C:\Users\<user>\squish-data (depending on the OS you're on).

View File

@@ -49,7 +49,7 @@
<value type="QString" key="PE.Profile.Icon">:///DESKTOP///</value>
<value type="QString" key="PE.Profile.Id">{fc5f34fd-e703-4f4c-85ce-ea5bf5869e6a}</value>
<valuelist type="QVariantList" key="PE.Profile.MutableInfo"/>
<value type="QString" key="PE.Profile.Name">Desktop 5.6.1 default</value>
<value type="QString" key="PE.Profile.Name">Desktop 5.14.1 default</value>
<value type="bool" key="PE.Profile.SDK">false</value>
<valuelist type="QVariantList" key="PE.Profile.StickyInfo"/>
</valuemap>

View File

@@ -17,7 +17,7 @@
<valuemap type="QVariantMap">
<value type="int" key="Id">9</value>
<value type="QString" key="Name">Qt %{Qt:Version} (SQUISH_DEFAULT_COMPILER)</value>
<value type="QString" key="QMakePath">~/Qt5.6.1/5.6/SQUISH_DEFAULT_COMPILER/bin/qmake</value>
<value type="QString" key="QMakePath">~/Qt5.14.1/5.14.1/SQUISH_DEFAULT_COMPILER/bin/qmake</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Desktop</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>

View File

@@ -91,7 +91,7 @@
<value type="QString" key="PE.Profile.Icon">:///DESKTOP///</value>
<value type="QString" key="PE.Profile.Id">{542217c7-ce0f-48f7-843b-d4fad339688d}</value>
<valuelist type="QVariantList" key="PE.Profile.MutableInfo"/>
<value type="QString" key="PE.Profile.Name">Desktop 5.6.1 default</value>
<value type="QString" key="PE.Profile.Name">Desktop 5.14.1 default</value>
<value type="bool" key="PE.Profile.SDK">false</value>
<valuelist type="QVariantList" key="PE.Profile.StickyInfo"/>
</valuemap>

View File

@@ -27,7 +27,7 @@
<valuemap type="QVariantMap">
<value type="int" key="Id">15</value>
<value type="QString" key="Name">Qt %{Qt:Version} (SQUISH_DEFAULT_COMPILER)</value>
<value type="QString" key="QMakePath">~/Qt5.6.1/5.6/SQUISH_DEFAULT_COMPILER/bin/qmake</value>
<value type="QString" key="QMakePath">~/Qt5.14.1/5.14.1/SQUISH_DEFAULT_COMPILER/bin/qmake</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Desktop</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>

View File

@@ -72,8 +72,8 @@
<value type="QString" key="PE.Profile.SysRoot"></value>
<value type="QString" key="PE.Profile.ToolChain">{7ca0887f-a9a5-4251-aba6-560a15595d20}</value>
<valuemap type="QVariantMap" key="PE.Profile.ToolChains">
<value type="QByteArray" key="C">{d35e7a1a-5ab8-4fd6-8a2c-634846c669bb}</value>
<value type="QString" key="Cxx">{7ca0887f-a9a5-4251-aba6-560a15595d20}</value>
<value type="QByteArray" key="C">{ce3a8004-e9ae-46f2-b62d-d7daf69435ca}</value>
<value type="QByteArray" key="Cxx">{3df7c776-a480-4a04-9099-6c75adac2dca}</value>
</valuemap>
<value type="QString" key="QtPM4.mkSpecInformation"></value>
<value type="int" key="QtSupport.QtInformation">24</value>
@@ -81,7 +81,7 @@
<value type="QString" key="PE.Profile.Icon">:///DESKTOP///</value>
<value type="QString" key="PE.Profile.Id">{f9c7858c-d167-4b78-847a-91943bd0af07}</value>
<valuelist type="QVariantList" key="PE.Profile.MutableInfo"/>
<value type="QString" key="PE.Profile.Name">Desktop 5.6.1 default</value>
<value type="QString" key="PE.Profile.Name">Desktop 5.14.1 default</value>
<value type="bool" key="PE.Profile.SDK">false</value>
<valuelist type="QVariantList" key="PE.Profile.StickyInfo"/>
</valuemap>

View File

@@ -26,8 +26,8 @@
<variable>QtVersion.2</variable>
<valuemap type="QVariantMap">
<value type="int" key="Id">24</value>
<value type="QString" key="Name">Qt %{Qt:Version} (msvc2013)</value>
<value type="QString" key="QMakePath">C:/Qt/Qt5.6.1/5.6/msvc2013/bin/qmake.exe</value>
<value type="QString" key="Name">Qt %{Qt:Version} (msvc2017_64)</value>
<value type="QString" key="QMakePath">C:/Qt/Qt5.14.1/5.14.1/msvc2017_64/bin/qmake.exe</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Desktop</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>

View File

@@ -49,18 +49,31 @@
<data>
<variable>ToolChain.3</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.MsvcToolChain.SupportedAbi">x86-windows-msvc2015-pe-32bit</value>
<value type="QString" key="ProjectExplorer.MsvcToolChain.VarsBat">C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat</value>
<value type="QString" key="ProjectExplorer.MsvcToolChain.VarsBatArg">x86</value>
<value type="bool" key="ProjectExplorer.ToolChain.Autodetect">true</value>
<value type="QString" key="ProjectExplorer.ToolChain.DisplayName">Microsoft Visual C++ Compiler 14.0 (x86)</value>
<value type="QString" key="ProjectExplorer.ToolChain.Id">ProjectExplorer.ToolChain.Msvc:{c96cfaf3-fb8a-472b-b3c7-e94e8c490f17}</value>
<value type="QString" key="ProjectExplorer.MsvcToolChain.SupportedAbi">x86-windows-msvc2017-pe-64bit</value>
<value type="QString" key="ProjectExplorer.MsvcToolChain.VarsBat">C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsall.bat</value>
<value type="QString" key="ProjectExplorer.MsvcToolChain.VarsBatArg">amd64</value>
<value type="bool" key="ProjectExplorer.ToolChain.Autodetect">false</value>
<value type="QString" key="ProjectExplorer.ToolChain.DisplayName">MSVC2017 (amd64)</value>
<value type="QString" key="ProjectExplorer.ToolChain.Id">ProjectExplorer.ToolChain.Msvc:{ce3a8004-e9ae-46f2-b62d-d7daf69435ca}</value>
<value type="int" key="ProjectExplorer.ToolChain.Language">1</value>
<value type="QString" key="ProjectExplorer.ToolChain.LanguageV2">C</value>
</valuemap>
</data>
<data>
<variable>ToolChain.4</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.MsvcToolChain.SupportedAbi">x86-windows-msvc2015-pe-32bit</value>
<value type="QString" key="ProjectExplorer.MsvcToolChain.VarsBat">C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat</value>
<value type="QString" key="ProjectExplorer.MsvcToolChain.VarsBatArg">x86</value>
<value type="bool" key="ProjectExplorer.ToolChain.Autodetect">true</value>
<value type="QString" key="ProjectExplorer.ToolChain.DisplayName">Microsoft Visual C++ Compiler 14.0 (x86)</value>
<value type="QString" key="ProjectExplorer.ToolChain.Id">ProjectExplorer.ToolChain.Msvc:{c96cfaf3-fb8a-472b-b3c7-e94e8c490f17}</value>
<value type="int" key="ProjectExplorer.ToolChain.Language">1</value>
<value type="QString" key="ProjectExplorer.ToolChain.LanguageV2">C</value>
</valuemap>
</data>
<data>
<variable>ToolChain.5</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.MsvcToolChain.SupportedAbi">x86-windows-msvc2015-pe-32bit</value>
<value type="QString" key="ProjectExplorer.MsvcToolChain.VarsBat">C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat</value>
@@ -73,7 +86,7 @@
</valuemap>
</data>
<data>
<variable>ToolChain.5</variable>
<variable>ToolChain.6</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.MsvcToolChain.SupportedAbi">x86-windows-msvc2013-pe-32bit</value>
<value type="QString" key="ProjectExplorer.MsvcToolChain.VarsBat">C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/vcvarsall.bat</value>
@@ -83,9 +96,22 @@
<value type="QString" key="ProjectExplorer.ToolChain.Id">ProjectExplorer.ToolChain.Msvc:{7ca0887f-a9a5-4251-aba6-560a15595d20}</value>
</valuemap>
</data>
<data>
<variable>ToolChain.7</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.MsvcToolChain.SupportedAbi">x86-windows-msvc2017-pe-64bit</value>
<value type="QString" key="ProjectExplorer.MsvcToolChain.VarsBat">C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsall.bat</value>
<value type="QString" key="ProjectExplorer.MsvcToolChain.VarsBatArg">amd64</value>
<value type="bool" key="ProjectExplorer.ToolChain.Autodetect">false</value>
<value type="QString" key="ProjectExplorer.ToolChain.DisplayName">MSVC2017 (amd64)</value>
<value type="QString" key="ProjectExplorer.ToolChain.Id">ProjectExplorer.ToolChain.Msvc:{3df7c776-a480-4a04-9099-6c75adac2dca}</value>
<value type="int" key="ProjectExplorer.ToolChain.Language">2</value>
<value type="QString" key="ProjectExplorer.ToolChain.LanguageV2">Cxx</value>
</valuemap>
</data>
<data>
<variable>ToolChain.Count</variable>
<value type="int">6</value>
<value type="int">8</value>
</data>
<data>
<variable>Version</variable>

View File

@@ -32,15 +32,15 @@ class Targets:
(DESKTOP_4_8_7_DEFAULT,
EMBEDDED_LINUX,
DESKTOP_5_4_1_GCC,
DESKTOP_5_6_1_DEFAULT,
DESKTOP_5_10_1_DEFAULT) = ALL_TARGETS
DESKTOP_5_10_1_DEFAULT,
DESKTOP_5_14_1_DEFAULT) = ALL_TARGETS
__TARGET_NAME_DICT__ = dict(zip(ALL_TARGETS,
["Desktop 4.8.7 default",
"Embedded Linux",
"Desktop 5.4.1 GCC",
"Desktop 5.6.1 default",
"Desktop 5.10.1 default"]))
"Desktop 5.10.1 default",
"Desktop 5.14.1 default"]))
@staticmethod
def availableTargetClasses():
@@ -71,7 +71,7 @@ class Targets:
@staticmethod
def getDefaultKit():
return Targets.DESKTOP_5_6_1_DEFAULT
return Targets.DESKTOP_5_14_1_DEFAULT
# this class holds some constants for easier usage inside the Projects view
class ProjectSettings:
@@ -106,7 +106,7 @@ class Qt5Path:
@staticmethod
def getPaths(pathSpec):
qt5targets = [Targets.DESKTOP_5_6_1_DEFAULT, Targets.DESKTOP_5_10_1_DEFAULT]
qt5targets = [Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT]
if platform.system() != 'Darwin':
qt5targets.append(Targets.DESKTOP_5_4_1_GCC)
if pathSpec == Qt5Path.DOCS:

View File

@@ -278,7 +278,7 @@ def createProject_Qt_Console(path, projectName, checks = True, buildSystem = Non
__verifyFileCreation__(path, expectedFiles)
def createNewQtQuickApplication(workingDir, projectName=None,
targets=Targets.desktopTargetClasses(), minimumQtVersion="5.6",
targets=Targets.desktopTargetClasses(), minimumQtVersion="5.10",
template="Qt Quick Application - Empty", fromWelcome=False,
buildSystem=None):
available = __createProjectOrFileSelectType__(" Application (Qt Quick)", template, fromWelcome)
@@ -298,7 +298,7 @@ def createNewQtQuickApplication(workingDir, projectName=None,
return checkedTargets, projectName
def createNewQtQuickUI(workingDir, qtVersion = "5.6"):
def createNewQtQuickUI(workingDir, qtVersion = "5.10"):
available = __createProjectOrFileSelectType__(" Other Project", 'Qt Quick UI Prototype')
if workingDir == None:
workingDir = tempDir()
@@ -316,7 +316,7 @@ def createNewQtQuickUI(workingDir, qtVersion = "5.6"):
return checkedTargets, projectName
def createNewQmlExtension(workingDir, targets=[Targets.DESKTOP_5_6_1_DEFAULT]):
def createNewQmlExtension(workingDir, targets=[Targets.DESKTOP_5_14_1_DEFAULT]):
available = __createProjectOrFileSelectType__(" Library", "Qt Quick 2 Extension Plugin")
if workingDir == None:
workingDir = tempDir()
@@ -505,10 +505,7 @@ def __getSupportedPlatforms__(text, templateName, getAsStrings=False):
else:
version = None
if templateName.startswith("Qt Quick Application - "):
if templateName == "Qt Quick Application - Empty":
result = set([Targets.DESKTOP_5_6_1_DEFAULT, Targets.DESKTOP_5_10_1_DEFAULT])
else:
result = set([Targets.DESKTOP_5_10_1_DEFAULT])
result = set([Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT])
elif 'Supported Platforms' in text:
supports = text[text.find('Supported Platforms'):].split(":")[1].strip().split(" ")
result = set()
@@ -517,7 +514,7 @@ def __getSupportedPlatforms__(text, templateName, getAsStrings=False):
result.add(Targets.DESKTOP_4_8_7_DEFAULT)
if platform.system() in ("Linux", "Darwin"):
result.add(Targets.EMBEDDED_LINUX)
result = result.union(set([Targets.DESKTOP_5_6_1_DEFAULT, Targets.DESKTOP_5_10_1_DEFAULT]))
result = result.union(set([Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT]))
if platform.system() != 'Darwin':
result.add(Targets.DESKTOP_5_4_1_GCC)
elif 'Platform independent' in text:

View File

@@ -86,7 +86,7 @@ def main():
checkSimpleCppLib("SampleApp1", False)
checkSimpleCppLib("SampleApp2", True)
pluginTargets = (Targets.DESKTOP_5_6_1_DEFAULT, Targets.DESKTOP_5_10_1_DEFAULT)
pluginTargets = (Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT)
projectName, className = createNewQtPlugin(tempDir(), "SampleApp3", "MyPlugin", pluginTargets)
virtualFunctionsAdded = False
for kit, config in iterateBuildConfigs("Debug"):

View File

@@ -28,7 +28,7 @@ source("../../shared/qtcreator.py")
# entry of test
def main():
# prepare example project
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT),
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT),
"quick", "animation")
proFile = "animation.pro"
if not neededFilePresent(os.path.join(sourceExample, proFile)):
@@ -42,6 +42,7 @@ def main():
# open example project, supports only Qt 5
targets = Targets.desktopTargetClasses()
targets.discard(Targets.DESKTOP_4_8_7_DEFAULT)
targets.discard(Targets.DESKTOP_5_4_1_GCC)
openQmakeProject(examplePath, targets)
# build and wait until finished - on all build configurations
availableConfigs = iterateBuildConfigs()

View File

@@ -29,7 +29,7 @@ source("../../shared/qtcreator.py")
# entry of test
def main():
# prepare example project
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT),
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT),
"quick", "animation")
proFile = "animation.pro"
if not neededFilePresent(os.path.join(sourceExample, proFile)):

View File

@@ -28,7 +28,7 @@ source("../../shared/qtcreator.py")
# entry of test
def main():
# prepare example project
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT),
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT),
"gui", "openglwindow")
proFile = "openglwindow.pro"

View File

@@ -28,7 +28,7 @@ source("../../shared/qtcreator.py")
# entry of test
def main():
# prepare example project
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT),
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT),
"gui", "openglwindow")
proFile = "openglwindow.pro"
if not neededFilePresent(os.path.join(sourceExample, proFile)):

View File

@@ -168,7 +168,7 @@ def main():
with TestSection(getCodeModelString(useClang)):
if not startCreatorVerifyingClang(useClang):
continue
openQmakeProject(examplePath, [Targets.DESKTOP_5_6_1_DEFAULT])
openQmakeProject(examplePath, [Targets.DESKTOP_5_14_1_DEFAULT])
checkCodeModelSettings(useClang)
if not openDocument("cplusplus-tools.Sources.main\\.cpp"):
earlyExit("Failed to open main.cpp.")

View File

@@ -67,7 +67,7 @@ def checkUsages(resultsView, expectedResults, directory):
def main():
# prepare example project
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT),
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT),
"quick", "animation")
proFile = "animation.pro"
if not neededFilePresent(os.path.join(sourceExample, proFile)):
@@ -80,7 +80,7 @@ def main():
if not startedWithoutPluginError():
return
# open example project
openQmakeProject(examplePath, [Targets.DESKTOP_5_6_1_DEFAULT])
openQmakeProject(examplePath, [Targets.DESKTOP_5_14_1_DEFAULT])
# open qml file
openDocument("animation.Resources.animation\\.qrc./animation.basics.color-animation\\.qml")
# get editor
@@ -94,10 +94,10 @@ def main():
type(editorArea, "<Left>")
invokeContextMenuItem(editorArea, "Find References to Symbol Under Cursor")
# check if usage was properly found
expectedResults = [ExpectedResult("color-animation.qml", 49, "Rectangle {"),
ExpectedResult("color-animation.qml", 109, "Rectangle {"),
ExpectedResult("property-animation.qml", 48, "Rectangle {"),
ExpectedResult("property-animation.qml", 57, "Rectangle {")]
expectedResults = [ExpectedResult("color-animation.qml", 59, "Rectangle {"),
ExpectedResult("color-animation.qml", 119, "Rectangle {"),
ExpectedResult("property-animation.qml", 58, "Rectangle {"),
ExpectedResult("property-animation.qml", 67, "Rectangle {")]
resultsView = waitForObject(":Qt Creator_Find::Internal::SearchResultTreeView")
test.verify(checkUsages(resultsView, expectedResults, templateDir),
"Verifying if usages were properly found using context menu.")
@@ -113,10 +113,10 @@ def main():
type(editorArea, "<Left>")
invokeMenuItem("Tools", "QML/JS", "Find References to Symbol Under Cursor")
# check if usage was properly found
expectedResults = [ExpectedResult("color-animation.qml", 50, "anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter }"),
ExpectedResult("color-animation.qml", 110, "anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom }"),
ExpectedResult("property-animation.qml", 49, "anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter }"),
ExpectedResult("property-animation.qml", 58, "anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom }")]
expectedResults = [ExpectedResult("color-animation.qml", 60, "anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter }"),
ExpectedResult("color-animation.qml", 120, "anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom }"),
ExpectedResult("property-animation.qml", 59, "anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter }"),
ExpectedResult("property-animation.qml", 68, "anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom }")]
resultsView = waitForObject(":Qt Creator_Find::Internal::SearchResultTreeView")
test.verify(checkUsages(resultsView, expectedResults, templateDir),
"Verifying if usages were properly found using main menu.")
@@ -132,7 +132,7 @@ def main():
type(editorArea, "<Left>")
type(editorArea, "<Ctrl+Shift+u>")
# check if usage was properly found
expectedResults = [ExpectedResult("color-animation.qml", 93, "SequentialAnimation on opacity {")]
expectedResults = [ExpectedResult("color-animation.qml", 103, "SequentialAnimation on opacity {")]
resultsView = waitForObject(":Qt Creator_Find::Internal::SearchResultTreeView")
test.verify(checkUsages(resultsView, expectedResults, templateDir),
"Verifying if usages were properly found using shortcut.")

View File

@@ -65,7 +65,7 @@ def checkTypeAndProperties(typePropertiesDetails):
def main():
# prepare example project
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT),
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT),
"quick", "animation")
if not neededFilePresent(sourceExample):
return

View File

@@ -114,6 +114,8 @@ def testLoggingFeatures():
clickButton(":*Qt Creator.Clear_QToolButton")
def main():
test.xfail("Skipping test. This will not work correctly with Qt <= 5.15 (QTBUG-82150).")
return
projName = "simpleQuickUI2.qmlproject"
projFolder = os.path.dirname(findFile("testdata", "simpleQuickUI2/%s" % projName))
if not neededFilePresent(os.path.join(projFolder, projName)):

View File

@@ -27,6 +27,8 @@ source("../../shared/qtcreator.py")
source("Tree.py")
def main():
test.xfail("Skipping test. This must be rewritten for current kits.")
return
if os.getenv("SYSTEST_OPENGL_MISSING") == "1":
test.xfail("This test needs OpenGL - skipping...")
return

View File

@@ -66,8 +66,7 @@ def performTest(workingDir, projectName, availableConfigs):
# because of differences between MSVC's and MinGW's Makefile (so clean before changing kit)
invokeMenuItem('Build', 'Clean Project "%s"' % projectName)
verifyBuildConfig(kit, config, True, True, True)
qtVersion = "5.6.1" if kit == Targets.DESKTOP_5_6_1_DEFAULT else "5.10.1"
test.log("Selected kit using Qt %s" % qtVersion)
test.log("Selected kit '%s'" % Targets.getStringForTarget(kit))
# explicitly build before start debugging for adding the executable as allowed program to WinFW
invokeMenuItem("Build", "Rebuild All Projects")
waitForCompile()
@@ -100,7 +99,7 @@ def performTest(workingDir, projectName, availableConfigs):
colMean, colMedian, colLongest, colShortest) = range(2, 11)
model = waitForObject(":Events.QmlProfilerEventsTable_QmlProfiler::"
"Internal::QmlProfilerStatisticsMainView").model()
compareEventsTab(model, "events_qt%s.tsv" % qtVersion)
compareEventsTab(model, "events_qt5.10.1.tsv")
test.compare(dumpItems(model, column=colPercent)[0], '100 %')
# cannot run following test on colShortest (unstable)
for i in [colMean, colMedian, colLongest]:

View File

@@ -1,9 +0,0 @@
"0" "1" "6" "11"
"<program>" "" "1" "Main program"
"main.qml:15" "Handling Signal" "2" "onTriggered: { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }"
"main.qml:15" "JavaScript" "2" "onTriggered"
"main.qml:4" "Creating" "2" "QtQuick.Window/Window"
"main.qml:1" "Compiling" "1" "main.qml"
"main.qml:10" "Creating" "2" "QtQuick/Timer"
"main.qml:14" "Binding" "3" "running: runCount < 2"
"main.qml:14" "JavaScript" "3" "expression for running"
1 0 1 6 11
2 <program> 1 Main program
3 main.qml:15 Handling Signal 2 onTriggered: { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }
4 main.qml:15 JavaScript 2 onTriggered
5 main.qml:4 Creating 2 QtQuick.Window/Window
6 main.qml:1 Compiling 1 main.qml
7 main.qml:10 Creating 2 QtQuick/Timer
8 main.qml:14 Binding 3 running: runCount < 2
9 main.qml:14 JavaScript 3 expression for running

View File

@@ -47,7 +47,8 @@ def main():
if not startCreatorVerifyingClang(useClang):
continue
createProject_Qt_Console(tempDir(), "SquishProject")
selectBuildConfig(Targets.DESKTOP_5_6_1_DEFAULT, "Debug") # do not use the default Qt4
# by default Qt4 is selected, use a Qt5 kit instead
selectBuildConfig(Targets.DESKTOP_5_10_1_DEFAULT, "Debug")
checkCodeModelSettings(useClang)
selectFromLocator("main.cpp")
cppwindow = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")

View File

@@ -28,7 +28,7 @@ source("../../shared/qtcreator.py")
focusDocumentPath = "keyinteraction.Resources.keyinteraction\.qrc./keyinteraction.focus.%s"
def main():
target = Targets.DESKTOP_5_6_1_DEFAULT
target = Targets.DESKTOP_5_14_1_DEFAULT
sourceExample = os.path.join(Qt5Path.examplesPath(target), "quick/keyinteraction")
proFile = "keyinteraction.pro"
if not neededFilePresent(os.path.join(sourceExample, proFile)):

View File

@@ -71,7 +71,7 @@ def main():
with TestSection("Testing project template %s -> %s" % (category, template)):
displayedPlatforms = __createProject__(category, template)
if template.startswith("Qt Quick Application - "):
qtVersionsForQuick = ["5.6", "5.10"] if template == "Qt Quick Application - Empty" else ["5.10"]
qtVersionsForQuick = ["5.10", "5.14"]
for counter, qtVersion in enumerate(qtVersionsForQuick):
def additionalFunc(displayedPlatforms, qtVersion):
requiredQtVersion = __createProjectHandleQtQuickSelection__(qtVersion)

View File

@@ -28,7 +28,7 @@ source("../../shared/qtcreator.py")
def main():
# prepare example project
projectName = "adding"
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT),
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT),
"qml", "referenceexamples", "adding")
proFile = projectName + ".pro"
if not neededFilePresent(os.path.join(sourceExample, proFile)):

View File

@@ -39,7 +39,7 @@ def main():
"Verifying window title contains created session name.")
checkWelcomePage(sessionName, True)
for project in projects:
openQmakeProject(project, [Targets.DESKTOP_5_6_1_DEFAULT])
openQmakeProject(project, [Targets.DESKTOP_5_14_1_DEFAULT])
waitForProjectParsing()
checkNavigator(52, "Verifying whether all projects have been opened.")
openDocument("animation.Resources.animation\\.qrc./animation.basics.animators\\.qml")
@@ -67,9 +67,9 @@ def main():
invokeMenuItem("File", "Exit")
def prepareTestExamples():
examples = [os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT),
examples = [os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT),
"quick", "animation", "animation.pro"),
os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT),
os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT),
"quick", "keyinteraction", "keyinteraction.pro")
]
projects = []

View File

@@ -30,7 +30,7 @@ outline = ":Qt Creator_QmlJSEditor::Internal::QmlJSOutlineTreeView"
treebase = "keyinteraction.Resources.keyinteraction\\.qrc./keyinteraction.focus."
def main():
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT),
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT),
"quick", "keyinteraction")
proFile = "keyinteraction.pro"
if not neededFilePresent(os.path.join(sourceExample, proFile)):
@@ -39,7 +39,7 @@ def main():
startQC()
if not startedWithoutPluginError():
return
openQmakeProject(os.path.join(templateDir, proFile), [Targets.DESKTOP_5_6_1_DEFAULT])
openQmakeProject(os.path.join(templateDir, proFile), [Targets.DESKTOP_5_14_1_DEFAULT])
qmlFiles = [treebase + "focus\\.qml", treebase + "Core.ListMenu\\.qml"]
checkOutlineFor(qmlFiles)
testModify()

View File

@@ -30,8 +30,8 @@ def main():
if not startedWithoutPluginError():
return
available = [("5.6", "Qt Quick Application - Empty", Targets.DESKTOP_5_6_1_DEFAULT),
("5.10", "Qt Quick Application - Swipe", Targets.DESKTOP_5_10_1_DEFAULT)]
available = [("5.10", "Qt Quick Application - Empty", Targets.DESKTOP_5_10_1_DEFAULT),
("5.14", "Qt Quick Application - Swipe", Targets.DESKTOP_5_14_1_DEFAULT)]
for qtVersion, appTemplate, targ in available:
# using a temporary directory won't mess up a potentially existing

View File

@@ -36,7 +36,7 @@ def main():
startQC()
if not startedWithoutPluginError():
return
available = ["5.6", "5.10"]
available = ["5.10", "5.14"]
for qtVersion in available:
# using a temporary directory won't mess up a potentially existing
@@ -45,9 +45,9 @@ def main():
checkedKitNames = Targets.getTargetsAsStrings(checkedKits)
test.verify(_exactlyOne_(map(lambda name: qtVersion in name, checkedKitNames)),
"The requested kit should have been checked")
if qtVersion == "5.10":
test.verify(not any(map(lambda name: "5.6" in name, checkedKitNames)),
"The 5.6 kit should not have been checked when 5.10 is required")
if qtVersion == "5.14":
test.verify(not any(map(lambda name: "5.10" in name, checkedKitNames)),
"The 5.10 kit should not have been checked when 5.14 is required")
clickButton(waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton"))
if not waitForProcessRunning():
test.fatal("Couldn't start application - leaving test")

View File

@@ -29,7 +29,7 @@ def main():
startQC()
if not startedWithoutPluginError():
return
for target in [Targets.DESKTOP_5_6_1_DEFAULT, Targets.DESKTOP_5_10_1_DEFAULT]:
for target in [Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT]:
# using a temporary directory won't mess up a potentially existing
createNewQmlExtension(tempDir(), [target])
# wait for parsing to complete