Commit Graph

1914 Commits

Author SHA1 Message Date
Lars Knoll
df853fed66 Use qsizetype in QList
The change creates a slight source incompatibility. The main
things to take care of are

* code using printf statements on list.size(). Using qsizetype in
printf statements will always require a cast to work on both 32
and 64 bit.
* A few places where overloads now get ambiguous. One example is
QRandomGenerator::bounded() that has overloads for int, uint and
double, but not int64.
* Streaming list.size() to a QDataStream will change the format
depending on the architecture.

[ChangeLog][QtCore][QList] QList now uses qsizetype to index into
elements.

Change-Id: Iaff562a4d072b97f458417b670f95971bd47cbc6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-06 21:31:14 +02:00
Lars Knoll
ded37aedc9 Implement a proper iterator for QTypedArrayData
This avoids ambiguities in our API when someone e.g. writes
vector.insert(0, ...).

It requires a slight workaround in qlalr, where std::search()
for libc++ doesn't like that our difference_type is qsizetype.

Change-Id: I40aa1040781ffbdd12d04410078207969b3bde53
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-06 21:30:54 +02:00
Tor Arne Vestbø
939f5112a1 androiddeployqt: Fix format specifier warnings
Fixes: QTBUG-85344
Change-Id: I298370ef04b9be502c54bfee729e97379ad81231
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-07-03 11:14:11 +02:00
Jarek Kobus
e114e580e7 Use QList instead of QVector in other tools
Task-number: QTBUG-84469
Change-Id: I90d0e2e723bb4d205d7bf333b21cdf583fdf4ea0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-25 22:30:54 +02:00
Fabian Kosmale
844e4f7b98 moc: Fix QProperty code generation
This addresses two issues:
1. The generated code for QNotifiedProperty<T, ...> was broken when T is
   a pointer. Notably, const S* &  is not a constant reference to S*.
   This is addressed by consistently using T const& instead of const T&.
2. The Q_PRIVATE_QPROPERTY approach assumed that the property name and
   the getter are equal. This does break when they are not, and we are
   unable to change either of them due to API compatibility concerns. An
   example of this would be QQuickItem's parent property with a
   parentItem getter. Therefore, we now allow the usage of NAME to
   override the name of the property.

Change-Id: Idf2e85576c74371b5b0f6db15dbe6f2d17c5e33d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-25 14:11:56 +02:00
Jarek Kobus
670c5bd140 Use QList instead of QVector in moc
Task-number: QTBUG-84469
Change-Id: Id95a656e6277a7c348c02c3267a45ac176c1643b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-06-22 16:46:08 +02:00
Jarek Kobus
a298a8ea54 Use QList instead of QVector in uic
Task-number: QTBUG-84469
Change-Id: I2ce8ca51409c8e29a84d88bdda968e6dec419bea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-06-22 13:58:30 +02:00
Karsten Heimrich
18ec53156e Move QTextCodec support out of QtCore
* Assume UTF-8 on all Unix like systems
* Export some functions to be able to compile QTextCodec once
  moved to Qt5Compat.

Task-number: QTBUG-75665
Change-Id: I52ec47a848bc0ba72e9c7689668b1bcc5d736c29
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-20 02:04:38 +02:00
Simon Hausmann
b0f445a152 Add support for QNotifiedProperty to the moc
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>
2020-06-18 17:26:11 +02:00
Assam Boudjelthia
4041610cb2 Android: warn about too long build paths on Windows
If Gradle build fails on Windows, check for java files that exceed
the max length of 260 that Gradle can handle, then warn about the length
issue.

Pick-to: 5.15
Task-number: QTBUG-83875
Change-Id: Ia7462bc816b3efa4ba9fdd0f179fdc4c06e23248
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-06-18 12:17:34 +00:00
Alexandru Croitor
976fa5134a CMake: Use intelcet flags for bootstrap and qmake
This should fix build failures on Ubuntu 20.04.

Amends fa98adbd04

Change-Id: Iff399faff0cf06f5b88d756b1f632b8798069578
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-18 11:51:41 +02:00
Assam Boudjelthia
9ba88a2689 Android: fix qmlimportscanner not correctly assigned
Change-Id: I6c1212085211e060dda0a84a8660b653bcd30817
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2020-06-15 11:54:52 +03:00
Lars Knoll
6bbfae9457 Port dbus from QStringRef to QStringView
Task-number: QTBUG-84319
Change-Id: Ifdfad6b7ac8b61ead71382e5ae3cb22b50b2504c
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2020-06-15 10:44:10 +02:00
Lars Knoll
2393432cd0 Port androiddeployqt and uic from QStringRef to QStringView
Task-number: QTBUG-84319
Change-Id: I7f30a4d73dd98ee1977645d7274816cd71307506
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-15 10:44:04 +02:00
Alexandru Croitor
a08bf7f00a CMake: Fix usage of gc_binaries feature
The qt_internal_apply_gc_binaries function should apply both compile
and link flags, not just link flags.

The flags should be applied publically to all consumers of Bootstrap
regardless if the gc_binaries feature is enabled.

The flags should be applied publically to Core only in case if the
feature is enabled (aka for static builds only).

Change-Id: Id42af0d9b527004d74c04eff2c9e3c2be1e76aac
Fixes: QTBUG-84461
Task-number: QTBUG-83929
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-12 22:34:12 +02:00
Lars Knoll
d0689ec867 Get rid of the obsolete isEditable flag for properties
Change-Id: I54411bd8e223671523c9c8fad5c80bfa6b5b7097
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-06-11 19:39:56 +02:00
Fabian Kosmale
630c7b4811 Cleanups in QMetaProperty
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>
2020-06-11 19:39:54 +02:00
Lars Knoll
5603be705e Qt6: remove support for property flags being functions
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>
2020-06-11 19:39:53 +02:00
Volker Hilsheimer
44fb925f50 Phase 2 of removing QDesktopWidget
Remove QDestopWidget public header, simplify the implementation that
maintains a Qt::Desktop type QWidget for each QScreen, and turn
QWidget's initial target screen into a QScreen pointer.

QApplication::desktop() now takes an optional QScreen pointer, and
returns a QWidget pointer, so that applications and widgets can get
access to the root widget for a specific screen without having to
resort to private APIs.

QDesktopWidgetPrivate implementations to look up a screen for an index,
widget, or point are now all inline functions that thinly wrap
QGuiApplication::screens/screenAt calls. We should consider adding those
as convenience APIs to QScreen instead.

Note that QWidget::screen is assumed to return a valid pointer; there is
code that handles the case that it returns nullptr (but also code that
trusts that it never is nullptr), so this needs to be defined, verified
with tests, and asserted. We can then simplify the code further.

Change-Id: Ifc89be65a0dce265b6729feaf54121c35137cb94
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-06-08 20:29:49 +02:00
Volker Hilsheimer
94dcb5454f Remove the deprecated QDirModel
QFileSystemModel is the documented replacement. It uses threads to
populate the model, which QDirModel doesn't.

Change-Id: I7818ecd8f849eb566ac176612f382e17a0471c47
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-06-04 19:11:19 +02:00
Leander Beernaert
5a779a4ad3 CMake: Make it possible to build tools when cross-compiling
This patch allows tools to be built for the target platform when the
QT_BUILD_TOOLS_WHEN_CROSSCOMPILING parameter is set at configuration
time.

To avoid naming conflicts, the target tools are suffixed with "_native".
The qt_get_tool_target_name() function can be used to get the tool name
for both scenarios (cross and non-cross compilation).

Extend pro2cmake to refer to the right target name for tools.
The relevant write_XXX functions have a new target_ref parameter that
will be "${target_name}" for tools and literally the target name for
everything else.

Fixes: QTBUG-81901
Change-Id: If4efbc1fae07a4a3a044dd09c9c06be6d517825e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-02 22:42:15 +02:00
Fabian Kosmale
fa987d4441 MetaObject: Store the QMetaType of the methods
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>
2020-06-02 22:42:15 +02:00
Alexandru Croitor
a9fbe53966 CMake: Regenerate tools and 3rd party
Change-Id: I38e065cddc954e8594a5dce823c3bb5385a8a1e8
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-29 23:22:43 +02:00
Fabian Kosmale
d8a2456fbf moc: handle include directives in enums
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>
2020-05-27 09:21:08 +02:00
Lars Knoll
2b8863a98c Get rid of some QTextCodec leftovers
There's no real dependency to QTextCodec in those files anymore.

Change-Id: Ifaf19ab554fd108fa26095db4e2bd4a3e9ea427f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-14 07:51:20 +02:00
Lars Knoll
33bb695a28 Start porting QTextStream away from QTextCodec
As a first step add setEncoding/encoding() methods that use the
QStringConverter::Encoding enum, and port all uses of setCodec()/
codec() over to the new API.

Internally QTextStream still uses QTextCodec, this will be ported
over to QStringConverter in a follow-up change.

Change-Id: Icd764cf47b449b57f4ebd010c2dad89e6717d6c0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-14 07:50:13 +02:00
Lars Knoll
ea0a08c898 Move the UTF conversion methods to qstringconverter
Separate them from the qutfcodec, so that the codec
can later on be moved out of Qt Core.

Fix the QUtf methods to take qsizetype instead of int
for length arguments.

This also makes it possible to not build QTextCodec into
the bootstrap lib anymore.

Change-Id: I0b4f83139d61b19c651520a2f3a5012aa7e85cb8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-14 07:46:38 +02:00
Lars Knoll
f64a6bd638 Start work on a new API to replace QTextCodec
The new QStringEncoder and QStringDecoder classes
(with a common QStringConverter base class) are
there to replace QTextCodec in Qt 6.

It currently uses a trivial wrapper around the utf
encoding functionality.

Added some autotests, mostly copied from the text codec
tests.

Change-Id: Ib6eeee55fba918b9424be244cbda9dfd5096f7eb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-14 07:46:14 +02:00
Joerg Bornemann
286d79d2ed pro2cmake: Handle QMAKE_TARGET_XXX variables
Change-Id: I62151e04d21c20d8c8ad5825464f26074c8abc3d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-12 14:31:12 +02:00
Jean-Michaël Celerier
3f1cffdb2e Fix some build warnings due to bad integer format in printf
Change-Id: I4b882b0a800f92eaa13f38ed23caa4b1f4992e26
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-05-12 14:27:31 +02:00
Friedemann Kleint
21a66c167d uic: Adapt to ActiveQt module restructuring
Task-number: QTBUG-78167
Change-Id: I827db1bf519a6ffcc609d215e08622bf910d519e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-05-11 12:45:31 +00:00
Lars Knoll
56a7984a90 Remove QRegExp from the bootstrap library
All it's uses have been replaces with QRegularExpression.

Change-Id: I5bcdfdd8a39dad6d1288f18f1b24d2eea9e028d2
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
2020-05-06 09:57:31 +02:00
Cristian Maureira-Fredes
2f975b39a9 uic/Python: import all the classes for QtCore and QtGui
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>
2020-05-05 22:04:51 +02:00
Thiago Macieira
0ef6b3d138 Remove use of std::not1 completely
libc++ that comes with XCode does not have the feature macros, resulting in
warnings printed. Just invert the condition in the functor itself.

lalr.cpp:316:84: warning: 'not1<Nullable>' is deprecated [-Wdeprecated-declarations]

Pick-To: 5.15
Change-Id: I99ab0f318b1c43b89888fffd160bf8d79bc4b47e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2020-05-05 12:28:23 -07:00
Marc Mutz
6da4ff824e Port two more local QSets to QDuplicateTrackers
Apart from a more fitting, minimal, API, QDuplicateTracker also
transparently uses C++17 pmr::monotonic_buffer_resource to avoid, or
at least reduce, memory allocations.

