Merge "Merge remote-tracking branch 'origin/10.0'"

This commit is contained in:
The Qt Project
2023-03-06 07:50:20 +00: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) project(accelbubble VERSION 0.1 LANGUAGES CXX)
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD_REQUIRED 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 qt_add_executable(appaccelbubble
main.cpp main.cpp
@@ -15,7 +16,7 @@ qt_add_executable(appaccelbubble
qt_add_qml_module(appaccelbubble qt_add_qml_module(appaccelbubble
URI accelbubble URI accelbubble
VERSION 1.0 VERSION 1.0
QML_FILES main.qml QML_FILES Main.qml
RESOURCES Bluebubble.svg RESOURCES Bluebubble.svg
) )
@@ -37,4 +38,8 @@ target_compile_definitions(appaccelbubble
target_link_libraries(appaccelbubble target_link_libraries(appaccelbubble
PRIVATE Qt6::Quick Qt6::Sensors Qt6::Svg Qt6::Xml) PRIVATE Qt6::Quick Qt6::Sensors Qt6::Svg Qt6::Xml)
install(TARGETS appaccelbubble
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
qt_finalize_executable(appaccelbubble) qt_finalize_executable(appaccelbubble)

View File

@@ -2,10 +2,11 @@ cmake_minimum_required(VERSION 3.16)
project(transitions VERSION 0.1 LANGUAGES CXX) project(transitions VERSION 0.1 LANGUAGES CXX)
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD_REQUIRED 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 qt_add_executable(apptransitions
main.cpp main.cpp
@@ -14,7 +15,7 @@ qt_add_executable(apptransitions
qt_add_qml_module(apptransitions qt_add_qml_module(apptransitions
URI transitions URI transitions
VERSION 1.0 VERSION 1.0
QML_FILES main.qml Page.qml QML_FILES Main.qml Page.qml
RESOURCES qt-logo.png RESOURCES qt-logo.png
) )
@@ -26,7 +27,10 @@ set_target_properties(apptransitions PROPERTIES
WIN32_EXECUTABLE TRUE WIN32_EXECUTABLE TRUE
) )
target_compile_definitions(apptransitions
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(apptransitions 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 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. 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. Next, you select a location for the project and specify settings for it.
@@ -95,9 +95,12 @@
\li Uses a single main.cpp file. \li Uses a single main.cpp file.
\row \row
\li Qt Quick Application \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 QML and C++ code. You can build the application and deploy it
to desktop, embedded, and mobile target platforms. 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 \row
\li {1,4} Application (Qt for Python) \li {1,4} Application (Qt for Python)
\li Empty Application \li Empty Application
@@ -129,7 +132,7 @@
\row \row
\li Qt Quick 2 Extension Plugin \li Qt Quick 2 Extension Plugin
\li Creates a C++ plugin that makes it possible to offer extensions \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. applications.
\row \row
\li \QC Plugin \li \QC Plugin
@@ -142,7 +145,7 @@
\li Qt Quick UI Prototype \li Qt Quick UI Prototype
\li Creates a \l{Creating Qt Quick UI Projects}{Qt Quick UI project} \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 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}. \l{Validating with Target Hardware}{QML Scene preview tool}.
You do not need to build them because they do not have any You do not need to build them because they do not have any
C++ code. C++ code.
@@ -333,7 +336,7 @@
\uicontrol {New Subproject}. Follow the steps in the \uicontrol {New Subproject}. Follow the steps in the
\uicontrol {New Subproject} wizard to create a subproject. \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 To add an existing project as a subproject, select
\uicontrol {Add Existing Projects} in the context menu. \uicontrol {Add Existing Projects} in the context menu.

View File

@@ -22,12 +22,12 @@
For more examples, see \l{Qt Quick Examples and Tutorials}. For more examples, see \l{Qt Quick Examples and Tutorials}.
You can develop Qt Quick applications also in \QDS. For more information, You can use a visual editor to develop Qt Quick applications in \QDS. For
see \l{Qt Design Studio Manual}. more information, see \l{Qt Design Studio Manual}.
\include qtquick-tutorial-create-empty-project.qdocinc qtquick empty application \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. \uicontrol Edit mode.
\section1 Deploying Applications \section1 Deploying Applications

View File

@@ -14,8 +14,6 @@
\title Creating Qt Quick Projects \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 The following table lists the wizard templates for creating a new
Qt Quick project from scratch. Qt Quick project from scratch.
@@ -27,9 +25,12 @@
\row \row
\li Application (Qt) \li Application (Qt)
\li Qt Quick Application \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 QML and C++ code. You can build the application and deploy it
to desktop, embedded, and mobile target platforms. to desktop, embedded, and mobile target platforms.
You can select an option to create a project that you can open
in \QDS.
\row \row
\li Application (Qt for Python) \li Application (Qt for Python)
\li Qt for Python - Qt Quick Application \li Qt for Python - Qt Quick Application
@@ -39,7 +40,7 @@
\li Other Project \li Other Project
\li Qt Quick UI Prototype \li Qt Quick UI Prototype
\li Creates a Qt Quick UI project with a single QML file that \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 in the QML Scene preview tool. You do not need to build them
because they do not have any C++ code. because they do not have any C++ code.
@@ -47,14 +48,14 @@
template only if you are prototyping. You cannot create template only if you are prototyping. You cannot create
a full application by using this template. a full application by using this template.
Qt Quick UI projects cannot be deployed to embedded or mobile You cannot deploy Qt Quick UI projects to embedded or
target platforms. For those platforms, create a Qt Quick mobile target platforms. For those platforms, create a Qt Quick
application instead. application instead.
\row \row
\li Library \li Library
\li Qt Quick 2 Extension Plugin \li Qt Quick 2 Extension Plugin
\li Creates C++ plugins that make it possible to offer extensions \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 \endtable
\note The SDK for a particular target platform might install additional \note The SDK for a particular target platform might install additional
@@ -72,6 +73,8 @@
\uicontrol {Application (Qt)} > \uicontrol {Qt Quick Application} \uicontrol {Application (Qt)} > \uicontrol {Qt Quick Application}
> \uicontrol Choose. > \uicontrol Choose.
\image qtcreator-project-qt-quick.webp {New Project dialog}
\li In the \uicontrol {Project Location} dialog, \uicontrol Name field, \li In the \uicontrol {Project Location} dialog, \uicontrol Name field,
enter a name for the project. Keep in mind that you cannot easily enter a name for the project. Keep in mind that you cannot easily
change the project name later. change the project name later.
@@ -84,6 +87,11 @@
\li Select \uicontrol Next (or \uicontrol Continue on \macos) to open \li Select \uicontrol Next (or \uicontrol Continue on \macos) to open
the \uicontrol {Define Build System} dialog. 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 \li In the \uicontrol {Build system} field, select the build system to
use for building and running the project: \l qmake, use for building and running the project: \l qmake,
\l {Setting Up CMake}{CMake}, or \l {Setting Up Qbs}{Qbs}. \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 \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 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. {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} \li Select \uicontrol Next to open the \uicontrol {Kit Selection}
dialog. dialog.
@@ -136,7 +133,7 @@
\endlist \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. \uicontrol Edit mode.
\include creator-python-project.qdocinc python qml project wizards \include creator-python-project.qdocinc python qml project wizards

View File

@@ -11,6 +11,8 @@
\li Select \uicontrol File > \uicontrol {New Project} > \li Select \uicontrol File > \uicontrol {New Project} >
\uicontrol {Application (Qt)} > \uicontrol {Qt Quick Application}. \uicontrol {Application (Qt)} > \uicontrol {Qt Quick Application}.
\image qtcreator-project-qt-quick.webp {New Project dialog}
\li Select \uicontrol Choose to open the \li Select \uicontrol Choose to open the
\uicontrol {Project Location} dialog. \uicontrol {Project Location} dialog.
@@ -34,16 +36,20 @@
\li Select \uicontrol Next to open the \li Select \uicontrol Next to open the
\uicontrol {Define Project Details} dialog. \uicontrol {Define Project Details} dialog.
\li In the \uicontrol {Minimum required Qt version} field, select \image qtcreator-project-qt-quick-details.webp {Define Project Details dialog}
Qt 6.2.
\li Select \uicontrol Next to open the \uicontrol {Translation File} \li In the \uicontrol {Minimum required Qt version} field, select
dialog. 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 \li Select \uicontrol Next to use the default settings and to open
the \uicontrol {Kit Selection} dialog. 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 platforms that you want to build the application for. To build
applications for mobile devices, select kits also for Android and applications for mobile devices, select kits also for Android and
iOS. iOS.

View File

@@ -29,7 +29,8 @@
\note Since \QDS 2.3.0, \QDS project wizard templates generate projects that \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 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 \target wizard-template-note
\note Since \QDS 3.9.0, \QDS project wizard templates generate projects that \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.isBaseClass = val.name == val._type.name
val.nativeValue = nativeValue val.nativeValue = nativeValue
val.laddress = nativeValue.address() val.laddress = nativeValue.address()
val.lbitsize = nativeValue.bitsize()
return val return val
def nativeTypeId(self, nativeType): def nativeTypeId(self, nativeType):

View File

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

View File

@@ -418,7 +418,24 @@ def qdump__QDir(d, value):
d.putExpandable() d.putExpandable()
privAddress = d.extractPointer(value) privAddress = d.extractPointer(value)
bit32 = d.ptrSize() == 4 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. # Change 9fc0965 reorders members again.
# bool fileListsInitialized # bool fileListsInitialized
@@ -454,7 +471,9 @@ def qdump__QDir(d, value):
# + 2 byte padding # + 2 byte padding
fileSystemEntrySize = 2 * d.ptrSize() + 8 fileSystemEntrySize = 2 * d.ptrSize() + 8
if d.qtVersion() >= 0x060000: if d.qtVersion() >= 0x060600:
case = 3
elif d.qtVersion() >= 0x060000:
case = 2 case = 2
elif d.qtVersion() >= 0x050300: elif d.qtVersion() >= 0x050300:
case = 1 case = 1
@@ -467,7 +486,20 @@ def qdump__QDir(d, value):
firstValue = d.extractInt(privAddress + d.ptrSize()) firstValue = d.extractInt(privAddress + d.ptrSize())
case = 1 if firstValue == 0 or firstValue == 1 else 0 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: if bit32:
filesOffset = 4 filesOffset = 4
fileInfosOffset = 16 fileInfosOffset = 16
@@ -507,6 +539,7 @@ def qdump__QDir(d, value):
d.call('int', value, 'count') # Fill cache. d.call('int', value, 'count') # Fill cache.
except: except:
pass pass
#d.putCallItem('absolutePath', '@QString', value, 'absolutePath') #d.putCallItem('absolutePath', '@QString', value, 'absolutePath')
#d.putCallItem('canonicalPath', '@QString', value, 'canonicalPath') #d.putCallItem('canonicalPath', '@QString', value, 'canonicalPath')
with SubItem(d, 'absolutePath'): 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 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) bool CMakeConfigItem::less(const CMakeConfigItem &a, const CMakeConfigItem &b)
@@ -424,9 +434,7 @@ QString CMakeConfigItem::toString(const Utils::MacroExpander *expander) const
break; break;
} }
const QString expandedValue return QString("%1:%2=%3").arg(QString::fromUtf8(key), typeStr, expandedValue(expander));
= expander ? expander->expand(QString::fromUtf8(value)) : QString::fromUtf8(value);
return QString::fromUtf8(key) + QLatin1Char(':') + typeStr + QLatin1Char('=') + expandedValue;
} }
QString CMakeConfigItem::toArgument() const QString CMakeConfigItem::toArgument() const

View File

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

View File

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

View File

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

View File

@@ -19,6 +19,7 @@
#include <QLibraryInfo> #include <QLibraryInfo>
#include <private/qdatetime_p.h> #include <private/qdatetime_p.h>
#include <private/qdir_p.h>
#include <private/qfile_p.h> #include <private/qfile_p.h>
#include <private/qfileinfo_p.h> #include <private/qfileinfo_p.h>
#include <private/qobject_p.h> #include <private/qobject_p.h>
@@ -52,6 +53,23 @@ OFFSET_ACCESS(QString, QFileSystemEntry, m_filePath);
OFFSET_ACCESS(QFileSystemEntry, QFileInfoPrivate, fileEntry); OFFSET_ACCESS(QFileSystemEntry, QFileInfoPrivate, fileEntry);
OFFSET_ACCESS(QObjectPrivate::ExtraData*, QObjectPrivate, extraData); 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 #if QT_VERSION < 0x50000
OFFSET_ACCESS(QString, QObjectPrivate, objectName); OFFSET_ACCESS(QString, QObjectPrivate, objectName);
#endif #endif
@@ -290,6 +308,21 @@ void tst_offsets::offsets_data()
OFFSET_TEST(QDateTimePrivate, m_timeZone) << 20 << 24; OFFSET_TEST(QDateTimePrivate, m_timeZone) << 20 << 24;
#endif #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 #ifdef HAS_BOOST
OFFSET_TEST(Uset, table_) << 0 << 0; OFFSET_TEST(Uset, table_) << 0 << 0;
OFFSET_TEST(UsetTable, size_) << 8 << 16; OFFSET_TEST(UsetTable, size_) << 8 << 16;