Commit Graph

33241 Commits

Author SHA1 Message Date
Edward Welbourne
60a9747bb5 Add a date-time test for time-zones near epoch and odd transitions
Check we do handle DST after epoch and don't before.
Check we do notice various unusual transitions.
Check we do handle non-whole-hour-offset zones.
(Unfortunately, MS-Win lacks data for some of the zones and is wrong
about the two date-line crossers, so we skip those for it.)

Change-Id: If420d61b9db7f914ca25c22297c16e917ad2307a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-31 09:24:31 +00:00
Joerg Bornemann
85403d0af0 Support more than 62 instances of QWinEventNotifier, take 2
QWinEventNotifiers were limited to 62 instances, because of
WaitForMultipleObject's limitation to MAXIMUM_WAIT_OBJECTS - 1 handles.

Use the RegisterWaitForSingleObject API which does not have this
restriction and executes waits in threads managed by the system. A
central manual reset event per event dispatcher is signaled in the
RegisterWaitForSingleObject callback and waited for in the event loop.

Task-number: QTBUG-8819
Change-Id: I3061811c18e669becf9de603bbdd7ba96e4d2fcd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-07-30 19:11:49 +00:00
Friedemann Kleint
7b2debda2b Windows QPA: Fix compilation with MinGW 7.1
MinGW 7.1 claims the qUuidOf<> specializations are unused:

In file included from accessible\qwindowsaccessibility.cpp:59:0:
accessible\iaccessible2.h:274:5: error: 'IID qUuidOf() [with DesiredInterface = IAccessible2]' defined but not used [-Werror=unused-function]
 IID qUuidOf<IAccessible2>() { return IID_IAccessible2; }
     ^~~~~~~~~~~~~~~~~~~~~
In file included from accessible\qwindowsaccessibility.cpp:59:0:
accessible\iaccessible2.h:58:5: error: 'IID qUuidOf() [with DesiredInterface = IAccessibleComponent]' defined but not used [-Werror=unused-function]
 IID qUuidOf<IAccessibleComponent>() { return IID_IAccessibleComponent; }
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Amends 4f599c5ea1.

Change-Id: Iafcfe8b8d8ca9cdf00663f39ad491347b51d3ace
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-07-29 09:52:29 +00:00
Tor Arne Vestbø
f25b4d2fe3 macOS: Modernize QCocoaBackingStore::flush()
Instead of forwarding the flush to the view, using CoreGraphics to blit
the backing store to the window, we do everything in flush(), and use
higher level AppKit APIs to do the blit.

This simplifies the flow and code quite a bit, and also supports blitting
of individual regions in a flush instead of the whole bounding rect.

Change-Id: I2173c1a7763fe652a94125c7e3ae93a655412cd3
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-07-29 05:10:58 +00:00
David Fries
047e0e5118 Docs: Fix day/year format in QDateTime
QDateTime takes dd and yyyy.  It is confusing when the example format
strings don't work because they use DD YYYY, and it is a silent error
with the characters not getting substituted and can be easy to miss.

Improved Qt::ISODate, TZD isn't a format character so skip writing out
a bad format example.

Task-number: QTBUG-62111
Change-Id: Ia61d561074ae885fc0a99238d93cb34aaa9953bb
Reviewed-by: David Fries <david@fries.net>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-07-28 23:55:27 +00:00
Edward Welbourne
8b628bb251 Add test for time zone transitions near the epoch
This needs a zone with transitions near the epoch; and the only CET
with DST that winter was Italy (copied by Malta), for which the Olson
database had a recent (2016) correction to its data, for that winter.
That means we get inconsistent results on O/Sen of different ages.

So add a separate testEpochTranPrivate(), alongside testCetPrivate(),
and test it with America/Toronto.  (Unfortunately, MS-Win gets the
date wrong on the first transition after the epoch, so we have to code
round that.)

Since information before the epoch isn't reliably available, only test
the search backwards if nextTransition does find something before it.
(We can safely assume all real transitions happened since 1601;
non-celestial time-keeping wasn't accurate enough, before that, for
anyone to synchronize with anything but celestial time.)

