Commit Graph

26280 Commits

Author SHA1 Message Date
Laszlo Agocs
1172e18c3c Promote backingstore image format to alpha
Like xcb does since 1bcfc3de75.
For TranslucentBackground (ARGB32_Premultiplied) there is no change
in practice. For RGB32 we will promote to ARGB32_Premultiplied
but everything should behave like before, except that we do not rely
on undefined behavior anymore when QOpenGL/QuickWidget is in use. For
RGB16 this will enable QOpenGL/QuickWidget since there the hole
punching mechanism needs an alpha channel always.

Change-Id: Id04ea548cee245ec91642f1358a5e501b62ff64c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2016-01-17 01:31:55 +00:00
BogDan Vatra
9bb24615ad Android: fix native libs dir.
On Andorid 64 bit O.S.s the libs are not located anymore on dataDir/lib/
but they are located on dataDir/lib/<arch>/. Using nativeLibraryDir instead
of dataDir we'll get the right folder.

Change-Id: I40ef9513eb5b51f81032bd41f9943ab7b959ad51
Task-number: QTBUG-50394
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-01-16 08:52:56 +00:00
Friedemann Kleint
c26562033b QFileDialog: Check whether sizeHint() is valid before resizing.
Fixes a regression appearing in 5.5 where QtWidgets-based file dialogs
showed up too small on Windows.

Change-Id: I5f74ab01d4368d67ab79d3a1b145fb63bdd69ca0
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-01-15 22:34:43 +00:00
Allan Sandfeld Jensen
8fd75739ef Lock qfontdatabase mutex in qt_fallbacksForFamily
When called from outside of qfontdatabase, the qfontdatabase mutex will
not be locked upon entry to qt_fallbacksForFamily, so we need to add
it to the exported version.

Change-Id: I16a21708d7cca15730c12de3dbeeaab13ffbd315
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2016-01-15 19:22:45 +00:00
André Klitzing
5ef14c52d0 Fix QFileSelector::select if called with QUrl and scheme "assets"
QFileSelector::select(QUrl) will use ":" for scheme "qrc" to
call QFileSelector::select(QString). Scheme "assets" needs
to remain "assets:" for select(QString), otherwise it won't
recognize the file in "assets".

Following failed because it was passed as ":/qml/example.qml"
to select(QString):
    select(QUrl("assets:/qml/example.qml"));

This will call select(QString) to:
    select("assets:/qml/example.qml");

Change-Id: I6bdeed6bb67992498ae3b8e1273c20e70049381a
Task-number: QTBUG-50435
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2016-01-15 13:30:37 +00:00
Allan Sandfeld Jensen
4f71654385 Handle RGB30 formats in OpenGL backing-store integration
Optimizes composition on platforms that may use 10-bit per color channel
formats.

Change-Id: Ib303c391d47795c79a4ba55d78dbb1c3c702d90a
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-01-15 08:59:28 +00:00
Thiago Macieira
434302eae1 Fix non-Latin1 strings in QJsonDocument on big-endian platforms
QJsonDocument stores the entire JSON tree in its binary format. Since
the binary format is the same on-disk as in-memory, it has a fixed
endianness. But when converting from QString to the little-endian
format, the code accidentally converted twice (from little endian, to
little endian), which resulted in a no-op and the string got stored as
big-endian.

It's like encrypting with double-ROT13.

No new testcase because tst_QtJson::removeNonLatinKey was already
failing and gets fixed by this commit.

Task-number: QTBUG-50419
Change-Id: I408dcb81ba654c929f25ffff1428cc79472bbe13
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-15 06:38:53 +00:00
Thiago Macieira
d53f614740 Doc: add missing semi-colon
Change-Id: I408dcb81ba654c929f25ffff14291c57198e7367
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-01-15 06:38:50 +00:00
Friedemann Kleint
b6c086ad6c Windows/Direct2D QPA plugins: Fix overrides.
Fix warnings found by clang.

Change-Id: Ia8e7a271e9d33011eded1e63e61dbcaeaf692600
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-01-14 16:57:59 +00:00
Allan Sandfeld Jensen
0bc4288689 Optimize OpenGL binding of ARGB32PM backing store
Detect premultiplied backing store and upload it without conversion
and adjust blend to not multiply alpha again.

