Push conversions from pthread_t to Qt::HANDLE and back into functions.
The casts that were being used didn't work for the unusual 64-bit
pointer/32-bit int combination that QNX is using for 7.0. HANDLE ends
up as a 64-bit pointer and pthread_t ends up as a 32-bit integer. g++
considers the precision loss when converting from the 64-bit pointer
to the 32-bit integer an error. Better to have the casts hidden in
functions so it's easier to adjust them for unusual combinations such
as this.
Change-Id: Ia156b26224a0f7edc1c31e3d1ee8b21191381698
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
As we are rendering into a new paint device we need to copy the device
pixel ratio from the widget.
Task-number: QTBUG-50207
Change-Id: I2fe08052c4ab589cb871f4c95440b7d63f79beb9
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
GetModuleFileName exists for Windows 10 and upwards, hence use the
generic version from the win32 mkspec. This allows to create a
QCoreApplication object with nullptr argv, as the application filename
is identified via the binary itself and not via arguments. A couple of
auto-tests use this method to create multiple application objects during
runtime.
Unfortunately we cannot apply this for msvc2013, even though MSDN states
the GetModuleFileName exists, it fails to compile for Windows Phone 8.1.
Change-Id: I2b8b988107487ef3785462f8ca40b0a6e0623e32
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
In case QEventDispatcherWinRT::runOnXamlThread returns an error the
runtime sets the status of IAsyncInfo to Error. At the point when the
IAsyncInfo destructor is invoked, an unhandled exception is thrown
indicating the error has not been handled, causing any application to
just crash deep inside the Windows platform libraries.
Hence, in case runOnXamlThread returns non-S_OK we have to manually
invoke Close() of the IAsyncInfo to tell the system we have taken care
of everything.
Change-Id: I3ac1e2ec2726f42e44f4f9a92191e454711120dd
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Contrary to our initial assumption, this should be added by default to
allow full functionality during development by default. Developers need
to decide which capabilities to use during the publishing step already,
hence improve DX by adding this.
Task-number: QTBUG-50847
Change-Id: I36e0214f7bcf8610d31851eea172aba3944cfd99
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
There is no need for the functions to assert. By returning false they
show that something went wrong and the error will be handled
gracefully.
Change-Id: Ib026adf5c6fb23b5e6b5598533caec3b3669220c
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
If runOnXamlThread returns anything but S_OK an exception is thrown
which might cause the application to terminate. So we give the lambda
a reference to hr and check that reference instead of runOnXamlThread's
return value for errors.
Change-Id: I1188ea720c63f6fdf43400f2f3ff928b72afc58e
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
runOnXamlThread should always return S_OK (causes exceptions otherwise)
so we need another way of error reporting to the outside (hr reference).
A failed hr is reported to the outside (of the lambda) and interpreted
as an unknown error.
Specific error cases like the given address not being a local address
or the given address being in use already are handled inside the lambda.
The specificErrorSet variable is necessary in these cases so that the
error is not overwritten by unknownError.
Change-Id: I198d66fe97726d5127bf31e50c7eff3363d5259c
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Q_COMPILER_CONSTEXPR can be undefined (or not defined at all) to
indicate that constexpr should not be used regardless of the compiler's
ability to support it. This is done for QNX because some C library
floating point functions used in the Dinkumware C++ library aren't
constexpr functions; i.e., the library doesn't have proper constexpr
support even though the compiler does.
(cherry picked from commit d87242968f)
Change-Id: If0bdeb2180710dd9ccd97d79fa91cf9ff42f7990
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
[ChangeLog][QtGui][Platform Specific Changes] Added bsdfb
platform plugin for FreeBSD. Plugin renders directly to
framebuffer, no hardware acceleration supported. bsdfb accepts
"fb", "size", "offset", and "mmsize" arguments with the same
format as linuxfb.
Change-Id: I5f5cea0b5ed70d5c6f8d01dc547f54c731bcae5f
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
BSD OS mkspecs share mainly the same configurations except very few
differences. Merge into a common/bsd/bsd.conf file to be used across all BSD
OSes in their respective qmake.conf and add a qplatformdefs.h that contain
the common defines to be re-used in the BSD mkspecs.
The change includes the usage of <sys/param.h> also on NetBSD through the
common qplatformdefs.h, which is intended for using NetBSD's version defines.
Change-Id: Ibb0ac9e4c8bb5aff7d0febdcab1a4b9600a61117
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The fromCGRect function was left out for QRect, as the foundation type is
using CGFloats internally. Clients should use an explicit QRectF::toRect()
when potentially throwing away precision.
Change-Id: I0d4c5c5a4e6a45ea3287e3f37a00b69b0bfdefcf
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Use larger system metric SM_CXICON instead of SM_CXSMICON and set NIIF_LARGE_ICON
in the NOTIFYICONDATA. De-inline function iconFlag() and set NIIF_USER for user
icons for NIIF_LARGE_ICON to take effect.
Task-number: QTBUG-53591
Change-Id: I47c8e0a020ef94241403b1fbae76d5ef2e074301
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
The move constructor is slightly more interesting than the copy
constructor because we can reset other to a short data state on 64-bit
systems. The assembly of that function is simply:
mov (%rsi),%rax
mov %rax,(%rdi)
movq $0x1,(%rsi)
retq
The move-assignment operator for QDateTime was already there. There's no
need for one for QDateTime::Data since it's never called.
Change-Id: I06bae9392f534e45b3f1ffff144dffdd7f23b170
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We won't shrink on manipulation when we have memory allocated, but it's
a good idea to create a non-shared copy if we can. It's an unlikely
scenario, though, because it requires the QDateTime object to have been
set to a large state then manipulated back into a small state.
Change-Id: I06bae9392f534e45b3f1ffff144dfee755bafa01
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The file has an organization, so let's follow it. This commit has no
other changes besides moving code around.
Change-Id: I06bae9392f534e45b3f1ffff144e0b1f6dd72622
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Well, maybe not for so long: we may want to revisit it for Qt 6. At the
very least, we should enlarge the size of QDateTime on 32-bit system so
that they too can benefit from the optimization.
With this optimization, on 64-bit systems, the most common uses of
QDateTime now no longer allocate memory at all. The range is slightly
reduced from 584,554,049 years to 2,283,414 years around 1970. The other
drawback is that calling QDateTime::offsetFromUtc() on a localtime now
needs to recalculate the offset, instead of using the cached offset.
(QDateTime::toMSecsSinceEpoch() didn't use the cache).
Change-Id: Id5480807d25e49e78b79ffff144a8b2c9af91814
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit moves QDateTimePrivate functions setTimeSpec, setDateTime,
getDateTime, checkValidDateTime and refreshDateTime outside the
class. Like the previous commit, this is done in preparation for the
"Short QDateTime Optimization" as the "msecs" field will be placed in
the short data, if possible.
By making them file-level static, this also improves code generation, as
the compiler doesn't know whether it has to emit the class members for
out-of-line use or not.
Change-Id: I06bae9392f534e45b3f1ffff144df4d73cbc9184
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit changes most accesses to the d->m_status (including
d->spec() and d->setSpec() uses) to use new static functions. This is
done in preparation to the "Short QDateTime Optimization" as the status
byte will be kept in the short data.
Change-Id: I06bae9392f534e45b3f1ffff144dbd795d03227a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Instead of using a macro for maybe passing an extra parameter, pass the
d pointer and let the function decide what to use and what not to use.
Change-Id: I06bae9392f534e45b3f1ffff144dbeb68a30cb48
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
They're superfluous, since b491fab02a
removed the distinction between null and invalid. Just use the
isValidXxx equivalents.
Change-Id: I06bae9392f534e45b3f1ffff144db9badad010fd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We're going to have to stop using QSharedDataPointer because of the
upcoming short-datetime-optimization. By dropping the inheritance, I am
also able to rearrange the members and remove the padding hole that
existed.
The second padding hole was removed in the previous commit, which merged
two 32-bit fields into one.
On 64-bit systems, there's no way around a remaining 4-byte hole
somewhere due to the odd number of 32-bit members. I chose to leave it
in the middle of the struct, before the m_timeZone member, instead of
tail padding, so that the layout of the first members structure are the
same in bootstrapped and non-bootstrapped builds. That should help
debugging the bootstrapped tools in Qt Creator. It's also now the same
in 32- and in 64-bit systems.
Change-Id: Id69569111e7d4e619e22ffff144b1fba708885f7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Storing them in a single byte is the first step towards the Short
QDateTime Optimization.
The bump in the "private version" by 10 is to accommodate possible
changes in the Qt 5.7 branch.
Change-Id: Id5480807d25e49e78b79ffff144a59420457bcf0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The animated glow always has a length of 120 but was previously drawn
with the clipping rect of the bar's actual size. For sizes smaller than
120 the native theme part would be clipped and the black gradient would
show.
Change-Id: Id81e39c405ef81ae08af0f64249568016944bdf1
Task-number: QTBUG-51266
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This enables creation of autotests which use touch events, without using
private API.
Task-number: QTBUG-44030
Change-Id: If8fe89f8423aaafd9e6501e231c33580b9365eb8
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
This makes it easier for users to find out how to get a file's
extension when browsing docs.
Change-Id: I08a1b620dea5432462133324824fae85754b9a09
Task-number: QTBUG-53380
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
The backing store would not report itself dirty if only render-to-
texture widgets were dirty.
This caused QOpenGLWidgets not be repainted after being remapped if they
marked themselves dirty while unmapped.
Task-number: QTBUG-50818
Task-number: QTBUG-51815
Change-Id: If43f7cbb6f4d44831b4c21b89f884d6bcaebf87c
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
the assumption stated in b67a0836d is actually invalid - configure sets
build_all without debug_and_release there. debug_and_release does
actually imply build_all, though.
to make things less confusing, don't let configure inject
iphonesimulator_and_iphoneos into all projects, but handle it like
debug_and_release instead.
Change-Id: Ib7acdc63308a538862fc603428f81aba60bca08e
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
The Apple documentation explicitly says that you should call super
when implementing these methods.
Change-Id: I584bb140a4a5bde88927b379ab19158a78c6fea9
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Add a class to display debug messages, providing convenience functions for
installing and formatting parameters like indentation. It prints a startup
message containing relevant information about Qt.
Change-Id: Id0a19adbb5953a6ded1a8e692f242b63748e7273
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
On ABIs where quint64 is aligned on 8-byte boundaries (such 32-bit
Windows and all 64-bit systems), there was a padding hole of 4 bytes
between QHostAddressPrivate::a and the anonymous union. If we move the
member to after the union, there is no hole anymore.
That operation causes the tail padding to grow from 3 to 7 bytes. Since
we also don't need full 32 bits for the protocol, we can shrink the
structure by 8 bytes on those architectures and by 4 bytes on 32-bit
Unix systems.
Change-Id: I461e9fc7199748faa187ffff1415d6601a7bd777
Reviewed-by: hjk <hjk@theqtcompany.com>
And ask the user to apply one of the patches we're carrying to their
Standard Libraries.
Change-Id: I7e6338336dd6468ead24ffff141139c79056922e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The first is "exact", not "more": qCalculateBlockSize. It ensures that
there's no overflow in multiplying, adding the header size or when
converting back to an int.
The second is the replacement for qAllocMore: it calculates the block
size like the first, but increases the block size to accommodate future
appends. The number of elements that fit in the block is also returned.
Task-number: QTBUG-41230
Change-Id: I52dd43c12685407bb9a6ffff13f5da09f816e667
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The GCC builtins for clzs and ctzs are enabled when the x86 extension
for LZCNT and TZCNT are enabled. The use of only __BMI__ in commit
f5f47987ce was incorrect.
But GCC needs both BMI and LZCNT enabled to enable this builtin.
Change-Id: I1cc7601489634e96833cfffd145647e9fc9f2f51
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This was no longer used and always false.
Change-Id: I981055e6cc736cfe3432914c173c8b3edc31b46e
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
This works only on Aarch64, because the vaddv instruction is only
available on 64bit ARM. Doing something equivalent on 32bit ARM has the
high chance to run into micro-architecture differences: on an Cortex-a8,
transferring a single vector element from NEON to the regular CPU
registers takes 20 cycles(!).
Change-Id: Iccbfe84da82abb9b10f3f3dc35c8b950df69e251
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>