Merge remote-tracking branch 'origin/5.0'

Conflicts:
	src/plugins/coreplugin/locator/executefilter.cpp

Change-Id: Iff5b82a9e491b782e4720138904f389d318b005c
This commit is contained in:
Eike Ziller
2021-08-11 10:10:51 +02:00
104 changed files with 1405 additions and 552 deletions

View File

@@ -269,6 +269,7 @@ function(add_qtc_library name)
PREFIX ""
IMPORT_SUFFIX "${IDE_VERSION_MAJOR}${CMAKE_IMPORT_LIBRARY_SUFFIX}"
IMPORT_PREFIX ""
PDB_NAME "${name}${IDE_VERSION_MAJOR}${.pdb}"
)
endif()
@@ -525,6 +526,7 @@ function(add_qtc_plugin target_name)
PREFIX ""
IMPORT_SUFFIX "${IDE_VERSION_MAJOR}${CMAKE_IMPORT_LIBRARY_SUFFIX}"
IMPORT_PREFIX ""
PDB_NAME "${name}${IDE_VERSION_MAJOR}${.pdb}"
)
endif()
if (NOT _arg_SKIP_PCH)

10
dist/changes-5.0.0.md vendored
View File

@@ -35,9 +35,14 @@ Editing
(QTCREATORBUG-25715)
* Fixed code model for changed but not yet built `.ui` and `.scxml` files
(QTCREATORBUG-25937)
* Fixed lookup of toplevel virtual function declarations (QTCREATORBUG-25749)
* Fixed `switch` statement completion for templates (QTCREATORBUG-25998)
* Fixed `Escape String Literal as UTF-8` if literal contains numbers
(QTCREATORBUG-26003)
### QML
* Updated parser to Qt 6.2
* Fixed handling of multiline template strings (QTCREATORBUG-22766)
* Fixed handling of required and readonly properties (QTCREATORBUG-24144)
* Fixed reformatting of inline components (QTCREATORBUG-24144)
@@ -61,6 +66,7 @@ Projects
--------
* Added experimental support for building and running on Docker devices
* Added find support to `Issues` pane
* Added option `Show Source and Header Groups` to project tree
(QTCREATORBUG-25313)
* Fixed crash when closing project while changing current configuration
@@ -112,11 +118,13 @@ Analyzer
* Fixed URL for `clang-tidy` checks (QTCREATORBUG-25902)
* Fixed application of options to checks (QTCREATORBUG-25827)
* Fixed links to clazy documentation (QTCREATORBUG-25869)
FakeVim
-------
* Fixed backspace option
* Fixed updating visual marks when mark settings change
Platforms
---------
@@ -127,10 +135,12 @@ Platforms
### macOS
* Improved experience on ARM based macOS with Intel based Qt Creator build
* Fixed performance issue with registering file watches after loading projects
### Android
* Added detection of Android 12
* Fixed detection of `_prepare_apk_dir` target for CMake projects
(QTCREATORBUG-25216)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@@ -437,8 +437,9 @@
means that the overflow button in the system navigation bar will not be
enabled by default.
\li In the \uicontrol Application group, set the application's name.
You can also give an activity a name and select the activity to run.
\li In the \uicontrol {Application name} field, set the application's name.
\li In the \uicontrol {Activity name} field, set an activity name.
\li In the \uicontrol {Style extraction} field, set the method that Qt
uses to \l{Styling}{determine which UI style to use}.

View File

@@ -243,6 +243,14 @@
\li When searching, select \uicontrol {Silver Searcher} in the
\uicontrol {Search engine} field.
\li If Silver Searcher is not found, you might have installed it in a
location that is not found via the \c{PATH} environment variable.
Select \uicontrol Tools > \uicontrol Options > \uicontrol Environment >
\uicontrol System (or \uicontrol {\QC} > \uicontrol Preferences >
\uicontrol Environment > \uicontrol System on macOS), then select
\uicontrol Change in the \uicontrol Environment field and add an entry
\c{PATH=/path/to/bin:${PATH}}.
\endlist
\endif
*/

View File

@@ -390,6 +390,7 @@ def main():
'wayland-decoration-client',
'wayland-graphics-integration-client',
'wayland-shell-integration',
'tls'
]
if common.is_windows_platform():

View File

@@ -67,6 +67,17 @@ if [ -d "$assetimporterSrcDir" ]; then
fi
fi
# collect tls plugins to have ssl download feature available
tlsDestDir="$app_path/Contents/PlugIns/tls"
tlssrcDir="$plugin_src/tls"
if [ -d "$tlssrcDir" ]; then
if [ ! -d "$tlsDestDir" ]; then
echo "- Copying tls plugins to have ssl download feature available"
mkdir -p "$tlsDestDir"
find "$tlssrcDir" -iname "*.dylib" -maxdepth 1 -exec cp {} "$tlsDestDir"/ \;
fi
fi
# workaround for Qt 6.2:
# - QTBUG-94796 macdeployqt does not deploy /Contents/PlugIns/sqldrivers/libqsqlite.dylib anymore
sqldriversDestDir="$app_path/Contents/PlugIns/sqldrivers"

View File

@@ -1165,7 +1165,8 @@ class Dumper(DumperBase):
def appendSolibSearchPath(self, args):
new = list(map(self.hexdecode, args['path']))
old = [gdb.parameter('solib-search-path')]
gdb.execute('set solib-search-path %s' % args['separator'].join(old + new))
joined = os.pathsep.join([item for item in old + new if item != ''])
gdb.execute('set solib-search-path %s' % joined)
def watchPoint(self, args):
self.reportToken(args)

View File