Task-number: QTBUG-50381
Change-Id: I51939c4f82fbb0c48eaca6e2475bf4cf3722bc2d
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-01-14 13:28:57 +00:00
Błażej Szczygieł
18119a58de xcb: Don't clear alpha on every repaint
Since 1bcfc3de75 every image has alpha
in XCB even if it is not used by window. This patch prevents clearing
the alpha channel on every repaint when window is not transparent.

Change-Id: Icfdd39f8636401906ace77ea3c2fa25386979d5f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2016-01-14 10:47:10 +00:00
Maurice Kalinowski
c3376ed3f9 winrt: enable hardware buttons for Windows 10
Previously the hardware and camera button handler were guarded inside a
Q_OS_WINPHONE which does not apply to Windows 10.

Instead use WINAPI_PARTITION_FAMILY like on other places, this covers
Windows Phone 8.1 as well as Windows 10.

To find windows.phone.ui.input.h at build time the Mobile Extension
directory needs to be added to the include paths inside qmake. On
runtime we need to check whether we have hardware buttons or not. In
case they exist, register the handlers, otherwise skip registration.
Skipping also helps to keep WACK succeeding.

Task-number: QTBUG-50427
Change-Id: Ibeae15dbde12553cebd2b73b1a40b754c014f426
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-01-14 07:43:26 +00:00
André Klitzing
f831c97a08 Replace QStringLiteral with QLatin1String in QFileSelector
Change-Id: I5c109d26bf5252947ae016465db5675e38cd68c9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-01-13 22:06:32 +00:00
Volker Krause
b5447f9c33 QtConcurrent: Avoid an allocation in ExceptionHolder if there is no exception to store.
Qt3D hits this several times per frame.

Change-Id: Iaadcfbe79f146bd73b36f01325580dc24a10225c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-01-13 22:06:25 +00:00
Błażej Szczygieł
7b63c45df5 QtWidgets: Don't show window of native widget with WA_OutsideWSRange
This patch prevents visibility of native widgets which for some reasons
has width or height of 0.

Due to async expose event in Qt5 we must force "hide_sys()" during
resizing for widgets with WA_OutsideWSRange flag. This avoid problems
for non-native and visible widgets which are converted to native and
then resized:
child->winId();
child->resize(0, 0);

Task-number: QTBUG-49445
Change-Id: Ied62a4f253f89447941b2dc03316db8c168f4bb5
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2016-01-13 19:02:34 +00:00
Błażej Szczygieł
a9c0a83207 xcb: Don't duplicate expose events
Use ExposeCompressor for mapping the window to prevent duplicating
expose event when window is mapped.
Remove sending expose event from configure notivy event.

Change-Id: I6836c06047ffebd65775aa8aca90750afba6efe8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-01-13 19:02:29 +00:00
Oswald Buddenhagen
b8bee40726 unbreak propagation of dependencies on private modules
most module project files define two logical modules: a public one and
the corresponding private one. these are really separate modules as far
as qmake is concerned (even though the private one contains just
headers), and consequently have separate dependencies - QT and
QT_FOR_PRIVATE.

as public modules cannot depend on private ones, all private
dependencies would have to go to QT_FOR_PRIVATE, and a dependency on the
respective public module would have to be added to QT. this would be a
bit tedious, so we have a convenience feature which allows putting
private dependencies into QT, but automatically "downgrades" them to
their public counterpart when creating the public module's .pri file.

however, we failed to put verbatim versions of these private
dependencies into the private modules, which meant that these
dependencies were not pulled in transitively by the private modules'
users.

note that this entirely unrelated to QT_PRIVATE - this one defines the
private (non-propagated) dependencies of the module's implementation,
i.e., the libraries (and headers) that are not part of the link
interface. there is no QT_PRIVATE_FOR_PRIVATE, because there is
obviously no point in assigning the dependencies to a particular
logical submodule when neither one inherits them as far as the qt
module system is concerned.

Change-Id: Ib056b47dde3341ef9a52ffff13efaf8ef8e6817b
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-13 15:59:05 +00:00
Oswald Buddenhagen
dc1f65d4cf make module .pri files more flexible
save the actual library/framework name and framework paths in the .pri
file instead of computing them again at use time in qt.prf.

qt_no_framework_direct_includes inherently requires a use-time decision,
so this ugliness remains.

