This reduces unnecessary OS conditions in qmake since these platforms
are mutually exclusive, and also opens up their potential for use on
future devices (like carOS(?), which is device idiom '5').
This is also more similar to what Xcode does, as the
TARGETED_DEVICE_FAMILY variable is not platform specific.
Change-Id: I29d209cd8e0779f492bda829008264773e13c75c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This reduces unnecessary OS conditions in qmake since these platforms
are mutually exclusive, and also opens up their potential for use on
macOS to transparently support multi-arch builds like UIKit platforms.
This is also more similar to what Xcode does, as the DEPLOYMENT_TARGET
variables are platform specific, while the ARCHS variable is not.
DEPLOYMENT_TARGET has a use case for being OS specific in qmake (host
tools vs targets), while ARCHS does not.
Change-Id: Icee838a39e84259c2089faff08cc11d5f849758d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The calculated end position of script lines, consisting of nothing but
trailing spaces, is lower than the start position. This results in not
shaping those script lines.
Task-number: QTBUG-55255
Change-Id: Ib70c1a800d2f70b7f61e3d05c10618e275f45f12
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Handling user events while creating a window can cause problems and
crashes as the event tries to access non initialized parts of the window
itself being created. Hence exclude user input events at that time and
have them handled when the event loop checks for them regularly.
Change-Id: I2a78efd619250be8f6f2e737ed78e39481a4cf76
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
widgetlessNativeDialog() is the only test function that creates
a native file dialog instance. GTK+ versions prior 3.15.5 have
a nasty bug (https://bugzilla.gnome.org/show_bug.cgi?id=725164)
in GtkFileChooserWidget, which makes it leak its folder change
callback, causing a crash "at some point later". Running the
native test last is enough to avoid spinning the event loop after
the test, and that way circumvent the crash (QTBUG-55276).
The crash has been fixed in GTK+ 3.15.5, but the RHEL 7.2 CI has
GTK+ 3.14.13 installed.
Change-Id: I867755969a4458693bd12f848d052adf77a2086e
Task-number: QTBUG-55276
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Since 74cade1ee4, QFontconfigDatabase
has forced a full init to the default configuration breaking
applications that set a custom fontconfig.
Change-Id: If9ee3e185c42af10c05ae3852d088881da1d4f1a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
The rest of Qt, including the QString constructor, uses UTF-8 to
interpret narrow character literals. The fact that QTextStream uses
Latin 1 should be considered a defect.
We can't fix this in Qt 5, so log it for consideration in Qt 6.
Change-Id: I9e96ecd4f6aa4ff0ae08fffd14710fa61673db57
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Detect and apply style sheets font set when calculating
QHeaderView section content size and drawing it.
Change-Id: I542cd0d31bbe62f127c509f297eef0a576fec054
Task-number: QTBUG-55597
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Backport a feature of the new configure system setting the
variables QT_CL_MAJOR_VERSION, QT_CL_MINOR_VERSION,
QT_CL_PATCH_VERSION similarly to the existing variables for gcc.
This allows for disabling optimizations depending on the compiler
version.
Task-number: QTBUG-55238
Change-Id: If2349b008c1049e2ab98a5c1160b244a6e8937a8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
QLatin1Literal is just alias of QLatin1String
for Qt4 compatibility.
So it's style cleanup patch.
Change-Id: Ia3b3e5dc3169f13a1ef819d69be576b8a8bfb258
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This patch moves towards a more sensible layout for UIKit platforms,
where both the device and simulator architectures for binaries are
combined into a single Mach-O file instead of separating out the
simulator architecutures into separate _simulator.a files.
This approach is both more common in the iOS ecosystem at large and
significantly simplifies the implementation details for Qt, especially
with the upcoming support for shared libraries on UIKit platforms.
This patch takes advantage of the -Xarch compiler option to pass the
appropriate -isysroot, -syslibroot, and -m*-version-min compiler and
linker flags to the clang frontend, operating in exactly the same way
as a normal multi-arch build for device or simulator did previously.
Exclusive builds are still enabled for the xcodebuild wrapper Makefile,
which builds all four configurations of a UIKit Xcode project as before,
as expected.
A particularly advantageous benefit of this change is that it flows very
well with existing Xcode workflows, namely that:
- Slicing out unused architectures is handled completely automatically
for static builds, as an executable linking to a library with more
architectures than it itself is linked as, the unused architectures
will be ignored silently, resulting in the same behavior for users
(and the App Store won't let you submit Intel architectures either).
- Removing architectures from a fat binary using lipo does NOT
invalidate the code signature of that file or its container if it is a
bundle. This allows shared library and framework builds of Qt to work
mostly automatically as well, since an Xcode shell script build phase
can remove unused architectures from the embedded frameworks when that
is implemented, and if Qt ever starts signing its SDK releases, it
won't interfere with that either (though binaries are just resigned).
Change-Id: I6c3578c78f75845a2fcc85f3a5b728ec997dbe90
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This is done because a followup patch will cause simulator_and_device builds
to no longer use exclusive builds and so this feature could not work,
but it is not strictly necessary anyways because users do not need to be
able to do this.
Done-with: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Change-Id: If869fbfea776751553c352c2d652edf745a3638d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
An entry was missing in one of the tables. This patch adds it back in
and adds the enum comments used to keep track of whether they all are
there and correctly set.
Change-Id: Ic6a55a8f81f9c42a3174a2a75c80c3a354f173b7
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Otherwise we will return an empty list of fallbacks if no QFontDatabase
has been created yet.
Task-number: QTBUG-55222
Change-Id: I50508162fad3206e0acf3cc6eb39aefac5c3e197
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Earlier versions of the compiler cannot default
move special member functions, even though we
also define Q_COMPILER_RVALUE_REFS for them.
Fix by retracting the less-often-used of the
two compiler feature defines.
Q_COMPILER_DEFAULT_MEMBERS is not used outside
QtBase in neither 5.6 nor 5.7 (5.8 is not
released at this time, so wasn't considered).
The same is true of the dependent macros
Q_COMPILER_DEFAULT_DELETE_MEMBERS and
Q_DECL_EQ_DEFAULT.
In QtBase, the three uses are:
1. in QAtomic*, where the user also requires
Q_COMPILER_CONSTEXPR, which is not defined
for any MSVC at this time,
2. for QEnableSharedFromThis, which is a class
template with an alternative {} implementa-
tion of the default constructor, and uncon-
ditional user-defined copy special member
functions.
3. The test of the corresponding functionality
in tst_compiler, which this commit amends.
That means that neither of these two only uses
of the macro in Qt libraries are affected by
the change.
The reason we do this change, then, is that in
the future, we want to be able to more easily
restore move special member functions for
classes for which they are suppressed due to
user-defined dtors or copy special member
functions.
Change-Id: I6f88cad66d6b87a758231f16355c3bddae697b86
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
According to https://msdn.microsoft.com/en-us/library/5dae5d43.aspx,
strncpy_s' second argument must not be 0:
> If strDest or strSource is NULL, *or numberOfElements is 0*, the
> invalid parameter handler is invoked.
Move the existing check for len > 0 up to protect the strncpy_s
call, too.
Change-Id: I70d339ea60d4b76f3038b2e4e4756f6590a9bd31
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
uic should use Q_NULLPTR instead of 0 as the default disambiguation
context.
Task-number: QTBUG-45291
Change-Id: I889182c7fe1c4be3336f3cd645aa60838863c633
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
- order includes from most specific to most general
- include only what you need
- port uses of inefficient QLists to QVector
(required adding default ctors to the payload types)
- mark types as Q_MOVABLE_TYPE
- inline some trivial functions
- add explicit to ctors
- mark plugin with QT_NO_FOREACH
Change-Id: I7ae13141ece22bfdf49be42deb0987d51da2d72b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Run cl.exe /? and extract version from header line printed
to standard error.
Change-Id: Iecf18f1b0f94cc1d51add7021d80772784e0f953
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This is the simple part of the job, removing Q_FOREACH loops
which are obviously safe to be replaced by C++11 range-for.
In QNetworkManagerEngine::sessionStateForId(), instead of
iterating over QHash::keys(), iterate over the QHash
directly (using C++11 range-for, as we're only using the
values, not the keys).
In QNetworkManagerEngine::connectToId(), simplify the loop
body by merging three identical if blocks into one.
Saves ~1.7KiB accumulated over the three Linux bearer plugins:
connman, generic, nm (optimized GCC 6.1 Linux AMD64 build).
Change-Id: Ic66139c25f7e2173f5a919927e269b873334d2c8
Reviewed-by: Lorn Potter <lorn.potter@canonical.com>
The actual blocker for precompiled headers is not the iOS/tvOS/watchOS
platforms, but the way qmake handled multiple-architecture builds on
Apple platforms.
This patch allows multi-arch builds to be performed while using
precompiled headers.
Since df91ef3d6c55692a0236f67b6c6b134a3bf84098 (April 2009), Clang has
had support for PCH files in the driver, which allows to use the
-include flag to automatically translate to -include-pch. We can then
take advantage of the fact that the -include option is allowed to not
be separate from its argument, which lets us take advantage of -Xarch to
specify a per-architecture precompiled header file.
This is done through some magic in the qmake Makefile generator which
"multiplexes" the PCH creation rule across multiple architectures and
replaces a series of tokens with the proper precompiled header paths
and architecture flags at usage point.
Change-Id: I76c8dc9cda7e218869c2919f023d9b04f311c6fd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Not all tests have been updated to consider sandboxed targets causing
open/write errors.
Change-Id: Id7bb925c0faf04bf88cb126fb7c2846c38f36290
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The functions defined there are used almost exclusively in
qcolor.cpp, so give the compiler the whole picture.
Also fixes the non-standard naming of the files: qcolor_p.h
should have been qcolor_p_p.h, since it declared functions
defined in qcolor_p.cpp.
Change-Id: I06e61232a906fd0d98d5adcfe4af5881985367d8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
iOS was excluded in 09aeda21b9, probably
unnecessarily. The build has been found to be warning-free.
Change-Id: I81de2fff40938b6ab9f7a6a5b9f08f8a8baadb16
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
No need to get libs flags other than -L and -l, since we're adding
everything to the LIBS variable in qmake anyway. We wouldn't want rpath
or other linker flags to leak through.
Change-Id: I7d42fe4b581e49df891cfffd146fab61fecbc5c9
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
CFURLCreateDataAndPropertiesFromResource has been
deprecated since 10.9.
Instead of loading the PAC file contents, we call
CFNetworkExecuteProxyAutoConfigurationURL. This
function being asynchronous, we make sure we block
until the CFProxyAutoConfigurationResultCallback
has been invoked.
Change-Id: I97e32d7f9b349e8e15fe1fdcb35b10e7aab39b3a
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
While testdata has been added in a previous commit, the test never
searched for files and directories properly.
Change-Id: Ieae28e5f7e4ef8968b13f5ede553bd5268e53e17
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
The sleep time increases exponentially, but we never checked whether the
time to sleep was less than the remaining time. For example, if timeout
was 4000 ms on entry, we'd progressively sleep 100 ms, 200, 400, 800,
1600 ms. At this point, the accummulated sleep time would be 3100 ms and
the next sleep should be no more than 900 ms.
Prior to this change, the tryLock() would then proceed to sleep 3200 ms,
for a total wait time of 6300 ms, or 57.5% above the timeout provided by
the user.
Change-Id: Ifc295639c8cf4ddcaa69fffd146f7586a7ee95e4
Reviewed-by: David Faure <david.faure@kdab.com>
The constructor that sets it is inline already, so there's no point in
hiding this.
Change-Id: I66707fdfe8eb460a9c72fffd146d8dbc35b13056
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
incidentally, this helps with building in feature-reduced
configurations.
Change-Id: I2f523cff92985539383970e137df12d86c20a626
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
that variable is not modified in this scope, so there is no point in
exporting it here. it was probably a leftover from an earlier version.
amends c0cc50520.
Change-Id: Ic6f93d8c38d547308aa88ef337fe49bda004b337
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
test callbacks MUST NOT act as outputs, ever.
this went unnoticed so far, as it would become visible only with
configure -recheck.
Change-Id: Idd923097b4b2790ef4fe8a6d430db4b62851801a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
they are build-time generated, so they must go to the build dir
irrespective of whether we're using pre-synced headers.
Task-number: QTBUG-55585
Change-Id: I5f10b35c40b0ae2ddc5568d70e254b787ac3f914
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
we need to suppress another qtConfig(simulator_and_device) check during
the configuration phase.
amends 60985aa4.
Change-Id: Iae279d282d47b4c254b7a6f9f33315abe126eff0
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Use mapToGlobal(QPoint(0, 0)) when encountering a foreign window in
the parent hierarchy as it is not clear whether it is a native
top level or child. In the latter case, using the position is not
sufficient.
Task-number: QTBUG-43252
Change-Id: I5eebb1f0dbc6a0abbd968c5d383d3eded75c11a5
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Release the IShellItem instances according to the
documentation of IFile[Open]Dialog.
Task-number: QTBUG-55509
Task-number: QTBUG-55459
Change-Id: Ib79622cde21982b1bda0be7d0483c6e652a1d5fe
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
When the pixmap is initially from a higher device pixel ratio and it is
being used on a window that does not have a device pixel ratio other
than 1.0 set then the pixmap should also have it set to 1.0. This ensures
that the size of the pixmap is preserved and it is not scaled down as a
result on the normal display.
Change-Id: Ie5d96b3e1508867b723000bea182c8157640af02
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>