Change-Id: I984b46938a2805b93bb2afd6855e317b5d66b386
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-28 08:14:36 +00:00
Soroush Rabiei
5e1408bd0d Test locale propagation from date-time editor to its calendar popup
Done-with: Edward Welbourne <edward.welbourne@qt.io>
Task-number: QTBUG-59106
Change-Id: I5b79b76087f0e980de5ea4ec687e8b8e2184506f
Reviewed-by: David Faure <david.faure@kdab.com>
2017-07-28 08:14:28 +00:00
Thiago Macieira
15df77f683 Fix use of getentropy on larger blocks
Found while working on suppressing the warning about the return value
(which is either 0 or -1) was being ignored.

Task-number: QTBUG-61968
Change-Id: I02d22222fff64d4dbda4fffd14d148b1724547ca
Reviewed-by: Florian Bruhin <qt-project.org@the-compiler.org>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-27 23:19:05 +00:00
Alex Trotsenko
8566487286 QSslSocketBackendPrivate::transmit(): improve reading from OpenSSL
This patch avoids intermediate copying of the data by writing SSL
decryption data directly into the outer socket's read buffer.

Change-Id: I19e5b6087595f280436a99fb2ca93cc6793c8f36
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
2017-07-27 19:26:40 +00:00
Tor Arne Vestbø
1828caad33 macOS: Send expose event with individual rects instead of bounding rect
Change-Id: I914521e1dfecb0157a8b9e1c9d9a86ca45e0826e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-07-26 21:07:44 +00:00
Eskil Abrahamsen Blomfeldt
73176d2922 Add API to disable text shaping on fonts
In the past, we had an undocumented text flag that worked with
one of the QPainter::drawText() overloads. This was never intended
as public API and served a specific cause in Qt WebKit at one point.

But there is a general need for such API, as disabling shaping features
easily gives 25% performance improvement on text rendering even for
fairly short strings.

This patch adds a new style strategy flag to disable shaping and
will just uses the CMAP and HDMX tables to get glyph indices and advances
for the characters. In Qt 6, the TextBypassShaping flag can be removed
completely and be replaced by the style strategy.

[ChangeLog][QtGui][Text] Added QFont::PreferNoShaping style strategy to support
improvements to performance at the expense of some cosmetic font features.

Task-number: QTBUG-56728
Change-Id: I48e025dcc06afe02824bf5b5011702a7e0036f6d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-07-26 10:51:00 +00:00
Tor Arne Vestbø
8719660416 macOS: Send expose event at drawRect and trigger updates via setNeedsDisplay
This changes the drawing model on macOS from the following:

 1. Sending synchronous expose events directly from callbacks such as
    windowDidOrderOnScreen and windowDidChangeOcclusionState
 2. Waiting for a resulting flush of the backing store, and issuing
    setNeedsDisplay as a response
 3. Waiting for the asynchronous drawRect call in response to
    setNeedsDisplay, where the backing store is finally drawn
    to the window

To the following:

 1. Issue setNeedsDisplay as a response to callbacks such as
    windowDidOrderOnScreen and windowDidChangeOcclusionState,
    when needed (in many cases this is automatic by AppKit)
 2. Send synchronous expose events from the resulting drawRect
    callback
 3. Draw the backing store to the window when flushed

The new model matches how normal Cocoa application draw in response to
drawRect, and makes the backing store flush synchronous instead of having
to trigger a async setNeedsDisplay. This gives AppKit more information
about how much time we're spending in drawRect, as the actual drawing
and flushing all happens within the synchronous expose event.

Qt applications that draw outside of drawRect, e.g. in response to timers,
are still supported by manually locking focus of the view and flushing the
window at the end of the backingstore flush.

Task-number: QTBUG-50414
Change-Id: I2efb9ff8df51ab6e840ad20c497b71f53e21e1c2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-07-25 17:47:08 +00:00
Edward Welbourne
cff39f1818 tst_QTimeZone: improve readability of code and failure reports
When QCOMPARE(,) reports two 12-digit numbers, it's not always
immediately obvious what the difference is (much less what 1/3600000
of it is); nor is it obvious that (or why) a given 12-digit number is
in fact correct.  In contrast, our eyes can make sense of a
QDateTime's reported value quite well, enabling us to see what's
different; and it's possible to at least confirm the plausibility of
2-or-3 am on a spring or autumn day at a plausible transition (or even
to confirm it exactly by consulting suitable web-sites).  Also
document the actual transition happening in each case (since I *did*
consult a suitable web-site).  So prefer to QCOMPARE(,) two QDateTime
values instead of two 12-digit qint64s.

