Merge remote-tracking branch 'origin/10.0'

Change-Id: Idf151b6cfe87957cf905e67aab6b1275b9f0506a
This commit is contained in:
Eike Ziller
2023-03-06 08:24:18 +01:00
21 changed files with 1083 additions and 859 deletions

View File

@@ -2,10 +2,11 @@ cmake_minimum_required(VERSION 3.16)
project(accelbubble VERSION 0.1 LANGUAGES CXX)
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt6 6.2 COMPONENTS Quick Sensors Svg Xml REQUIRED)
find_package(Qt6 6.4 REQUIRED COMPONENTS Quick Sensors Svg Xml)
qt_standard_project_setup()
qt_add_executable(appaccelbubble
main.cpp
@@ -15,7 +16,7 @@ qt_add_executable(appaccelbubble
qt_add_qml_module(appaccelbubble
URI accelbubble
VERSION 1.0
QML_FILES main.qml
QML_FILES Main.qml
RESOURCES Bluebubble.svg
)
@@ -37,4 +38,8 @@ target_compile_definitions(appaccelbubble
target_link_libraries(appaccelbubble
PRIVATE Qt6::Quick Qt6::Sensors Qt6::Svg Qt6::Xml)
install(TARGETS appaccelbubble
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
qt_finalize_executable(appaccelbubble)

View File

@@ -2,10 +2,11 @@ cmake_minimum_required(VERSION 3.16)
project(transitions VERSION 0.1 LANGUAGES CXX)
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt6 6.2 COMPONENTS Quick REQUIRED)
find_package(Qt6 6.4 REQUIRED COMPONENTS Quick)
qt_standard_project_setup()
qt_add_executable(apptransitions
main.cpp
@@ -14,7 +15,7 @@ qt_add_executable(apptransitions
qt_add_qml_module(apptransitions
URI transitions
VERSION 1.0
QML_FILES main.qml Page.qml
QML_FILES Main.qml Page.qml
RESOURCES qt-logo.png
)
@@ -26,7 +27,10 @@ set_target_properties(apptransitions PROPERTIES
WIN32_EXECUTABLE TRUE
)
target_compile_definitions(apptransitions
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(apptransitions
PRIVATE Qt6::Quick)
PRIVATE Qt6::Quick
)
install(TARGETS apptransitions
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@@ -58,7 +58,7 @@
In the first step, you select a template for the project. You can filter
templates (1) to view only those that apply to a particular target platform.
\image qtcreator-new-project.png
\image qtcreator-new-project.webp {New Project dialog}
Next, you select a location for the project and specify settings for it.
@@ -95,9 +95,12 @@
\li Uses a single main.cpp file.
\row
\li Qt Quick Application
\li Creates a Qt Quick 2 application project that can have both
\li Creates a Qt Quick application project that can have both
QML and C++ code. You can build the application and deploy it
to desktop, embedded, and mobile target platforms.
You can select an option to create a project that you can open
in \QDS, which has a visual editor for Qt Quick UIs.
\row
\li {1,4} Application (Qt for Python)
\li Empty Application
@@ -129,7 +132,7 @@
\row
\li Qt Quick 2 Extension Plugin
\li Creates a C++ plugin that makes it possible to offer extensions
that the QQmlEngine class can load dynamically into Qt Quick 2
that the QQmlEngine class can load dynamically into Qt Quick
applications.
\row
\li \QC Plugin
@@ -142,7 +145,7 @@
\li Qt Quick UI Prototype
\li Creates a \l{Creating Qt Quick UI Projects}{Qt Quick UI project}
with a single QML file that has the main view. You can
preview Qt Quick 2 UI projects in the
preview Qt Quick UI projects in the
\l{Validating with Target Hardware}{QML Scene preview tool}.
You do not need to build them because they do not have any
C++ code.
@@ -333,7 +336,7 @@
\uicontrol {New Subproject}. Follow the steps in the
\uicontrol {New Subproject} wizard to create a subproject.
\image qtcreator-new-qt-quick-project.png
\image qtcreator-project-qt-quick.webp {New Project dialog}
To add an existing project as a subproject, select
\uicontrol {Add Existing Projects} in the context menu.

View File

@@ -22,12 +22,12 @@
For more examples, see \l{Qt Quick Examples and Tutorials}.
You can develop Qt Quick applications also in \QDS. For more information,
see \l{Qt Design Studio Manual}.
You can use a visual editor to develop Qt Quick applications in \QDS. For
more information, see \l{Qt Design Studio Manual}.
\include qtquick-tutorial-create-empty-project.qdocinc qtquick empty application
\QC generates a component file, \e main.qml, and opens it in the
\QC generates a component file, \e Main.qml, and opens it in the
\uicontrol Edit mode.
\section1 Deploying Applications

View File

@@ -14,8 +14,6 @@
\title Creating Qt Quick Projects
\image qtcreator-new-qt-quick-project.png "New Project dialog"
The following table lists the wizard templates for creating a new
Qt Quick project from scratch.
@@ -27,9 +25,12 @@
\row
\li Application (Qt)
\li Qt Quick Application
\li Creates a Qt Quick 2 application project that can have both
\li Creates a Qt Quick application project that can have both
QML and C++ code. You can build the application and deploy it
to desktop, embedded, and mobile target platforms.
You can select an option to create a project that you can open
in \QDS.
\row
\li Application (Qt for Python)
\li Qt for Python - Qt Quick Application
@@ -39,7 +40,7 @@
\li Other Project
\li Qt Quick UI Prototype
\li Creates a Qt Quick UI project with a single QML file that
has the main view. You can preview Qt Quick 2 UI projects
has the main view. You can preview Qt Quick UI projects
in the QML Scene preview tool. You do not need to build them
because they do not have any C++ code.
@@ -47,14 +48,14 @@
template only if you are prototyping. You cannot create
a full application by using this template.
Qt Quick UI projects cannot be deployed to embedded or mobile
target platforms. For those platforms, create a Qt Quick
You cannot deploy Qt Quick UI projects to embedded or
mobile target platforms. For those platforms, create a Qt Quick
application instead.
\row
\li Library
\li Qt Quick 2 Extension Plugin
\li Creates C++ plugins that make it possible to offer extensions
that can be loaded dynamically into Qt Quick 2 applications.
that can be loaded dynamically into Qt Quick applications.
\endtable
\note The SDK for a particular target platform might install additional
@@ -72,6 +73,8 @@
\uicontrol {Application (Qt)} > \uicontrol {Qt Quick Application}
> \uicontrol Choose.
\image qtcreator-project-qt-quick.webp {New Project dialog}
\li In the \uicontrol {Project Location} dialog, \uicontrol Name field,
enter a name for the project. Keep in mind that you cannot easily
change the project name later.
@@ -84,6 +87,11 @@
\li Select \uicontrol Next (or \uicontrol Continue on \macos) to open
the \uicontrol {Define Build System} dialog.
\image qtcreator-project-qt-quick-details.webp {Define Project Details dialog}
To create a project that you can develop with a visual editor in
\QDS, select \uicontrol {Create a project that you can open in \QDS}.
\li In the \uicontrol {Build system} field, select the build system to
use for building and running the project: \l qmake,
\l {Setting Up CMake}{CMake}, or \l {Setting Up Qbs}{Qbs}.
@@ -101,20 +109,9 @@
\note If you have not installed the Qt Virtual Keyboard module when
you installed Qt, an error message will appear when you try to open
\e main.qml for editing. You can use the \l {Installing Qt}
\e Main.qml for editing. You can use the \l {Installing Qt}
{Qt Maintenance Tool} to install Qt Virtual Keyboard.
\li Select \uicontrol Next to open the \uicontrol {Translation File}
dialog.
\li In the \uicontrol Language field, select a language that you plan
to \l {Using Qt Linguist}{translate} the application to. You can
add other languages later by editing the project file.
\li In the \uicontrol {Translation file} field, you can edit the
name for the translation source file that will be generated
for the selected language.
\li Select \uicontrol Next to open the \uicontrol {Kit Selection}
dialog.
@@ -136,7 +133,7 @@
\endlist
\QC creates a QML file, \e main.qml, that you can modify in the
\QC creates a QML file, \e Main.qml, that you can modify in the
\uicontrol Edit mode.
\include creator-python-project.qdocinc python qml project wizards

View File

@@ -11,6 +11,8 @@
\li Select \uicontrol File > \uicontrol {New Project} >
\uicontrol {Application (Qt)} > \uicontrol {Qt Quick Application}.
\image qtcreator-project-qt-quick.webp {New Project dialog}
\li Select \uicontrol Choose to open the
\uicontrol {Project Location} dialog.
@@ -34,16 +36,20 @@
\li Select \uicontrol Next to open the
\uicontrol {Define Project Details} dialog.
\li In the \uicontrol {Minimum required Qt version} field, select
Qt 6.2.
\image qtcreator-project-qt-quick-details.webp {Define Project Details dialog}
\li Select \uicontrol Next to open the \uicontrol {Translation File}
dialog.
\li In the \uicontrol {Minimum required Qt version} field, select
Qt 6.4.
\note This tutorial shows you how to create the application in the
\uicontrol Edit mode. If you select
\uicontrol {Create a project that you can open in \QDS}, the
following instructions won't apply.
\li Select \uicontrol Next to use the default settings and to open
the \uicontrol {Kit Selection} dialog.
\li Select Qt 6.2 or later \l{glossary-buildandrun-kit}{kits} for the
\li Select Qt 6.4 or later \l{glossary-buildandrun-kit}{kits} for the
platforms that you want to build the application for. To build
applications for mobile devices, select kits also for Android and
iOS.

View File

@@ -29,7 +29,8 @@
\note Since \QDS 2.3.0, \QDS project wizard templates generate projects that
can be built with CMake. You can open the \e CMakeLists.txt project file in
Qt Creator to continue developing the project.
Qt Creator to continue developing the project. Also, you can use Qt Creator
to create a Qt Quick Application project that you can open in \QDS.
\target wizard-template-note
\note Since \QDS 3.9.0, \QDS project wizard templates generate projects that

View File

@@ -118,6 +118,7 @@ class Dumper(DumperBase):
val.isBaseClass = val.name == val._type.name
val.nativeValue = nativeValue
val.laddress = nativeValue.address()
val.lbitsize = nativeValue.bitsize()
return val
def nativeTypeId(self, nativeType):

View File

@@ -2798,6 +2798,8 @@ class DumperBase():
return
self.putAddress(value.address())
if value.lbitsize is not None:
self.putField('size', value.lbitsize // 8)
if typeobj.code == TypeCode.Function:
#DumperBase.warn('FUNCTION VALUE: %s' % value)

View File

@@ -418,7 +418,24 @@ def qdump__QDir(d, value):
d.putExpandable()
privAddress = d.extractPointer(value)
bit32 = d.ptrSize() == 4
qt5 = d.qtVersion() >= 0x050000
# change fc3942114da adds FileCache
# QStringList nameFilters;
# QDir::SortFlags sort;
# QDir::Filters filters;
# std::unique_ptr<QAbstractFileEngine> fileEngine;
# QFileSystemEntry dirEntry;
# struct FileCache
# {
# QMutex mutex;
# QStringList files;
# QFileInfoList fileInfos;
# std::atomic<bool> fileListsInitialized = false;
# QFileSystemEntry absoluteDirEntry;
# QFileSystemMetaData metaData;
# };
# mutable FileCache fileCache;
# Change 9fc0965 reorders members again.
# bool fileListsInitialized
@@ -454,7 +471,9 @@ def qdump__QDir(d, value):
# + 2 byte padding
fileSystemEntrySize = 2 * d.ptrSize() + 8
if d.qtVersion() >= 0x060000:
if d.qtVersion() >= 0x060600:
case = 3
elif d.qtVersion() >= 0x060000:
case = 2
elif d.qtVersion() >= 0x050300:
case = 1
@@ -467,7 +486,20 @@ def qdump__QDir(d, value):
firstValue = d.extractInt(privAddress + d.ptrSize())
case = 1 if firstValue == 0 or firstValue == 1 else 0
if case == 2:
if case == 3:
if bit32:
dirEntryOffset = 24
fileCacheOffset = 52
filesOffset = fileCacheOffset + 4
fileInfosOffset = fileCacheOffset + 16
absoluteDirEntryOffset = fileCacheOffset + 32
else:
dirEntryOffset = 48
fileCacheOffset = 104
filesOffset = fileCacheOffset + 8
fileInfosOffset = fileCacheOffset + 32
absoluteDirEntryOffset = fileCacheOffset + 64
elif case == 2:
if bit32:
filesOffset = 4
fileInfosOffset = 16
@@ -507,6 +539,7 @@ def qdump__QDir(d, value):
d.call('int', value, 'count') # Fill cache.
except:
pass
#d.putCallItem('absolutePath', '@QString', value, 'absolutePath')
#d.putCallItem('canonicalPath', '@QString', value, 'canonicalPath')
with SubItem(d, 'absolutePath'):

File diff suppressed because it is too large Load Diff

View File

@@ -194,7 +194,17 @@ QString CMakeConfigItem::expandedValue(const ProjectExplorer::Kit *k) const
QString CMakeConfigItem::expandedValue(const Utils::MacroExpander *expander) const
{
return expander ? expander->expand(QString::fromUtf8(value)) : QString::fromUtf8(value);
QString expandedValue = expander ? expander->expand(QString::fromUtf8(value))
: QString::fromUtf8(value);
// Make sure we have CMake paths using / instead of \\ on Windows
// %{buildDir} returns \\ on Windows
if (type == CMakeConfigItem::FILEPATH || type == CMakeConfigItem::PATH) {
const FilePaths paths = transform(expandedValue.split(";"), &FilePath::fromUserInput);
expandedValue = transform(paths, &FilePath::path).join(";");
}
return expandedValue;
}
bool CMakeConfigItem::less(const CMakeConfigItem &a, const CMakeConfigItem &b)
@@ -424,9 +434,7 @@ QString CMakeConfigItem::toString(const Utils::MacroExpander *expander) const
break;
}
const QString expandedValue
= expander ? expander->expand(QString::fromUtf8(value)) : QString::fromUtf8(value);
return QString::fromUtf8(key) + QLatin1Char(':') + typeStr + QLatin1Char('=') + expandedValue;
return QString("%1:%2=%3").arg(QString::fromUtf8(key), typeStr, expandedValue(expander));
}
QString CMakeConfigItem::toArgument() const

View File

@@ -101,6 +101,11 @@ CMakeConfigItem ConfigModel::DataItem::toCMakeConfigItem() const
return cmi;
}
QString ConfigModel::DataItem::expandedValue(Utils::MacroExpander *expander)
{
return toCMakeConfigItem().expandedValue(expander);
}
// ConfigModel
ConfigModel::ConfigModel(QObject *parent) : Utils::TreeModel<>(parent)
@@ -165,7 +170,7 @@ void ConfigModel::appendConfiguration(const QString &key,
if (m_kitConfiguration.contains(key))
internalItem.kitValue = QString::fromUtf8(
isInitial ? m_kitConfiguration.value(key).value
: m_macroExpander->expand(m_kitConfiguration.value(key).value));
: m_kitConfiguration.value(key).expandedValue(m_macroExpander).toUtf8());
m_configuration.append(internalItem);
setConfiguration(m_configuration);
}
@@ -504,7 +509,7 @@ void ConfigModel::generateTree()
for (InternalDataItem &di : m_configuration) {
auto it = initialHash.find(di.key);
if (it != initialHash.end())
di.initialValue = macroExpander()->expand(it->value);
di.initialValue = it->expandedValue(macroExpander());
root->appendChild(new Internal::ConfigModelTreeItem(&di));
}

View File

@@ -36,6 +36,8 @@ public:
CMakeConfigItem toCMakeConfigItem() const;
QString expandedValue(Utils::MacroExpander *expander);
enum Type { BOOLEAN, FILE, DIRECTORY, STRING, UNKNOWN};
QString key;

View File

@@ -1440,15 +1440,15 @@ int WatchModel::memberVariableRecursion(WatchItem *item,
const QString nameRoot = name.isEmpty() ? name : name + '.';
for (int r = 0; r < rows; r++) {
WatchItem *child = item->childAt(r);
const quint64 childAddress = item->address;
const quint64 childAddress = child->address;
if (childAddress && childAddress >= start
&& (childAddress + item->size) <= end) { // Non-static, within area?
&& (childAddress + child->size) <= end) { // Non-static, within area?
const QString childName = nameRoot + child->name;
const quint64 childOffset = childAddress - start;
const QString toolTip = variableToolTip(childName, item->type, childOffset);
const QString toolTip = variableToolTip(childName, child->type, childOffset);
const ColorNumberToolTip colorNumberNamePair((*colorNumberIn)++, toolTip);
const ColorNumberToolTips::iterator begin = cnmv->begin() + childOffset;
std::fill(begin, begin + item->size, colorNumberNamePair);
std::fill(begin, begin + child->size, colorNumberNamePair);
childCount++;
childCount += memberVariableRecursion(child, childName, start, end, colorNumberIn, cnmv);
}

View File

@@ -19,6 +19,7 @@
#include <QLibraryInfo>
#include <private/qdatetime_p.h>
#include <private/qdir_p.h>
#include <private/qfile_p.h>
#include <private/qfileinfo_p.h>
#include <private/qobject_p.h>
@@ -52,6 +53,23 @@ OFFSET_ACCESS(QString, QFileSystemEntry, m_filePath);
OFFSET_ACCESS(QFileSystemEntry, QFileInfoPrivate, fileEntry);
OFFSET_ACCESS(QObjectPrivate::ExtraData*, QObjectPrivate, extraData);
#if QT_VERSION >= 0x60000
OFFSET_ACCESS(QFileSystemEntry, QDirPrivate, dirEntry);
#if QT_VERSION < 0x60600
OFFSET_ACCESS(QStringList, QDirPrivate, files);
OFFSET_ACCESS(QFileInfoList, QDirPrivate, fileInfos);
OFFSET_ACCESS(QFileSystemEntry, QDirPrivate, absoluteDirEntry);
#else
using FileCache = QDirPrivate::FileCache;
OFFSET_ACCESS(QDirPrivate::FileCache, QDirPrivate, fileCache);
OFFSET_ACCESS(QStringList, FileCache, files);
OFFSET_ACCESS(QFileInfoList, FileCache, fileInfos);
OFFSET_ACCESS(QFileSystemEntry, FileCache, absoluteDirEntry);
#endif
#endif
#if QT_VERSION < 0x50000
OFFSET_ACCESS(QString, QObjectPrivate, objectName);
#endif
@@ -290,6 +308,21 @@ void tst_offsets::offsets_data()
OFFSET_TEST(QDateTimePrivate, m_timeZone) << 20 << 24;
#endif
#if QT_VERSION >= 0x60000
#if QT_VERSION < 0x60600
OFFSET_TEST(QDirPrivate, dirEntry) << 40 << 96;
OFFSET_TEST(QDirPrivate, files) << 4 << 8;
OFFSET_TEST(QDirPrivate, fileInfos) << 16 << 32;
OFFSET_TEST(QDirPrivate, absoluteDirEntry) << 72 << 152;
#else
OFFSET_TEST(QDirPrivate, fileCache) << 52 << 104;
OFFSET_TEST(QDirPrivate, dirEntry) << 24 << 48;
OFFSET_TEST(FileCache, files) << 4 << 8;
OFFSET_TEST(FileCache, fileInfos) << 16 << 32;
OFFSET_TEST(FileCache, absoluteDirEntry) << 32 << 64;
#endif
#endif
#ifdef HAS_BOOST
OFFSET_TEST(Uset, table_) << 0 << 0;
OFFSET_TEST(UsetTable, size_) << 8 << 16;