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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
It only needs stdin now, instead of stdin plus a separate file containing
a list of file names.
Change-Id: I9f3db030001e47e4a4e5ffff1425b76884cc7ca0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This reverts commit 618e2cc081. The
original commit has a section of code that I failed to review properly
and is of questionable functionality.
Change-Id: I61c53d7b8b2aa7c3312292b017a18aba7da11bc5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is needed as of commit v5.6.0-beta1~483 (Add an automatic use of
the ELF-versioned QtCore symbol, 2015-10-20). Even if a translation
unit only contains
#include <QtCore/QString>
int main(int,char**)
{
return 0;
}
it must link to QtCore which provides the qt_version_tag symbol.
Change-Id: I827c0a7403320e7e5b384d8608face20fcecdaea
Reviewed-by: Stephen Kelly <ske@ableton.com>
Off-by-one error: we should have calculated whether the current year is
leap, not the next year. This affected any 53-week leap years.
Task-number: QTBUG-50273
Change-Id: I134ce5db2f82468585ffffff14264cb9f12998fd
Reviewed-by: Martin Klapetek <mklapetek@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
We forgot to setQuery() after the query was modified.
Task-number: QTBUG-49963
Change-Id: I11f559ef75544c50b3f8ffff1420148ba3092200
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Fix the signature of QWindowsShcoreDLL::GetProcessDpiAwareness and output the
value in the warning about failures of SetProcessDpiAwareness and in debug
output. Failures occur when Qt is embedded into another application, for
example Active Qt servers.
Task-number: QTBUG-41186
Task-number: QTBUG-50206
Change-Id: I3fd6cba26826ee8bbfa0a34f129deb64797c947f
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
It is equal to m_geometry since c173a50719
(Remove QT_DEVICE_PIXEL_RATIO support from xcb).
Also remove the declaration for QXcbWindow::screenForNativeGeometry(),
which was forgotten to be removed in that commit.
Change-Id: I8ec425a3bc111ec579e2e25c4fda8a02f1c8d09c
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
We depend on being able to punch holes in the backing store when
integrating with FBO elements. To do that we need a format with an alpha
channel. This was only working previously because RGB32 didn't mask when
filling or when converting to ARGB32_PM, but other formats didn't.
Also unifies the logic for getting alpha versions of QImage formats.
Task-number: QTBUG-50281
Change-Id: Ied1325f60e2b67d9ea2dfa9701b06fc2231ebfca
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
qtAddToolEnv() (via qtPrepareTool()) does not write the tool wrapper
scripts during build passes, while qt_docs.prf (which calls it for qdoc
and qhelpgenerator) was loaded only during build passes. the consequence
was that the makefiles tried calling non-existent scripts.
amends 5418d77a1, sort of.
Change-Id: I64ab573495ca339be4c7b5e8c6848b298b6cb605
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
The wrapper batch files were called wrapper.bat for both, flex and
bison. Resolve this conflict by providing proper tool names.
Change-Id: I7987f94976abc29302c9f6a696faa5c7d1fb030d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
now that we don't create .pc files for private modules any more, the
conditionals cannot be nested.
amends 6c5d227da, partially reverting aa20e7f9d.
Task-number: QTBUG-49763
Change-Id: I2578c83e0c767b6533abdb26bf4e8bcc8c416ef1
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
judging by the history, this was only ever a workaround for poor rpath
handling. we're supposed to be over that.
Change-Id: I85601493a05a76ead999e707a2d2e9a430610981
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This is a false positive because the only offset that can be outside the
bounds was the last one (-1), which could not be reached in this line
because of the qBound on the line before limiting the maximum value.
The -1 wasn't generated by the Perl script embedded in the file anyway.
qdbuserror.cpp:142:64: error: offset outside bounds of constant string [-Werror]
Change-Id: I24a735698d3c4a719fc9ffff1425f8aad5e5978e
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
proper prefix builds don't have the redundant .dlls in bin (the copy
step is simply omitted), so this is broken. the change would have to be
done atomically with making DLLDESTDIR sane.
This reverts commit 9b2e98245a.
Task-number: QTBUG-50065
Change-Id: I9ce0a2d1147a1a2d4bd2f22e619d5c737864a637
Reviewed-by: Romain Pokrzywka <romain.pokrzywka@gmail.com>
Reviewed-by: Tim Blechmann <tim@klingt.org>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
this is just an optimization/clarification: variables which are known to
be never empty (like PATH) can be extended with less convoluted code.
Change-Id: Ib365bbec8301673ed1c874979b4de19bc983dab1
Reviewed-by: Romain Pokrzywka <romain.pokrzywka@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
the primary purpose is making env var prepend mode work for unset
variables on windows. this is achieved by using a conditional and delayed
variable expansion. however, the latter is disabled by default and can
be locally enabled only in batch files. therefore, write wrapper scripts
and substitute them for the actual commands. we do this also on unix,
both for consistency and simply because the commands look much less
confusing.
this change is slightly backwards-incompatible, as invoking
qtAddToolEnv() multiple times on the same command will now make a total
mess. also, invoking it on a command that contains 'make' macro
expansions isn't a good idea, so testcase.prf needed an adjustment. the
function is an undocumented internal, so Nobody Should Care (TM).
this also reverts 80ebedecf9, as it's obsolete now.
Change-Id: I8394b77868b495abcf27b688996ca74c40b80994
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Don't try to run test_interface when Qt is configured without QtWidgets.
Change-Id: If6c376c250215c1d639b06881d16c0141091f288
Reviewed-by: Stephen Kelly <ske@ableton.com>
Render-to-texture widgets that are native children may have a non-zero
offset telling the position within the top-level widget. The size is
usually different (smaller) than the tlw's size as well.
An unfortunate optimization attempt led to ignoring the size for native
children with offset (0, 0). This resulted in interesting rendering
artifacts whenever such widgets were placed in the top-left corner of
the toplevel. This is now corrected.
Task-number: QTBUG-48130
Change-Id: If449610c3f3333cb73ae149efaefd7ef42953951
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Setting a screen to a child window causes a warning message. This patch
prevents the debug message by catching incorrect behavior made by QPA
earlier.
Change-Id: Idf3ac02290a18afc134f19c2b91348dc009ca4ca
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Find the top level window on the primary virtual desktop first to avoid
obtaining a window which doesn't belong to the primary virtual desktop
when screen geometry is similar.
Change-Id: I78fdfa0b5146d0ba9b912338adeb612c102c4ac3
Reviewed-by: Adam Majer <adamm@zombino.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Qt3D is making heavy use of this, causing the QList node allocations
to be among the top 10 per frame allocation sources. Switching to
QVector fixes that.
Change-Id: I3b4df329710f82bf8d6797ea1f0c79b288a08063
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The reply serial is displayed for method call returns and errors,
while the serial is displayed for all message types.
To see a message serial it is required to dump messages after
sending, not before.
Task-number: QTBUG-44490
Change-Id: I859f50d739ed059d5b2dfe1a2efdf04b906891a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This patch includes setup of class member 'msg' in
QDBusMessagePrivate::toDBusMessage() to be able to get the
serial after message sending.
Testcases for comparing the 'reply serial to' with the 'serial'
are included.
Task-number: QTBUG-44490
Change-Id: Iae7c48f5b0c70a6c5ae500904072b38b46dfd876
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Change the QWindowsInputContext::composition if it is called
with lParam has flags GCS_RESULTSTR and GCS_DELTASTART,
it doesn't call endContextComposition.
Task-number: QTBUG-49955
Change-Id: I49de3f239bf8a77414e433b255db08f227141158
Reviewed-by: Tasuku Suzuki <stasuku@gmail.com>
Reviewed-by: Takumi ASAKI <takumi.asaki@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
(cherry picked from qtbase/786984e7e47a63094ad64ec86a4892cc5c0ad6d4)
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
On Android, back button will send a CloseEvent to the focused window.
This change will activate (focus) the Popup windows when they'll become
visible.
Task-number: QTBUG-46419
Change-Id: I6787435b24502bbf9a78662a0c6fd159d4ee2e8d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
On X11, QXcbVirtualDesktop represents an X11 screen while QScreen
represents an X11 output. In the case that there are multiple screens
(possibly with multiple outputs), calculate the screen number correctly:
Find the screen index on the primary virtual desktop first to avoid
obtaining a screen index which doesn't belong to the primary virtual
desktop when screen geometry is similar.
Change-Id: I4cbb29b7aa7cd2125759ffbbbe3db4e934feaeae
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Find the root widget only when more than one virtual desktop exists
and find the screen index using virtual siblings from this root
widget.
Use intersecting rects instead of middle point to obtain the screen.
This can help to get the screen index when the middle point is outside
the screen geometry, but part of the window is still on the screen.
If the widget is completely outside the screen geometry, -1 is
returned.
This commit amends: a6b2a4642f
Change-Id: I80247fc1956a82c487ee6f728d1576bf48b28748
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
This is a partial revert of eaa3a9d010
Task-number: QTBUG-50081
Change-Id: Ic3dc4daa90d7a968a4ebf45d3029c99a12985686
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>