Where a that would be unsuitable, at least compare the difference to
zero, to make the error easier to understand (except when one of the
twelve-digit numbers consists entirely of 9s; that, for once, actually
is easy to see).

Write various multiples of 3600 as the relevant intelligible whole
number times 3600, rather than premultiplying, to make it obvious to
reders what's going on.

None of this changes what is actually tested.

Change-Id: I488e751283a55d4623c93612af13ad631144900d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-25 14:09:03 +00:00
Edward Welbourne
37b0a4d2e1 Fix a loop-test and the bogus data the loop expected
A loop initialized i = 0 and used i > 2 as its condition; it didn't
get very far.  Consequently, the test it was in never checked whether
CET's 2011 transitions happened at the times expected - which they
didn't, as the times in question were in fact the times at which
Pacific/Auckland had its transitions that year.

Change-Id: I94d1f8df615c5bcfe48e73d41b4c7faf2beccb96
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-25 14:08:55 +00:00
Edward Welbourne
3ff2d70a15 Rework qAppFileName() on MS-Win to handle problems gracefully
Using a stack buffer and then a growing realloc() buffer can be tidily
packaged by using a QVLA.  Passing the reported name length to
QString::fromWCharArray() saves the need for 0-termination, even if it
has been missed.  This also degrades gracefully to produce an empty
QString when GetModuleFileName fails (returning 0).

Change-Id: If58f5ad8505f66fb67e59572af1ceb60a068f0ab
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2017-07-25 14:08:47 +00:00
Alexandru Croitor
03bb4fe6b1 Fix WebEngine build when VULKAN_SDK environment variable is present
Instead of expanding the VULKAN_SDK environment variable at Makefile
processing time, expand it at qmake time, so that a resolved include
path is passed to WebEngine's build system GN.

Task-number: QTBUG-61823
Change-Id: I63bd661350883d22af2ccdeb7c360ed0d8d881c8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-07-25 13:48:41 +00:00
Timur Pocheptsov
410148ef1e tst_QSslSocket::ephemeralServerKey - fix for OpenSSL 1.1
The original test is quite unfortunate - it has cipher names hardcoded,
and it fails with OpenSSL 1.1 - no matching cipher found for 'RC4-SHA'
and QSslContext::initSsl fails with 'Invalid or empty cipher list'.
We skip this test entry for 1.1.

Change-Id: I810b80a62d9e27a60db71fd412af0c80630d976c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-07-25 13:29:32 +00:00
Sérgio Martins
4034c3a3d2 Don't call QVariant::fromValue<T>() with T=QVariant
Could be unwrapped further but that's a different topic.

Change-Id: I8f3414374dd6f114ab368c7508f725cece74ce34
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-25 13:26:17 +00:00
Gatis Paeglis
5be8445f11 doc: minor cleanup in QPlatformWindow::setGeometry()
This patch amends a4c8129.

This is more consistent with other parts in QPlatformWindow docs.

Change-Id: I26d7a91849f3fde3ab2a0f3c81e00a5f9c830707
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-07-25 12:03:29 +00:00
Tor Arne Vestbø
185d87708b Fix tst_QAbstractItemView::task200665_itemEntered
Moving the cursor is not synchronous.