Change-Id: Ia9e837ebba88aeb1916da041fc8460a0692a03e4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-05-05 18:58:35 +02:00
Friedemann Kleint
ae7e701074 uic: Generate string-based connections for custom slots
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>
2020-05-05 15:35:51 +02:00
Friedemann Kleint
da3cb1deb6 uic: Generate Qt 5 connection syntax
Add a enum and formatting for member function pointer based
connections. Now preferably use member function pointer for Qt classes
or parameterless connections.

This should not require qOverload() within Qt classes after the
Signal/Slot disambiguation.

Add command line option to force either syntax for all connections.

Task-number: QTBUG-76375
Change-Id: Icdb4051e1173172a71cd536bdbc7d1ab1edf267d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-05-04 08:12:33 +02:00
Simon Hausmann
3d7265db90 Provide a way of exposing private QProperties with a fake API
The API reduces the amount of manual plumbing required to offer a
conceptual property through the traditional setter/getter API as well as
through QProperty<T> API. Since the latter would require inlining the
type and thus making it impossible to add new properties without
breaking binary compatibility, this patch introduces a fake API that
behaves similar but does not contain the property by value.

Change-Id: Ib9bccd867f0e4e36a520e5583ba348e728284253
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-04-30 19:39:25 +02:00
Simon Hausmann
b480acb372 Allow for private properties to be implemented using QProperty
Recently the moc learned that Q_PROPERTY(int x ...) can mean that "x" is
implemented as QProperty and then allows installing bindings, etc. -
this works by scanning the same class' members.

For our own use of QProperty, we need to place the QProperty member
itself into the d-pointer to be able to maintain the ability to add new
properties without breaking binary compatibility. That however means
that moc can't know that a certain property is backed by QProperty - we
don't scan the members of the private class.

As a workaround, this change enables the syntax where the property type
used in Q_PRIVATE_PROPERTY may be wrapped with QProperty<T>.

In addition this patch fixes the compilation of such declared properties
by ensuring the accessor prefix (t->$accessor) is applied also for the
QProperty related meta call variants.

Change-Id: I8fbdc49319048b57f4eb0b65b56daba0459e9598
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-04-30 19:39:19 +02:00
Leander Beernaert
6dd90afb76 CMake: Regenerate projects to match updated plugin API
Change-Id: Iafe0a953e74d7f36ec48fa075b3725dd6466c5e3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-27 12:21:29 +02:00
Qt Forward Merge Bot
efd7757154 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/widgets/widgets/qabstractbutton.cpp
	src/widgets/widgets/qbuttongroup.cpp
	src/widgets/widgets/qbuttongroup.h
	src/widgets/widgets/qsplashscreen.cpp
	tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp
        tests/benchmarks/opengl/main.cpp

  Needed update:
	src/plugins/platforms/cocoa/CMakeLists.txt

Change-Id: I7be4baebb63844ec2b3e0de859ca9de1bc730bb5
2020-04-22 15:28:01 +02:00
Friedemann Kleint
a54294369d rcc: Fix line endings on Windows when redirected
Extend the fix 53d5811b0c
to work for the file generation mode as well.

Pick-to: 5.15
Fixes: PYSIDE-1273
Change-Id: I5a91e2de87b44658f276cea87cbd730452b1bd78
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-04-20 20:25:32 +02:00
hjk
300bd7fff8 rcc: Always seed the hash with 0
That was already done to pass the auto tests, but the randomization also
bites for reproducible builds.

Change-Id: Ibf4da513059deb5a806d2ac1a83c1994edf09d4a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-17 09:02:22 +02:00
Lars Knoll
23b14237f8 Port androidtestrunner to QRegularExpression
Change-Id: If135b29996b7036d65472a1b5fa4817cd7907aba
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-04-15 14:37:35 +02:00
Lars Knoll
e174c2f7d7 Port tracedef to QRegularExpression
Change-Id: I38bbf36719c99d4fda102eca375011c38792dd4a
Reviewed-by: Rafael Roquetto <rafael@roquetto.com>
2020-04-13 09:40:26 +02:00
Lars Knoll
5b10b57c45 Port androiddeployqt from QRegExp to QRegularExpression
As a drive-by, also fix spelling of architecture.

Change-Id: Ibeaa6b611ddbb75b9492deb5d97a64ed8b030c3a
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-04-13 09:40:16 +02:00
Lars Knoll
33752a9bd3 Include QRegularExpression in the bootstrap library
This allows us to use regular expressions in bootstrapped tools
such as moc and tracegen.

Change-Id: I4310dd15bf26651aac6ab30c884e025ca06b3099
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-04-13 09:40:09 +02:00
Lars Knoll
c6cdf38e75 Change qHash() to work with size_t instead of uint
This is required, so that QHash and QSet can hold more
than 2^32 items on 64 bit platforms.

The actual hashing functions for strings are still 32bit, this will
be changed in a follow-up commit.

Change-Id: I4372125252486075ff3a0b45ecfa818359fe103b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-09 20:03:25 +02:00
Qt Forward Merge Bot
8823bb8d30 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	examples/opengl/doc/src/cube.qdoc
	src/corelib/global/qlibraryinfo.cpp
	src/corelib/text/qbytearray_p.h
	src/corelib/text/qlocale_data_p.h
	src/corelib/time/qhijricalendar_data_p.h
	src/corelib/time/qjalalicalendar_data_p.h
	src/corelib/time/qromancalendar_data_p.h
	src/network/ssl/qsslcertificate.h
	src/widgets/doc/src/graphicsview.qdoc
	src/widgets/widgets/qcombobox.cpp
	src/widgets/widgets/qcombobox.h
	tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp
	tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
	tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
	tests/manual/diaglib/debugproxystyle.cpp
	tests/manual/diaglib/qwidgetdump.cpp
	tests/manual/diaglib/qwindowdump.cpp
	tests/manual/diaglib/textdump.cpp
	util/locale_database/cldr2qlocalexml.py
	util/locale_database/qlocalexml.py
	util/locale_database/qlocalexml2cpp.py

