qdbusxml2cpp's -i option uses "" for the includes.
However, an option to include with <> would be also
desirable, since some compilers may use a different
search strategy for <> than for "".
Add a new command line option -I/--global-include
to include the given argument using <>.
The new option will be used in qtconnectivity.
[ChangeLog][qdbusxml2cpp] Added command line option
-I/--global-include to include header files with <> in
the generated files.
Fixes: QTBUG-103362
Change-Id: If8e7f8b86440bdec53f2517db1ad460912664b20
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
You can't mismatch the export macros. The QT_MOC_EXPORT_PLUGIN_V2 macro
defines these functions as Q_DECL_EXPORT so they can be found by
QPluginLoader. We must match the macro here, otherwise GCC 12 complains
(tst_moc.cpp is compiled with -fvisibility=hidden):
tst_moc.cpp.o: non-canonical reference to canonical protected function `qt_plugin_instance' in moc_plugin_metadata.cpp.o
Pick-to: 6.4
Change-Id: Id0fb9ab0089845ee8843fffd16f99893d5730da5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
We had the code to calculate the length, but were improperly using it
only for the offset, not the length of the string or its containing
array. That resulted in the generated moc output containing:
QT_MOC_LITERAL(111, 5), // "\xffz"
QT_MOC_LITERAL(114, 5), // "\0012"
QT_MOC_LITERAL(117, 23), // "slotWithAReallyLongName"
The two strings are described as occupying 5 bytes (length 4 + null
terminator), which is incorrect. The offset was correct: 114 - 111 = 3
and 117 - 114 = 3. The new output is:
QT_MOC_LITERAL(111, 2), // "\xffz"
QT_MOC_LITERAL(114, 2), // "\0012"
QT_MOC_LITERAL(117, 23), // "slotWithAReallyLongName"
The effect of the array size calculation would only be felt if moc
decided it needed a second string array (for strings over 65535 bytes),
which would cause the offsets in the second array to be all wrong. There
was no such test until now.
Drive-by fixing of the newline, indentation, and the stale comment
referring to QByteArrayData (Qt 5).
Pick-to: 6.2 6.3 6.4
Change-Id: Id0fb9ab0089845ee8843fffd16f9cd01b3e0709a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The behavior is similar to MEMBER: If the READ accessor is "default",
synthesize it using the bindable.
[ChangeLog][QtCore] You can now specify "READ default" in a Q_PROPERTY
if you also specify a BINDABLE. moc will synthesize a READ accessor in
that case.
Task-number: QTBUG-97249
Change-Id: I4a275adabaed12df95dac505095f847c4be65dfe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It was previously understanding them as character literal delimiters,
with unfortunate consequences if a numeric literal contained an odd
number of them. Recognize that an apostrophe with a digit on each side
of it isn't the opening quote of a character literal (unless the digit
before it is preceded by a u). Extend the findMocs test to trigger the
bug, prior to the fix; verified it passes with the fix.
Fixes: QTBUG-98845
Change-Id: I5db3ac59aaeade7c2d6c1fb680ba97261ec0e8a9
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Revert the change to uic of 05fc3aef53.
Task-number: QTBUG-67283
Change-Id: Icfd83bb6d80b91d4e58f1be460f6772ba49a6921
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.
Task-number: QTBUG-67283
Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Because setObjectName() now takes a QAnyStringView, passing C string
literals is much more efficient than using QString::fromUtf8().
This patch only deals with setObjectName() as a known property,
probably from a name attribute. If the objectName property is set by a
<property> element (or so I assume), we still emit a
QString::fromUtf8(). Detecting objectName there would be too much
magic.
Besides, I haven't been able to find why sometimes there's a second
setObjectName call right after the first, when in the XML it seems all
kosher (name attribute and objectName <property> agreeing on the
content).
Change-Id: Icf07bad841ac735a9c744bbd955428ba15758089
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Use VERBATIM option to prepare the correct command line for the
add_custom_command. This especially sensitive when using build
directories with names containing special symbols, that cannot be
handled by shell correctly.
Change-Id: I51d7041cb806411135fd59bf6273c04a3c695443
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
And remove their uses.
[ChangeLog][QtCore][Deprecation Notice] Deprecated QString::count()
and QByteArray::count() that take no parameters, to avoid confusion
with the algorithm overloads of the same name. They can be replaced
by size() or length() methods.
Change-Id: I6541e3235ab58cf750d89568d66d3b1d9bbd4a04
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Relying on string manipulation leads to -Wredundant-parens warnings in
the best case, and to non-compiling code (when using typedefs) in the
worst case.
We can avoid both issues by simply generating code that uses
add_pointer, which takes care of reference types (even typedef'd ones),
and creates no warnings about parens (as we don't write any anymore).
Fixes: QTBUG-100915
Pick-to: 6.3 6.2
Change-Id: Ic5b1cbfda20d920d11f51beeb62e9479261d5f00
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
moc, qmake, rcc, and uic tests execute corresponding tools inside
the test executables. This adds dependencies explicitly, to execute
tests using _check targets, without the need to manually build
dependencies.
Pick-to: 6.3 6.2
Fixes: QTBUG-98576
Change-Id: I8b989276e21199b867591f7b0f6af9204695ac13
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The IGNORE directive was likely removed as an oversight
in the linked change.
This fixes the test to pass when bumping the Qt version.
Amends 9836dbd6ee
Change-Id: I497325d6d8b8b67cce7b0840bfb9bfa70d85fe73
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Change the minimum amount of buckets to be at least
128, ie. one full Span. This will simplify some assumptions
in the code.
Regeneration of rcc test-data needed because the extra buckets
causes the order of the keys to change.
Task-number: QTBUG-91739
Task-number: QTBUG-98436
Change-Id: Ic0c7da03570cc4c4e6aacc9645e536aec3667a98
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Like Q_NAMESPACE_EXPORT for Q_NAMESPACE, this variant of Q_GADGET
allows passing an export macro. This is useful to avoid exporting the
whole class just to get the staticMetaObject hidden therein exported.
Before anyone asks: No, we don't need Q_OBJECT_EXPORT, because QObject
subclasses, being polymorphic, always need to have a class-level
export macro (to export their vtable), but while that technique also
works for value classes (the Q_GADGET audience), it is not desirable
for them, because it makes inline functions exported in Windows debug
builds, which is not what we want, because it needlessly restricts
what you can to with the inline functions (e.g. remove).
[ChangeLog][QtCore] Added the Q_GADGET_EXPORT macro, which is like
Q_GADGET, but allows passing an export macro (like Q_NAMESPACE_EXPORT
for Q_NAMESPACE).
Fixes: QTBUG-55458
Change-Id: I546297de1e8aa45d83381991bcd3fbca61e1eef0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Having all *deployqt tools in qtbase will allow us to couple deployment
support more tightly with the build system.
Change-Id: I299efdacfa6b66a303bb3996ff3ff84e723210a5
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
This hasn't worked for some time. It's not in our CI and I don't think
it was working at all. When I tried to build it, I ran into several
problems with C++17 and an Internal Compiler Error I did not have any
interest in working around.
After discussing with the Intel compiler team, it was decided that
fixing those issues in the old compiler is not going to happen. Instead,
their recommendation is to adopt the new LLVM-based compiler, which
the last commit added support for.
This commit does not remove qmake support for the old ICC. It's possible
someone is using qmake with a non-Qt6 project and ICC.
Change-Id: Icb2516126f674e7b8bb3fffd16ad6350ddbd49e5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
They return a pointer to the actual header, skipping the magic string.
This is done in preparation for the header located in an ELF note, which
won't have the magic.
Change-Id: I3eb1bd30e0124f89a052fffd16a8229bec2ad588
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The .qtmetadata section is already suppressed for static plugins, but we
carried this unnecessary magic string. For library file formats where we
don't have a scanner (Windows COFF PE), a library that linked multiple
static plugins could end up with multiple metadata found.
We can't suppress the header because the version of moc could be
different to the version of Qt, so we need to read the header version
too. Right now, the version isn't output by moc (all the logic is in
qplugin.h), but this could change again in the future. In any case, 4
extra bytes are not a big deal, so the header stays.
Change-Id: I3eb1bd30e0124f89a052fffd16a82088d8303081
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
tests/auto/tools/moc/CMakeFiles/tst_moc.dir/tst_moc.cpp.o: in function `tst_Moc::os9Newline()':
qtbase/tests/auto/tools/moc/tst_moc.cpp:1225: undefined reference to `Os9Newlines::staticMetaObject'
tests/auto/tools/moc/CMakeFiles/tst_moc.dir/tst_moc.cpp.o: in function `tst_Moc::winNewline()':
qtbase/tests/auto/tools/moc/tst_moc.cpp:1239: undefined reference to `WinNewlines::staticMetaObject'
Pick-to: 6.2
Change-Id: I629d67c1190e09b26dc09e41cb7170cb0eadf1cb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Hopefully we won't need it but let's have it still at least for
consistency
Change-Id: I72289e65e5e5613174ad4d98cf8d614f9caae8e6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The solution in d3ed7dac8a was needlessly
complicated, and broke a valid use case.
The issue of no identifier being available to parse after the include
has been processed can instead be solved by moving the test for the
closing brace after the include processing.
Fixes: QTBUG-94790
Pick-to: 6.2 6.1 5.15
Change-Id: Ieec4b89e1d117637f11479e8bddc4060f93da43d
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The QtTest best practices documentations recommends using output
mechanisms such as qDebug() and qWarning() for diagnostic messages,
and this is also what most of our own tests do.
The QWARN() macro and corresponding internal QTest::qWarn() function
was added when QtTest was first implemented, but was likely meant as
an internal implementation detail, like its cousin QTestLog::info(),
which does not have any corresponding macro.
This theory is backed by our own QtTest self-test (tst_silent)
describing the output from QWARN() as "an internal testlib warning".
The only difference between QWARN() and qWarning(), besides the much
richer feature set of the latter, is that qWarning() will not pass
on file and line number information in release mode, but QWARN() will.
This is an acceptable loss of functionality, considering that the user
can override this behavior by defining QT_MESSAGELOGCONTEXT.
[ChangeLog][QtTest] QWARN() has been deprecated in favor of qWarning()
Pick-to: 6.2
Change-Id: I5a2431ce48c47392244560dd520953b9fc735c85
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Before this change, next() was the only way to advance the iterator,
whether the caller was ultimately interested in just the filePath()
(good) or not (bad luck, had to call .fileInfo()).
Add a new function, nextFileInfo(), with returns fileInfo() instead.
Incidentally, the returned object has already been constructed as part
of advance()ing the iterator, so the new function is faster than
next() even if the result is ignored, because we're not calculating a
QString result the caller may not be interested in.
Use the new function around the code.
Fix a couple of cases of next(); fileInfo().filePath() (just use
next()'s return value) as a drive-by.
[ChangeLog][QtCore][QDirIterator] Added nextFileInfo(), which is like
next(), but returns fileInfo() instead of filePath().
Change-Id: I601220575961169b44139fc55b9eae6c3197afb4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
There's a chance that this would be used in some macro, so why not test
that this thing works in general (especially since it actually works)
Change-Id: Ib9d91fbd17cf16675ae89a99f010dacc5d30967a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Triggered by API review in Gerrit patch 355960.
Task-number: QTBUG-94407
Pick-to: 6.2
Change-Id: I7cafc1cc9d4b929040b53c6bf92c91d73c3b39f2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The relevant test is conducted by tst_Moc::warnOnVirtualSignal(),
added in 2009, <quote>
Fix Warning saying that signal cannot be made virtual
The test for virtual signal did not work.
But we cannot make an error right now or it might break existing code
(exemple in task 210879)
</quote> but without removing the #include, so we do still get a
warning about that when building tst_moc.
Pick-to: 6.2 6.1 5.15
Change-Id: I5ea18058f22bbd483d1ff18b0ca7b360f6674ed9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Needed for QML compiler to know property index of C++ type at
compile time without going through QMetaObject::indexOfProperty
Change-Id: I404e71d6071d36812661df17d12b879a8dcbd146
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Use class WriteIncludesBase and store classes encountered in a
per-module hash (Qt/custom widgets). Write out only the required
classes.
Add --star-import as a fallback should the change cause issues.
Task-number: PYSIDE-1404
Change-Id: Ic50e26758ddd0f2f8aebbce470d32a36fb09a2c4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
The BASE argument of qt_add_resources now denotes the root point of the
alias of the file. Before, BASE was merely prepended to every file that
got passed to qt_add_resources.
Old behavior:
qt_add_resources(app "images"
PREFIX "/"
BASE "../shared"
FILES "images/button.png")
Alias is "../shared/images/button.png", and pro2cmake generated
QT_RESOURCE_ALIAS assignments to fix this.
New behavior:
qt_add_resources(app "images"
PREFIX "/"
BASE "../shared"
FILES "../shared/images/button.png")
The alias is "images/button.png". No extra QT_RESOURCE_ALIAS assignment
is needed.
The new behavior is in effect for user projects and for Qt repositories
that define QT_USE_FIXED_QT_ADD_RESOURCE_BASE. Qt repositories will be
ported one by one to this new behavior. Then the old code path can be
removed.
Pick-to: 6.1
Task-number: QTBUG-86726
Change-Id: Ib895edd4df8e97b54badadd9a1c34408beff131f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We only need to the location of certain paths for the test. For that,
qtpaths is sufficient.
Change-Id: I5af0d56b548629edc48949150ed8fbd408b617a6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Although the code is never executed compilers still throw a warning
because it's compiled.
Amends 12b8283f89
Pick-to: 5.15 6.1
Change-Id: Ib790d4bcb33c4b9f2a55a784b852275b59debde9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We deliberately expose moc to warning-worthy C++, but we don't want the
compiler warnings coming from those.
Change-Id: I09c36d7c8bfbb88f7bde61fa7bcc52a5adde81da
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
[ChangeLog][Build System] Tools that are called by the build system and
are unlikely to be called by the user are now installed to the libexec
directory.
This is a step towards easier co-installability of different Qt
versions.
Pick-to: 6.1
Task-number: QTBUG-88791
Change-Id: Id19575b5ba27795f7715e4ea6a09391b26dd4942
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
With the updated QEMU and toolchain, these tests now pass.
Change-Id: Icb74562a0e6422cd4564f63db991aa431e0e3119
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Those serve no purpose anymore, now that the .pro files are gone.
Task-number: QTBUG-88742
Change-Id: I39943327b8c9871785b58e9973e4e7602371793e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Remove the qmake project files for most of Qt.
Leave the qmake project files for examples, because we still test those
in the CI to ensure qmake does not regress.
Also leave the qmake project files for utils and other minor parts that
lack CMake project files.
Task-number: QTBUG-88742
Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Complete search and replace of QtTest and QtTest/QtTest with QTest, as
QtTest includes the whole module. Replace all such instances with
correct header includes. See Jira task for more discussion.
Fixes: QTBUG-88831
Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44
Pick-to: 6.0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Apparently some library definitions went overboard, link them directly.
Pick-to: 6.0
Change-Id: I009737f7e3edff5619241b700a627dc4e25e6018
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Just like it was done in the .pro file.
Pick-to: 6.0
Change-Id: I7def52127f4bab6f0ef490ac7eee2de2da479352
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
gcc, clang, and MSVC all use lowercase "warning:", "error:" and
"note:". Follow that standard.
Also, include a column number; just print 1, as the Symbol doesn't
give us a column number, and searching backwards for a newline seems
overkill.
This fixes IDE integrations that parse compiler output using regular
expressions.
The test checks for moc output, but most tests were so far only
running on Linux systems. Expand this to Unix for most tests, which
then includes macOS.
Change-Id: I0a6151cc0dc50e52ca72ff8048a45213aebdb3a8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
A dependency was missing, causing qduplicatetracker_p not to be found.
Change-Id: I4076d6cf82d804354731c357bcdbfd03c3d42142
Reviewed-by: David Faure <david.faure@kdab.com>
The existing logic broke down when we reentered the enumerator parsing
loop, and encountered a INCLUDE_MOC_END token in the first handleInclude
call. Fix this by restarting the loop in that case.
Amends d8a2456fbf.
Fixes: QTBUG-88125
Pick-to: 5.15
Change-Id: I87acaa986a81de53730eddc40bc7d48c15328aba
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
When cross-building Qt with CMake to target qemu configs in the CI,
we specify the -DQT_BUILD_TOOLS_WHEN_CROSSCOMPILING=ON option to also
cross-build tools (like qmake).
In this case, $prefix/bin/qmake points to the cross-compiled qmake,
and the shell script that wraps the host qmake is called
$prefix/bin/host-qmake instead.
In such a scenario, tst_qmake ends up running the cross-compiled
qmake, which thinks that it's being run on device (via user-space
qemu emulation) and doesn't specify the sysroot when computing include
paths, link paths, etc. This causes the test building to fail in
various ways.
To fix the test, check for the existence of the host-qmake wrapper,
and if it exsists use it instead.
Task-number: QTBUG-86053
Change-Id: Iaa4afdf11b17f23abef873dd15b1ed950126ab8c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Use a simpler constexpr to generate type name on gcc This
works around an ICE on gcc in release mode when compiling
with PCH enabled. As the type we're getting from Q_FUNC_INFO is
already in a somewhat normalized form, this requires significanlty
less processing and esp. not a recursive constexpr method which
I suspect triggers the ICE.
Fix integer type conversions to also properly normalize long long
values (to q(u)longlong. Make sure the mapping also works on
MSVC, where long long types get mapped to __int64. Also, normalize
unsigned short and unsigned char to ushort and uchar, respectively, to
follow the convention set by uint and ulong.
Add some test cases to verify the mappings.
Change-Id: I3dec5764450bf22ab6f066597803c3f46c2cd5ac
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This time based on grepping to also include documentation, tests and
examples previously missed by the automatic tool.
Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Change the implementation of Qt DBus to use QMetaType directly
instead of integer based type ids.
Change-Id: I999023b58fa50dcc3504386467faf09874f7d2cf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Modify special case locations to use the new API as well.
Clean up some stale .prev files that are not needed anymore.
Clean up some project files that are not used anymore.
Task-number: QTBUG-86815
Change-Id: I9947da921f98686023c6bb053dfcc101851276b5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
And add mutable iterators. This requires some refactoring of the
existing iterators.
Task-number: QTBUG-81716
Change-Id: I61b3a3e8c0df5fd449679257a29d9f0c3d19c4f0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Adjust to changes to QIcon::pixmap, QMetaType::type, and
QAbstractItemView::itemDelegate.
Change-Id: I9eb0331ef899131afc86c33f27feeee76331ffc8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
As per ### Qt6 comment. Also rename the LibraryLocation enum
to LibraryPath.
Change-Id: I556025a19c5bcdf2ff52598eaba32269522d4128
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remove around 1000 compiler warnings about missing overrides
in our auto tests.
This significantly reduce the compiler warning noise in our auto
tests, so that one can actually better see the real problems
inbetween.
Change-Id: Id0c04dba43fcaf55d8cd2b5c6697358857c31bf9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
In 3558704ed5, we added code to
support old .ui files which used the old integer scale for font
weights by checking for a special attribute which would help
separate new and old files.
Since then, it has become apparent that the weight element in
.ui is not actually used for anything, since it is only emitted
when the bold flag is set and always has to match QFont::Bold
in these cases.
So instead of converting, we simply ignore it now, and respect
the bold flag instead.
This also reverts the changes to ui4.* in uic, since the
scale attribute is no longer needed.
Task-number: QTBUG-42248
Change-Id: I1898868b58004099590f4eaf01f24c57bd34d779
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Add a new BINDABLE declaration to the Q_PROPERTY() macro that tells moc
where to find the QBindable for the property.
Add a QUntypedBindable base class to QBindable<T> that gives access to
generic functionality and checks argument compatibility at runtime.
QBindable<T> will still do static checking at compile time.
Add QMetaProperty::isBindable() and QMetaProperty::bindable()
to be able to dynamically access the binding functionality.
Change-Id: Ic7b08ae2cde83fd43e627d813a886e1de01fa3dc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
And all related functionality. This is being replaced by
Q_BINDABLE_PROPERTY and Q_OBJECT_BINDABLE_PROPERTY in the
next few commits. The new infrastructure coming will play
nicer along with the existing property system.
Commented out some autotests, that will get reimplemented
with the updated infrastructure.
Change-Id: I50c30bd4d5c6c6b6471f8eb93870e27d86f5a009
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Export some private functions from QUtf8 to resolve
undefined symbols in Qt5Compat after moving QStringRef.
Task-number: QTBUG-84437
Change-Id: I9046dcb14ed520d8868a511d79da6e721e26f72b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We use qt_wrap_cpp instead of AUTOMOC so that we can easily find the
json files.
Getting autorcc to run only after json file has been generated was
deemed too tricky. Therefore the test is slightly modified to check for
the json files in its directory instead of the resource, if the qrc file
does not exist.
Change-Id: Id1aabb117c8bab3ff81156da1f66d64e796bf18b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Previously, only QNotifiedProperty was supported. As moc cannot
determine by itself whether the backing property is a QProperty or a
QNotifiedProperty, allow NOTIFY false to indicate that it is a plain
QProperty. For symmetry, NOTIFY true is also allowed and means that the
backing property is a QNotifiedProperty.
Change-Id: I66f3105c976ef084198ce8658bc07499a3cb1cd8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This way we can return a nullptr for cases where the class does not want
to provide a property at all. For example outside of bindings when
reading the default value. The moc-generated code can check for such
nullptrs and handle them.
Change-Id: I7ff478cb254012147bb7aed3feb160e3e679cb6d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
And generate a few more test projects that were missing.
Change-Id: I5df51106549aa5ae09bc3c42360e14b143719547
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Use pro2cmake with '--api-version 2' to force regenerate
projects to use the new prefixed qt_foo APIs.
Change-Id: I055c4837860319e93aaa6b09d646dda4fc2a4069
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
If you pass "STORED false" the name is interpreted as function to be
invoked in order to access the property. This allows storage of a
property in a lazily allocated data type.
Change-Id: I4d3a9cac6985c6419ce687868cb74b91921595a6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The reason for setting this variable was removed in commit 300bd7fff8.
Task-number: QTBUG-25078
Change-Id: Id06072c099481a258cb65b4603efe010e306b7b2
Reviewed-by: hjk <hjk@qt.io>
This is required to remove the ; from the macro with Qt 6.
Task-number: QTBUG-82978
Change-Id: I3f0b6717956ca8fa486bed9817b89dfa19f5e0e1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
As a side effect, data() can now return a nullptr. This
has the potential to cause crashes in existig code. To work
around this, return an empty string from QString::data()
and QByteArray::data() for now.
For Qt 6 (and once all our internal issues are fixed), data()
will by default return a nullptr for a null QString, but we'll
offer a #define to enable backwards compatible behavior.
Change-Id: I4f66d97ff1dce3eb99a239f1eab9106fa9b1741a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This change only happens to files touched
by the commit to add missing ; to Q_UNUSED.
Task-number: QTBUG-82978
Change-Id: I10e6993a2bb3952cf9a262708b8573550e0dbe63
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Skip crashing tests and ignore failing tests on CMake platforms.
Add missing QTEST_ENVIRONMENT=ci env var assignment to Coin test
instructions. This was hardcoded by the Coin code for qmake
configurations.
Task-number: QTBUG-85364
Change-Id: Id2312e504a0d36b8f8596d4cebaa49c63731406e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
We don't really know why, but using the ctest
--force-new-ctest-process flag stops the test from hanging.
Also re-enable the test.
Task-number: QTBUG-78449
Task-number: QTBUG-81365
Change-Id: I33094696dfe3f610dc257089074b1c2a9926f651
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
The QMAKE_CROSS_COMPILED define isn't used since 2011.
Change-Id: I9f03791e9f7c0ef439db5e65d930c0b7cb928974
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This test calls qmake on a project that generates a .qrc file. On
Windows, where debug_and_release is on by default, the generated qrc
file ends up in a "debug" or "release" subdirectory. On other
platforms the file is generated directly in the build dir.
To guess the right location, the preprocessor defines RELEASE_BUILD
and DEBUG_BUILD were passed to tst_qmake.cpp by the test's .pro file.
While the mapping from debug_and_release was fine for the .pro file,
it was commented out in the automatically converted CMakeLists.txt.
Instead of trying to fix the condition, we're going the easier route
that's used in all other .pro files of tst_qmake: make sure that
debug_and_release doesn't get in the way. In other tests this is done
by setting
DESTDIR = ./
which doesn't work for the generated qrc file. That's why we simply do
CONFIG -= debug_and_release
to make sure that everything is generated directly in the build dir.
Change-Id: I557ac4e21d7b385004d369fae8a3f727d76d4d88
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
[ChangeLog][QtCore][QByteArray] Remove method overloads taking
QString as argument, all of which were equivalent to passing the
toUtf8() of the string instead.
Change-Id: I9251733a9b3711153b2faddbbc907672a7cba190
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
And name the main class QList. That's also the one we document.
This gives less porting pain for our users, and a lot less churn
in our API, as we use QList in Qt 5 in 95% of our API.
In addition, it gives more consistent naming with QStringList and
QByteArrayList and disambiguates QList vs QVector(2|3|4)D.
Fixes: QTBUG-84468
Change-Id: I3cba9d1d3179969d8bf9320b31be2230d021d1a9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Change the meaning of Q_PRIVATE_QPROPERTY to imply that the property is
implemented using a QNotifiedProperty. That requires passing the owner
object instance to the value and binding setters.
Similarly, detect QNotifiedProperty members like QProperty.
Change-Id: If49bbb04c8ccd4a661973888c50d2d556c25034f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This changes the layout of the meta object data, so
also bump the meta object revision.
Original-patch-by: Lars Knoll <lars.knoll@qt.io>
Change-Id: I176fb16c207e8ebe59e358e69554be813406232f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Property flags should be compile time booleans, not something to
be determined at runtime.
We've been using this to dynamically disable some properties in QWidget
based classes dependent on the state of a different property, but this
should better get implemented on top of our widgets.
Change-Id: I6296e8761303ecdf24d9e842142e8596304c015d
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This does the analog of 46f407126e for the
methods we care about (signals, slots, Q_INVOKABLEs). In addition to the
actual QMetaType, we store an array with offsets so that we later can do
a mapping from methodIndex to metatype.
The newly added QMetaMethod::{return,parameter}MetaType methods can then
be used to retrieve the metatypes.
This does however require that all involved types are complete. This is
unfortunately not a feasible requirement. Thus, we only populate the
metatype array on a best effort basis. For any incomplete type, we store
QMetaType::Unknown. Then, when accessing the metatype, we fall back to
the old string based code base if it's Unknown.
Squashes "moc: support incomplete types" and "Fix compile failures
after QMetaMethod change"
Fixes: QTBUG-82932
Change-Id: I6b7a587cc364b7cad0c158d6de54e8a204289ad4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
When including files, moc inserts a MOC_INCLUDE_BEGIN and
MOC_INCLUDE_END token into the token stream. Those are already handled
in the toplevel Moc::parse function, but parseEnum lacked support so
far.
Pick-to: 5.15
Fixes: QTBUG-80578
Change-Id: I35c8fd959347d94af20090b3a505dd9e6bfaff88
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We already had this approach for QtWidgets, so to avoid
adding the specific cases every time, we import all the
classes from QtCore and QtGui.
Change-Id: I38dd2eec3bbdfb83f156a48f35a2f4fda44528c7
Pick-to: 5.15
Fixes: PYSIDE-1287
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Should improve performance and is going to be required in
the future anyway.
Change-Id: I89d7c50441d2491da1ab0a4d564dcc91f52ade85
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Qt Designer let's you add custom slots and signals to the main
form; they should use string-based connection syntax since the
class is not known in setupUI(). Amends
da3cb1deb6.
Task-number: QTBUG-76375
Change-Id: I5a3a5630f77c812d48db1cdb7a8658a4d2718228
Reviewed-by: Liang Qi <liang.qi@qt.io>