Change-Id: I6b820af026585e1fcfef845cc712fa8f6812e941
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-07-25 10:54:40 +00:00
Friedemann Kleint
4f599c5ea1 Enable IAccessible2 for MinGW
MinGW 5.3 is able to compile the IAccessible2 classes. All that is needed
is some way to provide the missing IIDs, which is done via specialization
of a function template (similar to the MinGW's __uuidof operator).

[ChangeLog][Windows][Accessibility] MinGW builds now support IAccessible2.

Change-Id: I218a4b89c81b54aa96f7c743544388631ca9a53e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-07-25 10:06:43 +00:00
Allan Sandfeld Jensen
a06148e341 Improve symmetry of variant json conversions
Make QVariant::toJsonValue do conversions as well as
QJsonValue::fromVariant.

Change-Id: I175d43677061470691e2e0104a800be355fbbd3d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-25 09:00:46 +00:00
Friedemann Kleint
1044074a49 Fix some qdoc warnings for 5.10
src/corelib/io/qfiledevice.cpp:741: warning: Can't link to 'setFileName()'
src/corelib/io/qfiledevice.cpp:772: warning: Can't link to 'setFileName()'
src/corelib/io/qfiledevice.cpp:790: warning: No such parameter 'time' in QFileDevice::setFileTime()
src/corelib/io/qfiledevice.cpp:790: warning: Undocumented parameter 'fileTime' in QFileDevice::setFileTime()
src/corelib/io/qfileinfo.cpp:1344: warning: Can't link to 'FileTime'
src/corelib/kernel/qcoreapplication.cpp:2007: warning: Can't link to 'isTranslatorInstalled()'
src/gui/opengl/qopenglextrafunctions.h:468: warning: No documentation for 'QOpenGLExtraFunctions::glBlendBarrier(void )'
src/gui/opengl/qopenglextrafunctions.h:494: warning: No documentation for 'QOpenGLExtraFunctions::glGetGraphicsResetStatus(void )'
src/gui/opengl/qopenglextrafunctions.h:475: warning: No documentation for 'QOpenGLExtraFunctions::glPopDebugGroup(void )'
src/sql/models/qsqlquerymodel.cpp:217: warning: Unknown command '\override'

Change-Id: Ide0ce911f6faf964fda8f32fac433da7d2cb11de
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-25 08:58:20 +00:00
Thiago Macieira
1c6d5b0696 QFileSystemEngine: Remove the remainder of Windows XP functions
The attempt at loading these functions at runtime with WinRT always
failed, so stop trying.

Change-Id: I658f552684924f8aa2cafffd14cfc5179ac08498
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-25 01:01:02 +00:00
Thiago Macieira
325b46ce62 QFileSystemEngine: remove dynamic finding of Windows XP functions
(one of them is even from Windows 2000)

We just need to link to userenv.dll now. WinRT is not affected.

Change-Id: I658f552684924f8aa2cafffd14cfc4b785a1d55c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-07-25 01:00:54 +00:00
Tor Arne Vestbø
593719aab5 macOS: Blacklist flakey test tst_QMenu::tearOff()
Change-Id: Id220f10f4ff756230155c7c8f37713d53ed3ca0c
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-07-24 03:49:37 +00:00
Tor Arne Vestbø
58685a48a6 macOS: Blacklist tst_QMenu::pushButtonPopulateOnAboutToShow
It's flakey/failing on macOS, the menu is opened but opened above
the button, so the intersection test fails.

Change-Id: I6b13a1b0df2b07fa36bbb73071cdeb55547ac93a
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-07-24 03:49:30 +00:00
Frank Meerkoetter
c4e8726042 Fix warning about self assign
...tst_qlineedit.cpp:1938:9: warning: explicitly assigning value of variable of type 'Qt::Key' to itself
-Wself-assign]
    key = key;
    ~~~ ^ ~~~

Change-Id: I18a46f61e13f6e2c74edce869a1c36a7f3a0fb70
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-07-23 12:18:03 +00:00
Gatis Paeglis
0cd54e3cec xcb: use default member initialization in struct
... for better localization. This is not possible in C, but in
C++ a struct has the same features as a class. Thus, use default
member initialization feature (available since C++11).

Change-Id: I91522c3a4fe4270c37bb6e85fddeb5970a847352
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-07-22 12:25:10 +00:00
Tor Arne Vestbø
f948f96e91 macOS: Blacklist tst_QComboBox::task_QTBUG_56693_itemFontFromModel
Counting draw calls in the style is not a reliable way to count
italic items in the combobox.

Task-number: QTBUG-62080
Change-Id: I6cb6d54535f073f66cfcf61bb19eb645284c835d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-07-22 06:22:26 +00:00
Tor Arne Vestbø
ab5c28ac55 Fix tst_QListWidget::QTBUG50891_ensureSelectionModelSignalConnectionsAreSet
Don't assume signals will not be emitted during show. The test should
focus on testing that changing the model results in change signals. What
happens before that is not under test, and not stable.

Change-Id: I71e62abc15fc81c069d7685e4342e795449c3632
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-07-21 22:10:28 +00:00
Thiago Macieira
b91a6ef9cd Deprecate and remove the unused bearer support in QNetworkProxy
This hasn't done anything since at least Qt 5.0. It's possible it was
only used in Symbian, which we removed before the 5.0 release. This only
served to make the tst_QNetworkProxyFactory test slow.