@@ -105,8 +105,6 @@ Item {
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.visible = false;
editView.destroy();
}
@@ -157,14 +155,6 @@ Item {
updateActiveScene();
}
// Disables edit view update if scene doesn't match current activeScene.
// If it matches, updates are enabled.
function enableEditViewUpdate(scene)
{
if (editView)
_generalHelper.enableItemUpdate(editView, (scene && scene === activeScene));
}
function handleActiveSceneIdChange(newId)
{
if (sceneId !== newId) {

View File

@@ -328,7 +328,8 @@ void GeneralHelper::storeToolState(const QString &sceneId, const QString &tool,
handlePendingToolStateUpdate();
QVariant theState;
// Convert JS arrays to QVariantLists for easier handling down the line
if (state.canConvert(QMetaType::QVariantList))
// metaType().id() which only exist in Qt6 is the same as userType()
if (state.userType() != QMetaType::QString && state.canConvert(QMetaType::QVariantList))
theState = state.value<QVariantList>();
else
theState = state;

View File

@@ -727,7 +727,7 @@ static bool isTypeAvailable(const MockupTypeContainer &mockupType, QQmlEngine *e
void NodeInstanceServer::setupMockupTypes(const QVector<MockupTypeContainer> &container)
{
for (const MockupTypeContainer &mockupType : container) {
if (!isTypeAvailable(mockupType, engine()))
if (!isTypeAvailable(mockupType, engine())) {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
if (mockupType.majorVersion() == -1 && mockupType.minorVersion() == -1) {
QQuickDesignerSupportMetaInfo::registerMockupObject(mockupType.importUri().toUtf8(),
@@ -748,7 +748,7 @@ void NodeInstanceServer::setupMockupTypes(const QVector<MockupTypeContainer> &co
mockupType.minorVersion(),
mockupType.typeName());
#endif
}
}
}

View File

@@ -714,7 +714,10 @@ QObject *ObjectNodeInstance::createPrimitiveFromSource(const QString &typeName,
if (parts.isEmpty())
return nullptr;
QString importString = parts.join(".") + " " + QString::number(majorNumber) + "." + QString::number(minorNumber);
QString importString = parts.join(".");
if (majorNumber >= 0)
importString = importString + " " + QString::number(majorNumber) + "."
+ QString::number(minorNumber);
if (importString == "QtQuick 1.0") /* Workaround for implicit QQml import */
importString = "QtQuick 2.0";
QString source = "import " + importString + "\n" + unqualifiedTypeName + " {\n" + "}\n";

View File

@@ -642,12 +642,13 @@ void Qt5InformationNodeInstanceServer::updateActiveSceneToEditView3D()
if (!m_editView3DSetupDone)
return;
QVariant activeSceneVar = objectToVariant(m_active3DScene);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
// Active scene change handling on qml side is async, so a deleted importScene would crash
// editView when it updates next. Disable/enable edit view update synchronously to avoid this.
QVariant activeSceneVar = objectToVariant(m_active3DScene);
QMetaObject::invokeMethod(m_editView3DData.rootItem, "enableEditViewUpdate",
Q_ARG(QVariant, activeSceneVar));
#endif
ServerNodeInstance sceneInstance = active3DSceneInstance();
const QString sceneId = sceneInstance.id();
@@ -1470,8 +1471,11 @@ void Qt5InformationNodeInstanceServer::setup3DEditView(const QList<ServerNodeIns
++it;
}
if (toolStates.contains(helper->globalStateId())) {
if (toolStates[helper->globalStateId()].contains(helper->rootSizeKey()))
m_editView3DData.rootItem->setSize(toolStates[helper->globalStateId()][helper->rootSizeKey()].value<QSize>());
if (toolStates[helper->globalStateId()].contains(helper->rootSizeKey())) {
QSize size = toolStates[helper->globalStateId()][helper->rootSizeKey()].value<QSize>();
m_editView3DData.rootItem->setSize(size);
m_editView3DData.window->setGeometry(0, 0, size.width(), size.height());
}
if (toolStates[helper->globalStateId()].contains(helper->lastSceneIdKey()))
lastSceneId = toolStates[helper->globalStateId()][helper->lastSceneIdKey()].toString();
}

View File

@@ -129,6 +129,8 @@ Item {
expanded: dirExpanded
visible: dirVisible
expandOnClick: false
useDefaulContextMenu: false
onToggleExpand: {
dirExpanded = !dirExpanded
}

View File

@@ -217,6 +217,8 @@ ScrollView {
rightPadding: 0
expanded: importExpanded
expandOnClick: false
useDefaulContextMenu: false
onToggleExpand: {
if (categoryModel.rowCount() > 0)
importExpanded = !importExpanded

View File

@@ -61,7 +61,9 @@ Section {
PropertyLabel { text: qsTr("Alignment H") }
SecondColumnLayout {
AlignmentHorizontalButtons {}
AlignmentHorizontalButtons {
backendValue: backendValues.%2_horizontalAlignment
}
ExpandingSpacer {}
}
@@ -70,7 +72,7 @@ Section {
SecondColumnLayout {
AlignmentVerticalButtons {
backendValue: backendValues.%2_verticalAlignment;
backendValue: backendValues.%2_verticalAlignment
}
}

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
@@ -23,9 +23,7 @@
**
****************************************************************************/
import QtQuick 2.0
import QtQuick 2.15
import "../QtQuick" as Original
Original.ConnectionsSpecifics {
}
Original.ConnectionsSpecifics {}

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
@@ -23,9 +23,7 @@
**
****************************************************************************/
import QtQuick 2.0
import QtQuick 2.15
import "../QtQuick" as Original
Original.QtObjectPane {
}
Original.QtObjectPane {}

View File

@@ -26,37 +26,12 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtQuick.Templates 2.15 as T
import QtQuickDesignerTheme 1.0
import HelperWidgets 2.0
import StudioControls 1.0 as StudioControls
import StudioTheme 1.0 as StudioTheme
Rectangle {
PropertyEditorPane {
id: itemPane
width: 320
height: 400
color: Theme.qmlDesignerBackgroundColorDarkAlternate()
Component.onCompleted: Controller.mainScrollView = mainScrollView
MouseArea {
anchors.fill: parent
onClicked: forceActiveFocus()
}
ScrollView {
id: mainScrollView
clip: true
anchors.fill: parent
Column {
id: mainColumn
y: -1
width: itemPane.width
onWidthChanged: StudioTheme.Values.responsiveResize(itemPane.width)
Component.onCompleted: StudioTheme.Values.responsiveResize(itemPane.width)
ComponentSection {}
@@ -207,5 +182,3 @@ Rectangle {
}
}
}
}
}

View File

@@ -29,47 +29,28 @@ import QtQuickDesignerTheme 1.0
import HelperWidgets 2.0
import StudioTheme 1.0 as StudioTheme
Rectangle {
PropertyEditorPane {
id: itemPane
width: 320
height: 400
color: Theme.qmlDesignerBackgroundColorDarkAlternate()
MouseArea {
anchors.fill: parent
onClicked: forceActiveFocus()
}
ScrollView {
id: mainScrollView
clip: true
anchors.fill: parent
onWidthChanged: StudioTheme.Values.responsiveResize(itemPane.width)
Component.onCompleted: StudioTheme.Values.responsiveResize(itemPane.width)
Column {
id: rootColumn
y: -1
width: itemPane.width
ComponentSection {}
Column {
anchors.left: parent.left
anchors.right: parent.right
Loader {
id: specificsTwo
anchors.left: parent.left
anchors.right: parent.right
visible: theSource !== ""
sourceComponent: specificQmlComponent
property string theSource: specificQmlData
anchors.left: parent.left
anchors.right: parent.right
visible: specificsTwo.theSource !== ""
sourceComponent: specificQmlComponent
onTheSourceChanged: {
active = false
active = true
specificsTwo.active = false
specificsTwo.active = true
}
}
@@ -81,5 +62,3 @@ Rectangle {
}
}
}
}
}

View File

@@ -24,8 +24,11 @@
****************************************************************************/
import QtQuick 2.15
import QtQuick.Controls 2.15 as Controls
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
import QtQuickDesignerTheme 1.0
import StudioTheme 1.0 as StudioTheme
Rectangle {
id: itemPane
@@ -33,18 +36,22 @@ Rectangle {
height: 400
color: Theme.qmlDesignerBackgroundColorDarkAlternate()
Section {
y: -1
anchors.left: parent.left
anchors.right: parent.right
ColumnLayout {
id: mainColumn
anchors.fill: parent
SectionLayout {
Controls.Label {
text: qsTr("Select an Item in the Form Editor, Navigator or Text Edit View to see its properties.")
font.pixelSize: StudioTheme.Values.myFontSize * 1.5
color: StudioTheme.Values.themeTextColor
wrapMode: Text.WordWrap
Label {
id: test
text: qsTr("None or multiple components selected.")
anchors.fill: parent // TODO
}
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
Layout.fillHeight: true
Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter
Layout.margins: 20
}
}
}

View File

@@ -29,24 +29,8 @@ import QtQuickDesignerTheme 1.0
import HelperWidgets 2.0
import StudioTheme 1.0 as StudioTheme
Rectangle {
PropertyEditorPane {
id: itemPane
width: 320
height: 400
color: Theme.qmlDesignerBackgroundColorDarkAlternate()
MouseArea {
anchors.fill: parent
onClicked: forceActiveFocus()
}
ScrollView {
anchors.fill: parent
Column {
id: rootColumn
y: -1
width: itemPane.width
ComponentSection {}
@@ -77,5 +61,3 @@ Rectangle {
}
}
}
}
}

View File

@@ -58,9 +58,19 @@ Row {
evaluate()
}
property bool isInModel: backendValue.isInModel
property bool isInModel: {
if (backendValue !== undefined && backendValue.isInModel !== undefined)
return backendValue.isInModel
return false
}
onIsInModelChanged: evaluate()
property bool isInSubState: backendValue.isInSubState
property bool isInSubState: {
if (backendValue !== undefined && backendValue.isInSubState !== undefined)
return backendValue.isInSubState
return false
}
onIsInSubStateChanged: evaluate()
function evaluate() {

View File

@@ -55,9 +55,19 @@ Row {
evaluate()
}
property bool isInModel: backendValue.isInModel
property bool isInModel: {
if (backendValue !== undefined && backendValue.isInModel !== undefined)
return backendValue.isInModel
return false
}
onIsInModelChanged: evaluate()
property bool isInSubState: backendValue.isInSubState
property bool isInSubState: {
if (backendValue !== undefined && backendValue.isInSubState !== undefined)
return backendValue.isInSubState
return false
}
onIsInSubStateChanged: evaluate()
function evaluate() {

View File

@@ -39,6 +39,9 @@ SecondColumnLayout {
property bool supportGradient: false
property variant backendValue
property variant value: {
if (colorEditor.backendValue === undefined || colorEditor.backendValue.value === undefined)
return "white" // default color for Rectangle
if (colorEditor.isVector3D)
return Qt.rgba(colorEditor.backendValue.value.x,
colorEditor.backendValue.value.y,

View File

@@ -33,8 +33,18 @@ QtObject {
property color textColor: StudioTheme.Values.themeTextColor
property variant valueFromBackend: backendValue === undefined ? 0 : backendValue.value
property bool baseStateFlag: isBaseState
property bool isInModel: backendValue === undefined ? false : backendValue.isInModel
property bool isInSubState: backendValue === undefined ? false : backendValue.isInSubState
property bool isInModel: {
if (backendValue !== undefined && backendValue.isInModel !== undefined)
return backendValue.isInModel
return false
}
property bool isInSubState: {
if (backendValue !== undefined && backendValue.isInSubState !== undefined)
return backendValue.isInSubState
return false
}
property bool highlight: textColor === __changedTextColor
property bool errorState: false

View File

@@ -30,4 +30,7 @@ QtObject {
id: values
property Item mainScrollView
signal collapseAll()
signal expandAll()
}

View File

@@ -33,8 +33,18 @@ Item {
id: extendedFunctionButton
property variant backendValue
property bool isBoundBackend: backendValue === undefined ? false : backendValue.isBound
property string backendExpression: backendValue === undefined ? "" : backendValue.expression
property bool isBoundBackend: {
if (backendValue !== undefined && backendValue.isBound !== undefined)
return backendValue.isBound
return false
}
property string backendExpression: {
if (backendValue !== undefined && backendValue.expression !== undefined)
return backendValue.expression
return ""
}
property string glyph: StudioTheme.Constants.actionIcon
property string color: StudioTheme.Values.themeTextColor

View File

@@ -305,7 +305,7 @@ Section {
PropertyLabel {
text: qsTr("Word spacing")
tooltip: qsTr("Word spacing for the font.")
blockedByTemplate: !backendValue.isAvailable
blockedByTemplate: !getBackendValue("wordSpacing").isAvailable
}
SecondColumnLayout {

View File

@@ -0,0 +1,62 @@
/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtQuickDesignerTheme 1.0
import HelperWidgets 2.0
import StudioTheme 1.0 as StudioTheme
Rectangle {
id: itemPane
width: 320
height: 400
color: Theme.qmlDesignerBackgroundColorDarkAlternate()
Component.onCompleted: Controller.mainScrollView = mainScrollView
default property alias content: mainColumn.children
MouseArea {
anchors.fill: parent
onClicked: forceActiveFocus()
}
ScrollView {
id: mainScrollView
clip: true
anchors.fill: parent
Column {
id: mainColumn
y: -1
width: itemPane.width
onWidthChanged: StudioTheme.Values.responsiveResize(itemPane.width)
Component.onCompleted: StudioTheme.Values.responsiveResize(itemPane.width)
}
}
}

View File

@@ -27,6 +27,7 @@ import QtQuick 2.15
import QtQuick.Controls 2.15 as Controls
import QtQuick.Layouts 1.15
import QtQuickDesignerTheme 1.0
import StudioControls 1.0 as StudioControls
import StudioTheme 1.0 as StudioTheme
Item {
@@ -54,19 +55,51 @@ Item {
property bool addTopPadding: true
property bool addBottomPadding: true
property bool useDefaulContextMenu: true
clip: true
Connections {
id: connection
target: section
enabled: section.useDefaulContextMenu
function onShowContextMenu() { contextMenu.popup() }
}
Connections {
target: Controller
function onCollapseAll() { section.expanded = false }
function onExpandAll() { section.expanded = true }
}
signal showContextMenu()
signal toggleExpand()
Rectangle {
id: header
height: hideHeader ? 0 : StudioTheme.Values.sectionHeadHeight
visible: !hideHeader
height: section.hideHeader ? 0 : StudioTheme.Values.sectionHeadHeight
visible: !section.hideHeader
anchors.left: parent.left
anchors.right: parent.right
color: Qt.lighter(StudioTheme.Values.themeSectionHeadBackground, 1.0 + (0.2 * section.level))
Item {
StudioControls.Menu {
id: contextMenu
StudioControls.MenuItem {
text: qsTr("Expand All")
onTriggered: Controller.expandAll()
}
StudioControls.MenuItem {
text: qsTr("Collapse All")
onTriggered: Controller.collapseAll()
}
}
}
Image {
id: arrow
width: 8
@@ -92,9 +125,9 @@ Item {
acceptedButtons: Qt.LeftButton | Qt.RightButton
onClicked: function(mouse) {
if (mouse.button === Qt.LeftButton) {
trans.enabled = true
if (expandOnClick)
expanded = !expanded
transition.enabled = true
if (section.expandOnClick)
section.expanded = !section.expanded
else
section.toggleExpand()
} else {
@@ -109,8 +142,8 @@ Item {
height: 1
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 5 + leftPadding
anchors.leftMargin: 5 - leftPadding
anchors.rightMargin: 5 + section.leftPadding
anchors.leftMargin: 5 - section.leftPadding
visible: false
color: StudioTheme.Values.themeControlOutline
}
@@ -166,7 +199,7 @@ Item {
]
transitions: Transition {
id: trans
id: transition
enabled: false
NumberAnimation {
properties: "implicitHeight,rotation"

View File

@@ -53,6 +53,7 @@ OpacitySlider 2.0 OpacitySlider.qml
OriginControl 2.0 OriginControl.qml
OriginIndicator 2.0 OriginIndicator.qml
OriginSelector 2.0 OriginSelector.qml
PropertyEditorPane 2.0 PropertyEditorPane.qml
PropertyLabel 2.0 PropertyLabel.qml
PaddingSection 2.0 PaddingSection.qml
RoundedPanel 2.0 RoundedPanel.qml

View File

@@ -68,7 +68,7 @@
"enabled": "%{JS: !value('IsSubproject')}",
"data": {
"projectFilePath": "%{ProjectFile}",
"requiredFeatures": [ "QtSupport.Wizards.FeatureQt.5"]
"requiredFeatures": [ "QtSupport.Wizards.FeatureQtQuick", "QtSupport.Wizards.FeatureQtQuick.2" ]
}
},
{

View File

@@ -291,6 +291,13 @@ static void setHighDpiEnvironmentVariable()
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
Qt::HighDpiScaleFactorRoundingPolicy::Round);
#endif
#endif
} else {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
/* AA_DisableHighDpiScaling is deprecated */
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
Qt::HighDpiScaleFactorRoundingPolicy::Floor);
#endif
}
}
@@ -478,6 +485,8 @@ int main(int argc, char **argv)
QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
#else
qputenv("QSG_RHI_BACKEND", "opengl");
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
Qt::HighDpiScaleFactorRoundingPolicy::Round);
#endif
if (qEnvironmentVariableIsSet("QTCREATOR_DISABLE_NATIVE_MENUBAR")

View File

@@ -183,6 +183,7 @@ int ExpressionUnderCursor::startOfExpression_helper(BackwardsScanner &tk, int in
int leftParenIndex = tk.startOfMatchingBrace(currentIndex);
if (tk[leftParenIndex-1].is(T_THROW)) {
currentIndex = leftParenIndex-1;
continue;
} else if (tk[leftParenIndex-1].is(T_RBRACKET)) {
int leftBracketIndex = tk.startOfMatchingBrace(leftParenIndex);
if (leftBracketIndex != leftParenIndex-1)
@@ -192,9 +193,8 @@ int ExpressionUnderCursor::startOfExpression_helper(BackwardsScanner &tk, int in
int leftBracketIndex = tk.startOfMatchingBrace(currentIndex);
if (leftBracketIndex != currentIndex-1)
return leftBracketIndex;
} else {
--currentIndex;
}
--currentIndex;
}
}
}

View File

@@ -434,6 +434,10 @@ QString PluginManager::systemInformation()
result += QLatin1String(spec->isEffectivelyEnabled() ? "+ " : " ") + filled(spec->name(), size) +
" " + spec->version() + "\n";
}
QString settingspath = QFileInfo(settings()->fileName()).path();
if (settingspath.startsWith(QDir::homePath()))
settingspath.replace(QDir::homePath(), "~");
result += "\nUsed settingspath: " + settingspath + "\n";
return result;
}

View File

@@ -38,7 +38,7 @@
#include <algorithm>
static Q_LOGGING_CATEGORY(importsLog, "qtc.qmljs.imports", QtWarningMsg)
static Q_LOGGING_CATEGORY(importsBenchmark, "qtc.qmljs.imports.benchmark", QtDebugMsg)
static Q_LOGGING_CATEGORY(importsBenchmark, "qtc.qmljs.imports.benchmark", QtWarningMsg)
class ImportsBenchmarker

View File

@@ -43,7 +43,10 @@ if(${Qt5_VERSION} VERSION_LESS "6.2.0")
qml/tracing.qrc
)
else() # < Qt 6.2
find_package(Qt6 COMPONENTS ShaderTools QUIET)
add_qtc_library(Tracing
CONDITION TARGET Qt6::ShaderTools
FEATURE_INFO
DEPENDS Utils Qt5::Qml Qt5::Quick
PUBLIC_DEPENDS Qt5::Widgets
@@ -86,12 +89,8 @@ else() # < Qt 6.2
qml/ico_rangeselection@2x.png
qml/ico_selectionmode.png
qml/ico_selectionmode@2x.png
qml/notes.frag
qml/notes.vert
qml/range_handle.png
qml/range_handle@2.png
qml/timelineitems.frag
qml/timelineitems.vert
)
foreach(file IN LISTS TRACING_QML_FILES TRACING_QML_RESOURCES)
@@ -99,6 +98,17 @@ else() # < Qt 6.2
set_source_files_properties("${file}" PROPERTIES QT_RESOURCE_ALIAS "${fileName}")
endforeach()
qt_add_shaders(Tracing "res_tracingshaders"
BATCHABLE
PREFIX
"/QtCreator/Tracing"
FILES
qml/notes_qt6.vert
qml/notes_qt6.frag
qml/timelineitems_qt6.vert
qml/timelineitems_qt6.frag
)
qt_add_qml_module(Tracing
URI "QtCreator.Tracing"
VERSION "1.0"

View File

@@ -0,0 +1,36 @@
/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#version 440
layout (location = 0) in vec4 color;
layout (location = 1) in float d;
layout (location = 0) out vec4 fragColor;
void main()
{
fragColor = color * float(d < (2.0 / 3.0) || d > (5.0 / 6.0));
}

View File

@@ -0,0 +1,46 @@
/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#version 440
layout (location = 0) in vec4 vertexCoord;
layout (location = 1) in float distanceFromTop;
layout (std140, binding = 0) uniform Block {
mat4 matrix;
vec4 notesColor;
} block;
layout (location = 0) out vec4 color;
layout (location = 1) out float d;
void main()
{
gl_Position = block.matrix * vertexCoord;
gl_Position.z -= 0.1;
gl_Position.w = 1.0;
color = block.notesColor;
d = distanceFromTop;
}

View File

@@ -0,0 +1,43 @@
/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#version 440
layout (location = 0) in vec3 color;
layout (location = 1) in vec3 edgeColor;
layout (location = 2) in vec2 barycentric;
layout (location = 0) out vec4 fragColor;
void main()
{
lowp vec2 d = fwidth(barycentric) * 4.0;
lowp vec4 edge_closeness = step(vec4(d.x, d.y, d.x, d.y),
vec4(barycentric.x, barycentric.y, 1.0 - barycentric.x, 1.0 - barycentric.y));
lowp float total = min(min(edge_closeness[0], edge_closeness[1]),
min(edge_closeness[2], edge_closeness[3]));
fragColor.rgb = mix(edgeColor, color, total);
fragColor.a = 1.0;
}

View File

@@ -0,0 +1,63 @@
/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#version 440
layout (location = 0) in vec4 vertexCoord;
layout (location = 1) in vec2 rectSize;
layout (location = 2) in float selectionId;
layout (location = 3) in vec4 vertexColor;
layout (std140, binding = 0) uniform Block {
mat4 matrix;
vec2 scale;
vec4 selectionColor;
float selectedItem;
} block;
layout (location = 0) out vec3 color;
layout (location = 1) out vec3 edgeColor;
layout (location = 2) out vec2 barycentric;
void main()
{
gl_Position = block.matrix * vertexCoord;
// Make very narrow events somewhat wider so that they don't collapse into 0 pixels
float scaledWidth = block.scale.x * rectSize.x;
float shift = sign(rectSize.x) * max(0.0, 3.0 - abs(scaledWidth)) * 0.0005;
gl_Position.x += shift;
// Ditto for events with very small height
float scaledHeight = block.scale.y * rectSize.y;
gl_Position.y += float(rectSize.y > 0.0) * max(0.0, 3.0 - scaledHeight) * 0.003;
barycentric = vec2(rectSize.x > 0.0 ? 1.0 : 0.0, rectSize.y > 0.0 ? 1.0 : 0.0);
color = vertexColor.rgb;
float selected = min(abs(selectionId - block.selectedItem), 1.0);
edgeColor.rgb = mix(block.selectionColor.rgb, vertexColor.rgb, selected);
gl_Position.z += mix(0.0, (shift + 0.0015) / 10.0, selected);
gl_Position.w = 1.0;
}

View File

@@ -357,14 +357,22 @@ static qint64 endTime(const TimelineModel *model, const TimelineRenderState *par
const QSGGeometry::AttributeSet &OpaqueColoredPoint2DWithSize::attributes()
{
static QSGGeometry::Attribute data[] = {
QSGGeometry::Attribute::create(0, 2, QSGGeometry::FloatType, true),
QSGGeometry::Attribute::create(1, 2, QSGGeometry::FloatType),
QSGGeometry::Attribute::create(2, 1, QSGGeometry::FloatType),
QSGGeometry::Attribute::create(3, 4, QSGGeometry::UnsignedByteType)
static const QSGGeometry::Attribute data[] = {
// vec4 vertexCoord
QSGGeometry::Attribute::createWithAttributeType(0, 2, QSGGeometry::FloatType,
QSGGeometry::PositionAttribute),
// vec2 rectSize
QSGGeometry::Attribute::createWithAttributeType(1, 2, QSGGeometry::FloatType,
QSGGeometry::UnknownAttribute),
// float selectionId
QSGGeometry::Attribute::createWithAttributeType(2, 1, QSGGeometry::FloatType,
QSGGeometry::UnknownAttribute),
// vec4 vertexColor
QSGGeometry::Attribute::createWithAttributeType(3, 4, QSGGeometry::UnsignedByteType,
QSGGeometry::ColorAttribute),
};
static QSGGeometry::AttributeSet attrs = {
4,
static const QSGGeometry::AttributeSet attrs = {
sizeof(data) / sizeof(data[0]),
sizeof(OpaqueColoredPoint2DWithSize),
data
};
@@ -448,13 +456,13 @@ public:
private:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void initialize() override;
#endif // < Qt 6
int m_matrix_id;
int m_scale_id;
int m_selection_color_id;
int m_selected_item_id;
int m_z_range_id;
#endif // < Qt 6
};
TimelineItemsMaterialShader::TimelineItemsMaterialShader()
@@ -466,8 +474,8 @@ TimelineItemsMaterialShader::TimelineItemsMaterialShader()
setShaderSourceFile(QOpenGLShader::Fragment,
QStringLiteral(":/QtCreator/Tracing/timelineitems.frag"));
#else // < Qt 6
setShaderFileName(VertexStage, ":/QtCreator/Tracing/timelineitems.vert");
setShaderFileName(FragmentStage, ":/QtCreator/Tracing/timelineitems.frag");
setShaderFileName(VertexStage, ":/QtCreator/Tracing/timelineitems_qt6.vert.qsb");
setShaderFileName(FragmentStage, ":/QtCreator/Tracing/timelineitems_qt6.frag.qsb");
#endif // < Qt 6
}
@@ -488,11 +496,29 @@ void TimelineItemsMaterialShader::updateState(const RenderState &state, QSGMater
bool TimelineItemsMaterialShader::updateUniformData(RenderState &state,
QSGMaterial *newMaterial, QSGMaterial *)
{
// TODO: Make this work
QByteArray *buf = state.uniformData();
auto material = static_cast<const TimelineItemsMaterial *>(newMaterial);
// mat4 matrix
if (state.isMatrixDirty()) {
TimelineItemsMaterial *material = static_cast<TimelineItemsMaterial *>(newMaterial);
const QMatrix4x4 m = state.combinedMatrix();
memcpy(buf->data(), m.constData(), 64);
}
return state.isMatrixDirty();
// vec2 scale
const QVector2D scale = material->scale();
memcpy(buf->data() + 64, &scale, 8);
// vec4 selectionColor
const QColor color = material->selectionColor();
const float colorArray[] = { color.redF(), color.greenF(), color.blueF(), color.alphaF() };
memcpy(buf->data() + 80, colorArray, 16);
// float selectedItem
const float selectedItem = material->selectedItem();
memcpy(buf->data() + 96, &selectedItem, 4);
return true;
}
#endif // < Qt 6
@@ -516,6 +542,9 @@ void TimelineItemsMaterialShader::initialize()
TimelineItemsMaterial::TimelineItemsMaterial() : m_selectedItem(-1)
{
setFlag(QSGMaterial::Blending, false);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
setFlag(QSGMaterial::CustomCompileStep, true);
#endif // >= Qt 6
}
QVector2D TimelineItemsMaterial::scale() const
@@ -556,17 +585,12 @@ QSGMaterialType *TimelineItemsMaterial::type() const
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QSGMaterialShader *TimelineItemsMaterial::createShader() const
{
return new TimelineItemsMaterialShader;
}
#else // < Qt 6
QSGMaterialShader *TimelineItemsMaterial::createShader(
QSGRendererInterface::RenderMode renderMode) const
QSGMaterialShader *TimelineItemsMaterial::createShader(QSGRendererInterface::RenderMode) const
#endif // < Qt 6
{
Q_UNUSED(renderMode);
return new TimelineItemsMaterialShader;
}
#endif // < Qt 6
TimelineItemsRenderPassState::TimelineItemsRenderPassState(const TimelineModel *model) :
m_indexFrom(std::numeric_limits<int>::max()), m_indexTo(-1)

View File

@@ -48,7 +48,7 @@ public:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QSGMaterialShader *createShader() const override;
#else
QSGMaterialShader *createShader(QSGRendererInterface::RenderMode renderMode) const override;
QSGMaterialShader *createShader(QSGRendererInterface::RenderMode) const override;
#endif // < Qt 6
private:
@@ -83,8 +83,10 @@ public:
static OpaqueColoredPoint2DWithSize *fromVertexData(QSGGeometry *geometry);
private:
float x, y, w, h, id;
unsigned char r, g, b, a;
float x, y; // vec4 vertexCoord
float w, h; // vec2 rectSize
float id; // float selectionId
unsigned char r, g, b, a; // vec4 vertexColor
void setCommon(const OpaqueColoredPoint2DWithSize *master);
void setLeft(const OpaqueColoredPoint2DWithSize *master);

View File

@@ -32,7 +32,8 @@
namespace Timeline {
struct Point2DWithDistanceFromTop {
float x, y, d;
float x, y; // vec4 vertexCoord
float d; // float distanceFromTop
void set(float nx, float ny, float nd);
};
@@ -43,7 +44,7 @@ public:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QSGMaterialShader *createShader() const final;
#else // < Qt 6
QSGMaterialShader *createShader(QSGRendererInterface::RenderMode renderMode) const final;
QSGMaterialShader *createShader(QSGRendererInterface::RenderMode) const final;
#endif // < Qt 6
};
@@ -82,12 +83,16 @@ private:
const QSGGeometry::AttributeSet &NotesGeometry::point2DWithDistanceFromTop()
{
static QSGGeometry::Attribute data[] = {
QSGGeometry::Attribute::create(0, 2, QSGGeometry::FloatType, true),
QSGGeometry::Attribute::create(1, 1, QSGGeometry::FloatType),
static const QSGGeometry::Attribute data[] = {
// vec4 vertexCoord
QSGGeometry::Attribute::createWithAttributeType(0, 2, QSGGeometry::FloatType,
QSGGeometry::PositionAttribute),
// float distanceFromTop
QSGGeometry::Attribute::createWithAttributeType(1, 1, QSGGeometry::FloatType,
QSGGeometry::UnknownAttribute),
};
static QSGGeometry::AttributeSet attrs = {
2,
static const QSGGeometry::AttributeSet attrs = {
sizeof(data) / sizeof(data[0]),
sizeof(Point2DWithDistanceFromTop),
data
};
@@ -173,6 +178,9 @@ TimelineNotesRenderPassState::TimelineNotesRenderPassState(int numExpandedRows)
m_nullGeometry(NotesGeometry::point2DWithDistanceFromTop(), 0)
{
m_material.setFlag(QSGMaterial::Blending, true);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
m_material.setFlag(QSGMaterial::CustomCompileStep, true);
#endif // >= Qt 6
m_expandedRows.reserve(numExpandedRows);
for (int i = 0; i < numExpandedRows; ++i)
m_expandedRows << createNode();
@@ -229,18 +237,17 @@ public:
QSGMaterial *oldEffect) override;
char const *const *attributeNames() const override;
#else // < Qt 6
bool updateUniformData(RenderState &state,
QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override;
bool updateUniformData(RenderState &state, QSGMaterial *, QSGMaterial *) override;
#endif // < Qt 6
private:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void initialize() override;
#endif // < Qt 6
int m_matrix_id;
int m_z_range_id;
int m_color_id;
#endif // < Qt 6
};
NotesMaterialShader::NotesMaterialShader()
@@ -250,29 +257,44 @@ NotesMaterialShader::NotesMaterialShader()
setShaderSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/QtCreator/Tracing/notes.vert"));
setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/QtCreator/Tracing/notes.frag"));
#else // < Qt 6
setShaderFileName(VertexStage, ":/QtCreator/Tracing/notes.vert");
setShaderFileName(FragmentStage, ":/QtCreator/Tracing/notes.frag");
setShaderFileName(VertexStage, ":/QtCreator/Tracing/notes_qt6.vert.qsb");
setShaderFileName(FragmentStage, ":/QtCreator/Tracing/notes_qt6.frag.qsb");
#endif // < Qt 6
}
static QColor notesColor()
{
return Utils::creatorTheme()
? Utils::creatorTheme()->color(Utils::Theme::Timeline_HighlightColor)
: QColor(255, 165, 0);
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void NotesMaterialShader::updateState(const RenderState &state, QSGMaterial *, QSGMaterial *)
{
if (state.isMatrixDirty()) {
program()->setUniformValue(m_matrix_id, state.combinedMatrix());
program()->setUniformValue(m_z_range_id, GLfloat(1.0));
const QColor notesColor = Utils::creatorTheme()
? Utils::creatorTheme()->color(Utils::Theme::Timeline_HighlightColor)
: QColor(255, 165, 0);
program()->setUniformValue(m_color_id, notesColor);
program()->setUniformValue(m_color_id, notesColor());
}
}
#else // < Qt 6
bool NotesMaterialShader::updateUniformData(QSGMaterialShader::RenderState &state, QSGMaterial *, QSGMaterial *)
bool NotesMaterialShader::updateUniformData(RenderState &state, QSGMaterial *, QSGMaterial *)
{
QByteArray *buf = state.uniformData();
// mat4 matrix
if (state.isMatrixDirty()) {
const QMatrix4x4 m = state.combinedMatrix();
memcpy(buf->data(), m.constData(), 64);
}
return state.isMatrixDirty();
// vec4 notesColor
const QColor color = notesColor();
const float colorArray[] = { color.redF(), color.greenF(), color.blueF(), color.alphaF() };
memcpy(buf->data() + 64, colorArray, 16);
return true;
}
#endif // < Qt 6
@@ -299,16 +321,12 @@ QSGMaterialType *NotesMaterial::type() const
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QSGMaterialShader *NotesMaterial::createShader() const
{
return new NotesMaterialShader;
}
#else // < Qt 6
QSGMaterialShader *NotesMaterial::createShader(QSGRendererInterface::RenderMode renderMode) const
QSGMaterialShader *NotesMaterial::createShader(QSGRendererInterface::RenderMode) const
#endif // < Qt 6
{
Q_UNUSED(renderMode);
return new NotesMaterialShader;
}
#endif // < Qt 6
void Point2DWithDistanceFromTop::set(float nx, float ny, float nd)
{

View File

@@ -983,6 +983,15 @@ bool FilePath::endsWith(const QString &s) const
return m_data.endsWith(s, caseSensitivity());
}
/// \returns whether FilePath starts with a drive letter
/// \note defaults to \c false if it is a non-Windows host or represents a path on device
bool FilePath::startsWithDriveLetter() const
{
if (needsDevice() || !HostOsInfo::isWindowsHost())
return false;
return m_data.length() >= 2 && m_data.at(0).isLetter() && m_data.at(1) == ':';
}
/// \returns the relativeChildPath of FilePath to parent if FilePath is a child of parent
/// \note returns a empty FilePath if FilePath is not a child of parent
/// That is, this never returns a path starting with "../"

View File

@@ -129,6 +129,7 @@ public:
bool isChildOf(const QDir &dir) const;
bool startsWith(const QString &s) const;
bool endsWith(const QString &s) const;
bool startsWithDriveLetter() const;
bool isNewerThan(const QDateTime &timeStamp) const;
QDateTime lastModified() const;

View File

@@ -220,7 +220,9 @@ FilePath PathChooserPrivate::expandedPath(const QString &input) const
switch (m_acceptingKind) {
case PathChooser::Command:
case PathChooser::ExistingCommand: {
const FilePath expanded = m_environment.searchInPath(path.path(), {m_baseDirectory});
FilePaths searchPaths = m_environment.path();
searchPaths.append(m_baseDirectory);
const FilePath expanded = path.searchOnDevice(searchPaths);
return expanded.isEmpty() ? path : expanded;
}
case PathChooser::Any:
@@ -229,8 +231,19 @@ FilePath PathChooserPrivate::expandedPath(const QString &input) const
case PathChooser::ExistingDirectory:
case PathChooser::File:
case PathChooser::SaveFile:
if (!m_baseDirectory.isEmpty())
return m_baseDirectory.resolvePath(path.path()).absoluteFilePath();
if (!m_baseDirectory.isEmpty()) {
Utils::FilePath fp = m_baseDirectory.resolvePath(path.path()).absoluteFilePath();
// FIXME bad hotfix for manually editing PathChooser (invalid paths, jumping cursor)
// examples: have an absolute path and try to change the device letter by typing the new
// letter and removing the original afterwards ends up in
// D:\\dev\\project\\cD:\\dev\\build-project (before trying to remove the original)
// as 'cD:\\dev\\build-project' is considered is handled as being relative
// input = "cD:\\dev\build-project"; // prepended 'c' to change the device letter
// m_baseDirectory = "D:\\dev\\project"
if (!fp.needsDevice() && HostOsInfo::isWindowsHost() && fp.toString().count(':') > 1)
return path;
return fp;
}
break;
}
return path;
@@ -586,6 +599,12 @@ bool PathChooser::validatePath(FancyLineEdit *edit, QString *errorMessage) const
*errorMessage = tr("The path \"%1\" is not a directory.").arg(filePath.toUserOutput());
return false;
}
if (HostOsInfo::isWindowsHost() && !filePath.startsWithDriveLetter()
&& !filePath.startsWith("\\\\") && !filePath.startsWith("//")) {
if (errorMessage)
*errorMessage = tr("Invalid path \"%1\".").arg(filePath.toUserOutput());
return false;
}
break;
case PathChooser::Command:
if (filePath.exists() && !filePath.isExecutableFile()) {

View File

@@ -66,7 +66,8 @@ static void __attribute__((noreturn)) doExit(int code)
{
tcsetpgrp(0, getpid());
puts(sleepMsg);
fgets(sleepMsg, 2, stdin); /* Minimal size to make it wait */
const char *rv = fgets(sleepMsg, 2, stdin); /* Minimal size to make it wait */
(void)rv; // Q_UNUSED
exit(code);
}

View File

@@ -732,6 +732,8 @@ void TestTreeModel::handleParseResult(const TestParseResult *result, TestTreeIte
// restore former check state and fail state if available
newItem->forAllChildItems([this](TestTreeItem *childItem) {
if (!m_checkStateCache) // parse results may arrive after session switch / project close
return;
Utils::optional<Qt::CheckState> cached = m_checkStateCache->get(childItem);
if (cached.has_value())
childItem->setData(0, cached.value(), Qt::CheckStateRole);

View File

@@ -71,7 +71,7 @@ ArtisticStyleSettings::ArtisticStyleSettings() :
static int parseVersion(const QString &text)
{
// The version in Artistic Style is printed like "Artistic Style Version 2.04"
const QRegularExpression rx("([2-9]{1})\\.([0-9]{2})(\\.[1-9]{1})?$");
const QRegularExpression rx("([2-9]{1})\\.([0-9]{1,2})(\\.[1-9]{1})?$");
const QRegularExpressionMatch match = rx.match(text);
if (match.hasMatch()) {
const int major = match.captured(1).toInt() * 100;

View File

@@ -2298,6 +2298,9 @@ static void semanticHighlighter(QFutureInterface<TextEditor::HighlightingResult>
styles.mainStyle = TextEditor::C_GLOBAL;
}
} else if (token.type == "function" || token.type == "method") {
if (token.modifiers.contains("virtual"))
styles.mainStyle = TextEditor::C_VIRTUAL_METHOD;
else
styles.mainStyle = TextEditor::C_FUNCTION;
if (ast.isValid()) {
const Position pos(token.line - 1, token.column - 1);
@@ -2305,8 +2308,11 @@ static void semanticHighlighter(QFutureInterface<TextEditor::HighlightingResult>
if (path.length() > 1) {
const AstNode declNode = path.at(path.length() - 2);
if (declNode.kind() == "Function" || declNode.kind() == "CXXMethod") {
// TODO: Remove this once we can assume clangd >= 14.
if (declNode.arcanaContains("' virtual"))
styles.mainStyle = TextEditor::C_VIRTUAL_METHOD;
if (declNode.hasChildWithRole("statement"))
styles.mixinStyles.push_back(TextEditor::C_FUNCTION_DEFINITION);
}

View File

@@ -760,7 +760,7 @@ void ClangdTestHighlighting::test_data()
QTest::newRow("virtual function call via pointer") << 192 << 33 << 192 << 48
<< QList<int>{C_VIRTUAL_METHOD} << 0;
QTest::newRow("final virtual function call via pointer") << 202 << 38 << 202 << 58
<< QList<int>{C_FUNCTION} << 0;
<< QList<int>{C_VIRTUAL_METHOD} << 0;
QTest::newRow("non-final virtual function call via pointer") << 207 << 41 << 207 << 61
<< QList<int>{C_VIRTUAL_METHOD} << 0;
QTest::newRow("operator+ declaration") << 220 << 18 << 220 << 19
@@ -1299,12 +1299,18 @@ void ClangdTestHighlighting::test()
for (const TextEditor::TextStyle s : result.textStyles.mixinStyles)
actualStyles << s;
}
if (client()->versionNumber() < QVersionNumber(14)) {
QEXPECT_FAIL("final virtual function call via pointer",
"clangd < 14 does not send virtual modifier", Continue);
QEXPECT_FAIL("virtual member function definition outside of class body",
"FIXME: send virtual info in clangd", Continue);
"clangd < 14 does not send virtual modifier", Continue);
QEXPECT_FAIL("virtual function call via pointer",
"FIXME: send virtual info in clangd", Continue);
"clangd < 14 does not send virtual modifier", Continue);
QEXPECT_FAIL("non-final virtual function call via pointer",
"FIXME: send virtual info in clangd", Continue);
"clangd < 14 does not send virtual modifier", Continue);
}
QEXPECT_FAIL("template non-type parameter",
"FIXME: clangd reports non-type template parameters at \"typeParameter\"",
Continue);

View File

@@ -1061,8 +1061,8 @@ Tasks CMakeConfigurationKitAspect::validate(const Kit *k) const
const CMakeConfig config = configuration(k);
const bool isQt4 = version && version->qtVersion() < QtSupport::QtVersionNumber(5, 0, 0);
FilePath qmakePath;
QStringList qtInstallDirs;
FilePath qmakePath; // This is relative to the cmake used for building.
QStringList qtInstallDirs; // This is relativ to the cmake used for building.
FilePath tcCPath;
FilePath tcCxxPath;
for (const CMakeConfigItem &i : config) {
@@ -1076,7 +1076,7 @@ Tasks CMakeConfigurationKitAspect::validate(const Kit *k) const
else if (i.key == CMAKE_CXX_TOOLCHAIN_KEY)
tcCxxPath = expandedValue;
else if (i.key == CMAKE_PREFIX_PATH_KEY)
qtInstallDirs = CMakeConfigItem::cmakeSplitValue(expandedValue.toString());
qtInstallDirs = CMakeConfigItem::cmakeSplitValue(expandedValue.path());
}
Tasks result;
@@ -1100,7 +1100,7 @@ Tasks CMakeConfigurationKitAspect::validate(const Kit *k) const
"configured in the Qt version."));
}
}
if (version && !qtInstallDirs.contains(version->prefix().toString()) && !isQt4) {
if (version && !qtInstallDirs.contains(version->prefix().path()) && !isQt4) {
if (version->isValid()) {
addWarning(tr("CMake configuration has no CMAKE_PREFIX_PATH set "
"that points to the kit Qt version."));

View File

@@ -136,10 +136,10 @@ public:
void updateErrorFlags()
{
const QFileInfo fi = CMakeTool::cmakeExecutable(m_executable).toFileInfo();
m_pathExists = fi.exists();
m_pathIsFile = fi.isFile();
m_pathIsExecutable = fi.isExecutable();
const FilePath filePath = CMakeTool::cmakeExecutable(m_executable);
m_pathExists = filePath.exists();
m_pathIsFile = filePath.isFile();
m_pathIsExecutable = filePath.isExecutableFile();
CMakeTool cmake(m_autodetected ? CMakeTool::AutoDetection
: CMakeTool::ManualDetection, m_id);

View File

@@ -96,11 +96,13 @@ CorePlugin::CorePlugin()
qRegisterMetaType<Utils::CommandLine>();
qRegisterMetaType<Utils::FilePath>();
m_instance = this;
m_reaper = new ProcessReapers;
setupSystemEnvironment();
}
CorePlugin::~CorePlugin()
{
delete m_reaper;
IWizardFactory::destroyFeatureProvider();
Find::destroy();

View File

@@ -26,7 +26,6 @@
#pragma once
#include <qglobal.h>
#include "reaper_p.h"
#include <extensionsystem/iplugin.h>
#include <utils/environment.h>
@@ -45,6 +44,7 @@ namespace Internal {
class EditMode;
class MainWindow;
class Locator;
class ProcessReapers;
class CorePlugin : public ExtensionSystem::IPlugin
{
@@ -93,7 +93,7 @@ private:
MainWindow *m_mainWindow = nullptr;
EditMode *m_editMode = nullptr;
Locator *m_locator = nullptr;
ProcessReapers m_reaper;
ProcessReapers *m_reaper = nullptr;
Utils::Environment m_startupSystemEnvironment;
Utils::EnvironmentItems m_environmentChanges;
};

View File

@@ -190,8 +190,6 @@ namespace Internal {
return;
m_searchResultWidgets.at(visibleSearchIndex())->showFilterWidget(m_filterButton);
});
connect(m_widget, &QStackedWidget::currentChanged,
this, &SearchResultWindowPrivate::updateFilterButton);
}
void SearchResultWindowPrivate::setCurrentIndex(int index, bool focus)
@@ -214,16 +212,17 @@ namespace Internal {
m_newSearchButton->setEnabled(true);
}
q->navigateStateChanged();
updateFilterButton();
}
void SearchResultWindowPrivate::moveWidgetToTop()
{
auto widget = qobject_cast<SearchResultWidget *>(sender());
QTC_ASSERT(widget, return);
int index = m_searchResultWidgets.indexOf(widget);
const int index = m_searchResultWidgets.indexOf(widget);
if (index == 0)
return; // nothing to do
int internalIndex = index + 1/*account for "new search" entry*/;
const int internalIndex = index + 1/*account for "new search" entry*/;
QString searchEntry = m_recentSearchesBox->itemText(internalIndex);
m_searchResultWidgets.removeAt(index);

View File

@@ -27,7 +27,9 @@
#include <coreplugin/icore.h>
#include <coreplugin/messagemanager.h>
#include <coreplugin/reaper.h>
#include <utils/macroexpander.h>
#include <utils/qtcassert.h>
#include <QMessageBox>
@@ -46,15 +48,11 @@ ExecuteFilter::ExecuteFilter()
setDefaultShortcutString("!");
setPriority(High);
setDefaultIncludedByDefault(false);
}
m_process = new Utils::QtcProcess(this);
m_process->setEnvironment(Utils::Environment::systemEnvironment());
connect(m_process, &QtcProcess::finished, this, &ExecuteFilter::finished);
connect(m_process, &QtcProcess::readyReadStandardOutput, this, &ExecuteFilter::readStandardOutput);
connect(m_process, &QtcProcess::readyReadStandardError, this, &ExecuteFilter::readStandardError);
m_runTimer.setSingleShot(true);
connect(&m_runTimer, &QTimer::timeout, this, &ExecuteFilter::runHeadCommand);
ExecuteFilter::~ExecuteFilter()
{
removeProcess();
}
QList<LocatorFilterEntry> ExecuteFilter::matchesFor(QFutureInterface<LocatorFilterEntry> &future,
@@ -114,18 +112,20 @@ void ExecuteFilter::accept(LocatorFilterEntry selection,
value.right(value.length() - pos - 1));
}
if (m_process->state() != QProcess::NotRunning) {
if (m_process) {
const QString info(tr("Previous command is still running (\"%1\").\nDo you want to kill it?")
.arg(p->headCommand()));
int r = QMessageBox::question(ICore::dialogParent(), tr("Kill Previous Process?"), info,
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
QMessageBox::Yes);
if (r == QMessageBox::Yes)
m_process->kill();
if (r != QMessageBox::Cancel)
if (r == QMessageBox::Cancel)
return;
if (r == QMessageBox::No) {
p->m_taskQueue.enqueue(d);
return;
}
p->removeProcess();
}
p->m_taskQueue.enqueue(d);
p->runHeadCommand();
@@ -133,6 +133,7 @@ void ExecuteFilter::accept(LocatorFilterEntry selection,
void ExecuteFilter::finished()
{
QTC_ASSERT(m_process, return);
const QString commandName = headCommand();
QString message;
if (m_process->result() == QtcProcess::FinishedWithSuccess)
@@ -141,13 +142,13 @@ void ExecuteFilter::finished()
message = tr("Command \"%1\" failed.").arg(commandName);
MessageManager::writeFlashing(message);
m_taskQueue.dequeue();
if (!m_taskQueue.isEmpty())
m_runTimer.start(500);
removeProcess();
runHeadCommand();
}
void ExecuteFilter::readStandardOutput()
{
QTC_ASSERT(m_process, return);
const QByteArray data = m_process->readAllStandardOutput();
MessageManager::writeSilently(
QTextCodec::codecForLocale()->toUnicode(data.constData(), data.size(), &m_stdoutState));
@@ -155,6 +156,7 @@ void ExecuteFilter::readStandardOutput()
void ExecuteFilter::readStandardError()
{
QTC_ASSERT(m_process, return);
const QByteArray data = m_process->readAllStandardError();
MessageManager::writeSilently(
QTextCodec::codecForLocale()->toUnicode(data.constData(), data.size(), &m_stderrState));
@@ -173,18 +175,47 @@ void ExecuteFilter::runHeadCommand()
return;
}
MessageManager::writeDisrupting(tr("Starting command \"%1\".").arg(headCommand()));
QTC_CHECK(!m_process);
createProcess();
m_process->setWorkingDirectory(d.workingDirectory);
m_process->setCommand({fullPath, d.arguments, Utils::CommandLine::Raw});
m_process->start();
if (!m_process->waitForStarted(1000)) {
MessageManager::writeFlashing(
tr("Could not start process: %1.").arg(m_process->errorString()));
m_taskQueue.dequeue();
removeProcess();
runHeadCommand();
}
}
}
void ExecuteFilter::createProcess()
{
if (m_process)
return;
m_process = new Utils::QtcProcess();
m_process->setEnvironment(Utils::Environment::systemEnvironment());
connect(m_process, &QtcProcess::finished, this, &ExecuteFilter::finished);
connect(m_process, &QtcProcess::readyReadStandardOutput, this, &ExecuteFilter::readStandardOutput);
connect(m_process, &QtcProcess::readyReadStandardError, this, &ExecuteFilter::readStandardError);
}
void ExecuteFilter::removeProcess()
{
if (!m_process)
return;
m_taskQueue.dequeue();
m_process->disconnect();
if (m_process->state() == QProcess::NotRunning)
m_process->deleteLater();
else
Reaper::reap(m_process);
m_process = nullptr;
}
QString ExecuteFilter::headCommand() const
{
if (m_taskQueue.isEmpty())

View File

@@ -31,7 +31,6 @@
#include <QQueue>
#include <QStringList>
#include <QTimer>
#include <QTextCodec>
namespace Core {
@@ -49,6 +48,7 @@ class ExecuteFilter : public Core::ILocatorFilter
public:
ExecuteFilter();
~ExecuteFilter() override;
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future,
const QString &entry) override;
void accept(LocatorFilterEntry selection,
@@ -60,12 +60,14 @@ private:
void readStandardError();
void runHeadCommand();
void createProcess();
void removeProcess();
QString headCommand() const;
QQueue<ExecuteData> m_taskQueue;
QStringList m_commandHistory;
Utils::QtcProcess *m_process = nullptr;
QTimer m_runTimer;
QTextCodec::ConverterState m_stdoutState;
QTextCodec::ConverterState m_stderrState;
};

View File

@@ -318,7 +318,7 @@ void Locator::saveSettings() const
s->remove(QString());
s->setValue("RefreshInterval", refreshInterval());
for (ILocatorFilter *filter : m_filters) {
if (!m_customFilters.contains(filter)) {
if (!m_customFilters.contains(filter) && filter->id().isValid()) {
const QByteArray state = filter->saveState();
s->setValueWithDefault(filter->id().toString(), state);
}

View File

@@ -130,6 +130,7 @@ ProcessReapers::~ProcessReapers()
if (alreadyWaited < timeoutMs) {
const unsigned long toSleep = static_cast<unsigned long>(timeoutMs - alreadyWaited);
QThread::msleep(toSleep);
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
alreadyWaited += toSleep;
}

View File

@@ -151,7 +151,7 @@ static bool isUVisionExecutable(const QFileInfo &fileInfo)
return baseName == "UV4";
}
void DebuggerItem::reinitializeFromFile(const Environment &sysEnv)
void DebuggerItem::reinitializeFromFile(const Environment &sysEnv, QString *error)
{
// CDB only understands the single-dash -version, whereas GDB and LLDB are
// happy with both -version and --version. So use the "working" -version
@@ -190,12 +190,14 @@ void DebuggerItem::reinitializeFromFile(const Environment &sysEnv)
proc.setEnvironment(sysEnv);
proc.setCommand({m_command, {version}});
proc.runBlocking();
const QString output = proc.allOutput().trimmed();
if (proc.result() != QtcProcess::FinishedWithSuccess) {
if (error)
*error = output;
m_engineType = NoEngineType;
return;
}
m_abis.clear();
const QString output = proc.allOutput().trimmed();
if (output.contains("gdb")) {
m_engineType = GdbEngineType;
@@ -263,6 +265,8 @@ void DebuggerItem::reinitializeFromFile(const Environment &sysEnv)
m_engineType = PdbEngineType;
return;
}
if (error)
*error = output;
m_engineType = NoEngineType;
}

View File

@@ -98,7 +98,8 @@ public:
bool operator==(const DebuggerItem &other) const;
bool operator!=(const DebuggerItem &other) const { return !operator==(other); }
void reinitializeFromFile(const Utils::Environment &sysEnv = Utils::Environment::systemEnvironment());
void reinitializeFromFile(const Utils::Environment &sysEnv = Utils::Environment::systemEnvironment(),
QString *error = nullptr);
Utils::FilePath workingDirectory() const { return m_workingDirectory; }
void setWorkingDirectory(const Utils::FilePath &workingPath) { m_workingDirectory = workingPath; }

View File

@@ -314,6 +314,15 @@ DebuggerItemConfigWidget::DebuggerItemConfigWidget()
m_binaryChooser->setExpectedKind(PathChooser::ExistingCommand);
m_binaryChooser->setMinimumWidth(400);
m_binaryChooser->setHistoryCompleter("DebuggerPaths");
m_binaryChooser->setValidationFunction([this](FancyLineEdit *edit, QString *errorMessage) {
if (!m_binaryChooser->defaultValidationFunction()(edit, errorMessage))
return false;
DebuggerItem item;
item.setCommand(m_binaryChooser->filePath());
errorMessage->clear();
item.reinitializeFromFile({}, errorMessage);
return errorMessage->isEmpty();
});
m_workingDirectoryChooser = new PathChooser(this);
m_workingDirectoryChooser->setExpectedKind(PathChooser::Directory);

View File

@@ -26,6 +26,7 @@
#include "dockerdevice.h"
#include "dockerconstants.h"
#include "dockerplugin.h"
#include <extensionsystem/pluginmanager.h>
@@ -330,14 +331,6 @@ public:
QFileSystemWatcher m_mergedDirWatcher;
Environment m_cachedEnviroment;
enum LocalAccessState
{
NotEvaluated,
NoDaemon,
Accessible,
NotAccessible
} m_accessible = NotEvaluated;
};
class DockerDeviceWidget final : public IDeviceWidget
@@ -365,16 +358,15 @@ public:
auto daemonStateLabel = new QLabel(tr("Daemon state:"));
m_daemonReset = new QToolButton;
m_daemonReset->setIcon(Icons::INFO.icon());
m_daemonReset->setToolTip(tr("Clear detected daemon state. "
"It will be automatically re-evaluated next time an access is needed."));
m_daemonState = new QLabel(tr("Daemon state not evaluated."));
m_daemonState = new QLabel;
updateDaemonStateTexts();
connect(m_daemonReset, &QToolButton::clicked, this, [this, dockerDevice] {
dockerDevice->resetDaemonState();
m_daemonReset->setIcon(Icons::INFO.icon());
m_daemonState->setText(tr("Daemon state not evaluated."));
DockerPlugin::setGlobalDaemonState(Utils::nullopt);
updateDaemonStateTexts();
});
m_runAsOutsideUser = new QCheckBox(tr("Run as outside user"));
@@ -411,16 +403,11 @@ public:
dockerDevice->tryCreateLocalFileAccess();
m_kitItemDetector.autoDetect(id);
if (!dockerDevice->isDaemonRunning()) {
if (DockerPlugin::isDaemonRunning().value_or(false) == false)
logView->append(tr("Docker daemon appears to be not running."));
m_daemonState->setText(tr("Docker daemon not running."));
m_daemonReset->setIcon(Icons::CRITICAL.icon());
} else {
else
logView->append(tr("Docker daemon appears to be running."));
m_daemonState->setText(tr("Docker daemon running."));
m_daemonReset->setIcon(Icons::OK.icon());
}
updateDaemonStateTexts();
});
connect(undoAutoDetectButton, &QPushButton::clicked, this, [this, logView, id = data.id()] {
@@ -451,6 +438,7 @@ public:
}
void updateDeviceFromUi() final {}
void updateDaemonStateTexts();
private:
QLineEdit *m_idLineEdit;
@@ -754,7 +742,7 @@ void DockerDevice::tryCreateLocalFileAccess() const
void DockerDevicePrivate::stopCurrentContainer()
{
if (m_container.isEmpty() || m_accessible == NoDaemon)
if (m_container.isEmpty() || !DockerPlugin::isDaemonRunning().value_or(false))
return;
if (m_shell) {
@@ -822,7 +810,7 @@ void DockerDevicePrivate::startContainer()
// negative exit codes indicate problems like no docker daemon, missing permissions,
// no shell and seem to result in exit codes 125+
if (m_shell->exitCode() > 120) {
m_accessible = NoDaemon;
DockerPlugin::setGlobalDaemonState(false);
LOG("DOCKER DAEMON NOT RUNNING?");
MessageManager::writeFlashing(tr("Docker Daemon appears to be not running. "
"Verify daemon is up and running and reset the "
@@ -837,6 +825,7 @@ void DockerDevicePrivate::startContainer()
m_shell->waitForStarted();
if (m_shell->state() != QProcess::Running) {
DockerPlugin::setGlobalDaemonState(false);
LOG("DOCKER SHELL FAILED");
return;
}
@@ -851,22 +840,24 @@ void DockerDevicePrivate::startContainer()
break;
}
}
if (i == 20 || m_accessible == NoDaemon) {
if (i == 20 || !DockerPlugin::isDaemonRunning().value_or(true)) {
qWarning("Docker cid file empty.");
return; // No
}
qApp->processEvents(); // FIXME turn this for-loop into QEventLoop
qApp->processEvents(); // FIXME turn this for-loop into
QThread::msleep(100);
}
DockerPlugin::setGlobalDaemonState(true);
}
void DockerDevicePrivate::tryCreateLocalFileAccess()
{
if (!m_container.isEmpty() || m_accessible == NoDaemon)
if (!m_container.isEmpty() || DockerPlugin::isDaemonRunning().value_or(true) == false)
return;
startContainer();
if (!DockerPlugin::isDaemonRunning().value_or(false))
return;
QtcProcess proc;
proc.setCommand({"docker", {"inspect", "--format={{.GraphDriver.Data.MergedDir}}", m_container}});
LOG(proc.commandLine().toUserOutput());
@@ -890,13 +881,11 @@ void DockerDevicePrivate::tryCreateLocalFileAccess()
// of using wsl or a named pipe.
// TODO investigate how to make it possible nevertheless.
m_mergedDir.clear();
m_accessible = NotAccessible;
MessageManager::writeSilently(tr("This is expected on Windows."));
return;
}
}
m_accessible = Accessible;
m_mergedDirWatcher.addPath(m_mergedDir);
}
@@ -905,24 +894,6 @@ bool DockerDevice::hasLocalFileAccess() const
return !d->m_mergedDir.isEmpty();
}
bool DockerDevice::isDaemonRunning() const
{
switch (d->m_accessible) {
case DockerDevicePrivate::NoDaemon:
return false;
case DockerDevicePrivate::NotEvaluated: // FIXME?
case DockerDevicePrivate::Accessible:
case DockerDevicePrivate::NotAccessible:
return true;
}
return false;
}
void DockerDevice::resetDaemonState()
{
d->m_accessible = DockerDevicePrivate::NotEvaluated;
}
void DockerDevice::setMounts(const QStringList &mounts) const
{
d->m_data.mounts = mounts;
@@ -1343,7 +1314,7 @@ static FilePaths filterEntriesHelper(const FilePath &base,
if (match.hasMatch())
return true;
}
return false;
return nameRegexps.isEmpty();
};
// FIXME: Handle sort and filters. For now bark on unsupported options.
@@ -1436,7 +1407,9 @@ bool DockerDevice::writeFileContents(const FilePath &filePath, const QByteArray
void DockerDevice::runProcess(QtcProcess &process) const
{
tryCreateLocalFileAccess();
if (d->m_container.isEmpty() || d->m_accessible == DockerDevicePrivate::NoDaemon) {
if (!DockerPlugin::isDaemonRunning().value_or(false))
return;
if (d->m_container.isEmpty()) {
LOG("No container set to run " << process.commandLine().toUserOutput());
QTC_CHECK(false);
process.setResult(QtcProcess::StartFailed);
@@ -1452,7 +1425,7 @@ void DockerDevice::runProcess(QtcProcess &process) const
cmd.addArgs({"-w", workingDir.path()});
if (process.processMode() == ProcessMode::Writer)
cmd.addArg("-i");
if (env.size() != 0 && d->m_accessible != DockerDevicePrivate::Accessible) {
if (env.size() != 0 && hasLocalFileAccess()) {
process.unsetEnvironment();
// FIXME the below would be probably correct if the respective tools would use correct
// environment already, but most are using the host environment which usually makes
@@ -1502,7 +1475,7 @@ void DockerDevicePrivate::fetchSystemEnviroment()
bool DockerDevicePrivate::runInContainer(const CommandLine &cmd) const
{
if (m_accessible == NoDaemon)
if (!DockerPlugin::isDaemonRunning().value_or(false))
return false;
CommandLine dcmd{"docker", {"exec", m_container}};
dcmd.addArgs(cmd);
@@ -1520,7 +1493,7 @@ bool DockerDevicePrivate::runInContainer(const CommandLine &cmd) const
bool DockerDevicePrivate::runInShell(const CommandLine &cmd) const
{
if (m_accessible == NoDaemon)
if (!DockerPlugin::isDaemonRunning().value_or(false))
return false;
QTC_ASSERT(m_shell, return false);
QMutexLocker l(&m_shellMutex);
@@ -1542,7 +1515,7 @@ static QByteArray randomHex()
QString DockerDevicePrivate::outputForRunInShell(const CommandLine &cmd) const
{
if (m_accessible == NoDaemon)
if (!DockerPlugin::isDaemonRunning().value_or(false))
return {};
QTC_ASSERT(m_shell, return {});
QMutexLocker l(&m_shellMutex);
@@ -1707,5 +1680,20 @@ IDevice::Ptr DockerDeviceFactory::create() const
return wizard.device();
}
void DockerDeviceWidget::updateDaemonStateTexts()
{
Utils::optional<bool> daemonState = DockerPlugin::isDaemonRunning();
if (!daemonState.has_value()) {
m_daemonReset->setIcon(Icons::INFO.icon());
m_daemonState->setText(tr("Daemon state not evaluated."));
} else if (daemonState.value()) {
m_daemonReset->setIcon(Icons::OK.icon());
m_daemonState->setText(tr("Docker daemon running."));
} else {
m_daemonReset->setIcon(Icons::CRITICAL.icon());
m_daemonState->setText(tr("Docker daemon not running."));
}
}
} // Internal
} // Docker

View File

@@ -109,8 +109,6 @@ public:
void tryCreateLocalFileAccess() const;
bool hasLocalFileAccess() const;
bool isDaemonRunning() const;
void resetDaemonState();
void setMounts(const QStringList &mounts) const;
Utils::FilePath mapToLocalAccess(const Utils::FilePath &filePath) const;

View File

@@ -58,10 +58,31 @@ public:
// };
// DockerBuildStepFactory buildStepFactory;
Utils::optional<bool> daemonRunning;
};
static DockerPlugin *s_instance = nullptr;
DockerPlugin::DockerPlugin()
{
s_instance = this;
}
// Utils::null_opt for not evaluated, true or false if it had been evaluated already
Utils::optional<bool> DockerPlugin::isDaemonRunning()
{
return s_instance ? s_instance->d->daemonRunning : Utils::nullopt;
}
void DockerPlugin::setGlobalDaemonState(Utils::optional<bool> state)
{
QTC_ASSERT(s_instance, return);
s_instance->d->daemonRunning = state;
}
DockerPlugin::~DockerPlugin()
{
s_instance = nullptr;
delete d;
}

View File

@@ -27,6 +27,8 @@
#include <extensionsystem/iplugin.h>
#include <utils/optional.h>
namespace Docker {
namespace Internal {
@@ -34,6 +36,11 @@ class DockerPlugin final : public ExtensionSystem::IPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Docker.json")
public:
DockerPlugin();
static Utils::optional<bool> isDaemonRunning();
static void setGlobalDaemonState(Utils::optional<bool> state);
private:
~DockerPlugin() final;

View File

@@ -85,7 +85,7 @@ Client::Client(BaseClientInterface *clientInterface)
, m_documentSymbolCache(this)
, m_hoverHandler(this)
, m_symbolSupport(this)
, m_tokentSupport(this)
, m_tokenSupport(this)
{
m_clientProviders.completionAssistProvider = new LanguageClientCompletionAssistProvider(this);
m_clientProviders.functionHintProvider = new FunctionHintAssistProvider(this);
@@ -106,8 +106,8 @@ Client::Client(BaseClientInterface *clientInterface)
this,
&Client::rehighlight);
m_tokentSupport.setTokenTypesMap(SemanticTokens::defaultTokenTypesMap());
m_tokentSupport.setTokenModifiersMap(SemanticTokens::defaultTokenModifiersMap());
m_tokenSupport.setTokenTypesMap(SemanticTokens::defaultTokenTypesMap());
m_tokenSupport.setTokenModifiersMap(SemanticTokens::defaultTokenModifiersMap());
}
QString Client::name() const
@@ -557,7 +557,7 @@ void Client::activateDocument(TextEditor::TextDocument *document)
auto uri = DocumentUri::fromFilePath(filePath);
m_diagnosticManager.showDiagnostics(uri, m_documentVersions.value(filePath));
SemanticHighligtingSupport::applyHighlight(document, m_highlights.value(uri), capabilities());
m_tokentSupport.updateSemanticTokens(document);
m_tokenSupport.updateSemanticTokens(document);
// only replace the assist provider if the language server support it
updateCompletionProvider(document);
updateFunctionHintProvider(document);
@@ -742,9 +742,9 @@ void Client::registerCapabilities(const QList<Registration> &registrations)
if (registration.method() == "textDocument/semanticTokens") {
SemanticTokensOptions options(registration.registerOptions());
if (options.isValid())
m_tokentSupport.setLegend(options.legend());
m_tokenSupport.setLegend(options.legend());
for (auto document : m_openedDocument.keys())
m_tokentSupport.updateSemanticTokens(document);
m_tokenSupport.updateSemanticTokens(document);
}
}
emit capabilitiesChanged(m_dynamicCapabilities);
@@ -764,7 +764,7 @@ void Client::unregisterCapabilities(const QList<Unregistration> &unregistrations
}
if (unregistration.method() == "textDocument/semanticTokens") {
for (auto document : m_openedDocument.keys())
m_tokentSupport.updateSemanticTokens(document);
m_tokenSupport.updateSemanticTokens(document);
}
}
emit capabilitiesChanged(m_dynamicCapabilities);
@@ -1009,7 +1009,7 @@ void Client::setDiagnosticsHandlers(const TextMarkCreator &textMarkCreator,
void Client::setSemanticTokensHandler(const SemanticTokensHandler &handler)
{
m_tokentSupport.setTokensHandler(handler);
m_tokenSupport.setTokensHandler(handler);
}
void Client::setSymbolStringifier(const LanguageServerProtocol::SymbolStringifier &stringifier)
@@ -1197,7 +1197,7 @@ void Client::sendPostponedDocumentUpdates()
if (currentWidget && currentWidget->textDocument() == update.document)
requestDocumentHighlights(currentWidget);
m_tokentSupport.updateSemanticTokens(update.document);
m_tokenSupport.updateSemanticTokens(update.document);
}
}
@@ -1354,6 +1354,7 @@ void Client::handleSemanticHighlight(const SemanticHighlightingParams &params)
void Client::rehighlight()
{
using namespace TextEditor;
m_tokenSupport.rehighlight();
for (auto it = m_highlights.begin(), end = m_highlights.end(); it != end; ++it) {
if (TextDocument *doc = TextDocument::textDocumentForFilePath(it.key().toFilePath())) {
if (LanguageClientManager::clientForDocument(doc) == this)
@@ -1436,7 +1437,7 @@ void Client::initializeCallback(const InitializeRequest::Response &initResponse)
auto tokenProvider = m_serverCapabilities.semanticTokensProvider().value_or(
SemanticTokensOptions());
if (tokenProvider.isValid())
m_tokentSupport.setLegend(tokenProvider.legend());
m_tokenSupport.setLegend(tokenProvider.legend());
qCDebug(LOGLSPCLIENT) << "language server " << m_displayName << " initialized";
m_state = Initialized;

View File

@@ -276,7 +276,7 @@ private:
SymbolSupport m_symbolSupport;
ProgressManager m_progressManager;
bool m_activateDocAutomatically = false;
SemanticTokenSupport m_tokentSupport;
SemanticTokenSupport m_tokenSupport;
QString m_serverName;
QString m_serverVersion;
LanguageServerProtocol::SymbolStringifier m_symbolStringifier;

View File

@@ -40,7 +40,7 @@ namespace LanguageClient {
class LspLogMessage
{
public:
enum MessageSender { ClientMessage, ServerMessage } sender;
enum MessageSender { ClientMessage, ServerMessage } sender = ClientMessage;
LspLogMessage();
LspLogMessage(MessageSender sender,

View File

@@ -374,9 +374,10 @@ void SemanticTokenSupport::handleSemanticTokens(const Utils::FilePath &filePath,
if (auto tokens = Utils::get_if<SemanticTokens>(&result)) {
m_tokens[filePath] = *tokens;
highlight(filePath);
}
} else {
m_tokens.remove(filePath);
}
}
void SemanticTokenSupport::handleSemanticTokensDelta(
const Utils::FilePath &filePath, const LanguageServerProtocol::SemanticTokensDeltaResult &result)

View File

@@ -49,6 +49,7 @@ if(${Qt5_VERSION} VERSION_LESS "6.2.0")
)
else() # < Qt 6.2
add_qtc_plugin(PerfProfiler
CONDITION TARGET Tracing
DEPENDS Tracing Qt5::QuickWidgets
PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport
SOURCES

View File

@@ -134,22 +134,18 @@ void BuildDirectoryAspect::addToLayout(LayoutBuilder &builder)
FilePath BuildDirectoryAspect::fixupDir(const FilePath &dir)
{
if (dir.needsDevice() || !HostOsInfo::isWindowsHost())
if (!dir.startsWithDriveLetter())
return {};
const QString dirString = dir.toString().toLower();
if (dirString.length() < 2)
return {};
if (!dirString.at(0).isLetter())
return {};
const QStringList drives = Utils::transform(QDir::drives(), [](const QFileInfo &fi) {
return fi.absoluteFilePath().toLower().chopped(1);
});
if (!Utils::contains(drives, [&dirString](const QString &drive) {
return dirString.startsWith(drive);
}) && !drives.isEmpty()) {
QString newDir = dirString;
QString newDir = dir.path();
newDir.replace(0, 2, drives.first());
return FilePath::fromString(newDir);
return dir.withNewPath(newDir);
}
return {};
}

View File

@@ -58,6 +58,7 @@
#include <QFileInfo>
#include <QFile>
#include <QPixmap>
#include <QTimer>
#include <coreplugin/messagebox.h>
@@ -646,6 +647,7 @@ void NavigatorTreeModel::handleItemLibraryItemDrop(const QMimeData *mimeData, in
return;
bool validContainer = false;
bool showMatToCompInfo = false;
QmlObjectNode newQmlObjectNode;
m_view->executeInTransaction("NavigatorTreeModel::handleItemLibraryItemDrop", [&] {
newQmlObjectNode = QmlItemNode::createQmlObjectNode(m_view, itemLibraryEntry, QPointF(), targetProperty, false);
@@ -692,6 +694,11 @@ void NavigatorTreeModel::handleItemLibraryItemDrop(const QMimeData *mimeData, in
targetModel = targetProperty.parentModelNode();
insertIntoList("materials", targetModel);
validContainer = true;
} else if (targetProperty.parentModelNode().isSubclassOf("QtQuick3D.Node")
&& targetProperty.parentModelNode().isComponent()) {
// Inserting materials under imported components is likely a mistake, so
// notify user with a helpful messagebox that suggests the correct action.
showMatToCompInfo = true;
}
} else {
const bool isShader = newModelNode.isSubclassOf("QtQuick3D.Shader");
@@ -722,6 +729,7 @@ void NavigatorTreeModel::handleItemLibraryItemDrop(const QMimeData *mimeData, in
}
}
if (!validContainer) {
if (!showMatToCompInfo)
validContainer = NodeHints::fromModelNode(targetProperty.parentModelNode()).canBeContainerFor(newModelNode);
if (!validContainer)
newQmlObjectNode.destroy();
@@ -755,6 +763,30 @@ void NavigatorTreeModel::handleItemLibraryItemDrop(const QMimeData *mimeData, in
}
}
}
if (showMatToCompInfo) {
QMessageBox::StandardButton selectedButton = QMessageBox::information(
Core::ICore::dialogParent(),
QCoreApplication::translate("NavigatorTreeModel", "Warning"),
QCoreApplication::translate(
"NavigatorTreeModel",
"Inserting materials under imported 3D component nodes is not supported. "
"Materials used in imported 3D components have to be modified inside the component itself.\n\n"
"Would you like to go into component '%1'?")
.arg(targetProperty.parentModelNode().id()),
QMessageBox::Yes | QMessageBox::No,
QMessageBox::No);
if (selectedButton == QMessageBox::Yes) {
qint32 internalId = targetProperty.parentModelNode().internalId();
QTimer::singleShot(0, this, [internalId, this]() {
if (!m_view.isNull() && m_view->model()) {
ModelNode node = m_view->modelNodeForInternalId(internalId);
if (node.isValid() && node.isComponent())
DocumentManager::goIntoComponent(node);
}
});
}
}
}
}
@@ -1041,6 +1073,7 @@ void NavigatorTreeModel::moveNodesInteractive(NodeAbstractProperty &parentProper
bool nodeCanBeMovedToParentProperty = removeModelNodeFromNodeProperty(parentProperty, modelNode);
if (nodeCanBeMovedToParentProperty) {
reparentModelNodeToNodeProperty(parentProperty, modelNode);
if (targetIndex > 0)
slideModelNodeInList(parentProperty, modelNode, idx++);
}
}

View File

@@ -400,10 +400,9 @@ void PuppetCreator::createQml2PuppetExecutableIfMissing()
m_qml2PuppetForKitPuppetHash.insert(m_target->id(), m_availablePuppetType);
}
}
} else if (m_target->kit()->isValid()) {
} else if (m_target && m_target->kit() && m_target->kit()->isValid()) {
if (pathForBinPuppet(m_target).isExecutableFile())
m_availablePuppetType = BinPathPuppet;
}
}

View File

@@ -668,7 +668,7 @@ bool QmlFlowItemNode::isValidQmlFlowItemNode(const ModelNode &modelNode)
QList<QmlFlowActionAreaNode> QmlFlowItemNode::flowActionAreas() const
{
QList<QmlFlowActionAreaNode> list;
for (const ModelNode &node : allDirectSubModelNodes())
for (const ModelNode node : allDirectSubModelNodes())
if (QmlFlowActionAreaNode::isValidQmlFlowActionAreaNode(node))
list.append(node);
return list;
@@ -751,7 +751,7 @@ bool QmlFlowViewNode::isValidQmlFlowViewNode(const ModelNode &modelNode)
QList<QmlFlowItemNode> QmlFlowViewNode::flowItems() const
{
QList<QmlFlowItemNode> list;
for (const ModelNode &node : allDirectSubModelNodes())
for (const ModelNode node : allDirectSubModelNodes())
if (QmlFlowItemNode::isValidQmlFlowItemNode(node)
|| QmlVisualNode::isFlowDecision(node)
|| QmlVisualNode::isFlowWildcard(node))

View File

@@ -168,7 +168,7 @@ QString ComponentNameDialog::isValid() const
if (!ui->pathEdit->isValid())
return tr("Invalid path.");
if (QDir(ui->pathEdit->path()).exists(compName + u".qml"))
if (QDir(ui->pathEdit->path()).exists(compName + ".qml"))
return tr("Component already exists.");
return QString();

View File

@@ -79,7 +79,10 @@ if(${Qt5_VERSION} VERSION_LESS "6.2.0")
qml/qmlprofiler.qrc
)
else() # < Qt 6.2
find_package(Qt6 COMPONENTS ShaderTools QUIET)
add_qtc_plugin(QmlProfiler
CONDITION TARGET Tracing AND TARGET Qt6::ShaderTools
DEPENDS QmlDebug QmlJS Tracing Qt5::QuickWidgets
PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport TextEditor
SOURCES
@@ -94,16 +97,20 @@ else() # < Qt 6.2
qml/QmlProfilerFlameGraphView.qml
)
set(QMLPROFILER_QML_RESOURCES
qml/bindingloops.frag
qml/bindingloops.vert
)
foreach(file IN LISTS QMLPROFILER_QML_FILES QMLPROFILER_QML_RESOURCES)
foreach(file IN LISTS QMLPROFILER_QML_FILES)
get_filename_component(fileName "${file}" NAME)
set_source_files_properties("${file}" PROPERTIES QT_RESOURCE_ALIAS "${fileName}")
endforeach()
qt_add_shaders(QmlProfiler "res_qmlprofilershaders"
BATCHABLE
PREFIX
"/QtCreator/QmlProfiler"
FILES
qml/bindingloops_qt6.frag
qml/bindingloops_qt6.vert
)
qt_add_qml_module(QmlProfiler
URI "QtCreator.QmlProfiler"
VERSION "1.0"

View File

@@ -0,0 +1,36 @@
/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#version 440
layout (location = 0) in vec4 color;
layout (location = 0) out vec4 fragColor;
void main()
{
fragColor.rgb = color.rgb;
fragColor.a = 1.0;
}

View File

@@ -0,0 +1,46 @@
/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#version 440
layout (location = 0) in vec4 vertexCoord;
layout (location = 1) in vec2 postScaleOffset;
layout (std140, binding = 0) uniform Block {
uniform mat4 matrix;
uniform vec4 bindingLoopsColor;
} block;
layout (location = 0) out vec4 color;
void main()
{
gl_Position = block.matrix * vertexCoord;
gl_Position.x += postScaleOffset.x * 0.005;
gl_Position.y += postScaleOffset.y * 0.01;
gl_Position.z -= 0.1;
gl_Position.w = 1.0;
color = block.bindingLoopsColor;
}

View File

@@ -37,7 +37,7 @@ public:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QSGMaterialShader *createShader() const override;
#else
QSGMaterialShader *createShader(QSGRendererInterface::RenderMode renderMode) const override;
QSGMaterialShader *createShader(QSGRendererInterface::RenderMode) const override;
#endif // < Qt 6
BindingLoopMaterial();
};
@@ -66,7 +66,8 @@ private:
};
struct Point2DWithOffset {
float x, y, x2, y2;
float x, y; // vec4 vertexCoord
float x2, y2; // vec2 postScaleOffset
void set(float nx, float ny, float nx2, float ny2);
};
@@ -199,12 +200,16 @@ Timeline::TimelineRenderPass::State *QmlProfilerBindingLoopsRenderPass::update(
const QSGGeometry::AttributeSet &BindlingLoopsGeometry::point2DWithOffset()
{
static QSGGeometry::Attribute data[] = {
QSGGeometry::Attribute::create(0, 2, QSGGeometry::FloatType, true),
QSGGeometry::Attribute::create(1, 2, QSGGeometry::FloatType),
static const QSGGeometry::Attribute data[] = {
// vec4 vertexCoord
QSGGeometry::Attribute::createWithAttributeType(0, 2, QSGGeometry::FloatType,
QSGGeometry::PositionAttribute),
// vec2 postScaleOffset
QSGGeometry::Attribute::createWithAttributeType(1, 2, QSGGeometry::FloatType,
QSGGeometry::UnknownAttribute),
};
static QSGGeometry::AttributeSet attrs = {
2,
static const QSGGeometry::AttributeSet attrs = {
sizeof(data) / sizeof(data[0]),
sizeof(Point2DWithOffset),
data
};
@@ -299,18 +304,17 @@ public:
QSGMaterial *oldEffect) override;
char const *const *attributeNames() const override;
#else // < Qt 6
bool updateUniformData(RenderState &state, QSGMaterial *newEffect,
QSGMaterial *oldEffect) override;
bool updateUniformData(RenderState &state, QSGMaterial *, QSGMaterial *) override;
#endif // < Qt 6
private:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void initialize() override;
#endif // < Qt 6
int m_matrix_id = 0;
int m_z_range_id = 0;
int m_color_id = 0;
#endif // < Qt 6
};
BindingLoopMaterialShader::BindingLoopMaterialShader()
@@ -322,31 +326,42 @@ BindingLoopMaterialShader::BindingLoopMaterialShader()
setShaderSourceFile(QOpenGLShader::Fragment,
QStringLiteral(":/QtCreator/QmlProfiler/bindingloops.frag"));
#else // < Qt 6
setShaderFileName(VertexStage, ":/QtCreator/QmlProfiler/bindingloops.vert");
setShaderFileName(FragmentStage, ":/QtCreator/QmlProfiler/bindingloops.frag");
setShaderFileName(VertexStage, ":/QtCreator/QmlProfiler/bindingloops_qt6.vert.qsb");
setShaderFileName(FragmentStage, ":/QtCreator/QmlProfiler/bindingloops_qt6.frag.qsb");
#endif // < Qt 6
}
static QColor bindingLoopsColor()
{
return Utils::creatorTheme()->color(Utils::Theme::Timeline_HighlightColor);
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void BindingLoopMaterialShader::updateState(const RenderState &state, QSGMaterial *, QSGMaterial *)
{
if (state.isMatrixDirty()) {
program()->setUniformValue(m_matrix_id, state.combinedMatrix());
program()->setUniformValue(m_z_range_id, GLfloat(1.0));
program()->setUniformValue(
m_color_id,
Utils::creatorTheme()->color(Utils::Theme::Timeline_HighlightColor));
program()->setUniformValue(m_color_id, bindingLoopsColor());
}
}
#else // < Qt 6
bool BindingLoopMaterialShader::updateUniformData(RenderState &state,
QSGMaterial *newMaterial, QSGMaterial *)
bool BindingLoopMaterialShader::updateUniformData(RenderState &state, QSGMaterial *, QSGMaterial *)
{
// TODO: Make this work
QByteArray *buf = state.uniformData();
// mat4 matrix
if (state.isMatrixDirty()) {
BindingLoopMaterial *material = static_cast<BindingLoopMaterial *>(newMaterial);
const QMatrix4x4 m = state.combinedMatrix();
memcpy(buf->data(), m.constData(), 64);
}
return state.isMatrixDirty();
// vec4 bindingLoopsColor
const QColor color = bindingLoopsColor();
const float colorArray[] = { color.redF(), color.greenF(), color.blueF(), color.alphaF() };
memcpy(buf->data() + 64, colorArray, 16);
return true;
}
#endif // < Qt 6
@@ -368,6 +383,9 @@ void BindingLoopMaterialShader::initialize()
BindingLoopMaterial::BindingLoopMaterial()
{
setFlag(QSGMaterial::Blending, false);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
setFlag(QSGMaterial::CustomCompileStep, true);
#endif // >= Qt 6
}
QSGMaterialType *BindingLoopMaterial::type() const
@@ -378,17 +396,12 @@ QSGMaterialType *BindingLoopMaterial::type() const
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QSGMaterialShader *BindingLoopMaterial::createShader() const
{
return new BindingLoopMaterialShader;
}
#else // < Qt 6
QSGMaterialShader *BindingLoopMaterial::createShader(
QSGRendererInterface::RenderMode renderMode) const
QSGMaterialShader *BindingLoopMaterial::createShader(QSGRendererInterface::RenderMode) const
#endif // < Qt 6
{
Q_UNUSED(renderMode);
return new BindingLoopMaterialShader;
}
#endif // < Qt 6
void Point2DWithOffset::set(float nx, float ny, float nx2, float ny2)
{

View File

@@ -73,6 +73,23 @@ Q_LOGGING_CATEGORY(infoLogger, "QmlProjectManager.QmlBuildSystem", QtInfoMsg)
namespace QmlProjectManager {
static bool isQtDesignStudio()
{
QSettings *settings = Core::ICore::settings();
const QString qdsStandaloneEntry = "QML/Designer/StandAloneMode"; //entry from qml settings
return settings->value(qdsStandaloneEntry, false).toBool();
}
static int preferedQtTarget(Target *target)
{
if (target) {
const QmlBuildSystem *buildSystem = qobject_cast<QmlBuildSystem *>(target->buildSystem());
if (buildSystem && buildSystem->qt6Project())
return 6;
}
return 5;
}
const char openInQDSAppSetting[] = "OpenInQDSApp";
static void openQDS(const QString &qdsPath, const Utils::FilePath &fileName)
@@ -102,12 +119,9 @@ QmlProject::QmlProject(const Utils::FilePath &fileName)
setBuildSystemCreator([](Target *t) { return new QmlBuildSystem(t); });
QSettings *settings = Core::ICore::settings();
const QString qdsStandaloneEntry = "QML/Designer/StandAloneMode"; //entry from qml settings
const QString qdsInstallationEntry = "QML/Designer/DesignStudioInstallation"; //set in installer
const bool isDesigner = settings->value(qdsStandaloneEntry, false).toBool();
if (!isDesigner) {
if (!isQtDesignStudio()) {
const QString qdsPath = settings->value(qdsInstallationEntry).toString();
const bool foundQDS = Utils::FilePath::fromString(qdsPath).exists();
@@ -407,7 +421,9 @@ Project::RestoreResult QmlProject::fromMap(const QVariantMap &map, QString *erro
if (!activeTarget()) {
// find a kit that matches prerequisites (prefer default one)
const QList<Kit *> kits = Utils::filtered(KitManager::kits(), [this](const Kit *k) {
return !containsType(projectIssues(k), Task::TaskType::Error);
return !containsType(projectIssues(k), Task::TaskType::Error)
&& DeviceTypeKitAspect::deviceTypeId(k)
== ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE;
});
if (!kits.isEmpty()) {
@@ -416,6 +432,29 @@ Project::RestoreResult QmlProject::fromMap(const QVariantMap &map, QString *erro
else
addTargetForKit(kits.first());
}
if (isQtDesignStudio()) {
auto setKitWithVersion = [&](int qtMajorVersion) {
const QList<Kit *> qtVersionkits
= Utils::filtered(kits, [qtMajorVersion](const Kit *k) {
QtSupport::BaseQtVersion *version = QtSupport::QtKitAspect::qtVersion(k);
return (version && version->qtVersion().majorVersion == qtMajorVersion);
});
if (!qtVersionkits.isEmpty()) {
if (qtVersionkits.contains(KitManager::defaultKit()))
addTargetForDefaultKit();
else
addTargetForKit(qtVersionkits.first());
}
};
int preferedVersion = preferedQtTarget(activeTarget());
if (activeTarget())
removeTarget(activeTarget());
setKitWithVersion(preferedVersion);
}
}
return RestoreResult::Ok;

View File

@@ -34,12 +34,14 @@
#include <coreplugin/icore.h>
#include <coreplugin/idocument.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/runcontrol.h>
#include <projectexplorer/runconfigurationaspects.h>
#include <projectexplorer/target.h>
#include <projectexplorer/environmentaspect.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/kitmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/runconfigurationaspects.h>
#include <projectexplorer/runcontrol.h>
#include <projectexplorer/session.h>
#include <projectexplorer/target.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
@@ -64,6 +66,14 @@ namespace Internal {
// QmlProjectRunConfiguration
static bool isQtDesignStudio()
{
QSettings *settings = Core::ICore::settings();
const QString qdsStandaloneEntry = "QML/Designer/StandAloneMode"; //entry from qml settings
return settings->value(qdsStandaloneEntry, false).toBool();
}
class QmlProjectRunConfiguration final : public RunConfiguration
{
Q_DECLARE_TR_FUNCTIONS(QmlProjectManager::QmlProjectRunConfiguration)
@@ -78,10 +88,12 @@ private:
QString mainScript() const;
FilePath qmlRuntimeFilePath() const;
QString commandLineArguments() const;
void createQtVersionAspect();
StringAspect *m_qmlViewerAspect = nullptr;
QmlMainFileAspect *m_qmlMainFileAspect = nullptr;
QmlMultiLanguageAspect *m_multiLanguageAspect = nullptr;
SelectionAspect *m_qtversionAspect = nullptr;
};
QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id)
@@ -103,6 +115,8 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id)
m_qmlMainFileAspect = addAspect<QmlMainFileAspect>(target);
connect(m_qmlMainFileAspect, &QmlMainFileAspect::changed, this, &RunConfiguration::update);
createQtVersionAspect();
connect(target, &Target::kitChanged, this, &RunConfiguration::update);
m_multiLanguageAspect = addAspect<QmlMultiLanguageAspect>(target);
@@ -223,6 +237,70 @@ QString QmlProjectRunConfiguration::commandLineArguments() const
return args;
}
void QmlProjectRunConfiguration::createQtVersionAspect()
{
if (!isQtDesignStudio())
return;
m_qtversionAspect = addAspect<SelectionAspect>();
m_qtversionAspect->setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox);
m_qtversionAspect->setLabelText(tr("Qt Version:"));
m_qtversionAspect->setSettingsKey("QmlProjectManager.kit");
Kit *kit = target()->kit();
BaseQtVersion *version = QtKitAspect::qtVersion(kit);
if (version) {
const QmlBuildSystem *buildSystem = qobject_cast<QmlBuildSystem *>(target()->buildSystem());
const bool isQt6Project = buildSystem && buildSystem->qt6Project();
if (isQt6Project) {
m_qtversionAspect->addOption(tr("Qt 6"));
m_qtversionAspect->setReadOnly(true);
} else { /* Only if this is not a Qt 6 project changing kits makes sense */
m_qtversionAspect->addOption(tr("Qt 5"));
m_qtversionAspect->addOption(tr("Qt 6"));
const int valueForVersion = version->qtVersion().majorVersion == 6 ? 1 : 0;
m_qtversionAspect->setValue(valueForVersion);
connect(m_qtversionAspect, &SelectionAspect::changed, this, [&]() {
QTC_ASSERT(target(), return );
auto project = target()->project();
QTC_ASSERT(project, return );
int oldValue = !m_qtversionAspect->value();
const int preferedQtVersion = m_qtversionAspect->value() > 0 ? 6 : 5;
Kit *currentKit = target()->kit();
const QList<Kit *> kits = Utils::filtered(KitManager::kits(), [&](const Kit *k) {
QtSupport::BaseQtVersion *version = QtSupport::QtKitAspect::qtVersion(k);
return (version && version->qtVersion().majorVersion == preferedQtVersion)
&& DeviceTypeKitAspect::deviceTypeId(k)
== ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE;
});
if (kits.contains(currentKit))
return;
if (!kits.isEmpty()) {
auto newTarget = target()->project()->target(kits.first());
if (!newTarget)
newTarget = project->addTargetForKit(kits.first());
SessionManager::setActiveTarget(project, newTarget, SetActive::Cascade);
/* Reset the aspect. We changed the target and this aspect should not change. */
m_qtversionAspect->blockSignals(true);
m_qtversionAspect->setValue(oldValue);
m_qtversionAspect->blockSignals(false);
}
});
}
}
}
bool QmlProjectRunConfiguration::isEnabled() const
{
return m_qmlMainFileAspect->isQmlFilePresent() && !commandLine().executable().isEmpty()

View File

@@ -934,6 +934,7 @@ QString BaseQtVersion::toHtml(bool verbose) const
str << "<td>" << abis.at(i).toString() << "</td></tr>";
}
}
const OsType osType = d->m_qmakeCommand.osType();
str << "<tr><td><b>" << QCoreApplication::translate("BaseQtVersion", "Source:")
<< "</b></td><td>" << sourcePath().toUserOutput() << "</td></tr>";
str << "<tr><td><b>" << QCoreApplication::translate("BaseQtVersion", "mkspec:")
@@ -977,7 +978,7 @@ QString BaseQtVersion::toHtml(bool verbose) const
isPath = false;
if (isPath) {
str << "<a href=\"" << QUrl::fromLocalFile(value).toString()
<< "\">" << QDir::toNativeSeparators(value) << "</a>";
<< "\">" << OsSpecificAspects::pathWithNativeSeparators(osType, value) << "</a>";
} else {
str << value;
}

View File

@@ -29,6 +29,7 @@
#include <coreplugin/progressmanager/progressmanager.h>
#include <texteditor/findinfiles.h>
#include <utils/algorithm.h>
#include <utils/environment.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <utils/runextensions.h>
@@ -83,10 +84,20 @@ QString convertWildcardToRegex(const QString &wildcard)
return regex;
}
QString silverSearcherExecutable()
{
return Utils::Environment::systemEnvironment().searchInPath("ag").toString();
}
bool isSilverSearcherAvailable()
{
const QString exe = silverSearcherExecutable();
if (exe.isEmpty())
return false;
QProcess silverSearcherProcess;
silverSearcherProcess.start("ag", {"--version"});
silverSearcherProcess.setProcessEnvironment(
Utils::Environment::systemEnvironment().toProcessEnvironment());
silverSearcherProcess.start(exe, {"--version"});
if (silverSearcherProcess.waitForFinished(1000)) {
if (silverSearcherProcess.readAll().contains("ag version"))
return true;
@@ -131,7 +142,8 @@ void runSilverSeacher(FutureInterfaceType &fi, FileFindParameters parameters)
arguments << "--" << parameters.text << path.toString();
QProcess process;
process.start("ag", arguments);
process.setProcessEnvironment(Utils::Environment::systemEnvironment().toProcessEnvironment());
process.start(silverSearcherExecutable(), arguments);
if (process.waitForFinished()) {
typedef QList<FileSearchResult> FileSearchResultList;
QRegularExpression regexp;

View File

@@ -46,7 +46,7 @@ QList<Utils::FileSearchResult> SilverSearcherOutputParser::parse()
continue;
}
parseFilePath();
while (output[index] != '\n') {
while (index < outputSize && output[index] != '\n') {
parseLineNumber();
if (index >= outputSize - 1)
break;

View File

@@ -1,7 +1,11 @@
#
# Internal Qt Creator variable reference
#
set(__just_reference_QT_QMAKE_EXECUTABLE ${QT_QMAKE_EXECUTABLE})
foreach(qtcreator_var
QT_QMAKE_EXECUTABLE CMAKE_PREFIX_PATH CMAKE_C_COMPILER CMAKE_CXX_COMPILER
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELWITHDEBINFO)
set(__just_reference_${qtcreator_var} ${${qtcreator_var}})
endforeach()
if (EXISTS "${CMAKE_SOURCE_DIR}/QtCreatorPackageManager.cmake")
include("${CMAKE_SOURCE_DIR}/QtCreatorPackageManager.cmake")

View File

@@ -0,0 +1,104 @@
# CMake script to download OpenJDK and Android Command Line Tools.
# Execute with: cmake -P setup_android.cmake
set(JDK_VERSION "8u292-b10")
set(ANDROID_CMDTOOLS_VERSION "6609375")
set(ANDROID_PLATFORM "android-30")
set(BUILD_TOOLS "30.0.2")
set(NDK_VERSION "21.3.6528147")
set(qtc_android_sdk_definitions "${CMAKE_CURRENT_LIST_DIR}/../../../../share/qtcreator/android/sdk_definitions.json")
if (EXISTS ${qtc_android_sdk_definitions} AND CMAKE_VERSION GREATER_EQUAL 3.19)
file(READ ${qtc_android_sdk_definitions} sdk_definitions)
string(JSON linux_url GET "${sdk_definitions}" common sdk_tools_url linux)
string(REGEX REPLACE "^.*commandlinetools-linux-\([0-9]+\)_latest.zip" "\\1" ANDROID_CMDTOOLS_VERSION "${linux_url}")
string(JSON essential_packages GET "${sdk_definitions}" common sdk_essential_packages default)
string(REGEX REPLACE "^.*\"platforms;\(android-[0-9]+\)\",.*$" "\\1" ANDROID_PLATFORM "${essential_packages}")
string(JSON sdk_essential_packages GET "${sdk_definitions}" specific_qt_versions 0 sdk_essential_packages)
string(REGEX REPLACE "^.*\"build-tools;\([0-9.]+\)\".*$" "\\1" BUILD_TOOLS "${sdk_essential_packages}")
string(REGEX REPLACE "^.*\"ndk;\([0-9.]+\)\".*$" "\\1" NDK_VERSION "${sdk_essential_packages}")
foreach(var ANDROID_CMDTOOLS_VERSION ANDROID_PLATFORM BUILD_TOOLS NDK_VERSION)
message("${var}: ${${var}}")
endforeach()
endif()
function(download_jdk)
string(REPLACE "-" "" version_no_dash ${JDK_VERSION})
if (WIN32)
set(jdk_suffix "windows_hotspot_${version_no_dash}.zip")
elseif(APPLE)
set(jdk_suffix "mac_hotspot_${version_no_dash}.tar.gz")
else()
set(jdk_suffix "linux_hotspot_${version_no_dash}.tar.gz")
endif()
set(jdk_url "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk${JDK_VERSION}/OpenJDK8U-jdk_x64_${jdk_suffix}")
message("Downloading: ${jdk_url}")
file(DOWNLOAD ${jdk_url} ./jdk.zip SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf ./jdk.zip)
endfunction()
function(download_android_commandline)
if (WIN32)
set(android_cmdtools_suffix "win")
elseif(APPLE)
set(android_cmdtools_suffix "mac")
else()
set(android_cmdtools_suffix "linux")
endif()
set(android_cmdtools_url "https://dl.google.com/android/repository/commandlinetools-${android_cmdtools_suffix}-${ANDROID_CMDTOOLS_VERSION}_latest.zip")
message("Downloading: ${android_cmdtools_url}")
file(DOWNLOAD ${android_cmdtools_url} ./android_commandline_tools.zip SHOW_PROGRESS)
file(MAKE_DIRECTORY android-sdk)
file(MAKE_DIRECTORY android-cmdlinetools)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf ../android_commandline_tools.zip WORKING_DIRECTORY android-cmdlinetools)
endfunction()
function(setup_android)
set(sdkmanager "${CMAKE_CURRENT_LIST_DIR}/android-cmdlinetools/tools/bin/sdkmanager")
if (WIN32)
set(sdkmanager "${sdkmanager}.bat")
endif()
set(ENV{JAVA_HOME} "${CMAKE_CURRENT_LIST_DIR}/jdk${JDK_VERSION}")
if (APPLE)
set(ENV{JAVA_HOME} "$ENV{JAVA_HOME}/Contents/Home")
endif()
file(WRITE ${CMAKE_CURRENT_LIST_DIR}/accept_license.txt "y\ny\ny\ny\ny\ny\ny\ny\ny\ny\n")
execute_process(
INPUT_FILE ${CMAKE_CURRENT_LIST_DIR}/accept_license.txt
COMMAND ${sdkmanager} --licenses --sdk_root=${CMAKE_CURRENT_LIST_DIR}/android-sdk)
execute_process(
COMMAND ${sdkmanager} --update --sdk_root=${CMAKE_CURRENT_LIST_DIR}/android-sdk)
execute_process(
COMMAND ${sdkmanager}
"platforms;${ANDROID_PLATFORM}"
"build-tools;${BUILD_TOOLS}"
"ndk;${NDK_VERSION}"
"platform-tools"
"cmdline-tools;latest"
"tools"
"emulator"
"ndk-bundle" --sdk_root=${CMAKE_CURRENT_LIST_DIR}/android-sdk)
if (WIN32)
execute_process(
COMMAND ${sdkmanager}
"extras;google;usb_driver"
--sdk_root=${CMAKE_CURRENT_LIST_DIR}/android-sdk)
endif()
endfunction()
download_jdk()
download_android_commandline()
setup_android()

View File

@@ -22,6 +22,7 @@
:Add Bookmark_BookmarkDialog {name='BookmarkDialog' type='BookmarkDialog' visible='1' windowTitle='Add Bookmark'}
:Add to Version Control.No_QPushButton {text='No' type='QPushButton' unnamed='1' visible='1' window=':Add to Version Control_QMessageBox'}
:Add to Version Control_QMessageBox {text~='Add the file.*to version control (.*)?' type='QMessageBox' unnamed='1' visible='1'}
:Additional arguments:_QWidget {buddy=':Qt Creator.Additional arguments:_QLabel' type='QWidget' unnamed='1' visible='1'}
:Analyzer Toolbar.AnalyzerManagerToolBox_QComboBox {container=':DebugModeWidget.Toolbar_QDockWidget' name='PerspectiveChooser' type='QComboBox' visible='1'}
:Analyzer Toolbar.Clear_QToolButton {container=':DebugModeWidget.Toolbar_QDockWidget' toolTip='Discard data' type='QToolButton' unnamed='1' visible='1'}
:Analyzer Toolbar.Elapsed:_QLabel {container=':DebugModeWidget.Toolbar_QDockWidget' text~='Elapsed: \\\\d+.\\\\d s' type='QLabel' unnamed='1' visible='1'}
@@ -117,12 +118,15 @@
:QML Debugging.No_QPushButton {text='No' type='QPushButton' unnamed='1' visible='1' window=':QML Debugging_QMessageBox'}
:QML Debugging_QMessageBox {text='The option will only take effect if the project is recompiled. Do you want to recompile now?' type='QMessageBox' unnamed='1' visible='1'}
:Qt Creator.Add Bookmark_QToolButton {text='Add Bookmark' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Additional arguments:_QLabel {text='Additional arguments:' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.CloseDoc_QToolButton {toolTip?='Close Document *' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.CloseFind_QToolButton {name='close' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Compile Output_Core::OutputWindow {type='Core::OutputWindow' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Compile Output'}
:Qt Creator.Configure Project_QPushButton {text='Configure Project' type='QPushButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.DebugModeWidget_QSplitter {name='DebugModeWidget' type='QSplitter' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.DragDoc_QToolButton {toolTip='Drag to drag documents between splits' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Effective qmake call:_QLabel {text='Effective qmake call:' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Effective qmake call:_QTextEdit {aboveWidget=':Additional arguments:_QWidget' leftWidget=':Qt Creator.Effective qmake call:_QLabel' type='QTextEdit' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Events_QDockWidget {name='QmlProfiler.Statistics.DockDockWidget' type='QDockWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Events_QTabBar {aboveWidget=':Qt Creator.Events_QDockWidget' type='QTabBar' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Issues_QListView {type='QListView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Issues'}
@@ -139,7 +143,6 @@
:Qt Creator.Timeline_QTabBar {aboveWidget=':Qt Creator.Timeline_QDockWidget' container=':Qt Creator.DebugModeWidget_QSplitter' type='QTabBar' unnamed='1' visible='1'}
:Qt Creator.WelcomeScreenStackedWidget {name='WelcomeScreenStackedWidget' type='QStackedWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.replaceEdit_Utils::FilterLineEdit {name='replaceEdit' type='Utils::FancyLineEdit' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.scrollArea_QScrollArea {type='ProjectExplorer::PanelsWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.splitter_QSplitter {name='splitter' type='QSplitter' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton {occurrence='3' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_BinEditor::BinEditorWidget {type='BinEditor::Internal::BinEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
@@ -211,7 +214,6 @@
:projectComboBox_QComboBox {buddy=':New Text File.Add to project:_QLabel' name='projectComboBox' type='QComboBox' visible='1'}
:projectComboBox_Utils::TreeViewComboBox {buddy=':New Text File.Add to project:_QLabel' name='projectComboBox' type='Utils::TreeViewComboBox' visible='1'}
:qdesigner_internal::WidgetBoxCategoryListView {container=':Widget Box_qdesigner_internal::WidgetBoxTreeWidget' occurrence='3' type='qdesigner_internal::WidgetBoxCategoryListView' unnamed='1' visible='1'}
:qmakeCallEdit {container=':Qt Creator.scrollArea_QScrollArea' text?='<b>qmake:</b> qmake*' type='QLabel' unnamed='1' visible='1'}
:qt_tabwidget_stackedwidget.Core__Internal__GeneralSettings_QWidget {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' name='Core__Internal__GeneralSettings' type='QWidget' visible='1'}
:qt_tabwidget_stackedwidget.QtSupport__Internal__QtVersionManager_QtSupport::Internal::QtOptionsPageWidget {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' type='QScrollArea' unnamed='1' visible='1'}
:qt_tabwidget_stackedwidget_QScrollArea {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' type='QScrollArea' unnamed='1' visible='1'}

View File

@@ -134,7 +134,7 @@ def doSimpleDebugging(currentKit, currentConfigName, expectedBPOrder=[], enableQ
expectedLabelTexts.append("Running\.")
switchViewTo(ViewConstants.PROJECTS)
switchToBuildOrRunSettingsFor(currentKit, ProjectSettings.RUN)
ensureChecked(waitForObject("{container=':Qt Creator.scrollArea_QScrollArea' text='Enable QML' "
ensureChecked(waitForObject("{container=':Qt Creator_Core::Internal::MainWindow' text='Enable QML' "
"type='QCheckBox' unnamed='1' visible='1'}"), enableQml)
switchViewTo(ViewConstants.EDIT)
if not __startDebugger__(currentKit, currentConfigName):
@@ -175,7 +175,8 @@ def doSimpleDebugging(currentKit, currentConfigName, expectedBPOrder=[], enableQ
def isMsvcConfig(currentKit):
switchViewTo(ViewConstants.PROJECTS)
switchToBuildOrRunSettingsFor(currentKit, ProjectSettings.BUILD)
isMsvc = " -spec win32-msvc" in str(waitForObject(":qmakeCallEdit").text)
clickButton(waitForObject(":scrollArea.Details_Utils::DetailsButton"))
isMsvc = " -spec win32-msvc" in str(waitForObject(":Qt Creator.Effective qmake call:_QTextEdit").plainText)
switchViewTo(ViewConstants.EDIT)
return isMsvc

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.10",
targets=Targets.desktopTargetClasses(), minimumQtVersion="5.12",
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.10"):
def createNewQtQuickUI(workingDir, qtVersion = "5.12"):
available = __createProjectOrFileSelectType__(" Other Project", 'Qt Quick UI Prototype')
if workingDir == None:
workingDir = tempDir()
@@ -505,7 +505,7 @@ def __getSupportedPlatforms__(text, templateName, getAsStrings=False):
else:
version = None
if templateName.startswith("Qt Quick Application - "):
result = set([Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT])
result = set([Targets.DESKTOP_5_14_1_DEFAULT])
elif 'Supported Platforms' in text:
supports = text[text.find('Supported Platforms'):].split(":")[1].strip().split("\n")
result = set()

View File

@@ -204,24 +204,24 @@ def substituteDefaultCompiler(settingsDir):
test.log("Injected default compiler '%s' to qtversion.xml..." % compiler)
def substituteCdb(settingsDir):
def canUse32bitCdb():
def canUse64bitCdb():
try:
serverIni = readFile(os.path.join(os.getenv("APPDATA"), "froglogic",
"Squish", "ver1", "server.ini"))
autLine = filter(lambda line: "AUT/qtcreator" in line, serverIni.splitlines())[0]
autPath = autLine.split("\"")[1]
return os.path.exists(os.path.join(autPath, "..", "lib", "qtcreatorcdbext32"))
return os.path.exists(os.path.join(autPath, "..", "lib", "qtcreatorcdbext64"))
except:
test.fatal("Something went wrong when determining debugger bitness",
"Did Squish's file structure change? Guessing 32-bit cdb can be used...")
return True
if canUse32bitCdb():
architecture = "x86"
bitness = "32"
else:
if canUse64bitCdb():
architecture = "x64"
bitness = "64"
else:
architecture = "x86"
bitness = "32"
debuggers = os.path.join(settingsDir, "QtProject", 'qtcreator', 'debuggers.xml')
__substitute__(debuggers, "SQUISH_DEBUGGER_ARCHITECTURE", architecture)
__substitute__(debuggers, "SQUISH_DEBUGGER_BITNESS", bitness)

View File

@@ -133,7 +133,7 @@ def main():
invokeContextMenuItem(editor, "Toggle Comment Selection")
virtualFunctionsAdded = True
invokeMenuItem('File', 'Save All')
invokeMenuItem('Build', 'Rebuild Project "%s"' % projectName)
selectFromLocator("t rebuild", "Rebuild (Rebuild Project)")
waitForCompile(10000)
checkCompile()

View File

@@ -100,7 +100,7 @@ def performDebugging(projectName):
test.log("Selecting '%s' as build config" % config)
verifyBuildConfig(kit, config, True, True)
waitForObject(":*Qt Creator.Build Project_Core::Internal::FancyToolButton")
invokeMenuItem("Build", "Rebuild All Projects")
selectFromLocator("t rebuild", "Rebuild (Rebuild All Projects)")
waitForCompile()
isMsvc = isMsvcConfig(kit)
clickButton(waitForObject(":*Qt Creator.Start Debugging_Core::Internal::FancyToolButton"))

View File

@@ -52,12 +52,12 @@ def main():
"Verifying Run and Debug are enabled (Qt5 is available).")
and test.compare(target, Targets.getStringForTarget(Targets.getDefaultKit()),
"Verifying selected Target is Qt5.")
and test.compare(exe, "QML Utility", "Verifying selected executable is QML Utility.")):
and test.compare(exe, "QML Runtime", "Verifying selected executable is QML Runtime.")):
earlyExit("Something went wrong opening Qml project - probably missing Qt5.")
return
switchViewTo(ViewConstants.PROJECTS)
switchToBuildOrRunSettingsFor(Targets.getDefaultKit(), ProjectSettings.RUN)
ensureChecked("{container=':Qt Creator.scrollArea_QScrollArea' text='Enable QML' "
ensureChecked("{container=':Qt Creator_Core::Internal::MainWindow' text='Enable QML' "
"type='QCheckBox' unnamed='1' visible='1'}")
switchViewTo(ViewConstants.EDIT)
clickButton(fancyDebugButton)

View File

@@ -58,7 +58,7 @@ def main():
test.log("Selecting '%s' as build config" % config)
verifyBuildConfig(kit, config, True, True, True)
# explicitly build before start debugging for adding the executable as allowed program to WinFW
invokeMenuItem("Build", "Rebuild All Projects")
selectFromLocator("t rebuild", "Rebuild (Rebuild All Projects)")
waitForCompile(300000)
if not checkCompile():
test.fatal("Compile had errors... Skipping current build config")

Some files were not shown because too many files have changed in this diff Show More