Resolution of util/locale_database/ are based on:
https://codereview.qt-project.org/c/qt/qtbase/+/294250
and src/corelib/{text,time}/*_data_p.h were then regenerated by
running those scripts.

Updated CMakeLists.txt in each of
	tests/auto/corelib/serialization/qcborstreamreader/
	tests/auto/corelib/serialization/qcborvalue/
	tests/auto/gui/kernel/
and generated new ones in each of
	tests/auto/gui/kernel/qaddpostroutine/
	tests/auto/gui/kernel/qhighdpiscaling/
	tests/libfuzzer/corelib/text/qregularexpression/optimize/
	tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/
	tests/libfuzzer/gui/text/qtextdocument/sethtml/
	tests/libfuzzer/gui/text/qtextdocument/setmarkdown/
	tests/libfuzzer/gui/text/qtextlayout/beginlayout/
by running util/cmake/pro2cmake.py on their changed .pro files.

Changed target name in
	tests/auto/gui/kernel/qaction/qaction.pro
	tests/auto/gui/kernel/qaction/qactiongroup.pro
	tests/auto/gui/kernel/qshortcut/qshortcut.pro
to ensure unique target names for CMake

Changed tst_QComboBox::currentIndex to not test the
currentIndexChanged(QString), as that one does not exist in Qt 6
anymore.

Change-Id: I9a85705484855ae1dc874a81f49d27a50b0dcff7
2020-04-08 20:11:39 +02:00
Simon Hausmann
5422fb7948 Allow declaring QProperty<> based Q_PROPERTYies with a notify signal
This requires mostly making moc a bit more permissive, which has the
advantage that it also simplifies the code a little bit.

The newly added test case demonstrates how to connect such a property
with a change signal.

One test case needed to be changed regarding the callback as the
publicProperty member now has a (permanent) observer and therefore
re-assigning the binding will re-evaluate it as the value might have
changed.

Change-Id: Ia7edcec432de830bdd4e07d943c5d4550c175ca4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-04-08 11:26:39 +02:00
Mårten Nordheim
d8b49e6b51 QtNetwork: Delete bearer management
All remaining pieces are gone, configuration included.

Relevant CMakeLists and configure.cmake were regenerated.

Fixes: QTBUG-76502
Change-Id: I667b5da7e3802830d236d50b5e9190c2ee9c19e2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-04-05 16:41:08 +02:00
Lars Knoll
64b1af3fa0 Warn that the EDITABLE flag for property declarations is deprecated
Additionally mark QMetaProperty::isEditable as deprecated.

Change-Id: I1abe4c6f2d30c2f96380f9e5942be431dbfed38f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-04-02 15:21:46 +00:00
Friedemann Kleint
098d2edb07 uic: Generate include statement for QActionGroup
Legacy forms from Qt 3 may still contain QActionGroup,
generate an include statement for them.

Change-Id: I292967f23f798a132ec7e360e437b20a529c3a26
Complements: bcaff2b06f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-03-31 18:51:57 +02:00
Eskil Abrahamsen Blomfeldt
adc205631b Android: Update minimum version to 23 again
In 519ea72108, the minimum SDK
version was moved away from the AndroidManifest.xml, and when
the change was merged, we lost parts of the update to set
the minimum version to 23.

This redoes it in the remaining locations.

Change-Id: Iada8188d3c0c8ec0a4801c1d219640ecb3976753
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-03-30 13:04:06 +01:00
Mitch Curtis
3f73995a03 Move undo framework out of Qt Widgets
- Moves QUndo* classes (except QUndoView) from src/widgets/utils to src/gui/utils
- Moves related auto tests from widgets to gui
- Replaces QUndoAction with lambdas that do text prefixing

[ChangeLog][Undo Framework] QUndo* classes (except QUndoView) were moved from Qt
Widgets to Qt GUI.

Done-with: volker.hilsheimer@qt.io
Fixes: QTBUG-40040
Change-Id: I3bd8d4d32c64f8dee548f62159a1df2126da89d8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-03-30 12:36:29 +02:00
Volker Hilsheimer
d975ad4ed7 Merge QGuiShortcut and QShortcut again in QtGui
QShortcut has only one widget specific feature, which is whatsThis; that
is just a QString, so the setters and getters can just as well be in
QtGui.

The widgets specific implementation of shortcut matching and of showing
the whatsThis balloon stays in QtWidgets, in the private implementation.
Using virtual functions in the private we can override the empty default
in QtGui, and by adding a virtual factory function in QGuiApplication,
the correct private is instantiated depending on the kind of application
running.

Change-Id: I09ae4a5482f9fb70940c5e2bfe76d3d7fd710afc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-29 19:31:14 +01:00
Volker Hilsheimer
bcaff2b06f Remove QGuiAction again and split QAction implementation up instead
Duplicating the number of classes is a high price to pay to be able to
have some QAction functionality behave differently, or be only available
in widgets applications.

Instead, declare the entire API in QtGui in QAction* classes, and
delegate the implementation of QtWidgets specific functionality to
the private. The creation of the private is then delegated to the
Q(Gui)ApplicationPrivate instance through a virtual factory function.

Change some public APIs that are primarily useful for specialized tools
such as Designer to operate on QObject* rather than QWidget*. APIs that
depend on QtWidgets types have been turned into inline template
functions, so that they are instantiated only at the caller side, where
we can expect the respective types to be fully defined. This way, we
only need to forward declare a few classes in the header, and don't
need to generate any additional code for e.g. language bindings.

Change-Id: Id0b27f9187652ec531a2e8b1b9837e82dc81625c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-03-29 11:18:57 +01:00
Lars Knoll
53f8f23369 Get rid of QRegExp usage in rcc
As a drive-by, enable testing of rcc in the cmake build.

Change-Id: I4150ff3ffe7404bab0cbc72f80b23b47a60cf33d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2020-03-25 09:34:37 +01:00
Mitch Curtis
69a5be7ef0 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ib2a2e3a292af43be3a980c2ccc943c08f4bbf72f
2020-03-20 11:28:14 +01:00
Eskil Abrahamsen Blomfeldt
1a18e138f4 Android: Fix deployment on Windows host
The paths in the build properties require forward slashes
apparently. On Windows, we would default to native backslashes
and they would be stripped from the path. Converting to forward
slashes fixes the problem.

Issue was introduced by dd04fb639b,
since before that, the NDK path was retrieved from the environment.

Fixes: QTBUG-82944
Change-Id: I6c51113efcf671461a5871991b3225a52b95266c
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-03-19 10:23:07 +01:00
Simon Hausmann
d4f0445331 Add support for exposing public QProperty members in the meta-object system
At the moment this makes the type as well as the setter/getter available
through the meta-call as well as the ability to register observers and
bindings. Only QProperty members that are annotated with
Q_PROPERTY(type name) are made public through the meta-object.

Change-Id: I16b98fd318122c722b85ce61e39975284e0c2404
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-03-18 15:42:58 +01:00
Lars Knoll
dee55af0a5 Remove QRegExpValidator
As QRegExp will be moved to a compat library in Qt 6.

Change-Id: I181aec45bd798f49d2c50a0e7fb64782e004b854
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2020-03-17 08:35:50 +01:00
Simon Hausmann
bc64ccbf00 Re-generate various CMake projects and configure after merge
Change-Id: I02f5926c6664aab518c5c81e0c33dca0818a1871
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-16 20:43:56 +01:00
Simon Hausmann
c2f167b412 Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2020-03-16 20:43:50 +01:00
Simon Hausmann
ff922e7b87 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/corelib/kernel/qmetatype.cpp

Change-Id: I88eb0d3e9c9a38abf7241a51e370c655ae74e38a
2020-03-16 18:41:27 +01:00
Tor Arne Vestbø
77885f8402 cmake: Remove APPLE prefix from platform names
None of the other platforms have it.

Change-Id: Ib448c2c03ba03f711b507ef391977c0e6aa7c192
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-16 17:57:56 +01:00
Tor Arne Vestbø
db745fdd2d cmake: Fix naming when referring to Apple macOS
Change-Id: Iafb5e448d0d65d42f788464fc600594a5666f9af
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-16 17:57:52 +01:00
Topi Reinio
26ed956cbc Doc: Remove \contentspage commands
The command is deprecated and has no effect apart from generating
a documentation warning.

Change-Id: I30871bfd6975f8268930cce99993a8579242fdb8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-15 10:48:58 +01:00
Alexandru Croitor
14546d1816 rcc: Teach rcc the --no-zstd option
It is needed when cross-building Qt using CMake, where the zstd
feature might have different values between the host and target,
in which case the build system tells rcc not to use zstd when
the feature is disabled.

Amends d20c980576

Change-Id: I9dc55b59b1be5272b79aa5f1e2daf2b516a157d6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-03-12 11:41:26 +01:00
Tor Arne Vestbø
5f940253bf macOS: Merge qcore_mac cpp and mm files
Files ending with .mm are Objective-C++ files, so we don't need
a separate file for the C++ parts.

Change-Id: I3ef52bc98291fd461b889978a538e81630d17c6e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-03-12 06:07:35 +01:00
Qt Forward Merge Bot
865afac250 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ibee5acec72a1a1769d4bc5f23f56c7dc8d4cf3cb
2020-03-11 15:34:21 +01:00
Qt Forward Merge Bot
116d68f105 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/corelib/plugin/qlibrary.cpp
	src/corelib/plugin/qlibrary_unix.cpp
	src/corelib/plugin/qpluginloader.cpp

Change-Id: I866feaaa2a4936ee5389679724c8471a5b4b583d
2020-03-11 11:27:49 +01:00
Kari Oikarinen
d6d902a990 Merge 5.14 into 5.14.2
Change-Id: Ib4b26bad47a850cde6253fb3422aae34b2cf622b
2020-03-10 09:43:16 +02:00
Lars Knoll
a0ffdf765e Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2020-03-04 19:10:37 +00:00
BogDan Vatra
519ea72108 Android: Bump gradle (plugin) versions
Move min & target sdk from AndroidManifest.xml to build.gradle

Fixes: QTBUG-70817
Change-Id: Id9bb9825a3232587e0255b2d3d6f0273c5f9b66a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-03-04 18:02:35 +00:00
Friedemann Kleint
649d7abcd2 Update uic's class lib map to reflect QtOpenGLWidgets
Task-number: QTBUG-74409
Change-Id: I5de957156c3120422f5c8f2e702e198f9f6cc43d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-03-04 15:31:13 +00:00
Lars Knoll
2a4b957789 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I99ee6f8b4bdc372437ee60d1feab931487fe55c4
2020-03-04 14:39:18 +00:00
Eskil Abrahamsen Blomfeldt
5f1afeacf6 Android: Increase minimum API level to Android-23 / Android 6
There are certain APIs we need which cannot be used without this,
and in general it simplifies some code.

[ChangeLog][Android] Minimum Android version is now Android 6.0,
API level 23.

Change-Id: I72ca3b429bf48969e16e2bc6b99d9c4af993ea77
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-03-04 08:28:04 +01:00
Cristián Maureira-Fredes
3f7d087d33 uic: Add pass to empty functions
When there are no translations on the UI file,
the function was left empty but without a 'pass'
statement, generating a SyntaxError,
this change includes it to avoid problems while
using the generated Python file.

Fixes: PYSIDE-1234
Change-Id: I30482a95c95fb4b4f4456531946a79c960d76318
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-03-03 14:50:35 +01:00
Qt Forward Merge Bot
63312fe2ec Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: If36d96c0fef3de5ab6503977501c55c62a2ecc97
2020-03-03 14:13:02 +01:00
BogDan Vatra
6806cb341c Android: fix apk generation on Android API 23+
Starting with Android API 23+ gradle enables uncompressed native libs by default.
We must set android.bundle.enableUncompressedNativeLibs = false to gradle.properties,
to force it to compress them and extract them on the device.

Fixes: QTBUG-80766
Change-Id: Ia6d8d9179a341bbe7f8dc254a3b31d2ee8d7a5d7
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-03-03 13:37:21 +02:00
Qt Forward Merge Bot
60ec012d8d Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I851c0328c3c38ea67b5ad115b205ac6a1262706e
2020-02-29 01:00:44 +01:00
Edward Welbourne
305ddbeb5b Use Qt::SplitBehavior in preference to QString::SplitBehavior
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.

Change-Id: I399b5ea56e9255e775ca1746632f7421519a6616
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-02-28 15:37:11 +01:00
Johan Klokkhammer Helsing
eca884a483 Remove various traces of QGL
Removed friend declarations, some check etc.

Task-number: QTBUG-74408
Change-Id: I1c5b46a564beee2c1d894678b908803f91df68aa
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-02-28 09:59:39 +01:00
Cristián Maureira-Fredes
de1d51a3fd uic: handle header tag for python imports
Fixes: PYSIDE-1233
Change-Id: Id2b6e2a8b833da6ea4417d06643b2f7b045515a9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-27 11:19:39 +01:00
Qt Forward Merge Bot
75c0ffaf6d Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	examples/network/bearermonitor/CMakeLists.txt
	examples/network/CMakeLists.txt
	src/corelib/tools/qlinkedlist.h
	src/sql/kernel/qsqldriver_p.h
	src/sql/kernel/qsqlresult_p.h
	src/widgets/kernel/qwidget.cpp
	src/widgets/kernel/qwidget_p.h
	tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
	tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
	tests/auto/tools/moc/allmocs_baseline_in.json

Change-Id: I21a3c34570ae79ea9d30107fae71759d7eac17d9
2020-02-26 18:39:21 +01:00
Alexandru Croitor
26059d1b9b CMake: Allow building bundled 3rd party libraries in qtbase
A few things are needed to accomplish that:

- the python scripts do not ignore certain system_foo features anymore
  (it is a hardcoded list for now just to be safe)

- configurejson2cmake now outputs
  qt_find_package(WrapSystemFoo) calls for bundled libraries
  (see below)

- the harfbuzz .pro file is modified to accommodate pro2cmake
  not being able to correctly parse some conditional scopes

- the freetype .pro file is modified to make sure linking of the
  library succeeds without duplicate symbol errors, which qmake
  doesn't encounter due to magical exclusion of cpp files that are
  included in other cpp files (presumably for include moc_foo.cpp
  support)

- feature evaluation for Core, Gui, Network now happens in the
  qtbase/src directory, so that bundled libraries can be conditionally
  built

- for each bundled library there are now two FindWrap scripts:
  - FindWrapSystemFoo which finds an installed library in the system
  - FindWrapFoo which either uses the system installed library or
    the built bundled one depending on a condition

- projects that intend to use bundled libraries need to link against
  WrapFoo::WrapFoo instead of WrapSystemFoo::WrapSystemFoo targets
  (this is handled by pro2cmake).
  Unfortunately manually added qt_find_package(WrapFoo) calls might
  still be needed as is the case for WrapFreetype and others.

- a new cmake/QtFindWrapHelper.cmake file is added that provides
  a macro to simplify creation of WrapFoo targets that link against
  a bundled or system library. The implementation is fairly ugly
  due to CMake macro constraints, but it was deemed better than
  copy-pasting a bunch of almost identical code across all
  FindWrapFoo.cmake files.

- a qtzlib header-only module is now created when using bundled
  zlib, to provide public syncqt created headers for consumers
  that need them. These are projects that have
  'QT_PRIVATE += zlib-private' in their .pro files
  (e.g. qtimageformats, qtlocation, qt3d, etc.)
  This is unfortunately needed due to QtNetwork using zlib
  types in its private C++ API.

The change includes support for building the following bundled
libraries:
- zlib
- libpng
- libjpeg
- Freetype
- Harfbuzz-ng
- PCRE2

The following 3rd party libraries are still using an old
implementation within the CMake build system, and should be migrated
to the new one in the near future:
- double-conversion
- Old harfbuzz

The are a few libraries that are not yet ported:
- system-sqlite
- systemxcb
- maybe others

Among other things, this change allows building qtbase on Windows
without requiring vcpkg.

Task-number: QTBUG-82167
Change-Id: I35ecea0d832f66c1943c82e618de4a51440971a5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
2020-02-25 15:43:16 +01:00
Olivier Goffart
46f407126e MetaObject: store the QMetaType of the properties
Change-Id: I563e7232b70e94de4184f2c23a581319313dcf5c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-02-25 15:43:15 +01:00
Olivier Goffart
4dbac23e53 Normalize types at compile time
This also fix the normalization algorithm:
 - Some 'const' after pointers were not removed as they should.
 - No need to keep the space in '> >' and '< :' in C++11 anymore
 - Fix normalization of 'long unsigned int' and similar

Change-Id: I2b72f0fede96c1063e7b155d9f25a85fccfc7bf9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-20 16:11:02 +01:00
Sona Kurazyan
63a559845c Remove QLinkedList
QLinkedList has been moved to Qt5Compat. Remove and stop mentioning
it in docs, examples (the docs & examples for QLinkedList itself will
be moved to Qt5Compat) and remove the corresponding tests.

Also remove QT_NO_LINKED_LIST, since it's not needed anymore.

Task-number: QTBUG-81630
Task-number: QTBUG-80312
Change-Id: I4a8f1105cb60aa87e7fd67e901ec1a27c489aa31
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-19 21:01:07 +01:00
Alexandru Croitor
eaa29378b9 CMake: Fix c++ standard config tests with MSVC
Need to pass additional -Zc:__cplusplus flag when using
MSVC, so that the __cplusplus define has correct values.

Additionally make the option be propagated to consumers of Qt
via the public Platform target, which QtCore links against.

Change-Id: Ie1283c25334b93f993529beb7fb32bdb001627f5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
2020-02-18 14:44:57 +01:00
Liang Qi
6b2535ea15 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	examples/widgets/graphicsview/boxes/scene.h
	src/corelib/Qt5CoreMacros.cmake
	src/corelib/Qt6CoreMacros.cmake
	src/network/ssl/qsslsocket.cpp
	src/network/ssl/qsslsocket.h
	src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp
	src/testlib/CMakeLists.txt
	src/testlib/.prev_CMakeLists.txt
	tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp

Disabled building manual tests with CMake for now, because qmake
doesn't do it, and it confuses people.

Done-With: Alexandru Croitor <alexandru.croitor@qt.io>
Done-With: Volker Hilsheimer <volker.hilsheimer@qt.io>
Change-Id: I865ae347bd01f4e59f16d007b66d175a52f1f152
2020-02-13 18:31:40 +01:00
Ulf Hermann
35f973d222 moc: Record whether a meta object is an object, gadget, or namespace
So far, objects had no identification, and both gadgets and namespaces
were called "gadget". qmltyperegistrar, however, is especially
interested in the distinction between namespaces and anything else.

Task-number: QTBUG-68796
Change-Id: Ic5739727bdef7766de6e535c6568920198fadb2b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-02-13 11:40:05 +01:00
Qt Forward Merge Bot
9a5df00a61 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I8caee4d1ce0eed27d905194df3c3d46c5d07d2b0
2020-02-12 01:00:50 +01:00
BogDan Vatra
dd04fb639b Set also ndk.dir
It's needed when ANDROID_NDK_HOME is not set

Fixes: QTBUG-81978
Change-Id: Id6108083ae62757ca839d652793d98a89e6cb6b5
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-02-11 11:16:42 +02:00
Alexandru Croitor
3af9d49bb7 Merge remote-tracking branch 'origin/wip/cmake' into dev
Change-Id: If75ae006db6eb977cf66af4c3d36cb5c8098a1f1
2020-02-10 18:35:07 +01:00
Qt Forward Merge Bot
9634055543 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I5d80d84d1fd9f52e7c8e4895cc34d4d29043f400
2020-02-08 01:00:08 +01:00
Ulf Hermann
f64694647a moc: Extend revision markers to allow for major and minor version
As we want Qt's own revisions to follow the Qt versioning scheme, we
need to allow for the minor version to reset to 0 now. In order to
facilitate this, we interpret the argument passed the current Q_REVISION
macro as major version and allow for an optional minor version. Both are
encoded it into the resulting revision number.

Change-Id: I3519fe20233d473f34a24ec9589d045cdd162a12
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-02-07 21:23:55 +01:00
Alexandru Croitor
1c571e5fe7 Merge "Merge remote-tracking branch 'origin/wip/cmake' into dev" 2020-02-07 18:19:51 +00:00
Friedemann Kleint
e9efd96e62 uic/Python: Add imports for Q(Date)Time, QKeySequence
Those types are used as properties of Q(Date)TimeEdit,
QKeySequenceEdit.

Fixes: PYSIDE-1215
Change-Id: I8b9ffebb8229fff447aa7dd6bee6e037d708333c
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-02-06 17:46:21 +01:00
Qt Forward Merge Bot
8ce0ad805d Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/network/ssl/qsslsocket_openssl_symbols.cpp

Change-Id: I8c13b5c48a8ecce96540b39c6d5f8ca146eb2339
2020-02-06 11:10:34 +01:00
Alexandru Croitor
ac38fa1182 Regenerate projects to correctly handle private dependencies
Change-Id: I7d84bc9962bff5c89a90367ae704974c6ce2ec89
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-02-05 14:36:31 +00:00
Friedemann Kleint
6baed76654 uic/Python: Set form object name correctly
Add missing "not" for the isEmpty() check.

Fixes: PYSIDE-1210
Change-Id: I3798d483df9d077300ff69dc5d3a8d08812f534e
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-02-05 10:37:02 +01:00
Lars Knoll
c6e1b54f94 Cleanup code where we mixed QHash and QMultiHash iterator code
Change-Id: Ib229cad13ca21d6288e009c6ee1c39fa974f80b8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-03 17:43:30 +01:00
Alexandru Croitor
a1dbdcbd6e Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts:
        src/corelib/Qt5CoreConfigExtras.cmake.in
        src/corelib/Qt5CoreMacros.cmake
        src/dbus/Qt5DBusConfigExtras.cmake.in
        src/widgets/Qt5WidgetsConfigExtras.cmake.in

Change-Id: Ib782f3b177c38b2cce83beebe15be9c0baa578f7
2020-01-29 16:57:27 +01:00
Qt Forward Merge Bot
a3fc03c130 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I98b1a5a11ece3957a1115c1d9be8841759206ffe
2020-01-29 01:00:56 +01:00
Qt Forward Merge Bot
558fc903ac Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/corelib/io/qsettings.cpp
	src/corelib/kernel/qvariant.cpp
	src/corelib/serialization/qjsoncbor.cpp
	src/corelib/serialization/qjsonvalue.cpp
	src/corelib/tools/tools.pri
	src/gui/image/qimage.cpp
	src/gui/kernel/qguivariant.cpp
	src/widgets/kernel/qshortcut.cpp
	tests/auto/tools/moc/allmocs_baseline_in.json
	tests/auto/tools/moc/tst_moc.cpp
        src/opengl/qglframebufferobject.cpp

Done-With: Edward Welbourne <edward.welbourne@qt.io>
Done-With: Leander Beernaert <leander.beernaert@qt.io>
Change-Id: Ie7f5fa646c607fe70c314bf7195f7578ded1d271
2020-01-28 14:14:20 +00:00
Alexandru Croitor
c9bea1ad62 Add initial support for CMake "Ninja Multi-Config" generator
This allows doing debug_and_release builds with Ninja on all
platforms.
The "Ninja Multi-Config generator" is available starting with CMake
3.17.

Desired configurations can be set via CMAKE_CONFIGURATION_TYPES.
Possible values: "Release, Debug, RelWithDebInfo, MinRelSize".
For example -DCMAKE_CONFIGURATION_TYPES="Release;Debug".

The first configuration is the 'default' configuration which is
built when calling ninja with no arguments.

To build all targets of a certain configuration use "ninja all:Release"
or "ninja all:Debug".

To build all targets in all configurations use "ninja all:all".

Note that the first configuration influences which configuration of
tools will be used when building the libraries for all configurations.
In simple terms, when configured with
-DCMAKE_CONFIGURATION_TYPES="Release;Debug" the release version of moc
is used by AUTOMOC.
When configured with -DCMAKE_CONFIGURATION_TYPES="Debug;Release"
the debug version of moc is used by AUTOMOC.

Framework builds and Ninja Multi-Config don't currently work together
due to multiple bugs in CMake, which ends up generating an invalid ninja
file with duplicate rules. There are also issues with placement of the
debug artifacts.

This will be handled in a follow up patch after CMake is fixed.

Task-number: QTBUG-76899
Change-Id: If224adc0b71b7d1d6606738101536146aa866cd7
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-27 11:47:57 +00:00
Leander Beernaert
48c82e90af Post Merge Fixes
Change-Id: I1e06c01b76b119c3f23b6e6ecbaae8df719b70ce
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-24 12:29:18 +00:00
Leander Beernaert
502d3d6744 Merge remote-tracking branch 'origin/dev' into merge-dev
Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
2020-01-24 13:17:33 +01:00
Fabian Kosmale
cb3152086c Introduce Q_PROPERTY attribute REQUIRED
This is meant to correspond to required properties in QML.

Change-Id: I2645981e13f7423bc86b48370c165b3cfe2aaa62
Task-number: QTBUG-81561
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-01-23 16:47:45 +01:00
Olivier Goffart
73d1476fb1 Replace most use of QVariant::type and occurrences of QVariant::Type
I made a clazy automated check that replaced the use of QVariant::Type
by the equivalent in QMetaType.
This has been deprecated since Qt 5.0, but many uses were not yet removed.

In addition, there was some manual changes to fix the compilation errors.

Adapted the Private API of QDateTimeParser and QMimeDataPrivate
and adjust QDateTimeEdit and QSpinBox.

QVariant(QVariant::Invalid) in qstylesheet made no sense.

But note that in QVariant::save, we actually wanted to use the non-user type.

In the SQL module, many changes were actually reverted because the API
still expects QVarient::Type.

Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-01-23 16:46:51 +01:00
Andy Shaw
54c713e58f Android: Respect the --no-build option for APK packages
Fixes: QTBUG-80884
Change-Id: I90bc3100aeb85089256ce414434c98753e02c79c
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-01-18 14:02:07 +01:00
Qt Forward Merge Bot
c70208c2d0 Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2020-01-17 08:52:14 +01:00
Olivier Goffart
983432effd Introduce Q_MOC_INCLUDE
A new macro that can be added in the header file parsed by moc to tell moc
to include that file in the generated file

Change-Id: I03ad702c3fcd8380371015f226ee4b7456daf132
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-17 02:22:22 +01:00
Qt Forward Merge Bot
0a4e5bb265 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/widgets/kernel/qshortcut.cpp
	tests/auto/network/access/spdy/tst_spdy.cpp

Change-Id: If76c434beac2c0a393440aa365f89f77439774ce
2020-01-16 11:20:42 +01:00
Qt Forward Merge Bot
c3123c757a Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I8dbcf23835d52d3aa7d018ed250814d60c68aa83
2020-01-15 01:00:39 +01:00
Leander Beernaert
89d4f2f13e Remove invalid conversion and make it clearer for the future
Change-Id: I62fc075a4ebec7783a1e5fa35e113951aab9e674
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-14 14:24:43 +00:00
Friedemann Kleint
21a14767b3 uic/Python: Fix missing QCursor import
Fixes: PYSIDE-1182
Change-Id: I1ccc524a152ea75508166f3d2c0c60f8d829cd8f
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-01-14 14:17:52 +01:00
Leander Beernaert
0761715f79 Regenerate src/
Change-Id: Icef5e834a6acc1cc4488bbed7749e81e1f2388b3
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-14 12:37:25 +00:00
Cristián Maureira-Fredes
3f6275960c uic: add customwidget imports support for python
Fixes: QTBUG-81073
Change-Id: I29659481b14927ffcb8f2cb1829b577a67e4b937
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-01-14 08:11:53 +01:00
Qt Forward Merge Bot
cccc9d0b95 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp

Change-Id: I4d3041fa291a918c774ffa5eb5c8792a0966451d
2020-01-13 10:13:01 +01:00
Liang Qi
a59c768489 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/corelib/kernel/qobject.cpp

Change-Id: I4780b25665672692b086ee92092e506c814642f2
2020-01-09 20:30:39 +01:00
Jani Heikkinen
1e42c97cf0 Bump copyright year
Change-Id: I9468ef21a2cf03cf07c38f012a2aa9bae6d02a03
Reviewed-by: Johanna Äijälä <johanna.aijala@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-01-09 14:41:53 +02:00
BogDan Vatra
3b54009b13 AAB files can be signed only with jarsigner tool
Fixes: QTBUG-80406
Change-Id: I04b99477c744e7dd729a791c81194b90c4ec658a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-01-09 08:26:50 +02:00
Friedemann Kleint
75391511ff Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ia2ce994c42adc010c453edaeea57f672556958f6
2020-01-07 08:34:53 +01:00
Joerg Bornemann
4b2de41b13 CMake: Add support for framework builds
Framework builds are enabled by default on macOS.
They are controlled via the framework feature.

Task-number: QTBUG-75751
Change-Id: I00bc64672f02bbd1672508b2b5010d202984a961
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CMake Build Bot
2020-01-06 11:53:53 +00:00
Qt Forward Merge Bot
3a010f72b8 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/corelib/kernel/qvariant.h

Change-Id: I8f3873e74b9795ac889e7c7ec5de2619bca92160
2020-01-06 07:20:18 +00:00
Cristián Maureira-Fredes
9b647bf5ac uic: setWeight replace semi-colon by language::eol
Change-Id: I87f9c2896cfd6f83f683cf731e4a62aef627d69c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-01-05 15:31:41 +01:00
Liang Qi
a503bf5470 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/corelib/tools/qvector.h
		Make QVector(DataPointer dd) public to be able to properly merge
		5b4b437b30 from 5.15 into dev.
	src/widgets/kernel/qapplication.cpp
	tests/auto/tools/moc/allmocs_baseline_in.json

Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Change-Id: I929ba7c036d570382d0454c2c75f6f0d96ddbc01
2020-01-04 15:32:34 +01:00
Friedemann Kleint
01f0df1cf5 uic: Add handling of resources imports for Python
The Python-bases pyside2-uic would write an import for each
resource file encountered, adding a "_rc" suffix. Add this
handling.

Task-number: PYSIDE-1171
Task-number: PYSIDE-1170
Change-Id: I870d61ca7262c0684de5359a5f990d23a4171032
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-01-03 16:10:13 +01:00
Friedemann Kleint
8b0b2057d0 uic: Add colon missing for "if()" constructs in Python
Task-number: PYSIDE-1169
Change-Id: I63c5305b0ddad1c4fcd585b65c3c78c05b40bac1
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-01-03 15:09:53 +01:00
Friedemann Kleint
7c0341daee uic: Fix empty strings for Python
Introduce a constant in the language namespace.

Fixes: PYSIDE-1174
Change-Id: Ic3e58580b20c1d9a6ddf97f20709a3046d4b6f0c
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-01-03 12:54:00 +01:00
Qt Forward Merge Bot
4054c0d6ed Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	.qmake.conf
	src/plugins/platforms/xcb/qxcbscreen.cpp
	src/widgets/accessible/qaccessiblewidget.cpp

Change-Id: Ib3138e61ba7981610940509a7ff02ba2dd281bf0
2019-12-27 09:29:30 +01:00
Cristián Maureira-Fredes
b31aef2900 uic: Rename raise() to raise_() for Python
Fixes: QTBUG-80791
Change-Id: Ia6339b8c683147456cdffa7f2d45972e8eacd92c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-12-19 12:38:58 +01:00
Allan Sandfeld Jensen
52876e0a82 Basic QImage cleanup
Remove deprecated methods and do marked TODOs for Qt6.

Change-Id: I905743cf909776c6433616b3a7c3b544d75f2afe
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-12-18 10:00:29 +01:00
Alexandru Croitor
cf3d4cf3c3 Teach moc to output a Make-style depfile
If moc is invoked with the --output-dep-file option, it will generate
a "moc_<source_file_name>.d" dep file which contains dependency
entries that can be consumed by a Makefile / Ninja build system.

This is useful for build tools (like CMake) to know when moc should be
re-ran.
In the future, it might also be useful for ccache (teach ccache not to
re-run moc when not necessary).

The dependency list contains: the original source file, the passed
--include files (like moc_predefs.h), the include files that
were discovered while preprocessing the source file, and the plugin
metadata json files listed in Q_PLUGIN_METADATA macros.

The file paths are encoded using QFile::encodeName, so using the local
8-bit encoding.

The paths are also escaped (so ' ' replaced by '\ ', '$' by '$$',
etc) according to the Make-style rules as described in
clang's dep file generator
https://github.com/llvm/llvm-project/blob/release/9.x/clang/lib/Frontend/DependencyFile.cpp#L233

For reference, the equivalent Ninja depfile parser source code can be
found at
https://github.com/ninja-build/ninja/blob/v1.9.0/src/depfile_parser.in.cc#L37

Additional options that can be passed:
--dep-file-path - to change the location where the dep file should be
generated.
--dep-file-rule-name - to change the rule name (first line) of the
dep file (useful when no -o option is specified, so output goes to
stdout).

Encoding story.
Note that moc doesn't handle non-local-8-bit characters properly when
processing include directives at the preprocessor step. Specifically
the content of the main input file is read as a raw byte array (which
can be UTF-8 encoded) and then each include directive is resolved via
Preprocessor::resolveInclude(), which calls QString::fromLocal8Bit().

Because moc uses the QtBootstrap library, only a limited set of codecs
are available: various UTF 8 / 16 / 32 codecs and
QLatin1Codec (ISO-8859-15).

This means that on Windows, if the source input file is UTF-8 encoded,
and contains include names with UTF-8 characters (like an emoji or any
character >= 127 that is not in the QLatin1 codec), moc will fail to
resolve and process that include, and thus no dep file entry will be
created either.

On macOS / QNX / WASM the main locale is UTF-8, so file content
and paths will be processed correctly (hardcoded via QT_LOCALE_IS_UTF8
in src/corelib/codecs/qtextcodec_p.h).

On Linux it will depend on the current locale / encoding set,
and if that encoding is one of the ones supported above. UTF-8 should
work fine.

[ChangeLog][QtCore][moc] moc can now output a ".d" dep file that can
be consumed by other build systems.

Task-number: QTBUG-74521
Task-number: QTBUG-76598
Change-Id: I5585631ff1bbbae4e2875cade9cb6c20ed018c0a
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2019-12-17 21:43:41 +01:00
Allan Sandfeld Jensen
deeaa500ad Mark the old style unprefixed stream functions deprecated
Requires a third definition for the source-compatible but deprecated
version.

Change-Id: I260ae79f4547f99eed701b10e0b25222f81cd5ff
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-12-16 11:23:47 +01:00
Mårten Nordheim
b79d74e96f moc: change QMap::unite to QMap::insert
Which is the intended behavior.

Change-Id: I0cffc623fc09284f3d95850f840564dca20ed0d4
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2019-12-12 15:25:39 +01:00
Lars Knoll
c7e35ffe69 Use a QMultiHash explicitly if insertMulti() is being used
This is a step towards deprecating QHash::insertMulti() and clearly
separating QHash and QMultiHash.

Change-Id: Ic2c7665673ff00d4f2186e94850710b70330f8ba
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-12-12 15:25:22 +01:00
Milian Wolff
656d6f2a9b Support Q_GADGET QMetaObject super class hierarchies across templates
This patch fixes the QMetaObject::superClass hierarchy for Q_GADGETs
that inherit from a template which in turn inherits another Q_GADGET.
One common scenario where this is applied is for the CRTP. Without this
patch, moc would stop at the template and then sets the superClass
QMetaObject to a nullptr. For QObjects this works, since there moc knows
that every child must by definition inherit QObject. In order to support
this for Q_GADGETs too, we defer the judgment about the availability
of a staticMetaObject in the base class to compile time through the
existing QtPrivate::MetaObjectForType<Base>::value() helper.

[ChangeLog][QtCore][moc] Moc now correctly sets a non-null
QMetaObject::superClass for Q_GADGETs that inherit from a template which
inherits another Q_GADGET.

Change-Id: I103b5efd74ed24172dffce477ca2ed6d0f374d44
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2019-12-12 13:02:52 +01:00
Qt Forward Merge Bot
be270ac82b Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2019-12-12 11:39:59 +01:00
Ulf Hermann
23d2312506 Split cborstream feature in two
Reading of Cbor streams is substantially more complicated than writing
as it requires float16 support. When writing Cbor, we can just choose to
always write 32bit floats, even if we could compress the numbers into
16 bits.

We need Cbor writing in the bootstrap library, but we cannot easily add
float16 support.

Furthermore, Cbor reading is required for plugin support, but not Cbor
writing. It might make sense for some users to build a custom Qt with
Cbor writing disabled.

Therefore, provide two features, cborstreamreader and cborstreamwriter,
split up the code in cborstream.{h|cpp} into several files, and enable
Cbor writing in the bootstrap library.

Change-Id: I15450afb0e328a84a22ebca9379cffc4f900a75a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-12-12 10:42:27 +01:00
Qt Forward Merge Bot
11d7788c18 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I69238f23882deebeaad46e4fdcf899ab22cc2b8f
2019-12-12 01:01:04 +01:00
Michael Dippold
3162345670 Support both qrc and qml files for qmlimportscanner
Some projects can be configured to have both qrcFiles and qml-root-path
included in the deployment settings file. The addition to qrc scanning
prevented the qml root directory from being scanned.

Change-Id: Idadb62f5572be45d0083294440bdb29740c2c47e
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2019-12-11 11:14:47 -08:00
Samuel Gaist
42aa740df7 rcc: Fix namespace handling for initializer
rcc currently always writes the namespace mangling macros in both the
initializer constructor and destructor. This patch add the missing
handling of the --namespace option for that part of the generated code.

[ChangeLog][Tools][rcc] rcc now generates correct code when using the
--namespace option.

Change-Id: I7e5e608eb0ad267d11d601fc69c1a87d3f655a6e
Fixes: QTBUG-80649
Reviewed-by: hjk <hjk@qt.io>
2019-12-10 13:30:31 +01:00
Qt Forward Merge Bot
bef74b6c3a Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ia24cc8b86def0d9d9c17d6775cc519e491b860b1
2019-12-09 10:16:01 +01:00
Lars Knoll
e58b44d557 Change representation of string data in the meta object
Don't store our string data as QByteArrayLiterals anymore, but revert
back to simply storing them as an array of char* and offsets into that
array.

This is required to be able to inline size and begin into QByteArray
itself. Once that change is done, we can then avoid creating copies of
the string data again.

Change-Id: I362a54581caefdb1b3da4a7ab922d37e2e63dc02
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-12-08 18:19:58 +01:00
Olivier Goffart
cedf0207d1 Use Q_NAMESPACE for the Qt namespace, and remove the old moc hack to support it
Since I can't #include qobjectdefs from qnamespace because of circular dependency,
move the Qt macro in the qtmetamacros.h header.

Deprecate QObject::staticQtMetaObject since now one can just use Qt::staticMetaObject

Change-Id: I11982aa17c2afa2067486b113f8052672f3695eb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-12-06 20:29:15 +00:00
Allan Sandfeld Jensen
ece0c0a5e7 Tidy nullptr usage
Move away from using 0 as pointer literal.

Done using clang-tidy. This is not complete as
run-clang-tidy can't handle all of qtbase in one go.

Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-12-06 12:13:20 +01:00
Leander Beernaert
0f220d473a Collect Json Metatypes from CMake's Automoc
This patch adds a new bootstrap tool which will read CMake's
AutoGenInfo.json and ParseCache.txt to determine what the current
list of json files is that needs to be passed to moc --collect-json
option.

Right now this is enabled for qt_add_module() with the option
GENERATE_METATYPES. pro2cmake has also been updated to detect qmake's
CONFIG += metatypes and to generate the above option for modules.

The implementation lives in Qt6CoreMacros so it can eventually be used
in the public facing apis.

The generated meta types file is saved under the target property
QT_MODULE_META_TYPES_FILE.

Change-Id: I03709c662be81dd0912d0068c23ee2507bfe4383
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-12-04 10:48:06 +00:00
Qt Forward Merge Bot
ad4ef9836c Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ib8357609b37b7cc22b51c27602ba60c69bf91da9
2019-11-29 01:01:08 +01:00
Friedemann Kleint
0c4e502b56 androidtestrunner: Fix warnings about missing parameter to QStringLiteral
Use QString instead, fixing:
src\tools\androidtestrunner\main.cpp(474): warning C4003: not enough arguments for function-like macro invocation 'QStringLiteral'

Change-Id: I88b8c0f1dfa7828460e8952510e3d4150ab68896
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-11-28 11:19:16 +01:00
Leander Beernaert
43f341a137 Moc Sort json file list in collectjson
This patch ensures that the list of input files are sorted before being
collected. This provides consistency when comparing results generated
from the CMake port which do not have the same order as qmake.

Change-Id: I46e3acf7c26dfd21fd0c1196bdeddf22acbf6ba5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-11-27 10:59:58 +01:00
Friedemann Kleint
719ad1db55 uic: Migrate from QList to QVector
Replace QList by QVector in the ui4.cpp/.h files and replace
occurrences in remaining code.

Change-Id: I15913710b339ef1ef5f7e3c72a7a1be69a87079b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2019-11-26 15:13:47 +01:00
Leander Beernaert
1c655fb0fc Post merge fixes
Change-Id: I78d3c9687f99c0a32da04257e297e88ef0b02581
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-11-25 14:53:27 +00:00
Qt Forward Merge Bot
58c69df4d3 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/corelib/tools/qhash.h
	src/gui/kernel/qevent.h
	src/widgets/kernel/qshortcut.cpp
	src/widgets/kernel/qshortcut.h

Change-Id: If61c206ee43ad1d97f5b07f58ac93c4583ce5620
2019-11-25 11:30:04 +01:00
Leander Beernaert
26e8769124 Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: Ifecc2d9db396d783124df8567553ba5f846f30bb
2019-11-19 13:53:21 +01:00
Qt Forward Merge Bot
adc7bbe910 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/gui/rhi/qshader.cpp
	tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp

Change-Id: I1c4ae718eb3592a0a0a90af9d11553f3ab68cad5
2019-11-15 16:29:40 +01:00
Alexandru Croitor
e9a58ba9e5 Regenerate src/*
Change-Id: I0314b4faa1e4860e86198eea4189987e527dfec2
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-14 09:05:48 +00:00
Friedemann Kleint
0ec40c21c1 uic: Update ui4.cpp/h sources
Apply changes from qttools/4235774262f633da196a192248dbacf4f67f085e.

Task-number: QTBUG-79896
Change-Id: I49466980a7c5983f57d4948386b15e8fcec82343
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2019-11-14 08:46:14 +01:00
Friedemann Kleint
f2cc6fd4a0 uic: Remove some usages of QList
Task-number: QTBUG-79896
Change-Id: I298a434040fa903509685b7cde82bbea722f3246
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2019-11-13 17:05:23 +01:00
Andy Shaw
2735c5bf06 Add support for passing qrc files to qmlimportscanner
With the qrcFiles entry in the deployment JSON for Android, it can now
pass this on to qmlimportscanner for scanning the qrc files for the
available imports. This enables qmake to populate the qrc files it has
referenced in the project, be it generated by qmake or added by the
user.

Task-number: QTBUG-55259
Change-Id: Ic512ce6f24508b3ea09ebdd07ac4446debfd9155
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-11-13 14:00:39 +01:00
Alexandru Croitor
cb6f92c481 Regenerate everything under ./src
Change-Id: Ibdbdc17f8c2ee41356f490dd839a47e1bcf4c586
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-11-12 17:27:29 +00:00
Alexandru Croitor
e6a845ad88 Regenerate a bunch of projects after pro2cmake changes
Change-Id: I675a068411785364915a074ca0e631fec944d228
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-12 13:16:08 +00:00
Lars Knoll
5357231c0a Make QList an alias to QVector
This is almost 100% source compatible with Qt 5. Exceptions are

* Stability of references for large or non movable types
* taking a PMF for types that are now overloaded with r-value references
  in QVector
* The missing prepend optimization in QVector (that is still planned
  to come for Qt 6)

Change-Id: I96d44553304dd623def9c70d6fea8fa2fb0373b0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-30 11:52:48 +01:00
Qt Forward Merge Bot
8bcecd86fa Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I182a639748760393f9e6b0724259201588aeaae3
2019-10-27 01:00:50 +02:00
Qt Forward Merge Bot
7b3bdcbfe8 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I379794a01cbf6fb39d94b24cc8c90b1971a212b9
2019-10-26 01:01:32 +02:00
Qt Forward Merge Bot
86e74d60d2 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I208a36bf1c88c8291baaa5ca8fe8e838bc9d7aea
2019-10-26 01:01:14 +02:00
Cristián Maureira-Fredes
968cc365d2 uic: Add language::eol in more cases for python code
Change-Id: I0ab4b37399d3fba6d27cf90cab22676a3c599e5a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-25 15:53:13 +02:00
BogDan Vatra
b5b9eb68c4 Fix typo
Change-Id: I9a429805414fb50aa059677beb5f8f8a48b72d9b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-10-25 07:03:37 +03:00
BogDan Vatra
1ce71a6a11 Fix bundled_libs section from libs.xml
Fixes: QTBUG-79376
Change-Id: If7681365110341379913ae46a96a2f2296197b8f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-10-25 07:01:32 +03:00
Leander Beernaert
340763d1ff Add --skip-install-root option to androidtestrunner
Add the above option to android test runner since its not required
when building with Cmake.

Change-Id: Ie5c9b0af29cfa76802723960071b3bd2a37a56a5
Reviewed-by: Qt CMake Build Bot
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-10-24 07:16:51 +00:00
Leander Beernaert
f2cb720e3f Add Android test runner tool
Change-Id: I235bc07be0e0f7a3b0ce6297c187950a57fb31ed
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-23 11:15:56 +00:00
Qt Forward Merge Bot
563dc21c51 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ic062a5bd62621877b17cc0d47303b3c879241385
2019-10-22 01:00:49 +02:00
Ulf Hermann
35adb74ddd Reimplement JSON support on top of Cbor
In turn, deprecate the QJsonDocument methods that deal with JSON binary
data. You should use CBOR for data serialization these days.

[ChangeLog][Deprecation Notice] The binary JSON representation is
deprecated. The CBOR format should be used instead.

Fixes: QTBUG-47629
Change-Id: Ic8b92ea36de87815b12307a9d8b1095f07166db8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-21 19:12:51 +02:00
Christian Ehrlicher
aa4b0f5cb7 Uic: fix crash when trying to resource icon information
Fix a typo introduced in be56db2c49 to
avoid a crash when a pixmap is given for selected on but not for
selected off.

Fixes: QTBUG-79125
Change-Id: I84072b6b4e8a4d21684be21f5bff1deeaddbba6d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-21 09:48:30 +02:00
Simon Hausmann
4df389eb4f Re-generate affected cmake files and configure.json after the merge
This also removes the workarounds of commit
b2662b05dd now that it's fixed "upstream"
in the .pro files.

Change-Id: Idd5e6273873a700fcda5a6cad2039c4e88b61f6f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-17 16:56:23 +00:00
Simon Hausmann
02164e0288 Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: Ia1da879a7bd8f71a649661a1844144dd67d60b3a
2019-10-17 09:41:36 +02:00
Qt Forward Merge Bot
6f27bb1352 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ica69de99be9c8af4d28a52e4b69e6af748ed983c
2019-10-17 01:01:01 +02:00
Qt Forward Merge Bot
faab18c65a Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ifd83db69416230175ddc3161f640b612755018fc
2019-10-16 01:00:49 +02:00
Alexandru Croitor
190e9dcdcf Regenerate files after dev -> wip/cmake merge
Note the following bigger things that had to be done:
Handle GSS library / feature with a new custom find module.
Implement rudimentary support for relocatability (does not currently
handle extprefix).

Change-Id: Ic6cd27dda7ebca9829f51cb42ea76fff6d1767ef
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-14 19:01:19 +00:00
Friedemann Kleint
05a829f923 Win32: Consolidate registry code
Add a RAII class for registry keys and use it throughout
the code base.

Change-Id: I666b2fbb790f83436443101d6bc1e3c0525e78df
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-10-14 20:26:42 +02:00
Alexandru Croitor
440286655e Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: I4a78428a8ea273b6960792e3b8043f816fa37fcf
2019-10-14 17:46:34 +02:00
Alexandru Croitor
b6e75ff3ea Regenerate qtbase after wip/qt6 -> wip/cmake merge
Note that android builds will be broken after this merge and
regeneration, because we don't currently handle the minimum required
changes that were brought in with the Android multi ABI support
that comes from 5.14.

This will have to be addressed in a separate change.
For now the build on Android will fail while compiling due to incorrect
generation of LIB_SUFFIX with QT_ARCH.

Change-Id: Ia4a871f4b7ddd0da11caf5f34e10a599a97bb55d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-10-14 08:49:24 +00:00
Qt Forward Merge Bot
e164d61ca8 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I129dd579f92cb2592a38ca043472b45cb926ae12
2019-10-14 01:00:34 +02:00
Qt Forward Merge Bot
8d8140dffa Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I9953c1ca16862184c2373027e946c482ce8e6f0e
2019-10-13 01:00:43 +02:00
Alexandru Croitor
f4b4c4f79b Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I3a1d7673c3c20019ab12a2ea0a60f1619920a34c
2019-10-11 16:23:19 +02:00
Liang Qi
9c84b7786c Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/plugins/platforms/xcb/qxcbscreen.h
	src/src.pro

Change-Id: I4e1981e69a1ddcbe4078ec6ab2a64b0da6a445de
2019-10-10 09:13:49 +02:00
Milian Wolff
2d7ec5922a Fix compile with tracing enabled: include QStringList header
Change-Id: I40f737338d10a871442bb453fe1eeede9dacec79
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-09 16:19:17 +02:00
Alexandru Croitor
4c06abb8dc Regenerate tools projects
Change-Id: I69a56ca2bd1d5f983197c6cde400c191c5dc7bd9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-10-08 13:09:38 +00:00
Simon Hausmann
a48a3e95cf Clean up tinycbor handling
Now that pro2cmake handles the include path resolution more like qmake,
the tinycbor wrapper target is not needed anymore.

Re-generated some CMakeLists.txt to complete that step.

Change-Id: I032b2e9bdf9e26f63f3c550d7bca5df93369a82a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-10-08 09:49:07 +00:00
Alexandru Croitor
cb90784eb1 Regenerate qmake and bootstrap projects
Change-Id: I6649a58752309a346bc03271f17fe80d0b727be3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-10-07 22:45:53 +00:00
Lars Knoll
4c571032f8 Add support for slots to receive the raw void ** arguments array
This is currently being used by dbus und our state machine framework,
and supported by hand editing moc generated code.

Get rid of that hack, and instead add support to moc to forward
the raw arguments array to the slot.

Change-Id: I0e36626f91eb01041464e6d931dc1d4660de91d2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-07 20:40:51 +02:00
Qt Forward Merge Bot
2c4b44d750 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ife31dad3c8dc43c5ff4d266e6d646230c5d20a50
2019-10-06 01:01:08 +02:00
Qt Forward Merge Bot
327b305e95 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I554a2762890391b3b6013c8b82211a8386a4ced8
2019-10-05 01:01:06 +02:00
Simon Hausmann
da284ef10e Add support for machine-readable JSON output to the MOC
The --output-json parameter will make moc produce a .json file next to
the regular output file. With --collect-json the .json files for a
module can be merged into a single one.

Task-number: QTBUG-68796
Change-Id: I0e8fb802d47bd22da219701a8df947973d4bd7b5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-10-04 18:35:29 +02:00
Liang Qi
96a2044009 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/network/access/qnetworkaccessmanager.cpp
	src/network/access/qnetworkreplyhttpimpl.cpp

Change-Id: I059be651604623616fd31e8616be8ae61b4f8883
2019-10-04 15:27:15 +02:00
Edward Welbourne
0118e2e915 Include likely-adjusted uiLanguages for the system locale
QLocale::uiLanguages() on the system locale uses whatever the system
locale's query(QSystemLocale::UILanguages,...) returns. On Android,
this is just a list of locales. However, for non-system locales, we
also include some results of removing likely sub-tags from the locale
name, where equivalent. Thus zh-CN would also get zh and zh-Hans-CN
added to it; however, if the system locale is zh-Hans-CN, the shorter
forms are omitted. So post-process the system locale list in the same
way, albeit tweaked to avoid duplicates and rearranged so that we can
insert likely-adjusted entries between what they adjust and what
followed it.

Added QLocalePrivate::rawName() in the process, since it looks likely
to be useful in other contexts (and I needed its value): it just joins
such tags as are non-Any. This, however, uses QByteArrayList, so added
that (it's small) to the bootstrap library and qmake.

This follows up on commit 8796e3016f.

[ChangeLog][QtCore][QLocale] The system locale's UI languages list now
includes, as for that of an ordinary locale, the results of adding
likely sub-tags from each locale name, and of removing some, where
this doesn't change which locale is specified. This gives searches for
translation files a better chance of finding a suitable file.

Fixes: QTBUG-75413
Change-Id: Iaafd79aac6a0fdd5f44aed16e445e84a2267c9da
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-04 15:16:15 +02:00
BogDan Vatra
c8b07f7da3 Android: Do not extract QML assets data
Instead to extract the assets QML file, we create a .rcc bundle file
which is register by android qpa plugin before the it invokes the main
function. Thsi way we avoid extracting the QML files from assets as they
can be accessed directly from resources.

[ChangeLog][Android] Instead of bundling QML resources in assets
and extracting them on first start, Qt now creates an .rcc file
and register it before invoking the main function.

Change-Id: Icb2fda79d82c5af102cc9a0276ff26bb0d1599e8
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-10-02 15:00:35 +00:00
BogDan Vatra
fcb78b5000 Android: Fix plugins naming
Android 5 doesn't extract the files from libs folder unless they are prefixed with "lib".
This patch sets a proper name for the plugin which will make gdb happy and it will also
avoid any name clashes.
If we rename the plugins when we copy them, gdb won't find them, therefore it can't load their
symbols.
On Android all the libs are in a single folder, so to make sure we don't have any name clashes,
we are prefixing the plugin name with it's relative path to qt folder (we replace / with _).

Fixes: QTBUG-78616
Change-Id: I7e0e67d65448532769d69f46b1856c029e2cf5cb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-10-01 11:36:24 +03:00
Simon Hausmann
e3888dd932 Merge remote-tracking branch 'origin/wip/qt6' into dev
Conflicts:
	src/gui/image/qpicture.cpp

Change-Id: Iecf79f96f54dc23bd703e6c4c634f909b796d7b3
2019-09-18 08:30:11 +02:00
Qt Forward Merge Bot
caf123a288 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ib6649a412e131bf679aab97c4c384520af348b4f
2019-09-06 09:44:10 +02:00
Alexandru Croitor
f255b1e8e2 Merge remote-tracking branch 'origin/dev' into wip/qt6
Change-Id: I54741635460bb2d8f3fd0be535ee1968d6c442bb
2019-09-04 14:33:40 +02:00
Alexandru Croitor
098d7549c1 Android: Fix architecture extraction from file path in androiddeployqt
The regular expression was too greedy with the ".*" sub-expression,
thus if the prefix path contained underscores, the extracted
architecture value was wrong.

Example prefix:
~/dev/qt/qt514_built_android/qtbase

Example captured architecture:
built_android/qtbase/plugins/platforms/android/libqtforandroid_x86

First extract the file name from the given path, and then match
on just the file name.

Change-Id: I8e56e56747096c7a2398e959d91c2d1f65de2495
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-09-03 16:44:08 +02:00
Qt Forward Merge Bot
d2db94cc54 Merge remote-tracking branch 'origin/5.14' into dev
Change-Id: I10ca9b20c26838800c654103951367a36af3ee30
2019-09-03 01:01:24 +02:00
BogDan Vatra
c9f8893000 Add support for aab
Change-Id: I4814a51b25d5e3953e5e1c71d9a0e1bf3fed7385
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-09-02 18:32:13 +03:00
Leander Beernaert
a5ba29b79d Add support to override Qml Import Scanner binary to androiddeployqt
This patch is required to properly support the CMake port of Qt. With
CMake we have to build the host tools separately. When androiddeployqt
attempts locate the qmlimportscanner binary it is unable to do so,
since its not build.

This patch adds the --qml-importscanner-binary option to androiddeployqt
and it also allows the optio to be set via the qml-importscanner-binary
setting in the deployment configuration file.

Change-Id: I5393340bc1bc3e8fedae69f8bc3eb5adfe7dbfd7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-08-30 14:47:16 +02:00
BogDan Vatra
4cc3615b4e Use QLatin1String where possible
Change-Id: I8f94ba4880bcac735e4445d71f0e22774d9f78eb
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-28 07:38:48 +03:00
Liang Qi
0f1f7fb97f Merge remote-tracking branch 'origin/dev' into 5.14
Conflicts:
	src/widgets/kernel/qwidget.cpp
	src/widgets/kernel/qwidget_p.h
	src/widgets/kernel/qwidgetrepaintmanager.cpp
	src/widgets/kernel/qwidgetwindow.cpp
	tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp

Change-Id: Ifae457d0427be8e2465e474b055722e11b3b1e5c
2019-08-27 09:45:52 +02:00
BogDan Vatra
5bb178c479 Say hello to Android multi arch build in one go
Multi arch build in one go is need to support the new .aab packaging format.

By default the users apps are built for all Android ABIs: arm64-v8a armeabi-v7a x86_64 x86
The user can pass ANDROID_ABIS to qmake to filter the ABIs during development,
e.g. qmake ANDROID_ABIS="arm64-v8a armeabi-v7a" will build only for arm ABIs.

[ChangeLog][Android] Android multi arch build in one go,
needed to support the new .aab packaging format.

Change-Id: I3a64caf9621c2a195863976a62a57cdf47e6e3b5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-08-26 12:59:15 +03:00
Jan Arve Sæther
529b271520 Don't excessively check all output files for failures
This is really just an optimization, but I suspect the author of the code
assumed that the bitwise &= operator short-cicuits. (It doesn't). So this
patch should then fix the code to have the intended behavior.

We don't have to check for failures in the remaining output files once
we've found one. pullFiles() returns just a bool indicating if one of the
output files has a recorded fail, so checking the remaining output files
after the first found failure is just a waste (and ideally they should
contain the same failure (however, flaky tests might break this ideal)).

Drive-by fix.

Change-Id: I951e500a69198e7ed124be32199ac81bbddb9bf7
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-08-22 11:21:38 +02:00
Soroush Rabiei
aa8393c94f Add support for calendars beside Gregorian
Add QCalendarBackend as a base class for calendar implementations and
QCalendar as a facade via which to access it.

QDate's implicit implementation of the Gregorian calendar becomes
QGregorianCalendar and QDate methods now support choice of calendar.

Convert QLocale's CLDR data for month names to a locale-data component
of each supported calendar and relevant QLocale methods now support
choice of calendar. Adapt Python scripts for locale data generation to
extract month name data from CLDR (keeping on version v35.1) into the
new calendar-locale files. The locale data for the Gregorian calendar
is held in a Roman calendar base, for sharing with other calendars.

Add tests for basic uses of the new API.

[ChangeLog][QtCore][QCalendar] Added QCalendar to support diverse
calendars, supported by implementing QCalendarBackend.

[ChangeLog][QtCore][QDate] Allow choice of calendar in various
operations, with Gregorian remaining the default.

Done-with: Lars Knoll <lars.knoll@qt.io>
Done-with: Edward Welbourne <edward.welbourne@qt.io>
Fixes: QTBUG-17110
Fixes: QTBUG-950
Change-Id: I9d6278f394269a183aee8156e990cec4d5198ab8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-20 13:41:21 +02:00
Daniel Smith
f5c118b6b8 Fix escaping of additional app parameters in adb shell command
Change-Id: I80e5b98efbc9654c684b3d78ba0d6688c21bd0f3
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-08-19 18:22:57 +02:00
Alexandru Croitor
c7ec7cd2a1 Merge branch 'wip/qt6' into wip/cmake
Change-Id: I50ac36b8803c296998149e98cc61e38687cdd14b
2019-08-15 16:53:19 +02:00
Liang Qi
1dade1bd8a Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	mkspecs/win32-clang-msvc/qmake.conf
	src/corelib/tools/qlist.h
	src/gui/painting/qcompositionfunctions.cpp
	src/gui/painting/qtriangulator_p.h
	src/gui/text/qfontengine_p.h
	src/network/kernel/qhostinfo_p.h
	src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp

Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io>
Change-Id: Ib8a0308cf77224c4fbdcf56778fdac4a43e37798
2019-08-13 09:46:17 +02:00
Allan Sandfeld Jensen
ae83398d82 Kill all QPictureIO
Has been deprecated for a long time.

Change-Id: I4579e3c2997c649f0fa66b9cdbcf8e7fc6d661a5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-08-12 10:56:52 +02:00
Lars Knoll
6f357f50b4 Merge remote-tracking branch 'origin/dev' into wip/qt6
Change-Id: Ib719a6249069e6bd6c9311bbec7f364855ab82ff
2019-08-06 12:24:37 +02:00
Liang Qi
f3b28e8021 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	qmake/generators/unix/unixmake2.cpp
	src/plugins/platforms/cocoa/qcocoawindow.mm

Change-Id: Iba7aa7324f35543e0297a3680956420058cd3630
2019-08-05 09:28:48 +02:00
Marc Mutz
9ad8debe38 qlalr: fix compilation with C++20
std::not1 is deprecated in C++17, removed in C++20.

Use its replacement, std::not_fn.

Change-Id: I37d4929c81c2a5befeb44f954ae77b23960d2ff0
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2019-08-01 11:20:27 +00:00
hjk
4fa0b41523 uic: Avoid use of Q_UNUSED in the generated code
Instead, use (void)x; directly.

The current use of Q_UNUSED(x); generates warnings for an
empty statement the expansion of Q_UNUSED contains a semicolon
already.

Emitting Q_UNUSED(x) without the extra semicolon would be
an option, too, but as the future of Q_UNUSED's embedded
semicolon seems unclear right now, avoid its use altogether.

The change affects only generated code that's barely ever
read by a human, so the overall utility of "improved readability"
of Q_UNUSED in that place is questionable anyway.

Change-Id: I332527ed7c202f779bd82290517837e3ecf09a08
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2019-07-30 09:34:36 +02:00
Tasuku Suzuki
f0f46ade9e Fix SOURCES duplication in tools/bootstrap on macOS
Three *_unix.cpp are added twice for unix and for mac

Makefile:14766: warning: overriding commands for target `.obj/
qfilesystemengine_unix.o'
Makefile:14037: warning: ignoring old commands for target `.obj/
qfilesystemengine_unix.o'
Makefile:14913: warning: overriding commands for target `.obj/
qfilesystemiterator_unix.o'
Makefile:14184: warning: ignoring old commands for target `.obj/
qfilesystemiterator_unix.o'
Makefile:15071: warning: overriding commands for target `.obj/
qfsfileengine_unix.o'
Makefile:14342: warning: ignoring old commands for target `.obj/
qfsfileengine_unix.o'

Change-Id: Ia5f9d2873f738081c2d1e763efbdfc64209aaf7d
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-07-19 23:18:53 +09:00
Thiago Macieira
9b8493314d Qt6: Fix uninitialized meta objects on Windows
Windows has a problem relating to cross-DLL variable relocations: they
are not supported. Since QMetaObject's link to the parent class is done
via a pointer, every QMetaObject in a DLL or in the EXE that derives
from a class from another DLL (such as QObject) will be dynamically
initialized.

This commit changes the meta object pointers in QMetaObject::d from raw
pointers to a wrapper class SuperData, which is almost entirely source-
compatible with the pointer itself. On all systems except for Windows
with Qt 6, it's binary compatible with the current implementation.

But for Windows with Qt 6, this commit will store both the raw pointer
and a pointer to a function that returns the QMetaObject, with one of
them non-null only. For all meta objects constructed by moc, we store
the function pointer, which allows the staticMetaObject to be statically
intialized. For dynamic meta objects (QMetaObjectBuilder, QtDBus, QtQml,
ActiveQt), we'll store the actual raw pointer.

[ChangeLog][QtCore][QMetaObject] Some internal members of the
QMetaObject class have changed types. Those members are not public API
and thus should not cause source incompatibilities.

The macro QT_NO_DATA_RELOCATION existed in Qt 4 but was called
Q_NO_DATA_RELOCATION and only applied to Symbian. It was removed in
commit 24a72c4efa ("qglobal: Remove
symbian specific features").

Task-number: QTBUG-38876
Fixes: QTBUG-69963
Change-Id: Id92f4a61915b49ddaee6fffd14ae1cf615525e92
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-16 18:34:41 -07:00
Alexandru Croitor
4dac45c9ee Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I715b1d743d5f11560e7b3fbeb8fd64a5e5ddb277
2019-07-11 17:17:51 +02:00
Edward Welbourne
a9aa206b7b Move text-related code out of corelib/tools/ to corelib/text/
This includes byte array, string, char, unicode, locale, collation and
regular expressions.

Change-Id: I8b125fa52c8c513eb57a0f1298b91910e5a0d786
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-10 17:05:30 +02:00
Alexandru Croitor
3622ebaac5 Merge remote-tracking branch 'origin/dev' into wip/qt6
Change-Id: I02cbc4f77a82100b96cdb90c160ce0207f180d7f
2019-07-08 13:20:48 +02:00
Jan Arve Sæther
ee6b19042f Fix 'make check' for android-mingw32
g_options.buildPath did not have native separators. This caused
INSTALL_ROOT to not have native path separators, which again made
'mingw32-make check' fail to deploy the .apk. (The actual failure was that
mkdir failed because it did not accept paths with forward-slashes, so the
install_target rule failed. For the record, the command of that rule had
the following call to mkdir:

mkdir $(INSTALL_ROOT:@msyshack@%=%)\libs\x86

Change-Id: Id792c36986b52a527546d48aa9f7d9587e7a18d9
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
 
 
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-07-03 09:25:46 +02:00
Marc Mutz
dce7dbecb0 qlalr: replace QLinkedList with std::list
This is in preparation of deprecating QLinkedList.

Most is straight-forward, except where operator+ was used on linked-list
iterators. In one case, replaced this with std::next, in the other, with
prefix increments, since the advancement was always equal to the loop
control variable. Since advancing a linked-list iterator is a linear
operation, this removes a source of quadratic complexity.

Another obstacle was the overloaded op< set, which was in the Qt namespace
while the iterator is from std and the payload, as before, was global.
This breaks ADL, so move these operators to namespace std. This violates
the standard, but the functions are tagged with our distinct types, so it
shouldn't cause any trouble.

Change-Id: Ifec0a927bfdabb002838cdf86fb8d23b32a38ff7
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2019-07-02 22:27:11 +02:00
Friedemann Kleint
fdef9c8039 uic: Implement form window setting to disable QObject::connectSlotsByName()
Task-number: QTBUG-76375
Change-Id: I16ad147366aa7d52b7a0e17ae240127d8ac34b3c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2019-07-02 09:15:47 +02:00
Marvin Scholz
a03270f891 rcc: Add -d option to output a Makefile-syntax depfile
The -d option makes rcc output a dependency file with the specified
file name.

The resulting dependency file is useful for make or ninja based build
systems.

[ChangeLog][Tools][rcc] Added -d option to generate a dependency file.

Fixes: QTBUG-45460
Change-Id: I495ade50f8d9865d4c00dce9373b2b6d1a6c8f2f
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-06-29 02:26:23 +02:00
Giuseppe D'Angelo
f66c1db16c Introduce Q_NAMESPACE_EXPORT
A recurring problem with the Q_NAMESPACE macro is that it declares
an object (staticMetaObject) in the surrounding namespace. That
object lacks any export/import qualification to make it usable
with shared libraries.

Introduce therefore another macro to work around this issue, allowing
the user to prefix the object with an exporting macro, f.i. like this:

Q_NAMESPACE_EXPORT(Q_CORE_EXPORT)

The old macro can simply then be rewritten in terms of this new one,
supplying an empty export macro.

Note that NOT passing an argument to a macro expecting one is well
defined behavior in C99 -- the macro will expand an empty token.
Of course, MSVC doesn't like this and emits warnings. As a
workaround, use a variadic macro.

[ChangeLog][QtCore] Added the new Q_NAMESPACE_EXPORT macro. It
can be used just like Q_NAMESPACE to add meta-object information
to a namespace; however it also supports exporting of such
information from shared libraries.

[ChangeLog][Potentially Source-Incompatible Changes] Prefixing
Q_NAMESPACE with an export macro may no longer work. Use the new
Q_NAMESPACE_EXPORT macro for that use case.

Fixes: QTBUG-68014
Change-Id: Ib044a555ace1f77ae8e0244d824ec473550f3d8e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-06-28 06:47:29 +02:00
Friedemann Kleint
94bee657c1 uic: Fix remaining clang warnings
Fix remaining nullptr and member initialization issues which
Qt Creator did not catch.

Change-Id: If5492259aea9849c790f00809a27f4c78b446b9b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2019-06-28 00:24:51 +02:00
Friedemann Kleint
6301d5e51b uic: Add option to disable the call to QObject::connectSlotsByName()
The code was actually there, but not connected to the command line
parser.

Task-number: QTBUG-76375
Change-Id: I801cf2bbd2f207a6ce1dabd1ee1dfbd892089bbc
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2019-06-28 00:24:47 +02:00
Liang Qi
25eb97d2d4 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	.qmake.conf
	src/network/ssl/qsslsocket_openssl.cpp

Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: Ibb57a0548b4977797b400637487a56245ac1c024
2019-06-27 14:38:03 +02:00
Simon Hausmann
7810209ba3 Merge remote-tracking branch 'origin/dev' into wip/qt6
Change-Id: I4ea2b77cc201daed94fbe321f146dfd20365a534
2019-06-26 11:33:19 +02:00
Thiago Macieira
cbdc9a7786 RCC: Change the default compression to Zlib
Codebases using QResource::isCompressed() and assuming it is Zlib break
if zstd is enabled. So change the default back to Zlib until Qt 6.0.

[ChangeLog][Important Behavior Changes] RCC's default compression
algorithm was changed back to Zlib, as it was in all previous releases
until 5.13.0. The default will remain Zlib for all Qt 5.x releases but
will change in Qt 6.0. To activate Zstd compression for your resources,
either pass the --compress-algo=zstd option to the rcc tool or add the
XML attribute compression-algorithm="zstd" to the <file> tags in the
.qrc file.

Task-number: QTBUG-76521
Change-Id: Ief874765cd7b43798de3fffd15a9f56fd9ad1ad4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-06-20 09:51:40 -07:00
Alexandru Croitor
fe3bd212fc Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
This changes many different CMake places to mention Qt6 instead of
Qt5.

Note that some old qt5 cmake config files in corelib are probably not
needed anymore, but I still renamed and kept them for now.

Change-Id: Ie69e81540386a5af153f76c0242e18d48211bec4
2019-06-14 16:31:09 +02:00
Alexandru Croitor
4e875d988e Merge remote-tracking branch 'origin/dev' into wip/qt6
Change-Id: Ieb8efee9d74229b9f141ec715e3a9557586b51e8
2019-06-11 11:16:42 +02:00
Giuseppe D'Angelo
3e75c2965c Remove QLatin1Literal usages
That's an undocumented Qt 4/3/2 remnant, start remove usages.

Fix incorrect include header in qclass_lib_map.h as a drive-by.

Change-Id: I939be2621bc03e5c75f7e3f152546d3af6d37b91
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-10 16:50:31 +00:00
Alexandru Croitor
2a302a7361 Merge remote-tracking branch 'origin/dev' into wip/qt6
Change-Id: Iac12a37fa6536ebe30e6548f7c54ec0c402c9f5d
2019-06-06 19:00:41 +02:00
Leander Beernaert
04da0df568 Android: SDK Support
Enable building androiddeployqt when performing host builds only.
Added QtPlatformAndroid.cmake to locate Java and the setup the
android SDK platform when building on android.
Install the androiddeployqt support files when performing a host
build.
Added ANDROID_SDK_ROOT configuration variable for specifying the
android sdk directory.
Generating the deployment-settings.json will be done in another
change.

Change-Id: I1bf15315af4ed904d2fb1d22b0e8e834df32d6ed
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-06-05 14:20:31 +00:00
Thiago Macieira
5e40d3d982 qfloat16: Check in the tables to Git
It's a 38k source file, which makes it MUCH smaller than other generated
files like qlocale_data_p.h (982k) and qunicodetables.cpp (718k). The
constants are platform-independent, since they are defined by IEEE 754,
so they will never change.

The generator tool is moved to util/ and removed from the build. That's
one fewer bootstrapped tool to have to worry about.

The output file is committed as .cpp so it won't get installed.

Fixes: QTBUG-76165
Change-Id: I2b1955a995ad40f3b89afffd15a3ded58dc3e35f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-06-03 10:42:53 -07:00
Thiago Macieira
26e5aa45e1 De-bootstrap the qfloat16 generator tool
It doesn't really need Qt. So remove the dependency. I've confirmed that
the output is identical to what used to be generated.

This ought to be replaced by a script. Or just committed to Git, since
the generated output is not really supposed to change, ever.

Change-Id: I46363e5b8944459e8c48fffd158bb5d74fb6184c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-06-03 10:42:44 -07:00
Jan Arve Sæther
cefaa2ff4c Fix androidtestrunner for windows
First, we cannot quote the whole command in double quotes, since the
command itself very often have double quotes inside it.

Secondly, we should use the same that the ssh(1) command does:
Instead of adb shell setprop foo 'a b' we should use
adb shell setprop foo "'a b'" as explained here:
[https://developer.android.com/studio/command-line/adb#shellcommands]

Last hunk in isRunning():
The pipe character got eaten by the shell if we used a single quote (so
the stuff after the pipe (grep) was actually run locally).
Switching to ssh-style quoting fixed that.

Change-Id: I3075cdf8595ac2549cec8019f2cba79f77815e0b
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-06-19 13:00:19 +02:00
Alexandru Croitor
e4079eca49 Merge remote-tracking branch 'origin/dev' into wip/cmake
Take 5.

Change-Id: Ifb2d20e95ba824e45e667fba6c2ba45389991cc3
2019-06-03 15:14:42 +02:00
Kai Koehne
5505d25be9 uic: Remove deprecated options
The --no-stringliteral option got introduced by commit d12d2949d1
for 5.10.0, but already deprecated in commit  ff18b02f21 for 5.12.0.

[ChangeLog][uic] uic does not accept the --no-stringliteral/-s option
anymore.

Change-Id: I7a0f647ad91b3760bc826884702bf8581f5565f2
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2019-05-27 09:56:38 +00:00
Edward Welbourne
9ff6df8929 Convert the one extant use of QTime as a timer to use a local class
Use QDateTime::currentMSecsSinceEpoch() instead of a QTime with funky
wrapping at midnight and potential DST glitches.

Change-Id: I2455db5778635fc00b4ffdef6edee6d6793e50eb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-24 16:37:39 +02:00
Edward Welbourne
548513a4bd Separate out the time, zone, date code from corelib/tools/
We'll be adding calendar code here as well, and tools/ was getting
rather crowded, so it looks like time to move out a reasonably
coherent sub-bundle of it all.

Change-Id: I7e8030f38c31aa307f519dd918a43fc44baa6aa1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-06-06 15:54:32 +02:00
Alexandru Croitor
fa21d29b75 Rerun pro2cmake on projects that use .ui files
Task-number: QTBUG-75875
Change-Id: I95109b07fc4a6e09fe7911a21fc5f27f2c895d77
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-05-22 14:58:24 +00:00
Friedemann Kleint
07071a23c3 uic/Python: Fix tab stop/Z-Order and buddy handling
The code compared the attribute names of the properties against the
m_registeredWidgets hash which contained the qualified names
(self.widget) and thus reported errors without actually generating
anything.

Replace the m_registeredWidgets hash by a lookup of the attribute name
in the m_widgets hash and add a function widgetVariableName()
returning the qualified variable name for an attribute name and use
that for the checks.

Remove unused m_registeredActions hash and rename some variables to
make it clearer.

Task-number: PYSIDE-797
Change-Id: Id31d95c1141d21c51eb85bcd8f8fc63486eb36a5
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2019-05-08 10:19:22 +02:00