[ChangeLog][QtNetwork][QNetworkProxy] The functions related to
QNetworkConfiguration are deprecated. They've performed no action since
Qt 5.0, so code using them can safely stop doing so.

Change-Id: I84e45059a888497fb55ffffd14d31b7c2978a04e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2017-07-21 18:25:42 +00:00
Tor Arne Vestbø
2e3e8cec89 macOS: Blacklist tst_QMenu::layoutDirection
It's failing when enabling synchronous expose events, but likely
due to making assumptions about expose behavior. Will be looked
at in more detail once the expose event patch is in, so we can
move forward.

Task-number: QTBUG-62092
Change-Id: Ie76b5f11ccf841981a42d2eda19fbcda8b43c36c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-07-21 13:31:19 +00:00
Timo Aarnipuro
5cae29ffc7 Move toString calls after their definition
Move two functions that are using toString(const QString &str) from
qtestcase.h to qtest.h. This fixes compilation on INTEGRITY platform.

Task-number: QTBUG-61702
Change-Id: I5a433126741c7a52621616c5b98203e7d642b330
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-21 06:10:02 +00:00
Jake Petroules
8418a6335b Add a safety check to prevent apps from running on unsupported OSes
Although Qt declares its minimum supported OS version to the compiler
and linker, the OS ignores this information when loading shared
libraries, so instead of failing with a useful error message, the
program will simply crash at runtime. This attempts to bring that
failure as early in the lifecycle as possible, and provide a better
error message as well.

Change-Id: Ic58b44f8895eac718c94e62cad6e2506dbea8a7e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-21 04:58:07 +00:00
Daniel Teske
854fdaaf76 QLineEdit: Add selectionEnd() and selectionLength()
Getting the end position of the selection was not possible.

[ChangeLog][QtWidgets][QLineEdit] Added selectionEnd(), selectionLength(),
complementing selectionStart().

Change-Id: Iaecc624063d7c043f9502351f07eb76f869e86f1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-07-20 13:46:26 +00:00
Simon Hausmann
d39ec44e19 Merge "Merge remote-tracking branch 'origin/5.9' into dev" into refs/staging/dev 2017-07-20 13:46:11 +00:00
Hannah von Reth
32e0da4501 Add "<APPDIR>/data/<APPNAME>" to the non Generic paths on Windows
<APPDIR> was initially thought to be app-specific but is in fact
more used as a kind of vendor prefix, where one vendor (e.g. KDE)
can install many applications into the same APPDIR.

[ChangeLog][QtCore][QStandardPaths] On Windows, QStandardPaths
now also looks into "<APPDIR>/data/<APPNAME>" for non-generic paths.

Change-Id: I426d97d61cc229bad0f5a2a4eb061e349de6681e
Reviewed-by: David Faure <david.faure@kdab.com>
2017-07-20 09:00:11 +00:00
Friedemann Kleint
2b44fb5c62 key-value iterator: Remove constexpr from equality operators
Fixes the build with MSVC2017.
Amends ae292be869.

Task-number: QTBUG-62052
Change-Id: Ibb55e4e93815da8077961e68525e3cb8dc6807b0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-07-20 09:00:06 +00:00
Edward Welbourne
7c0b706488 Fix QMacTimeZonePrivate::previousTransition() for early after epoch
The native APIs don't support previous transition, only next after a
stipulated date.  The prior code started its search at the epoch; if
used for a time before the first transition after the epoch, this
found no transitions so returned invalid data, when the last
transition before the epoch would have been suitable.  It also wound
through all transitions since the epoch, on its way to the selected
time, which was potentially laborious.

Instead, start a year before the stipulated time; this should get a
transition if the zone uses DST.  If it doesn't, start with the first
known transition and binary-chop our way to one within a year of the
last before the stipulated time; then wind forward one transition at a
time, as before.  The chopping is actually faster than binary: each
time we find a transition after the interval mid-point but early
enough, we move the early end of our interval to the transition, which
is later than the old interval's middle.  Using halving, starting with
a vast interval, should thus only incur modest cost, while ensuring we
give up early when no transition data is available at all or the
zone's first transition ever was after the stipulated time.