Change-Id: I09b2775e7d8e1d52e3af0d663e1babde10ae4814
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-01-13 15:59:00 +00:00
Edward Welbourne
cd9625fc3c Correct floordiv() to cope with implementation-defined division.
Irrelevant once we get to C++11 (so we can revert this in 5.7), but
division's rounding direction is implementation defined when either
operand is negative [0].  The prior code assumed C++11's truncation
(a.k.a. round towards zero), but rounding may be downwards instead.

[0] http://en.cppreference.com/w/cpp/language/operator_arithmetic#Multiplicative_operators

Change-Id: I2b6b27e1cf629def48b25433e81b9ed8230d8795
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-13 13:58:49 +00:00
Morten Johan Sørvig
eef7725775 eglfs: Round value returned from pixelDensity()
Avoid returning fractional scale factors, which we
do not support. This matches the pixelDensity()
implementation for the Xcb and Windows platform plugins.

Change-Id: I79156e802a0a436b9344f12d35d1f4861e20e7fa
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2016-01-13 12:55:15 +00:00
Andy Shaw
8c89a8b1ef [Android]: Java uses some deprecated locale codes so account for these
There are three deprecated language codes that Java still uses for the
locale so we need to account for these inside QLocale by mapping them to
the right language.

Task-number: QTBUG-49632
Change-Id: Ib66b3f2763e085f7384228f2490b048bb56be259
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-13 12:37:56 +00:00
Marc Mutz
61169b72c2 Fix UB in QIODevicePrivate
Passing nullptr as the second argument of memcpy/memmove
constitutes undefined behavior, even if the length argument
is zero at the same time.

Fix by protecting mem{cpy,move,chr} from nullptrs.

Found by UBSan:
  qtbase/src/corelib/io/qiodevice_p.h:105:33: runtime error: null pointer passed as argument 2, which is declared to never be null
  qtbase/src/corelib/io/qiodevice_p.h:175:53: runtime error: null pointer passed as argument 2, which is declared to never be null

Change-Id: I979158b0a74169ca4eb459928398ebc40f77dfb5
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-13 05:42:35 +00:00
Sérgio Martins
e770728a33 Add Qt6 TODO to remove copy-assign operator and copy-ctor
Change-Id: I5d80b272f31ada58d4eb7c19051fe447d6241633
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-01-12 23:52:35 +00:00
Tor Arne Vestbø
1e15b428b5 Fix shortcut modifiers not being propagated after c7e5e1d9e
The code-path used by non-OSX platforms were not passing on the native
scan-code, virtual key, and modifiers, breaking QKeyMapper::possibleKeys
in the process.

Task-number: QTBUG-50360
Change-Id: Idc36380a234f0a37d016dbeaca594aeb82c496d2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
2016-01-12 22:08:09 +00:00
Tor Arne Vestbø
af45b352d7 Fix reentrancy regression in QShortcutMap after c7e5e1d9e
When closing a popup dialog using a shortcut, when the popup
was originally opened using a shortcut, the closing-shortcut
would interfere with the state of the first shortcut, and we
ended up sending a key event for the original shortcut.

Task-number: QTBUG-50360
Change-Id: I62e5ddb9ca43b28519ede629775bc0d7598dccc4
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-12 22:08:04 +00:00
Thiago Macieira
70092c9a47 Fix GCC 6 warning about placement-new operator on too little space
GCC 6 is able to detect when you use a placement new of an object in a
space that is too small to contain it.

qvariant_p.h: In instantiation of ‘void v_construct(QVariant::Private*, const T&) [with T = QRectF]’:
qvariant_p.h:142:9: error: placement new constructing an object of type ‘QRectF’ and size ‘32’ in a region of type ‘void*’ and size ‘8’ [-Werror=placement-new]
         new (&x->data.ptr) T(t);
         ^~~~~~~~~~~~~~~~~~~~~~~

This happens even for the false branch of a constant expression (the
enum). So split the v_construct function in two pairs, one pair for
being able to use the internal space and one pair not so.

Change-Id: Ibc83b9f7e3bc4962ae35ffff1425ed898f279dea
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-01-12 19:25:42 +00:00
Thiago Macieira
9f09fed72f QVariant: use v_construct instead of duplicating logic
v_construct does what we want, so use it. This is required for the next
commit, which solves a GCC 6 warning issue.

