forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.13'
Conflicts: src/plugins/android/androidsettingswidget.cpp Change-Id: Iadf1d58a1e867ae7bb2dca55d3951613cfcc3d07
This commit is contained in:
@@ -641,7 +641,7 @@ function(extend_qtc_executable name)
|
||||
endfunction()
|
||||
|
||||
function(add_qtc_test name)
|
||||
cmake_parse_arguments(_arg "GTEST" "" "DEFINES;DEPENDS;INCLUDES;SOURCES;EXPLICIT_MOC;SKIP_AUTOMOC" ${ARGN})
|
||||
cmake_parse_arguments(_arg "GTEST" "TIMEOUT" "DEFINES;DEPENDS;INCLUDES;SOURCES;EXPLICIT_MOC;SKIP_AUTOMOC" ${ARGN})
|
||||
|
||||
foreach(dependency ${_arg_DEPENDS})
|
||||
if (NOT TARGET ${dependency} AND NOT _arg_GTEST)
|
||||
@@ -684,7 +684,12 @@ function(add_qtc_test name)
|
||||
|
||||
if (NOT _arg_GTEST)
|
||||
add_test(NAME ${name} COMMAND ${name})
|
||||
finalize_test_setup(${name})
|
||||
if (DEFINED _arg_TIMEOUT)
|
||||
set(timeout_option TIMEOUT ${_arg_TIMEOUT})
|
||||
else()
|
||||
set(timeout_option)
|
||||
endif()
|
||||
finalize_test_setup(${name} ${timeout_option})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
@@ -211,11 +211,17 @@ function(set_public_includes target includes)
|
||||
endfunction()
|
||||
|
||||
function(finalize_test_setup test_name)
|
||||
cmake_parse_arguments(_arg "" "TIMEOUT" "" ${ARGN})
|
||||
if (DEFINED _arg_TIMEOUT)
|
||||
set(timeout ${_arg_TIMEOUT})
|
||||
else()
|
||||
set(timeout 5)
|
||||
endif()
|
||||
# Never translate tests:
|
||||
set_tests_properties(${name}
|
||||
PROPERTIES
|
||||
QT_SKIP_TRANSLATION ON
|
||||
TIMEOUT 5
|
||||
TIMEOUT ${timeout}
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 76 KiB |
BIN
doc/qtcreator/images/qtcreator-meson-build-settings.png
Normal file
BIN
doc/qtcreator/images/qtcreator-meson-build-settings.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
BIN
doc/qtcreator/images/qtcreator-meson-build-steps.png
Normal file
BIN
doc/qtcreator/images/qtcreator-meson-build-steps.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.5 KiB |
BIN
doc/qtcreator/images/qtcreator-meson-clean-steps.png
Normal file
BIN
doc/qtcreator/images/qtcreator-meson-clean-steps.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.6 KiB |
BIN
doc/qtcreator/images/qtcreator-mesonexecutable.png
Normal file
BIN
doc/qtcreator/images/qtcreator-mesonexecutable.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 41 KiB |
@@ -44,7 +44,7 @@
|
||||
|
||||
You can drag and drop the views in the \uicontrol Debug mode to new
|
||||
positions on the screen. The size and position of views are saved for future
|
||||
sessions. Select \uicontrol Window > \uicontrol Views >
|
||||
sessions. Select \uicontrol View > \uicontrol Views >
|
||||
\uicontrol {Reset to Default Layout} to reset the views to their original
|
||||
sizes and positions.
|
||||
|
||||
|
@@ -608,7 +608,7 @@
|
||||
program you are debugging. The availability of views depends on whether
|
||||
you are debugging C++ or QML. Frequently used views are shown by
|
||||
default and rarely used ones are hidden. To change the default settings,
|
||||
select \uicontrol Window > \uicontrol Views, and then select views to
|
||||
select \uicontrol View > \uicontrol Views, and then select views to
|
||||
display or hide. Alternatively, you can enable or disable views from the
|
||||
context menu of the title bar of any visible debugger view.
|
||||
|
||||
@@ -616,10 +616,10 @@
|
||||
|
||||
You can drag and drop the views in \QC to new positions on the screen. The
|
||||
size and position of views are saved for future sessions. Select
|
||||
\uicontrol Window > \uicontrol Views > \uicontrol {Reset to Default Layout}
|
||||
\uicontrol View > \uicontrol Views > \uicontrol {Reset to Default Layout}
|
||||
to reset the views to their original sizes and positions.
|
||||
|
||||
To save space on the screen, select \uicontrol Window > \uicontrol Views >
|
||||
To save space on the screen, select \uicontrol View > \uicontrol Views >
|
||||
\uicontrol {Automatically Hide View Titlebars}.
|
||||
|
||||
To show and hide columns in views, toggle \uicontrol {Show Column} in
|
||||
@@ -1478,7 +1478,7 @@
|
||||
\li Make sure the debugger is set up properly. For more information,
|
||||
see \l{Setting Up Debugger}.
|
||||
|
||||
\li In the \uicontrol Debug mode, select \uicontrol Window >
|
||||
\li In the \uicontrol Debug mode, select \uicontrol View >
|
||||
\uicontrol Views > \uicontrol {Debugger Log} to open the
|
||||
\uicontrol {Debugger Log} view. Browse the contents of the pane on
|
||||
the right hand side to find out what went wrong. Always attach the
|
||||
|
@@ -234,7 +234,7 @@
|
||||
|
||||
When the application is interrupted by a breakpoint, you can use the
|
||||
\uicontrol {QML Debugger Console} to execute JavaScript expressions in the
|
||||
current context. To open it, choose \uicontrol Window >
|
||||
current context. To open it, choose \uicontrol View >
|
||||
\uicontrol {Output Panes} > \uicontrol {QML Debugger Console}.
|
||||
|
||||
\image qml-script-console.png "QML Debugger Console"
|
||||
|
@@ -135,8 +135,9 @@
|
||||
\endlist
|
||||
|
||||
To open the other output panes, such as \uicontrol{General Messages} and
|
||||
\uicontrol{Version Control}, select \uicontrol Window > \uicontrol {Output Panes}. The menu
|
||||
items also display the keyboard shortcuts that you can use.
|
||||
\uicontrol{Version Control}, select \uicontrol View >
|
||||
\uicontrol {Output Panes}. The menu items also display
|
||||
the keyboard shortcuts that you can use.
|
||||
|
||||
For more information about output panes, see \l{Viewing Output}.
|
||||
|
||||
|
@@ -196,7 +196,7 @@
|
||||
\b {How do I generate a core file in \QC?}
|
||||
|
||||
To trigger the GDB command that generates a core file while debugging,
|
||||
select \uicontrol Window > \uicontrol Views > \uicontrol {Debugger Log}.
|
||||
select \uicontrol View > \uicontrol Views > \uicontrol {Debugger Log}.
|
||||
In the \uicontrol Command field, type \c gcore and press \key Enter. The
|
||||
core file is created in the current working directory. You can specify
|
||||
another location for the file, including a relative or absolute path, as an
|
||||
|
@@ -286,7 +286,7 @@
|
||||
{corresponding keyboard shortcut}.
|
||||
|
||||
To hide the mode selector and to save space on the display, select
|
||||
\uicontrol Window > \uicontrol {Mode Selector Style} > \uicontrol Hidden.
|
||||
\uicontrol View > \uicontrol {Mode Selector Style} > \uicontrol Hidden.
|
||||
To only show icons on the mode selector, select the \uicontrol {Icons Only}
|
||||
style.
|
||||
|
||||
@@ -402,7 +402,7 @@
|
||||
\else
|
||||
\l{Using Git}{Version Control}
|
||||
\endif
|
||||
panes, select \uicontrol Window > \uicontrol {Output Panes}.
|
||||
panes, select \uicontrol View > \uicontrol {Output Panes}.
|
||||
\if defined(qtcreator)
|
||||
To display the \uicontrol {To-Do Entries} pane, enable the Todo plugin.
|
||||
\endif
|
||||
|
@@ -57,12 +57,12 @@
|
||||
|
||||
To close groups of views, select the \uicontrol {Close Group} button.
|
||||
|
||||
To open closed views, select \uicontrol Window > \uicontrol Views.
|
||||
To open closed views, select \uicontrol View > \uicontrol Views.
|
||||
|
||||
\section1 Saving Workspaces
|
||||
|
||||
The changes you make to a workspace are saved when you exit \QC.
|
||||
In \QMLD, you can select \uicontrol Window > \uicontrol Workspaces >
|
||||
In \QMLD, you can select \uicontrol View > \uicontrol Workspaces >
|
||||
\uicontrol Manage > \uicontrol {Restore last workspace on startup}
|
||||
to restore the current workspace the next time you start \QC.
|
||||
|
||||
|
@@ -0,0 +1,78 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
**
|
||||
** 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 Free Documentation License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Free
|
||||
** Documentation License version 1.3 as published by the Free Software
|
||||
** Foundation and appearing in the file included in the packaging of
|
||||
** this file. Please review the following information to ensure
|
||||
** the GNU Free Documentation License version 1.3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
/*!
|
||||
//! [meson build configuration]
|
||||
|
||||
\section2 Meson Build Configuration
|
||||
|
||||
\image qtcreator-meson-build-settings.png
|
||||
|
||||
Settings are grouped by category by Meson. All items are user modifiable
|
||||
except \c backend which is forced to Ninja, \c {buildtype}, \c debug as well
|
||||
as \c optimization to ensure a good compatibility with \QC.
|
||||
|
||||
Each setting type has its own editor. To modif any setting, double-click it,
|
||||
either edit the field, or select your choice depending on the control. To
|
||||
apply changes, select \uicontrol {Apply configuration changes}. This will
|
||||
trigger a \c {meson configure} command if there were any configuration
|
||||
changes. If for any reason the build directory configuration is broken,
|
||||
select \uicontrol {Wipe project}. This should fix any build directory.
|
||||
|
||||
\note Any modified setting will remain in bold until \uicontrol
|
||||
{Apply configuration changes} is selected.
|
||||
|
||||
//! [meson build configuration]
|
||||
|
||||
|
||||
//! [meson build steps]
|
||||
|
||||
\section2 Meson Build Steps
|
||||
|
||||
\QC builds Meson projects by running \c {ninja -v target}.
|
||||
|
||||
You can add arguments and targets for the build command in
|
||||
\uicontrol {Build Steps}.
|
||||
|
||||
\image qtcreator-meson-build-steps.png
|
||||
|
||||
The build errors and warnings are parsed and displayed in the
|
||||
\uicontrol Issues output pane.
|
||||
|
||||
//! [meson build steps]
|
||||
|
||||
//! [meson clean steps]
|
||||
|
||||
\section2 Meson Clean Steps
|
||||
|
||||
When building with Meson, you can add arguments and targets for the clean
|
||||
command in \uicontrol {Clean Steps}.
|
||||
|
||||
\image qtcreator-meson-clean-steps.png
|
||||
|
||||
The build errors and warnings are parsed and displayed in the
|
||||
\uicontrol Issues output pane.
|
||||
|
||||
//! [meson clean steps]
|
||||
*/
|
117
doc/qtcreator/src/meson/creator-projects-meson.qdoc
Normal file
117
doc/qtcreator/src/meson/creator-projects-meson.qdoc
Normal file
@@ -0,0 +1,117 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
**
|
||||
** 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 Free Documentation License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Free
|
||||
** Documentation License version 1.3 as published by the Free Software
|
||||
** Foundation and appearing in the file included in the packaging of
|
||||
** this file. Please review the following information to ensure
|
||||
** the GNU Free Documentation License version 1.3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\previouspage creator-project-nimble.html
|
||||
\page creator-project-meson.html
|
||||
\nextpage creator-cli.html
|
||||
|
||||
\title Setting Up Meson
|
||||
|
||||
\l{https://mesonbuild.com/}{Meson} is an open source and multi-platform build
|
||||
system generator using Ninja as main backend. Build definitions are located
|
||||
in \c {meson.build} files while build options are located in
|
||||
\c {meson_options.txt}.
|
||||
|
||||
Meson build support in \QC is not mature yet, you can only use it to build
|
||||
native desktop applications. Many features available with Meson build or
|
||||
usually available from \QC are missing.
|
||||
|
||||
\QC automatically detects the Meson and Ninja executables specified in the
|
||||
\c PATH. You can add paths to other Meson or Ninja executables and use them
|
||||
in different build and run \l{glossary-buildandrun-kit}{kits}.
|
||||
|
||||
\note Meson build plugin is disabled by default, see
|
||||
\l{Enabling and Disabling Plugins}.
|
||||
|
||||
\section1 Adding Meson Tools
|
||||
|
||||
\QC does not have strong requirements on Meson build's version, any version
|
||||
above 0.49.0 should be compatible.
|
||||
|
||||
To specify paths to Meson or Ninja executables:
|
||||
|
||||
\list 1
|
||||
|
||||
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol Meson >
|
||||
\uicontrol Tools > \uicontrol Add.
|
||||
|
||||
\image qtcreator-mesonexecutable.png
|
||||
|
||||
\li In the \uicontrol Name field, specify a name for the tool.
|
||||
|
||||
\li In the \uicontrol Path field, specify the path to the Meson or Ninja
|
||||
executable.
|
||||
|
||||
\li Select \uicontrol Apply to save your changes.
|
||||
|
||||
\endlist
|
||||
|
||||
Select the
|
||||
\uicontrol Tools > \uicontrol Options > \uicontrol Kits > \uicontrol Kits
|
||||
tab to add the Meson and Ninja tools to a build and run kit:
|
||||
|
||||
\image qtcreator-kits.png
|
||||
|
||||
For more information, see \l {Adding Kits}.
|
||||
|
||||
\section1 Editing Meson Build Descriptions
|
||||
|
||||
To open a meson.build file for editing, double-click it from project tree.
|
||||
Only plain text editor is available now.
|
||||
|
||||
|
||||
\section1 Code Completion and External Libraries
|
||||
|
||||
Through external libraries, \QC can support code completion and syntax
|
||||
highlighting as if they were part of the current project or the Qt library.
|
||||
|
||||
\QC handles code completion from compilation flags in Meson introspection
|
||||
data. Any external library added with \c {dependency()} or found in include
|
||||
path will be known by \QC for code completion.
|
||||
|
||||
Syntax completion and highlighting work once your project configures successfully.
|
||||
|
||||
\section1 Current Meson Support Limitations
|
||||
|
||||
The following features are not supported yet:
|
||||
|
||||
\list
|
||||
\li Cross compilation.
|
||||
\li Showing header files in project tree.
|
||||
\li Configuration change detection, for example when building triggers a
|
||||
Meson configuration first.
|
||||
\li Actions from locator such as searching or triggering builds.
|
||||
\li Adding files to Meson projects from \QC.
|
||||
\endlist
|
||||
|
||||
\section1 Related Topics
|
||||
|
||||
\list
|
||||
\li \l {Opening Projects}
|
||||
\li \l {Specifying Build Settings}
|
||||
\li \l {Specifying Run Settings}
|
||||
\endlist
|
||||
*/
|
@@ -49,6 +49,13 @@
|
||||
generation of build configurations. For more information, see
|
||||
\l {Setting Up CMake}.
|
||||
|
||||
\l {https://mesonbuild.com/}{Meson} Meson is an open source build system meant
|
||||
to be both extremely fast, and, even more importantly, as user friendly as
|
||||
possible. The main design point of Meson is that every second a developer
|
||||
spends writing or debugging build definitions is a second wasted. So is every
|
||||
second spent waiting for the build system to actually start compiling code.
|
||||
For more information, see \l {Setting Up Meson}.
|
||||
|
||||
\l{Qbs Manual}{Qbs} is an all-in-one build tool that generates a build graph
|
||||
from a high-level project description (like qmake or CMake do) and executes
|
||||
the commands in the low-level build graph (like make does). For more
|
||||
|
@@ -26,7 +26,7 @@
|
||||
/*!
|
||||
\previouspage creator-project-generic.html
|
||||
\page creator-project-nimble.html
|
||||
\nextpage creator-cli.html
|
||||
\nextpage creator-project-meson.html
|
||||
|
||||
\title Setting Up Nimble
|
||||
|
||||
|
@@ -82,7 +82,7 @@
|
||||
\li Select \uicontrol File > \uicontrol {Open File or Project}
|
||||
(\key Ctrl+O or \key Cmd+O on \macos) and select the project file
|
||||
for the project to open: \e {.pro} (qmake), \e {CMakeLists.txt}
|
||||
(CMake), \e {.qbs} (Qbs), \e {pyproject} (Python), or
|
||||
(CMake), \e {.qbs} (Qbs), \e {meson.build} (Meson), \e {pyproject} (Python), or
|
||||
\e {Makefile.am} (Autotools, experimental).
|
||||
|
||||
\li In the \uicontrol {Configure Project} tab, select kits for building
|
||||
|
@@ -37,7 +37,7 @@
|
||||
\title Using Other Build Systems
|
||||
|
||||
Most \QC project wizards enable you to choose the build system to use for
|
||||
building the project: qmake, CMake, or Qbs. qmake is installed and
|
||||
building the project: qmake, CMake, Meson, or Qbs. qmake is installed and
|
||||
configured when you install Qt. To use one of the other supported build
|
||||
systems, you need to set it up, as described in the the following sections:
|
||||
|
||||
@@ -73,6 +73,11 @@
|
||||
the Nimble package manager for generating Nim application
|
||||
executables that are supported on Windows, Linux, and \macos.
|
||||
|
||||
\li \l{Setting Up Meson}
|
||||
|
||||
Meson is an open source build system meant to be both extremely fast,
|
||||
and, even more importantly, as user friendly as possible.
|
||||
|
||||
\endlist
|
||||
|
||||
*/
|
||||
|
@@ -113,6 +113,7 @@
|
||||
information, see \l{http://doc.qt.io/QtQuickCompiler/}{Qt Quick Compiler}.
|
||||
|
||||
\include creator-projects-cmake-building.qdocinc cmake build configuration
|
||||
\include creator-projects-meson-building.qdocinc meson build configuration
|
||||
|
||||
\section1 Starting External Processes
|
||||
|
||||
@@ -145,7 +146,7 @@
|
||||
\section1 Build Steps
|
||||
|
||||
In \uicontrol{Build Steps} you can change the settings for the build system
|
||||
selected for building the project: qmake, CMake, or Qbs.
|
||||
selected for building the project: qmake, CMake, Meson, or Qbs.
|
||||
|
||||
\section2 qmake Build Steps
|
||||
|
||||
@@ -166,6 +167,7 @@
|
||||
|
||||
\include creator-projects-cmake-building.qdocinc cmake build steps
|
||||
\include creator-projects-settings-build-qbs.qdocinc qbs build steps
|
||||
\include creator-projects-meson-building.qdocinc meson build steps
|
||||
|
||||
\section2 Adding Custom Build Steps
|
||||
|
||||
@@ -211,4 +213,5 @@
|
||||
|
||||
\include creator-projects-cmake-building.qdocinc cmake clean steps
|
||||
\include creator-projects-settings-build-qbs.qdocinc qbs clean steps
|
||||
\include creator-projects-meson-building.qdocinc meson clean steps
|
||||
*/
|
||||
|
@@ -69,6 +69,9 @@
|
||||
\QC automatically adds run configurations for all targets specified in the
|
||||
CMake project file, \c {CMakeLists.txt}.
|
||||
|
||||
\QC automatically adds run configurations for all targets declared with
|
||||
\c {executable()} function in Meson build descriptions.
|
||||
|
||||
\section1 Creating Run Configurations for Subprojects
|
||||
|
||||
To prevent \QC from automatically creating run configurations for SUBDIRS
|
||||
@@ -113,7 +116,7 @@
|
||||
|
||||
\section1 Specifying a Custom Executable to Run
|
||||
|
||||
If you use CMake or the generic project type in \QC, or want
|
||||
If you use CMake, Meson or the generic project type in \QC, or want
|
||||
to run a custom desktop executable, create a \uicontrol {Custom Executable}
|
||||
run configuration for your project. For example, when working on a library,
|
||||
you can run a test application that links against the library.
|
||||
|
@@ -178,6 +178,15 @@
|
||||
\uicontrol Change to edit the variables of the CMake configuration
|
||||
for the kit.
|
||||
|
||||
\li In the \uicontrol {Meson tool} field, select the Meson tool to use
|
||||
for building the project. Select \uicontrol Manage to add installed
|
||||
Meson tools to the list. For more information, see
|
||||
\l{Adding Meson Tools}.
|
||||
|
||||
\li In the \uicontrol {Ninja tool} field, select the Ninja tool to use
|
||||
for building the project with Meson. Select \uicontrol Manage to add installed
|
||||
Ninja tools to the list.
|
||||
|
||||
\endlist
|
||||
|
||||
\QC uses the \e {default kit} if it does not have enough information to
|
||||
|
@@ -72,7 +72,7 @@
|
||||
\image qmldesigner-tutorial-design-mode.png "Transitions project in Design Mode"
|
||||
|
||||
\note If a view is hidden, you can show it by selecting
|
||||
\uicontrol Window > \uicontrol Views.
|
||||
\uicontrol View > \uicontrol Views.
|
||||
|
||||
\li In the \uicontrol Navigator, select \uicontrol Label and press
|
||||
\key Delete to delete it.
|
||||
|
@@ -49,7 +49,7 @@
|
||||
\image studio-design-mode.png "Design mode"
|
||||
|
||||
The Design mode contains different views for designing UIs. To open the
|
||||
following views, select \uicontrol Window > \uicontrol Views:
|
||||
following views, select \uicontrol View > \uicontrol Views:
|
||||
|
||||
\list
|
||||
\li \uicontrol {Form Editor} (1) provides a canvas for designing 2D UIs.
|
||||
|
@@ -130,7 +130,7 @@
|
||||
\endlist
|
||||
|
||||
The \uicontrol{Version Control} output pane displays the commands that are
|
||||
executed, a timestamp, and the relevant output. Select \uicontrol Window >
|
||||
executed, a timestamp, and the relevant output. Select \uicontrol View >
|
||||
\uicontrol {Output Panes} > \uicontrol {Version Control} to open the pane.
|
||||
|
||||
\image qtcreator-vcs-pane.png
|
||||
|
@@ -133,7 +133,7 @@
|
||||
\uicontrol Projects view to open it.
|
||||
|
||||
\note The visibility of views depends on the selected workspace. To open
|
||||
hidden views, select \uicontrol Window > \uicontrol Views in the Design
|
||||
hidden views, select \uicontrol View > \uicontrol Views in the Design
|
||||
mode. For more information, see \l {Managing Workspaces}.
|
||||
|
||||
To modify \e Screen01.ui.qml in \uicontrol {Form Editor}:
|
||||
|
@@ -189,7 +189,7 @@
|
||||
to \e loginState:
|
||||
|
||||
\list 1
|
||||
\li Select \uicontrol Window > \uicontrol Views >
|
||||
\li Select \uicontrol View > \uicontrol Views >
|
||||
\uicontrol {Connection View} to open the \uicontrol Connection view.
|
||||
\li Select \e registerButton in the \uicontrol Navigator.
|
||||
\li In the \uicontrol Connection view, select the \inlineimage plus.png
|
||||
|
@@ -135,7 +135,7 @@
|
||||
To add a timeline with settings for running the animation:
|
||||
|
||||
\list 1
|
||||
\li Select \uicontrol Window > \uicontrol Views >
|
||||
\li Select \uicontrol View > \uicontrol Views >
|
||||
\uicontrol Timeline to open the \uicontrol Timeline view.
|
||||
\li In \uicontrol Timeline, select \inlineimage plus.png
|
||||
to add a 1000-frame timeline and settings for running the animation.
|
||||
|
@@ -36,7 +36,8 @@
|
||||
|
||||
\list
|
||||
\li Place your Illustrator content into Adobe Photoshop and
|
||||
use \QBPS to export the assets to .ui.qml files.
|
||||
use \QBPS to export the assets to \e {.metadata} format that
|
||||
you can import to \QDS.
|
||||
\li Use the Illustrator \e {export for screens workflow} to export your
|
||||
assets into formats supported by \QDS, such as PNG and JPEG.
|
||||
\endlist
|
||||
|
@@ -30,13 +30,17 @@
|
||||
|
||||
\title Exporting Artwork from Design Tools
|
||||
|
||||
You need to use \QB to first export 2D assets from design tools and then
|
||||
import them. When working with 3D assets, you can use the export functions
|
||||
provided by the 3D graphics tools to save the assets in widely-used 3D
|
||||
graphics formats, and then use \QB to import them. You can download \QB
|
||||
from the \l{https://marketplace.qt.io/}{Qt Marketplace}.
|
||||
You need to use \QB to first export 2D assets from design tools and then use
|
||||
\QB to \l{Importing Designs}{import} them into \QDS.
|
||||
|
||||
For best results when importing 3D assets, follow
|
||||
When working with 3D assets, you can use the export functions provided by
|
||||
the 3D graphics tools to save the assets in widely-used 3D graphics formats,
|
||||
and then use \QB to import them into \QDS.
|
||||
|
||||
You can use the Qt online installer to install \QB if you have a license, or
|
||||
download \QB from the \l{https://marketplace.qt.io/}{Qt Marketplace}.
|
||||
|
||||
For best results when importing assets, follow
|
||||
the guidelines for creating and exporting them.
|
||||
|
||||
\list
|
||||
@@ -50,13 +54,13 @@
|
||||
\li \l{Exporting Designs from Adobe Photoshop}
|
||||
|
||||
You can use the \QBPS export tool in Adobe Photoshop to convert
|
||||
artwork into Qt Quick files (.ui.qml) that you can import to
|
||||
artwork into \e {.metadata} format that you can import into
|
||||
projects in \QDS.
|
||||
|
||||
\li \l{Exporting Designs from Sketch}
|
||||
|
||||
You can use the \QBSK export tool in Sketch to convert artwork into
|
||||
Qt Quick files that you can import to projects in \QDS.
|
||||
metadata that you can import into projects in \QDS.
|
||||
|
||||
\li \l{Exporting 3D Assets}
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Design Studio documentation.
|
||||
@@ -32,7 +32,8 @@
|
||||
|
||||
\title Exporting Designs from Adobe Photoshop
|
||||
|
||||
You can use \QBPS to export designs from Adobe Photoshop to .ui.qml files.
|
||||
You can use \QBPS to export designs from Adobe Photoshop to \e {.metadata}
|
||||
format that you can \l{Importing 2D Assets}{import} to projects in \QDS.
|
||||
|
||||
\image studio-ps-export.png
|
||||
|
||||
@@ -43,13 +44,12 @@
|
||||
\li \l{Setting Up Qt Bridge for Adobe Photoshop}
|
||||
|
||||
You must install and set up the \QBPS export tool before you can use
|
||||
it to convert artwork into Qt Quick files that you can import to
|
||||
projects in \QDS.
|
||||
it to export artwork.
|
||||
|
||||
\li \l{Using Qt Bridge for Adobe Photoshop}
|
||||
|
||||
To get the best results when you use \QBPS to export designs from
|
||||
Photoshop to Qt Quick files, you should follow the guidelines for
|
||||
working with Photoshop and organizing your assets.
|
||||
Photoshop, you should follow the guidelines for working with
|
||||
Photoshop and organizing your assets.
|
||||
\endlist
|
||||
*/
|
||||
|
@@ -33,7 +33,8 @@
|
||||
\section1 Organizing Assets
|
||||
|
||||
To get the best results when you use \QBPS to export designs from Adobe
|
||||
Photoshop to \QDS, follow these guidelines when working with Photoshop:
|
||||
Photoshop for importing them to \QDS, follow these guidelines when working
|
||||
with Photoshop:
|
||||
|
||||
\list
|
||||
\li Arrange your art into artboards and organize it into groups and
|
||||
@@ -55,9 +56,9 @@
|
||||
when you export designs from Adobe Photoshop and import them into \QDS.
|
||||
|
||||
When you use \QBPS to export your designs, you will determine how you want
|
||||
each group or layer exported: as a \e component or \e child. A component is
|
||||
a single QML file that can contain other assets. A child is a single PNG
|
||||
file that you can use within QML files.
|
||||
each group or layer exported: as a \e component or \e child. A component
|
||||
will be imported as a single QML file that can contain other assets. A child
|
||||
will be imported as a single PNG file that you can use within QML files.
|
||||
|
||||
If you plan to use pieces of your artwork as separate images in the UI,
|
||||
group them on an artboard as separate layers. You can then export the group
|
||||
@@ -74,7 +75,7 @@
|
||||
|
||||
Place different parts of the UI, such as menus and pop-ups, on separate
|
||||
artboards to be able to export them as components or children and to
|
||||
import them as QML and PNG files that you can drag and drop to the
|
||||
import them as QML and PNG files that you can drag and drop to
|
||||
\uicontrol {Form Editor} in \QDS Design mode while creating a UI.
|
||||
|
||||
\QDS offers predefined sets of UI controls that you can modify according
|
||||
@@ -85,12 +86,13 @@
|
||||
However, if you want your UI controls, such as check boxes, to look exactly
|
||||
like they do in Photoshop, you have to create the control in an Artboard and
|
||||
use the artboard in the layers where the control instance is to be created.
|
||||
\QB exports the control as a custom QML component that you can program in
|
||||
\QB imports the control as a custom QML component that you can program in
|
||||
\QDS.
|
||||
|
||||
\section1 Exporting Assets
|
||||
|
||||
Each artboard is exported automatically as a component. That is, a separate
|
||||
Each artboard is exported automatically as a component, which means that it
|
||||
will be imported as a separate
|
||||
QML file that contains all the artwork on the artboard, except layers that
|
||||
are set to be skipped or exported as child items. You determine how
|
||||
each group or layer in an artboard is exported: as a component or a child
|
||||
@@ -147,13 +149,14 @@
|
||||
\li In the \uicontrol {Export As} field, select the export type for the
|
||||
group or layer:
|
||||
\list
|
||||
\li \uicontrol Component creates a separate QML file for the
|
||||
selected artboard, group, or layer that contains all the
|
||||
artwork in it, except layers that are set to be skipped or
|
||||
exported as child items.
|
||||
\li \uicontrol Child creates a separate PNG file for each asset
|
||||
of the selected group or layer, with references to the
|
||||
images in the component file.
|
||||
\li \uicontrol Component exports the selected artboard, group,
|
||||
or layer with metadata. The exported data can be used later
|
||||
to import the component as a separate QML file that contains
|
||||
all the artwork in it, except layers that are set to be
|
||||
skipped or exported as child items.
|
||||
\li \uicontrol Child exports each asset of the selected group
|
||||
or layer as a separate PNG file, with references
|
||||
to the images in the component file.
|
||||
\li \uicontrol Merged merges the selected groups and layers into
|
||||
the parent as one item.
|
||||
\li \uicontrol Skipped completely skips the selected layer.
|
||||
@@ -162,9 +165,9 @@
|
||||
to reuse. For example, you can use an artboard to define a
|
||||
component, such as a button, and reuse it in other artboards.
|
||||
\li In the \uicontrol {QML Type} field, specify the QML type
|
||||
or Studio component to morph this layer into. The generated
|
||||
component will be of this type. For example, if you drew a
|
||||
rectangle, you can export it as a Rectangle Studio component.
|
||||
or Studio component to morph this layer into. The component that is
|
||||
generated during import will be of this type. For example, if you
|
||||
drew a rectangle, you can export it as a Rectangle Studio component.
|
||||
You can provide the import statement of the module where the QML
|
||||
type is defined in the \uicontrol {Add Imports} field.
|
||||
\li In the \uicontrol {Add Imports} field, enter additional
|
||||
@@ -225,8 +228,8 @@
|
||||
PSD Document instance. You can undo the temporary changes done in the function
|
||||
\e preExport(...).
|
||||
\li customDefaultQmlId(name, instance)
|
||||
The function is called for settings the default QML id of the layer. The returned value
|
||||
is used for the QML id. Return \e Falsey to use the auto generated QML id instead.
|
||||
The function is called for setting the default QML id of the layer. The returned value
|
||||
is used for the QML id. Return \c false to use the auto generated QML id instead.
|
||||
The parameter \a name is the auto generated QML id by the plugin and \a instance is the
|
||||
PSD layer instance.
|
||||
\endlist
|
||||
|
@@ -32,7 +32,8 @@
|
||||
|
||||
\title Exporting Designs from Sketch
|
||||
|
||||
You can use \QBSK to export designs from Sketch to .ui.qml files.
|
||||
You can use \QBSK to export designs from Sketch to \e {.metadata}
|
||||
format that you can \l{Importing 2D Assets}{import} to projects in \QDS.
|
||||
|
||||
\image studio-sketch-export.png
|
||||
|
||||
@@ -43,13 +44,12 @@
|
||||
\li \l{Setting Up Qt Bridge for Sketch}
|
||||
|
||||
You must install Sketch and the \QBSK export tool before you can use
|
||||
the tool to convert artwork into Qt Quick files that you can import
|
||||
to projects in \QDS.
|
||||
the tool to export artwork.
|
||||
|
||||
\li \l{Using Qt Bridge for Sketch}
|
||||
|
||||
To get the best results when you use \QBSK to export designs from
|
||||
Sketch to Qt Quick files, you should follow the guidelines for
|
||||
working with Sketch and organizing your assets.
|
||||
Sketch, you should follow the guidelines for working with Sketch and
|
||||
organizing your assets.
|
||||
\endlist
|
||||
*/
|
||||
|
@@ -77,10 +77,10 @@
|
||||
The relationships between artboards and layers are preserved when you export
|
||||
designs from Sketch and import them into \QDS.
|
||||
|
||||
An artboard can only be exported as a component or skipped. A component is
|
||||
a separate QML file that contains all the artwork on the artboard, except
|
||||
layers that are set to be skipped or exported as child items. The child
|
||||
items can contain graphical assets or text.
|
||||
An artboard can only be exported as a component or skipped. A component will
|
||||
be imported as a separate QML file that contains all the artwork on the
|
||||
artboard, except layers that are set to be skipped or exported as child
|
||||
items. The child items can contain graphical assets or text.
|
||||
|
||||
To use the contents of an artboard as a single image in the UI, you can
|
||||
merge the groups and layers when you export them. During import, the
|
||||
@@ -149,23 +149,24 @@
|
||||
\li In the \uicontrol {Export As} field, select the export type for the
|
||||
group or layer:
|
||||
\list
|
||||
\li \uicontrol Component creates a separate QML file for the
|
||||
selected symbol that contains all the artwork in it, except
|
||||
layers or groups that are set to be skipped or exported as
|
||||
child items.
|
||||
\li \uicontrol Child creates a separate file for each asset
|
||||
of the selected group or layer, with references to the
|
||||
images in the component file. You select the image format
|
||||
in the \uicontrol {Asset Format} field.
|
||||
\li \uicontrol Component exports the selected symbol with
|
||||
metadata. The exported data can be used later to import
|
||||
the component as a separate QML file that contains all
|
||||
the artwork in it, except layers or groups that are set
|
||||
to be skipped or exported as child items.
|
||||
\li \uicontrol Child exports each asset of the selected group
|
||||
or layer a separate PNG file, with references
|
||||
to the images in the component file. You select the image
|
||||
format in the \uicontrol {Asset Format} field.
|
||||
\li \uicontrol Merged merges the selected groups and layers into
|
||||
the parent artboard or group as one item.
|
||||
\li \uicontrol Skipped completely skips the selected layer.
|
||||
\endlist
|
||||
\li In the \uicontrol {QML Type} field, specify the QML type or
|
||||
\l {Studio Components}{Qt Quick Studio Component} to morph this
|
||||
layer into. The generated component will be of this type. For
|
||||
example, if you drew a rectangle, you can export it as a
|
||||
\l Rectangle component.
|
||||
layer into. The component that is generated during import will be
|
||||
of this type. For example, if you drew a rectangle, you can export
|
||||
it as a \l Rectangle component.
|
||||
You can provide the import statement of the module where the QML
|
||||
type is defined in the \uicontrol {QML Imports} field.
|
||||
\li In the \uicontrol {QML Imports} field, enter
|
||||
|
@@ -43,7 +43,7 @@
|
||||
|
||||
\image studio-editing-3d-scenes.png "3D assets in Design mode"
|
||||
|
||||
To open the following views, select \uicontrol Window > \uicontrol Views:
|
||||
To open the following views, select \uicontrol View > \uicontrol Views:
|
||||
|
||||
\list
|
||||
\li \uicontrol {3D Editor} (1) is the working area where you create the
|
||||
|
@@ -107,10 +107,22 @@ Item {
|
||||
if (createEditView()) {
|
||||
if (activeScene) {
|
||||
var toolStates = _generalHelper.getToolStates(sceneId);
|
||||
if (Object.keys(toolStates).length > 0)
|
||||
if (Object.keys(toolStates).length > 0) {
|
||||
updateToolStates(toolStates, true);
|
||||
else
|
||||
} else {
|
||||
// Don't inherit the edit light state from the previous scene, but rather
|
||||
// turn the edit light on for scenes that do not have any scene
|
||||
// lights, and turn it off for scenes that have.
|
||||
var hasSceneLight = false;
|
||||
for (var i = 0; i < lightIconGizmos.length; ++i) {
|
||||
if (lightIconGizmos[i].scene === activeScene) {
|
||||
hasSceneLight = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
showEditLight = !hasSceneLight;
|
||||
storeCurrentToolStates();
|
||||
}
|
||||
} else {
|
||||
// When active scene is deleted, this function gets called by object deletion
|
||||
// handlers without going through setActiveScene, so make sure sceneId is cleared.
|
||||
@@ -141,6 +153,14 @@ Item {
|
||||
_generalHelper.enableItemUpdate(editView, (scene && scene === activeScene));
|
||||
}
|
||||
|
||||
function handleActiveSceneIdChange(newId)
|
||||
{
|
||||
if (sceneId !== newId) {
|
||||
sceneId = newId;
|
||||
storeCurrentToolStates();
|
||||
}
|
||||
}
|
||||
|
||||
function fitToView()
|
||||
{
|
||||
if (editView) {
|
||||
|
@@ -1253,12 +1253,33 @@ void Qt5InformationNodeInstanceServer::changeIds(const ChangeIdsCommand &command
|
||||
{
|
||||
Qt5NodeInstanceServer::changeIds(command);
|
||||
|
||||
#ifdef QUICK3D_MODULE
|
||||
ServerNodeInstance sceneInstance = active3DSceneInstance();
|
||||
if (m_active3DSceneUpdatePending) {
|
||||
ServerNodeInstance sceneInstance = active3DSceneInstance();
|
||||
const QString sceneId = sceneInstance.id();
|
||||
if (!sceneId.isEmpty())
|
||||
updateActiveSceneToEditView3D();
|
||||
} else {
|
||||
qint32 sceneInstanceId = sceneInstance.instanceId();
|
||||
const QVector<IdContainer> ids = command.ids();
|
||||
for (const auto &id : ids) {
|
||||
if (sceneInstanceId == id.instanceId()) {
|
||||
QMetaObject::invokeMethod(m_editView3DRootItem, "handleActiveSceneIdChange",
|
||||
Qt::QueuedConnection,
|
||||
Q_ARG(QVariant, QVariant(sceneInstance.id())));
|
||||
render3DEditView();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void Qt5InformationNodeInstanceServer::changeState(const ChangeStateCommand &command)
|
||||
{
|
||||
Qt5NodeInstanceServer::changeState(command);
|
||||
|
||||
render3DEditView();
|
||||
}
|
||||
|
||||
// update 3D view size when it changes in creator side
|
||||
|
@@ -62,6 +62,7 @@ public:
|
||||
void changeAuxiliaryValues(const ChangeAuxiliaryCommand &command) override;
|
||||
void changePropertyBindings(const ChangeBindingsCommand &command) override;
|
||||
void changeIds(const ChangeIdsCommand &command) override;
|
||||
void changeState(const ChangeStateCommand &command) override;
|
||||
|
||||
private slots:
|
||||
void handleSelectionChanged(const QVariant &objs);
|
||||
|
@@ -3,15 +3,8 @@ QT -= gui
|
||||
CONFIG += c++11 console
|
||||
CONFIG -= app_bundle
|
||||
|
||||
# The following define makes your compiler emit warnings if you use
|
||||
# any Qt feature that has been marked deprecated (the exact warnings
|
||||
# depend on your compiler). Please consult the documentation of the
|
||||
# deprecated API in order to know how to port your code away from it.
|
||||
DEFINES += QT_DEPRECATED_WARNINGS
|
||||
|
||||
# You can also make your code fail to compile if it uses deprecated APIs.
|
||||
# You can make your code fail to compile if it uses deprecated APIs.
|
||||
# In order to do so, uncomment the following line.
|
||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
SOURCES += \\
|
||||
|
@@ -4,15 +4,8 @@ QtApplication {
|
||||
cpp.cxxLanguageVersion: "c++11"
|
||||
|
||||
cpp.defines: [
|
||||
// The following define makes your compiler emit warnings if you use
|
||||
// any Qt feature that has been marked deprecated (the exact warnings
|
||||
// depend on your compiler). Please consult the documentation of the
|
||||
// deprecated API in order to know how to port your code away from it.
|
||||
"QT_DEPRECATED_WARNINGS",
|
||||
|
||||
// You can also make your code fail to compile if it uses deprecated APIs.
|
||||
// You can make your code fail to compile if it uses deprecated APIs.
|
||||
// In order to do so, uncomment the following line.
|
||||
// You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
//"QT_DISABLE_DEPRECATED_BEFORE=0x060000" // disables all the APIs deprecated before Qt 6.0.0
|
||||
]
|
||||
|
||||
|
@@ -17,15 +17,8 @@ DEFINES += %{LibraryDefine}
|
||||
|
||||
CONFIG += c++11
|
||||
|
||||
# The following define makes your compiler emit warnings if you use
|
||||
# any Qt feature that has been marked deprecated (the exact warnings
|
||||
# depend on your compiler). Please consult the documentation of the
|
||||
# deprecated API in order to know how to port your code away from it.
|
||||
DEFINES += QT_DEPRECATED_WARNINGS
|
||||
|
||||
# You can also make your code fail to compile if it uses deprecated APIs.
|
||||
# You can make your code fail to compile if it uses deprecated APIs.
|
||||
# In order to do so, uncomment the following line.
|
||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
SOURCES += \\
|
||||
|
@@ -20,16 +20,9 @@ DynamicLibrary {
|
||||
"QT_PLUGIN",
|
||||
@endif
|
||||
|
||||
// The following define makes your compiler emit warnings if you use
|
||||
// any Qt feature that has been marked deprecated (the exact warnings
|
||||
// depend on your compiler). Please consult the documentation of the
|
||||
// deprecated API in order to know how to port your code away from it.
|
||||
"QT_DEPRECATED_WARNINGS",
|
||||
|
||||
// You can also make your code fail to compile if it uses deprecated APIs.
|
||||
// You can make your code fail to compile if it uses deprecated APIs.
|
||||
// In order to do so, uncomment the following line.
|
||||
// You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
// "QT_DISABLE_DEPRECATED_BEFORE=0x060000", // disables all the APIs deprecated before Qt 6.0.0
|
||||
//"QT_DISABLE_DEPRECATED_BEFORE=0x060000" // disables all the APIs deprecated before Qt 6.0.0
|
||||
]
|
||||
|
||||
files: [
|
||||
|
@@ -6,15 +6,8 @@ QT += quick
|
||||
|
||||
CONFIG += c++11
|
||||
|
||||
# The following define makes your compiler emit warnings if you use
|
||||
# any Qt feature that has been marked deprecated (the exact warnings
|
||||
# depend on your compiler). Refer to the documentation for the
|
||||
# deprecated API to know how to port your code away from it.
|
||||
DEFINES += QT_DEPRECATED_WARNINGS
|
||||
|
||||
# You can also make your code fail to compile if it uses deprecated APIs.
|
||||
# You can make your code fail to compile if it uses deprecated APIs.
|
||||
# In order to do so, uncomment the following line.
|
||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
SOURCES += \\
|
||||
|
@@ -13,15 +13,8 @@ CppApplication {
|
||||
cpp.cxxLanguageVersion: "c++14"
|
||||
|
||||
cpp.defines: [
|
||||
// The following define makes your compiler emit warnings if you use
|
||||
// any Qt feature that has been marked deprecated (the exact warnings
|
||||
// depend on your compiler). Please consult the documentation of the
|
||||
// deprecated API in order to know how to port your code away from it.
|
||||
"QT_DEPRECATED_WARNINGS",
|
||||
|
||||
// You can also make your code fail to compile if it uses deprecated APIs.
|
||||
// You can make your code fail to compile if it uses deprecated APIs.
|
||||
// In order to do so, uncomment the following line.
|
||||
// You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
//"QT_DISABLE_DEPRECATED_BEFORE=0x060000" // disables all the APIs deprecated before Qt 6.0.0
|
||||
]
|
||||
|
||||
|
@@ -4,15 +4,8 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
CONFIG += c++11
|
||||
|
||||
# The following define makes your compiler emit warnings if you use
|
||||
# any Qt feature that has been marked deprecated (the exact warnings
|
||||
# depend on your compiler). Please consult the documentation of the
|
||||
# deprecated API in order to know how to port your code away from it.
|
||||
DEFINES += QT_DEPRECATED_WARNINGS
|
||||
|
||||
# You can also make your code fail to compile if it uses deprecated APIs.
|
||||
# You can make your code fail to compile if it uses deprecated APIs.
|
||||
# In order to do so, uncomment the following line.
|
||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
SOURCES += \\
|
||||
|
@@ -3,16 +3,10 @@ import qbs.FileInfo
|
||||
QtApplication {
|
||||
Depends { name: "Qt.widgets" }
|
||||
|
||||
// The following define makes your compiler emit warnings if you use
|
||||
// any Qt feature that has been marked deprecated (the exact warnings
|
||||
// depend on your compiler). Please consult the documentation of the
|
||||
// deprecated API in order to know how to port your code away from it.
|
||||
// You can also make your code fail to compile if it uses deprecated APIs.
|
||||
// In order to do so, uncomment the second entry in the list.
|
||||
// You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
cpp.defines: [
|
||||
"QT_DEPRECATED_WARNINGS",
|
||||
/* "QT_DISABLE_DEPRECATED_BEFORE=0x060000" */ // disables all the APIs deprecated before Qt 6.0.0
|
||||
// You can make your code fail to compile if it uses deprecated APIs.
|
||||
// In order to do so, uncomment the following line.
|
||||
//"QT_DISABLE_DEPRECATED_BEFORE=0x060000" // disables all the APIs deprecated before Qt 6.0.0
|
||||
]
|
||||
|
||||
files: [
|
||||
|
@@ -73,6 +73,7 @@
|
||||
#include <QProcess>
|
||||
#include <QRegularExpression>
|
||||
#include <QSettings>
|
||||
#include <QStandardPaths>
|
||||
#include <QStringList>
|
||||
#include <QTcpSocket>
|
||||
#include <QThread>
|
||||
@@ -964,6 +965,27 @@ QStringList AndroidConfig::allEssentials() const
|
||||
return allPackages;
|
||||
}
|
||||
|
||||
bool AndroidConfig::allEssentialsInstalled()
|
||||
{
|
||||
QStringList essentialPkgs(allEssentials());
|
||||
for (const AndroidSdkPackage *pkg :
|
||||
AndroidConfigurations::sdkManager()->installedSdkPackages()) {
|
||||
if (essentialPkgs.contains(pkg->sdkStylePath()))
|
||||
essentialPkgs.removeOne(pkg->sdkStylePath());
|
||||
if (essentialPkgs.isEmpty())
|
||||
break;
|
||||
}
|
||||
return essentialPkgs.isEmpty() ? true : false;
|
||||
}
|
||||
|
||||
bool AndroidConfig::sdkToolsOk() const
|
||||
{
|
||||
bool exists = sdkLocation().exists();
|
||||
bool writable = sdkLocation().isWritablePath();
|
||||
bool sdkToolsExist = !sdkToolsVersion().isNull();
|
||||
return exists && writable && sdkToolsExist;
|
||||
}
|
||||
|
||||
QStringList AndroidConfig::essentialsFromQtVersion(const BaseQtVersion &version) const
|
||||
{
|
||||
QtVersionNumber qtVersion = version.qtVersion();
|
||||
@@ -1070,6 +1092,28 @@ void AndroidConfig::setAutomaticKitCreation(bool b)
|
||||
m_automaticKitCreation = b;
|
||||
}
|
||||
|
||||
FilePath AndroidConfig::defaultSdkPath()
|
||||
{
|
||||
QString sdkFromEnvVar = QString::fromLocal8Bit(getenv("ANDROID_SDK_ROOT"));
|
||||
if (!sdkFromEnvVar.isEmpty())
|
||||
return Utils::FilePath::fromString(sdkFromEnvVar);
|
||||
|
||||
// Set default path of SDK as used by Android Studio
|
||||
if (Utils::HostOsInfo::isMacHost()) {
|
||||
return Utils::FilePath::fromString(
|
||||
QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)
|
||||
+ "/../Android/sdk");
|
||||
}
|
||||
|
||||
if (Utils::HostOsInfo::isWindowsHost()) {
|
||||
return Utils::FilePath::fromString(
|
||||
QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/Android/Sdk");
|
||||
}
|
||||
|
||||
return Utils::FilePath::fromString(
|
||||
QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/Android/Sdk");
|
||||
}
|
||||
|
||||
///////////////////////////////////
|
||||
// AndroidConfigurations
|
||||
///////////////////////////////////
|
||||
|
@@ -134,6 +134,8 @@ public:
|
||||
QStringList defaultEssentials() const;
|
||||
QStringList essentialsFromQtVersion(const QtSupport::BaseQtVersion &version) const;
|
||||
QStringList allEssentials() const;
|
||||
bool allEssentialsInstalled();
|
||||
bool sdkToolsOk() const;
|
||||
|
||||
Utils::FilePath openJDKLocation() const;
|
||||
void setOpenJDKLocation(const Utils::FilePath &openJDKLocation);
|
||||
@@ -150,6 +152,7 @@ public:
|
||||
bool automaticKitCreation() const;
|
||||
void setAutomaticKitCreation(bool b);
|
||||
|
||||
static Utils::FilePath defaultSdkPath();
|
||||
Utils::FilePath adbToolPath() const;
|
||||
Utils::FilePath androidToolPath() const;
|
||||
Utils::FilePath emulatorToolPath() const;
|
||||
|
@@ -102,8 +102,9 @@ public:
|
||||
private:
|
||||
void apply() final { AndroidConfigurations::setConfig(m_androidConfig); }
|
||||
|
||||
void showEvent(QShowEvent *event) override;
|
||||
|
||||
void validateJdk();
|
||||
void validateNdk();
|
||||
void updateNdkList();
|
||||
void onSdkPathChanged();
|
||||
void validateSdk();
|
||||
@@ -127,10 +128,6 @@ private:
|
||||
void disableAvdControls();
|
||||
|
||||
void downloadSdk();
|
||||
bool allEssentialsInstalled();
|
||||
bool sdkToolsOk() const;
|
||||
FilePath getDefaultSdkPath() const;
|
||||
void showEvent(QShowEvent *event) final;
|
||||
void addCustomNdkItem();
|
||||
void validateOpenSsl();
|
||||
|
||||
@@ -166,9 +163,6 @@ enum AndroidValidation {
|
||||
SdkManagerSuccessfulRow,
|
||||
PlatformSdkInstalledRow,
|
||||
AllEssentialsInstalledRow,
|
||||
NdkPathExistsRow,
|
||||
NdkDirStructureRow,
|
||||
NdkinstallDirOkRow
|
||||
};
|
||||
|
||||
enum OpenSslValidation {
|
||||
@@ -293,29 +287,6 @@ AvdModel::AvdModel()
|
||||
setHeader({tr("AVD Name"), tr("API"), tr("CPU/ABI"), tr("Device type"), tr("Target"), tr("SD-card size")});
|
||||
}
|
||||
|
||||
FilePath AndroidSettingsWidget::getDefaultSdkPath() const
|
||||
{
|
||||
QString sdkFromEnvVar = QString::fromLocal8Bit(getenv("ANDROID_SDK_ROOT"));
|
||||
if (!sdkFromEnvVar.isEmpty())
|
||||
return FilePath::fromString(sdkFromEnvVar);
|
||||
|
||||
// Set default path of SDK as used by Android Studio
|
||||
if (HostOsInfo::isMacHost()) {
|
||||
return FilePath::fromString(
|
||||
QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)
|
||||
+ "/../Android/sdk");
|
||||
}
|
||||
|
||||
if (HostOsInfo::isWindowsHost()) {
|
||||
return FilePath::fromString(
|
||||
QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation)
|
||||
+ "/Android/Sdk");
|
||||
}
|
||||
|
||||
return FilePath::fromString(
|
||||
QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/Android/Sdk");
|
||||
}
|
||||
|
||||
void AndroidSettingsWidget::showEvent(QShowEvent *event)
|
||||
{
|
||||
Q_UNUSED(event)
|
||||
@@ -409,10 +380,6 @@ AndroidSettingsWidget::AndroidSettingsWidget()
|
||||
"All essential packages installed for all installed Qt versions.");
|
||||
androidValidationPoints[BuildToolsInstalledRow] = tr("Build tools installed.");
|
||||
androidValidationPoints[PlatformSdkInstalledRow] = tr("Platform SDK installed.");
|
||||
androidValidationPoints[NdkPathExistsRow] = tr("Default Android NDK path exists.");
|
||||
androidValidationPoints[NdkDirStructureRow] = tr("Default Android NDK directory structure is correct.");
|
||||
androidValidationPoints[NdkinstallDirOkRow] = tr("Default Android NDK installed into a path without "
|
||||
"spaces.");
|
||||
m_androidSummary = new SummaryWidget(androidValidationPoints, tr("Android settings are OK."),
|
||||
tr("Android settings have errors."),
|
||||
m_ui.androidDetailsWidget);
|
||||
@@ -438,7 +405,7 @@ AndroidSettingsWidget::AndroidSettingsWidget()
|
||||
|
||||
FilePath currentSDKPath = m_androidConfig.sdkLocation();
|
||||
if (currentSDKPath.isEmpty())
|
||||
currentSDKPath = getDefaultSdkPath();
|
||||
currentSDKPath = AndroidConfig::defaultSdkPath();
|
||||
|
||||
m_ui.SDKLocationPathChooser->setFilePath(currentSDKPath);
|
||||
m_ui.SDKLocationPathChooser->setPromptDialogTitle(tr("Select Android SDK folder"));
|
||||
@@ -471,7 +438,7 @@ AndroidSettingsWidget::AndroidSettingsWidget()
|
||||
this, &AndroidSettingsWidget::onSdkPathChanged);
|
||||
|
||||
connect(m_ui.ndkListWidget, &QListWidget::currentTextChanged, [this](const QString &ndk) {
|
||||
validateNdk();
|
||||
updateUI();
|
||||
m_ui.removeCustomNdkButton->setEnabled(m_androidConfig.getCustomNdkList().contains(ndk));
|
||||
});
|
||||
connect(m_ui.addCustomNdkButton, &QPushButton::clicked, this,
|
||||
@@ -602,26 +569,6 @@ void AndroidSettingsWidget::validateOpenSsl()
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void AndroidSettingsWidget::validateNdk()
|
||||
{
|
||||
const QListWidgetItem *currentItem = m_ui.ndkListWidget->currentItem();
|
||||
const FilePath ndkPath = FilePath::fromString(currentItem ? currentItem->text() : "");
|
||||
|
||||
m_androidSummary->setPointValid(NdkPathExistsRow, ndkPath.exists());
|
||||
|
||||
const FilePath ndkPlatformsDir = ndkPath.pathAppended("platforms");
|
||||
const FilePath ndkToolChainsDir = ndkPath.pathAppended("toolchains");
|
||||
const FilePath ndkSourcesDir = ndkPath.pathAppended("sources/cxx-stl");
|
||||
m_androidSummary->setPointValid(NdkDirStructureRow,
|
||||
ndkPlatformsDir.exists()
|
||||
&& ndkToolChainsDir.exists()
|
||||
&& ndkSourcesDir.exists());
|
||||
m_androidSummary->setPointValid(NdkinstallDirOkRow,
|
||||
ndkPlatformsDir.exists()
|
||||
&& !ndkPlatformsDir.toString().contains(' '));
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void AndroidSettingsWidget::onSdkPathChanged()
|
||||
{
|
||||
auto sdkPath = FilePath::fromUserInput(m_ui.SDKLocationPathChooser->rawPath());
|
||||
@@ -652,10 +599,7 @@ void AndroidSettingsWidget::validateSdk()
|
||||
// after AndroidSdkManager::packageReloadFinished.
|
||||
m_androidSummary->setPointValid(PlatformSdkInstalledRow,
|
||||
!m_sdkManager.installedSdkPlatforms().isEmpty());
|
||||
|
||||
m_androidSummary->setPointValid(AllEssentialsInstalledRow, allEssentialsInstalled());
|
||||
|
||||
updateUI();
|
||||
m_androidSummary->setPointValid(AllEssentialsInstalledRow, m_androidConfig.allEssentialsInstalled());
|
||||
|
||||
const bool sdkToolsOk = m_androidSummary->rowsOk({SdkPathExistsRow,
|
||||
SdkPathWritableRow,
|
||||
@@ -680,7 +624,7 @@ void AndroidSettingsWidget::validateSdk()
|
||||
|
||||
startUpdateAvd();
|
||||
updateNdkList();
|
||||
validateNdk();
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void AndroidSettingsWidget::openSDKDownloadUrl()
|
||||
@@ -857,7 +801,7 @@ void AndroidSettingsWidget::updateUI()
|
||||
|
||||
const QListWidgetItem *currentItem = m_ui.ndkListWidget->currentItem();
|
||||
const FilePath currentNdk = FilePath::fromString(currentItem ? currentItem->text() : "");
|
||||
const QString infoText = tr("(SDK Version: %1, NDK Bundle Version: %2)")
|
||||
const QString infoText = tr("(SDK Version: %1, NDK Version: %2)")
|
||||
.arg(m_androidConfig.sdkToolsVersion().toString())
|
||||
.arg(currentNdk.isEmpty() ? "" : m_androidConfig.ndkVersion(currentNdk).toString());
|
||||
m_androidSummary->setInfoText(androidSetupOk ? infoText : "");
|
||||
@@ -869,7 +813,7 @@ void AndroidSettingsWidget::updateUI()
|
||||
|
||||
void AndroidSettingsWidget::downloadSdk()
|
||||
{
|
||||
if (sdkToolsOk()) {
|
||||
if (m_androidConfig.sdkToolsOk()) {
|
||||
QMessageBox::warning(this, AndroidSdkDownloader::dialogTitle(),
|
||||
tr("The selected path already has a valid SDK Tools package."));
|
||||
validateSdk();
|
||||
@@ -889,25 +833,6 @@ void AndroidSettingsWidget::downloadSdk()
|
||||
}
|
||||
}
|
||||
|
||||
bool AndroidSettingsWidget::allEssentialsInstalled()
|
||||
{
|
||||
QStringList essentialPkgs = m_androidConfig.allEssentials();
|
||||
for (const AndroidSdkPackage *pkg : m_sdkManager.installedSdkPackages()) {
|
||||
essentialPkgs.removeOne(pkg->sdkStylePath());
|
||||
if (essentialPkgs.isEmpty())
|
||||
break;
|
||||
}
|
||||
return essentialPkgs.isEmpty() ? true : false;
|
||||
}
|
||||
|
||||
bool AndroidSettingsWidget::sdkToolsOk() const
|
||||
{
|
||||
bool exists = m_androidConfig.sdkLocation().exists();
|
||||
bool writable = m_androidConfig.sdkLocation().isWritablePath();
|
||||
bool sdkToolsExist = !m_androidConfig.sdkToolsVersion().isNull();
|
||||
return exists && writable && sdkToolsExist;
|
||||
}
|
||||
|
||||
// AndroidSettingsPage
|
||||
|
||||
AndroidSettingsPage::AndroidSettingsPage()
|
||||
|
@@ -14,18 +14,10 @@ CONFIG -= app_bundle
|
||||
|
||||
TEMPLATE = app
|
||||
|
||||
# The following define makes your compiler emit warnings if you use
|
||||
# any feature of Qt which as been marked as deprecated (the exact warnings
|
||||
# depend on your compiler). Please consult the documentation of the
|
||||
# deprecated API in order to know how to port your code away from it.
|
||||
DEFINES += QT_DEPRECATED_WARNINGS
|
||||
|
||||
# You can also make your code fail to compile if you use deprecated APIs.
|
||||
# You can make your code fail to compile if it uses deprecated APIs.
|
||||
# In order to do so, uncomment the following line.
|
||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
|
||||
SOURCES += tst_derivedtest.cpp \
|
||||
origin.cpp
|
||||
DEFINES += SRCDIR=\\\"$$PWD/\\\"
|
||||
|
@@ -23,14 +23,21 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
#pragma once
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/optional.h>
|
||||
#include <QDir>
|
||||
#include <QString>
|
||||
#include <QVariant>
|
||||
|
||||
namespace MesonProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
inline QStringList cleanPath(QStringList &&paths)
|
||||
{
|
||||
return Utils::transform(paths, QDir::cleanPath);
|
||||
}
|
||||
|
||||
struct Target
|
||||
{
|
||||
enum class Type {
|
||||
@@ -58,8 +65,8 @@ struct Target
|
||||
: language{std::move(language)}
|
||||
, compiler{std::move(compiler)}
|
||||
, parameters{std::move(parameters)}
|
||||
, sources{std::move(sources)}
|
||||
, generatedSources{std::move(generatedSources)}
|
||||
, sources{cleanPath(std::move(sources))}
|
||||
, generatedSources{cleanPath(std::move(generatedSources))}
|
||||
{}
|
||||
};
|
||||
using SourceGroupList = std::vector<SourceGroup>;
|
||||
@@ -71,17 +78,13 @@ struct Target
|
||||
const Utils::optional<QString> subproject;
|
||||
const SourceGroupList sources;
|
||||
|
||||
static inline QString fullName(const Target &target)
|
||||
static inline QString fullName(const Utils::FilePath &srcDir, const Target &target)
|
||||
{
|
||||
// TODO, this is bad, might be moved in a place where src dir is known
|
||||
if (target.fileName.first().startsWith("/")) {
|
||||
auto fname = target.fileName.first().split('/');
|
||||
auto definedIn = target.definedIn.split('/');
|
||||
definedIn.pop_back();
|
||||
int i = std::min(definedIn.length(), fname.length()) - 1;
|
||||
for (; i >= 0 && fname[i] == definedIn[i]; --i)
|
||||
;
|
||||
return fname.mid(i + 1).join("/");
|
||||
using namespace Utils;
|
||||
if (FileUtils::isAbsolutePath(target.fileName.first())) {
|
||||
const auto fname = target.fileName.first().split('/').last();
|
||||
QString definedIn = FilePath::fromString(target.definedIn).absolutePath().toString();
|
||||
return definedIn.remove(srcDir.toString()) + '/' + fname;
|
||||
} else {
|
||||
return target.fileName.first();
|
||||
}
|
||||
@@ -116,8 +119,8 @@ struct Target
|
||||
: type{toType(type)}
|
||||
, name{std::move(name)}
|
||||
, id{std::move(id)}
|
||||
, definedIn{std::move(definedIn)}
|
||||
, fileName{std::move(fileName)}
|
||||
, definedIn{QDir::cleanPath(definedIn)}
|
||||
, fileName{cleanPath(std::move(fileName))}
|
||||
, subproject{subproject.isNull() ? Utils::nullopt
|
||||
: Utils::optional<QString>{std::move(subproject)}}
|
||||
, sources{std::move(sources)}
|
||||
|
@@ -98,7 +98,7 @@ QStringList toAbsolutePath(const Utils::FilePath &refPath, QStringList &pathList
|
||||
std::cend(pathList),
|
||||
std::back_inserter(allAbs),
|
||||
[refPath](const QString &path) {
|
||||
if (path.startsWith("/"))
|
||||
if (Utils::FileUtils::isAbsolutePath(path))
|
||||
return path;
|
||||
return refPath.pathAppended(path).toString();
|
||||
});
|
||||
@@ -200,11 +200,11 @@ QList<ProjectExplorer::BuildTargetInfo> MesonProjectParser::appsTargets() const
|
||||
QList<ProjectExplorer::BuildTargetInfo> apps;
|
||||
std::for_each(std::cbegin(m_parserResult.targets),
|
||||
std::cend(m_parserResult.targets),
|
||||
[&apps](const Target &target) {
|
||||
[&apps, srcDir = m_srcDir](const Target &target) {
|
||||
if (target.type == Target::Type::executable) {
|
||||
ProjectExplorer::BuildTargetInfo bti;
|
||||
bti.displayName = target.name;
|
||||
bti.buildKey = Target::fullName(target);
|
||||
bti.buildKey = Target::fullName(srcDir, target);
|
||||
bti.displayNameUniquifier = bti.buildKey;
|
||||
bti.targetFilePath = Utils::FilePath::fromString(target.fileName.first());
|
||||
bti.workingDirectory
|
||||
@@ -260,10 +260,9 @@ void MesonProjectParser::update(const QFuture<MesonProjectParser::ParserData *>
|
||||
m_parserResult = std::move(parserData->data);
|
||||
m_rootNode = std::move(parserData->rootNode);
|
||||
m_targetsNames.clear();
|
||||
std::transform(std::cbegin(m_parserResult.targets),
|
||||
std::cend(m_parserResult.targets),
|
||||
std::back_inserter(m_targetsNames),
|
||||
Target::fullName);
|
||||
for (const Target &target : m_parserResult.targets) {
|
||||
m_targetsNames.push_back(Target::fullName(m_srcDir, target));
|
||||
}
|
||||
addMissingTargets(m_targetsNames);
|
||||
m_targetsNames.sort();
|
||||
delete data;
|
||||
@@ -278,11 +277,11 @@ ProjectExplorer::RawProjectPart MesonProjectParser::buildRawPart(
|
||||
{
|
||||
ProjectExplorer::RawProjectPart part;
|
||||
part.setDisplayName(target.name);
|
||||
part.setBuildSystemTarget(Target::fullName(target));
|
||||
part.setBuildSystemTarget(Target::fullName(m_srcDir, target));
|
||||
part.setFiles(sources.sources + sources.generatedSources);
|
||||
auto flags = splitArgs(sources.parameters);
|
||||
part.setMacros(flags.macros);
|
||||
part.setIncludePaths(toAbsolutePath(this->m_buildDir, flags.includePaths));
|
||||
part.setIncludePaths(toAbsolutePath(m_buildDir, flags.includePaths));
|
||||
part.setProjectFileLocation(target.definedIn);
|
||||
if (sources.language == "cpp")
|
||||
part.setFlagsForCxx({cxxToolChain, flags.args});
|
||||
|
@@ -42,14 +42,14 @@ void buildTargetTree(std::unique_ptr<MesonProjectNode> &root, const Target &targ
|
||||
|
||||
void addTargetNode(std::unique_ptr<MesonProjectNode> &root, const Target &target)
|
||||
{
|
||||
root->findNode([&target, path = Utils::FilePath::fromString(target.definedIn)](
|
||||
root->findNode([&root, &target, path = Utils::FilePath::fromString(target.definedIn)](
|
||||
ProjectExplorer::Node *node) {
|
||||
if (node->filePath() == path.absolutePath()) {
|
||||
auto asFolder = dynamic_cast<ProjectExplorer::FolderNode *>(node);
|
||||
if (asFolder) {
|
||||
auto targetNode = std::make_unique<MesonTargetNode>(path.absolutePath().pathAppended(
|
||||
target.name),
|
||||
Target::fullName(target));
|
||||
auto targetNode = std::make_unique<MesonTargetNode>(
|
||||
path.absolutePath().pathAppended(target.name),
|
||||
Target::fullName(Utils::FilePath::fromString(root->path()), target));
|
||||
targetNode->setDisplayName(target.name);
|
||||
asFolder->addNode(std::move(targetNode));
|
||||
}
|
||||
@@ -84,7 +84,7 @@ std::unique_ptr<MesonProjectNode> ProjectTree::buildTree(const Utils::FilePath &
|
||||
addTargetNode(root, target);
|
||||
});
|
||||
for (Utils::FilePath bsFile : bsFiles) {
|
||||
if (!bsFile.startsWith("/"))
|
||||
if (!bsFile.toFileInfo().isAbsolute())
|
||||
bsFile = srcDir.pathAppended(bsFile.toString());
|
||||
root->addNestedNode(
|
||||
std::make_unique<ProjectExplorer::FileNode>(bsFile, ProjectExplorer::FileType::Project));
|
||||
|
@@ -44,7 +44,7 @@ struct projectData
|
||||
|
||||
namespace {
|
||||
static const QList<projectData> projectList{
|
||||
{"Simple C Project", "SimpleCProject", {"SimpleCProject"}}};
|
||||
{"Simple C Project", "simplecproject", {"SimpleCProject"}}};
|
||||
} // namespace
|
||||
|
||||
#define WITH_CONFIGURED_PROJECT(_source_dir, _build_dir, ...) \
|
||||
|
@@ -34,7 +34,7 @@
|
||||
using namespace MesonProjectManager::Internal;
|
||||
|
||||
namespace {
|
||||
static const QList<QPair<const char *, QString>> projectList{{"Simple C Project", "SimpleCProject"}};
|
||||
static const QList<QPair<const char *, QString>> projectList{{"Simple C Project", "simplecproject"}};
|
||||
} // namespace
|
||||
|
||||
class AMesonWrapper : public QObject
|
||||
|
@@ -68,6 +68,8 @@ using namespace Utils;
|
||||
namespace ProjectExplorer {
|
||||
namespace Internal {
|
||||
|
||||
const int RunColumnWidth = 30;
|
||||
|
||||
static QIcon createCenteredIcon(const QIcon &icon, const QIcon &overlay)
|
||||
{
|
||||
QPixmap targetPixmap;
|
||||
@@ -475,14 +477,10 @@ void TargetSelectorDelegate::paint(QPainter *painter,
|
||||
->setData(index, index.model()->data(index, Qt::UserRole + 1).toString(), Qt::ToolTipRole);
|
||||
painter->drawText(option.rect.left() + 6, option.rect.top() + (option.rect.height() - fm.height()) / 2 + fm.ascent(), elidedText);
|
||||
if (index.column() == 1 && option.state & QStyle::State_MouseOver) {
|
||||
const QIcon icon = Utils::Icons::RUN_SMALL.icon();
|
||||
QRect iconRect(option.rect.right() - option.rect.height(),
|
||||
option.rect.top(),
|
||||
option.rect.height() / painter->device()->devicePixelRatio(),
|
||||
option.rect.height() / painter->device()->devicePixelRatio());
|
||||
iconRect.translate((option.rect.width() - iconRect.width()) / 2,
|
||||
(option.rect.height() - iconRect.height()) / 2);
|
||||
icon.paint(painter, iconRect, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
const QIcon icon = Utils::Icons::RUN_SMALL_TOOLBAR.icon();
|
||||
QRect iconRect(0, 0, 16, 16);
|
||||
iconRect.moveCenter(option.rect.center());
|
||||
icon.paint(painter, iconRect);
|
||||
}
|
||||
|
||||
painter->restore();
|
||||
@@ -545,6 +543,8 @@ int SelectorView::optimalWidth() const
|
||||
void SelectorView::setOptimalWidth(int width)
|
||||
{
|
||||
m_optimalWidth = width;
|
||||
if (model()->columnCount() == 2)
|
||||
m_optimalWidth += RunColumnWidth;
|
||||
updateGeometry();
|
||||
}
|
||||
|
||||
@@ -950,7 +950,7 @@ void MiniProjectTargetSelector::doLayout(bool keepSize)
|
||||
|
||||
QVector<int> widths = listWidgetWidths(minWidth, 1000);
|
||||
|
||||
const int runColumnWidth = widths[RUN] == -1 ? 0 : 30;
|
||||
const int runColumnWidth = widths[RUN] == -1 ? 0 : RunColumnWidth;
|
||||
int x = 0;
|
||||
for (int i = PROJECT; i < LAST; ++i) {
|
||||
int optimalWidth = widths[i];
|
||||
@@ -968,7 +968,8 @@ void MiniProjectTargetSelector::doLayout(bool keepSize)
|
||||
x += optimalWidth + 1; //1 extra pixel for the separators or the right border
|
||||
}
|
||||
|
||||
m_listWidgets[RUN]->setColumnWidth(0, m_listWidgets[RUN]->size().width() - runColumnWidth);
|
||||
m_listWidgets[RUN]->setColumnWidth(0, m_listWidgets[RUN]->size().width() - runColumnWidth
|
||||
- m_listWidgets[RUN]->padding());
|
||||
m_listWidgets[RUN]->setColumnWidth(1, runColumnWidth);
|
||||
m_summaryLabel->resize(x - 1, summaryLabelHeight);
|
||||
m_kitAreaWidget->resize(x - 1, kitAreaHeight);
|
||||
|
@@ -48,6 +48,7 @@
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/basetreeview.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/navigationtreeview.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/styledbar.h>
|
||||
@@ -341,11 +342,31 @@ public:
|
||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
}
|
||||
|
||||
private:
|
||||
// remove branch indicators
|
||||
void drawBranches(QPainter *, const QRect &, const QModelIndex &) const final
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool userWantsContextMenu(const QMouseEvent *e) const
|
||||
{
|
||||
// On Windows, we get additional mouse events for the item view when right-clicking,
|
||||
// causing unwanted kit activation (QTCREATORBUG-24156). Let's suppress these.
|
||||
return HostOsInfo::isWindowsHost() && e->button() == Qt::RightButton;
|
||||
}
|
||||
|
||||
void mousePressEvent(QMouseEvent *e)
|
||||
{
|
||||
if (!userWantsContextMenu(e))
|
||||
BaseTreeView::mousePressEvent(e);
|
||||
}
|
||||
|
||||
void mouseReleaseEvent(QMouseEvent *e)
|
||||
{
|
||||
if (!userWantsContextMenu(e))
|
||||
BaseTreeView::mouseReleaseEvent(e);
|
||||
}
|
||||
};
|
||||
|
||||
class ComboBoxItem : public TreeItem
|
||||
|
@@ -112,14 +112,8 @@ void QtProjectParameters::writeProFile(QTextStream &str) const
|
||||
|
||||
if (qtVersionSupport != SupportQt4Only) {
|
||||
str << "\n"
|
||||
"# The following define makes your compiler emit warnings if you use\n"
|
||||
"# any feature of Qt which has been marked as deprecated (the exact warnings\n"
|
||||
"# depend on your compiler). Please consult the documentation of the\n"
|
||||
"# deprecated API in order to know how to port your code away from it.\n"
|
||||
"DEFINES += QT_DEPRECATED_WARNINGS\n\n"
|
||||
"# You can also make your code fail to compile if you use deprecated APIs.\n"
|
||||
"# You can make your code fail to compile if you use deprecated APIs.\n"
|
||||
"# In order to do so, uncomment the following line.\n"
|
||||
"# You can also select to disable deprecated APIs only up to a certain version of Qt.\n"
|
||||
"#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0\n";
|
||||
}
|
||||
}
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include <QByteArrayList>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "utils/qtcassert.h"
|
||||
|
||||
|
@@ -81,9 +81,6 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
@@ -128,9 +125,6 @@
|
||||
</property>
|
||||
<item row="2" column="0" colspan="3">
|
||||
<widget class="QTableView" name="bindingView">
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
@@ -175,9 +169,6 @@
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QTableView" name="dynamicPropertiesView">
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
@@ -222,9 +213,6 @@
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QTableView" name="backendView">
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
|
@@ -38,10 +38,9 @@ QTableView::item:selected
|
||||
|
||||
QHeaderView::section {
|
||||
background-color: #494949;
|
||||
padding: 4px;
|
||||
border: 1px solid black;
|
||||
border: 0px;
|
||||
color: creatorTheme.DStextColor;
|
||||
margin: 2px
|
||||
margin-right: 1px
|
||||
}
|
||||
|
||||
QTableView {
|
||||
|
@@ -508,6 +508,9 @@ QVector<PropertyInfo> getObjectTypes(const ObjectValue *objectValue, const Conte
|
||||
|
||||
if (isValueType(property.second)) {
|
||||
const Value *dotValue = objectValue->lookupMember(nameAsString, context);
|
||||
if (!dotValue)
|
||||
continue;
|
||||
|
||||
if (const Reference *ref = dotValue->asReference())
|
||||
dotValue = context->lookupReference(ref);
|
||||
|
||||
|
@@ -861,9 +861,10 @@ Project {
|
||||
"transitioneditor/transitioneditorpropertyitem.h",
|
||||
"transitioneditor/transitioneditorsettingsdialog.cpp",
|
||||
"transitioneditor/transitioneditorsettingsdialog.h",
|
||||
"transitioneditor/transitioneditorsettingsdialog.ui"
|
||||
"transitioneditor/transitioneditorsettingsdialog.ui",
|
||||
"transitioneditor/transitionform.cpp",
|
||||
"transitioneditor/transitionform.h",
|
||||
"transitioneditor/transitionform.ui",
|
||||
"transitioneditor/transitioneditor.qrc"
|
||||
]
|
||||
}
|
||||
|
@@ -7,8 +7,10 @@ add_qtc_test(tst_debugger_disassembler
|
||||
"${DEBUGGERDIR}/disassemblerlines.cpp" "${DEBUGGERDIR}/disassemblerlines.h"
|
||||
)
|
||||
|
||||
option(WITH_DEBUGGER_DUMPERS "Include tests for debugger pretty printers" OFF)
|
||||
if (WITH_DEBUGGER_DUMPERS)
|
||||
add_qtc_test(tst_debugger_dumpers
|
||||
TIMEOUT 0
|
||||
DEPENDS Qt5::Network Utils
|
||||
DEFINES DUMPERDIR="${PROJECT_SOURCE_DIR}/share/qtcreator/debugger"
|
||||
INCLUDES
|
||||
|
@@ -4255,7 +4255,7 @@ void tst_TestCore::testMetaInfoSimpleType()
|
||||
QCOMPARE(itemMetaInfo.superClasses().size(), 2); // Item, QtQuick.QtObject
|
||||
QVERIFY(itemMetaInfo.isSubclassOf("QtQuick.Item", -1, -1));
|
||||
QVERIFY(itemMetaInfo.isSubclassOf("<cpp>.QObject", -1, -1));
|
||||
QVERIFY(itemMetaInfo.isSubclassOf("QtQuick.QtObject", -1, -1));
|
||||
QVERIFY(itemMetaInfo.isSubclassOf("QtQml.QtObject", -1, -1));
|
||||
|
||||
// availableInVersion
|
||||
QVERIFY(itemMetaInfo.availableInVersion(2, 2));
|
||||
|
Reference in New Issue
Block a user