Change-Id: I96c14540fc2600837e6a22e480fb8dc36cb37220
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-20 08:49:22 +00:00
Oliver Wolff
5018284e6e winrt: Enable SOCKS5 support
[ChangeLog][QtNetwork][QNetworkProxy] UWP now supports proxies using
SOCKS5.

Task-number: QTBUG-45495
Change-Id: I78cb7416b6c827eb41485f3f7682f85ff75fcbd0
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-07-20 05:45:30 +00:00
Thiago Macieira
42d2464d8f Stop setting FD_CLOEXEC on systems where O_CLOEXEC is honored
In commit 85ff351266, we removed support
for systems where the pipe2(), dup3(), and accept4() functions are
declared in the libc headers but fail at runtime. On Linux, O_CLOEXEC
was added before accept4(), so if the latter is supported, the former is
too. On the BSDs, the libc headers are updated in lockstep with the
kernel, so we know for sure.

There are still systems that have O_CLOEXEC (a POSIX.1-2008 flag) but
not the extra functions (Solaris and Darwin). Solaris libc must update
like the BSDs, but on Darwin we do build with a new SDK targeting an
old OS. Fortunately, O_CLOEXEC has been supported since 10.7, so we're
out of the woods.

Change-Id: I84e45059a888497fb55ffffd14d249dd4719e2cc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-07-20 01:17:35 +00:00
Thiago Macieira
cb9b42b493 QFileSystemEngine: a file only exists if its link count is not 0
QFileSystemMetaData::fillFromStatBuf is used when filling in the results
from both stat() as well as fstat(). Obviously the file exists if it was
stat()ed but not necessarily so by fstat(): we could be operating on a
file descriptor referring to an unlinked file or an O_TMPFILE.

Change-Id: I8d96dea9955d4c749b99fffd14cd52a8c8dd9ca1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-07-20 01:17:28 +00:00
Tor Arne Vestbø
a639a4cc07 tst_QWindow: Wait for platform to ack window states before continuing
Fixes flakiness where we enter and exit window states too fast on macOS,
while also removing 2 second waits in the positioning tests that were
slowing things down needlessly.

Change-Id: Ia4ee4d4812474c520fdd3f76b047f4eabe1a8220
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-07-19 23:06:21 +00:00
Tor Arne Vestbø
a63494ae12 macOS: Blacklist tst_MacNativeEvents::testKeyPressOnToplevel and friends
They fail when enabling synchronous expose events. Disabled for now
until we can look into why, but it's assumed to be an issue with the
test harness/how we hook into Quartz to send/observe events.

Task-number: QTBUG-62042
Change-Id: I723d049ec5d1029edb0ad3b1f47fffc829a8924b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-07-19 23:03:50 +00:00
Gatis Paeglis
f2c0fead18 widgets: remove redundant check in QMenu::popup
if (A)
 doA()
else if (B)
 doB()
if (B)
 doB()

is equal to:

if (A)
 doA()
if (B)
 doB()

when doB() is a self-contained basic operation like
QRect::setY(int ay) with { y1 = ay; } as body.

Change-Id: I3421493fe47459bd9b3d4cb5f4cfdd30ce566003
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-07-19 08:17:35 +00:00
Simon Hausmann
407302fb1b Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
	src/corelib/io/qwindowspipewriter.cpp
	src/widgets/styles/qcommonstyle.cpp

Change-Id: I0d33efdc4dc256e234abc490a18ccda72cd1d9e6
2017-07-19 09:47:29 +02:00
Martin Smith
0f30dcaea8 doc: Make qdoc comment a regular comment
This just removes a '!' from a comment that should not be
a qdoc comment.

Change-Id: I1d90e80656fdcc1c8bd6c177529bd930dcc62932
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-07-19 00:15:27 +00:00
Tor Arne Vestbø
73274860dd macOS: Improve QCocoaWindow logging a bit
Change-Id: Ic3555445b045edda884983aa01834a4ae243d6fa
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-07-18 23:40:33 +00:00
Thiago Macieira
ad3b41a06d QFile::rename: use the open file's ID, instead of using the file name
To do that, we needed to add virtual id() in QAbstractFileEngine and
override it in QFSFileEngine. It might be useful to return other types
of IDs for the other file engines, but this commit does not attempt that
just yet.

Change-Id: I1eba2b016de74620bfc8fffd14ccafe0762b3c38
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-18 15:51:35 +00:00