Change-Id: Ibc83b9f7e3bc4962ae35ffff1425ed5f035f631a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-01-12 19:25:29 +00:00
Thiago Macieira
5e1a5a78d9 QVariant: make sure to default-initialize in v_construct
Otherwise it's possible to get garbage for primitive types (trivially
constructible) under some conditions.

Change-Id: I408dcb81ba654c929f25ffff142885fc62395948
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-12 19:25:07 +00:00
Romain Pokrzywka
650b4d0f49 Append the environment's QT_PLUGIN_PATH to 'make check' targets
Without this, any test executable requiring a plugin path from
the environment's QT_PLUGIN_PATH will fail to run since the path is
overwritten when generating the 'make check' command, for example:

QT_PLUGIN_PATH=/path/to/qt/plugins \
LD_LIBRARY_PATH=/path/to/qt/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} \
./test_foo

A prepend config option is used for *PATH to preserve the envvar
value, so use the same option for QT_PLUGIN_PATH. The command above
then becomes:

QT_PLUGIN_PATH=/path/to/qt/plugins${QT_PLUGIN_PATH:+:$QT_PLUGIN_PATH} \
LD_LIBRARY_PATH=/path/to/qt/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} \
./test_foo

Change-Id: I69b43327974915eae52f299fc4001effe93a491a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-01-12 15:21:39 +00:00
Oswald Buddenhagen
d8cfa6a144 disable install targets for non-prefix builds
one reason to do that is some users' persistence in destroying their
non-prefix builds by trying an installation.

another reason is the fact that qt.pro's relative_qt_rpath is triggered
by the presence of an install rule for the target, which is of course
not helpful when the install dir is bogus.

Task-number: QTBUG-48406
Change-Id: I75f3940be79fcb5b86e34b975b789692423c92cb
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-01-12 15:16:37 +00:00
Oswald Buddenhagen
20c7ab44c6 rework include path construction in the module system
the main objective was to fix the bootstrap modules in framework builds.
bootstrapped modules which "borrow" headers from "proper" modules can
specify this in a clean way now.
a side effect of this is that the bootstrap-dbus module now has its own
syncqt call.

most includepath-related setup from qt_module_pris.prf was moved to
qt_module_headers.prf.

Change-Id: Ie0d8192cfac1a8cdae0ddd0bc0cd8c3092b1e85b
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-01-12 15:14:57 +00:00
Edward Welbourne
81858bf172 Don't pretend we know what DST to use for an offset date.
When QDateTime::addDate() and friends sanitize their end-state, they
were using the DST status of their start-state (if known) to control
it.  This lead to misguided results and, in particular, inconsistent
results given that a raw-constructed QDateTime comes into being
ignorant of its DST, while a .toLocalTime() one knows its DST.

Furthermore, the code to do this was triplicated, tricky and poorly
explained.  So pull it out into a local static function and explain
what it's doing, and why, more clearly and only once.

Task-number: QTBUG-49008
Change-Id: Ia4bb3c5e9267fff8bb963ea705267998218ed623
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-01-12 09:23:55 +00:00
Marc Mutz
08775e4bd7 Revert "QString: preserve embedded NULs when converting from QByteArray"
This partially reverts commit e486d69133.
It broke too many users, even though all of them deserved to be broken.
The new functionality will be provided by differently-named functions,
where possible (problem: equality operators).

I did not revert the fix for the off-by-one error in
tst_qtextdocumentfragment.cpp.

I also didn't revert the change in the inequality relational operators,
since for all strings s1, s2 and s2' where s2' is s2 truncated at the
first NUL, s1 < s2 ⟺ s1 < s2' (since NUL < c for any c != 0), and,
trivially, for ≤, >, ≥, too. This does not hold for = and ≠, of course,
since "foo\0bar" ≠ "foo".

[ChangeLog][Important Behavior Changes][EDITORIAL] Reverted: All
conversions from QByteArray to QString now preserve embedded NULs...

Change-Id: If4b47048b39ae5be6ed08e6d91809626a67ea7f5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-12 06:13:05 +00:00
Marc Mutz
13189360e5 Fix UB in QFileDevice::writeData()
Passing nullptr as the 2nd argument of memcpy
constitutes undefined behavior.

Fix by protecting the block with 'if (len)',
which, presumably, is the only valid case
where 'data' may be nullptr.

Change-Id: I7647d7e0808b1f26444ea3cf8bbf5cda9ddc9e6c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-12 06:11:53 +00:00
Marc Mutz
b4ab4868bc Fix UB in QFSFileEnginePrivate::writeFdFh()
Apparently, it is considered valid to call the function with
'data' set to nullptr, and 'len' to zero. But doing so
invokes undefined behavior because nullptr is passed to
fwrite().

Fix by protecting the loops with 'if (len)'.

Found by UBSan:
  qtbase/src/corelib/io/qfsfileengine.cpp:732:84: runtime error: null pointer passed as argument 1, which is declared to never be null

Change-Id: Idfe23875c868ebb21d2164550de3304d2f01e9df
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-11 22:39:43 +00:00
Richard Moe Gustavsen
ca7f1d2197 iOS: fix crash on iOS 8 due to unsupported selector
It turns out that f558bde was not enough to stop a crash when
trying to access forceTouchCapability of traitCollection. The
reason is that traitCollection is available on UIScreen starting
from iOS 8, while forceTouchCapability is available on
UITraitCollection starting from iOS 9. So only checking the former
will cause a crash when running on iOS 8.

Change-Id: I44f9fb785349694004fbf2f48fe3b85bb01d9a5a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-01-11 18:30:42 +00:00
Marc Mutz
71ea41f999 Fix UB in QVariant::canConvert()
'currentType' was not sanitized before being used as a shift.

Fix by checking for a valid shift amount before shifting.
Also change the shifted value from 1 (int) to 1U (uint).
It's just the right thing to do.

Found by UBSan:
    qtbase/src/corelib/kernel/qvariant.cpp:3131:59: runtime error: shift exponent 1114 is too large for 32-bit type 'unsigned int'

Change-Id: Id3910d6d7f166fd7c80adf5ce1699f0eeb453562
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-11 18:16:31 +00:00
David Faure
e8479592c5 Doc: mention that Qt::AA_X11InitThreads isn't used anymore
Whether or not to call XInitThreads() doesn't apply since Qt-5.0's switch to XCB.

Change-Id: I5f1e5e664a251c98af6357c87fc9a6bb03a46ce3
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-01-11 17:28:52 +00:00
David Faure
9002f7f47a Fix documentation for ReuseAddressHint on Unix.
The code says (for Q_OS_UNIX)
if ((mode & QAbstractSocket::ShareAddress) || (mode & QAbstractSocket::ReuseAddressHint))
    socketEngine->setOption(QAbstractSocketEngine::AddressReusable, 1);
so clearly ReuseAddressHint does the same as ShareAddress, which is: setting SO_REUSEADDR.

Change-Id: Ic2ab4d139c3f58c3c63723fc609a9d4f71bac97a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-11 17:28:43 +00:00
Maurice Kalinowski
0355345398 winrt: Flush the system event queue when adding/removing windows
This has only been identified by WACK for Windows 10.

QWinRTWindow::setVisible adds a Window to the screen and immediately
tries to set the native visibility. This only works when the system
events are handled immediately. While this is the case most of the time,
certification tests revealed that this is not always the case. We have
to flush before setting the element visibility.

Change-Id: Ifce4c045c185c57bc386a4e832074fb84f5d0053
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-01-11 10:06:46 +00:00
Maurice Kalinowski
14e43c8f42 winrt: Fix API usage certification
According to MSDN Tls* is inline replaced by Fls* on Windows (Phone) 8.1
and beyond.
However, this does not seem to be the case for Windows 10. An
application links against Tls* and the certification step fails due to
using non-allowed APIs.

Hence we do the inline replacement manually. QThreadStorage and QThread
tests continue to work, so it seems to be an oversight by Microsoft.

Task-number: QTBUG-50292
Change-Id: Ice1b6e54fcee238c94af5c6fb1753d903db7476d
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-01-11 10:06:40 +00:00
Maurice Kalinowski
becbffe291 winphone: Properly close the application
When shutting down an application on Windows Phone the SceneGraph tries
to create an offscreen surface to render into. If there is no offscreen
surface available, it creates a new native window and tries to hide it.
As the native event loop is about to shut down, creation fails and
exceptions are raised. Instead we create a vanilla
QPlatformOffscreenSurface. The SceneGraph recognizes it as such and can
handle a proper cleanup on its own.

Furthermore removing the suspend/resume handler in the destructor of
QWinRTIntegration fails for Windows Phone as the application object
itself does not accept this anymore. Hence skip this part for this
platform.

Task-number: QTBUG-49310
Change-Id: I02acdd5a635ef0b9d6ef8199376537b8f0f1a8fb
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-01-11 10:06:36 +00:00
Maurice Kalinowski
c4ecab7127 WinRT: Invoke correct remove handler
Probably a typo when moving to Xaml.

Change-Id: I0739f4561912e1e16df7b124d6d187cd0f60f657
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-01-11 10:06:31 +00:00
Maurice Kalinowski
2b1f01426c WinRT: Fix application shutdown
Do not create a dummy eglDisplay when the global static is constructed.
This causes ANGLE to wrongly set some internals, which breaks usage of
EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE as the attribute map
might be empty after calling eglGetPlatformDisplayEXT. Furthermore
initialize() assigns a new display to it without terminating the old
one. This way, the internal suspend handler in ANGLE (Trim11.cpp) will
be added to the application.

The suspend handler is not invoked when an application suspends though.
Reason being that the handler needs to be added from inside the Xaml
thread. As we cannot control this inside ANGLE, we will call
eglInitialize inside the Xaml thread and hence get the suspend event
properly.

Task-number: QTBUG-50337
Task-number: QTBUG-50292
Change-Id: I3867377254c37084bf24f18e78af467f6237db57
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-01-11 10:06:26 +00:00
Kevin Funk
558f69a18b CMake: Ensure that -fPIC is passed in tests.
CMake newer than 2.8.12 automatically adds the
appropriate flag, but CI still runs 2.8.11.

Change-Id: Ie61375f2feb54a92c9d8f0ed6ad5227a67343bc5
Reviewed-by: Stephen Kelly <ske@ableton.com>
2016-01-11 09:53:37 +00:00
Kevin Funk
1c32b71cd0 CMake: Fix qt5_use_modules macro for CMake 2.8.11
Note the excessive escaping around "GNU".
Otherwise this leaks the -fPIE flag to the target.

Change-Id: I340df5d5bce00ebec4e1ff3a557ade67022ba23b
Reviewed-by: Stephen Kelly <ske@ableton.com>
2016-01-11 09:53:32 +00:00
Dāvis Mosāns
c8af3160d2 Don't pass NULL Display to glXGetClientString
glXGetCurrentDisplay can return NULL so need to check
for that.

Change-Id: I1b85a5c575d1deb24dcce4719b6f737283adeabe
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-01-11 09:40:40 +00:00
Friedemann Kleint
f186c4a819 Diaglib: Fix and extend dumping of native windows (Windows).
When recursing over the windows, the code did not take into account
that EnumChildWindow enumerates grand children as well. Exclude
those by checking for the direct parent in the recursion so that
the hierarchy is printed correctly. Add more information about
class and module and rearrange the output a bit so that the window
title is more prominent.

Task-number: QTBUG-50206
Change-Id: Iffb12c44eda9d09da5eb14a8405aee52ed3aa849
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-01-11 07:56:17 +00:00
Edward Welbourne
89293e6b19 Make DST-transition test more general.
Widen its interval (to work in more TZs) and test spring as well as
autumn.  Anywhere that does have a DST transition probably has it
between August and December; and there's no benefit to using a narrow
window.

There's also no sense skipping the test if we don't know there's a DST
transition: the test should still work, it just won't be testing
anything (about DST transitions).

Combine date and time checks into date-time checks, so that, when one
of them fails, QCOMPARE lets us know how the other changed, too.

Task-number: QTBUG-49008
Change-Id: I145b939ffef0dd0b54fd0e3cdf72a159c57ec00b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-11 07:31:19 +00:00
Thiago Macieira
ac2bde9caf QVariant: make sure two floating points compare equal if they are equal
Not just fuzzily equal. The fuzzy comparison fails for infinities, since
the expression p1 - p2 where p1 = p2 = infinity is NaN. And NaN
comparisons are always false.

As a nice side-effect, we don't do the more expensive computation of a
multiplication if the two numbers really are equal.

Task-number: QTBUG-50036
Change-Id: I11f559ef75544c50b3f8ffff1420cec7c7273295
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-11 05:20:23 +00:00