Commits aba336c2b4 (in Qt 5.2) and
aba336c2b4 (in 5.6) both tried to deal
with this problem, with different levels of success. This is the third
attempt (and hopefully the charm).
Instead of modifying the path that the user provides, go straight ahead
and declare it invalid. This is supported by RFC 3986, which declares
this expansion impossible:
relative-part = "//" authority path-abempty
/ path-absolute
/ path-noscheme
/ path-empty
path-abempty = *( "/" segment )
path-absolute = "/" [ segment-nz *( "/" segment ) ]
path-noscheme = segment-nz-nc *( "/" segment )
The "path-abempty" and "path-noscheme" cases are the two issues we
already handle. This commit adds the third one: path-absolute, which
requires that the first segment of the path be of non-zero length.
That is, it is now possible again to have http://example.com//path
constructed piece-wise, without it producing http://example.com/path.
Additionally, it catches the case of http://example.com//path parsed
from full URL then followed by setAuthority("").
Change-Id: I69f37f9304f24709a823fffd14e67a5e7212ddcd
Reviewed-by: David Faure <david.faure@kdab.com>
We don't support Windows versions prior to 7 nor Windows CE anymore.
Change-Id: I638cf58bfa7b4e5fb386fffd14ea930155d67689
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The test tst_QXmlSimpleReader::inputFromSocket() is failing with
"QTestLib: This test case check ("(((server->listening)))") failed
because the requested timeout (5000 ms) was too short, 11700 ms would
have been sufficient this time".
Increased the timeout, since it's better to wait than to fail.
Task-number: QTBUG-63539
Change-Id: I804549648ea834e41d3c87871f5bab90f209385c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When many runnables are executed, this improves the
performance by not resizing the queue for each runnable,
which was the case in the previous version, because of
many calls to QVector::takeFirst().
Also add a test that makes sure tryTake() is safe to
call and does not leave the queue in a bad state that
tries to use nullptr entries.
Change-Id: I608134ecfa9cfc03db4878dcbd6f9c1107e13e90
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We can't qWaitForWindowExposed on native menu bars. Other test
functions in this file are already disabling the native manu bar.
Task-number: QTBUG-24326
Change-Id: Iecf907ca84589159417d0d942c911485a41af164
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
The original test was using QSslSocket::waitForEncrypted function, which
is apparently a bad idea on Windows: connecting to 'www.qt.io' we have
to verify certs and there is no guarantee a given Windows VM has the required
CA certificate ready in its cert store. In such cases we start a background
thread (aka CA fetcher's thread) and it calls a (potentially blocking for
a significant amount of time) function (CryptoAPI). When finished, this
thread reports the results via queued connection, which does not work
if we are sitting in a tiny-loop inside waitForEncrypted. Re-factor
the test to use signals/slots and a normally running event loop.
Also, the last test makes a wrong assumption about Windows - fixed.
Task-number: QTBUG-63481
Change-Id: I4abe9cda2a6c52d841ac858cccb6bf068e550cb8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
When the query is forward-only then nextIndex() is always 0, therefore
the cache values need to be cleared beforehand so that they are not
reused when the next row is retrieved.
Task-number: QTBUG-57765
Change-Id: I49e8427b24ec2d932e5b387699ac7f3496e9a48c
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This is enabled by default with Xcode 9 and would therefore be seen by
anyone calling this function from C or Objective-C.
Task-number: QTBUG-63450
Change-Id: Iecd67017b6774c9f2fce2433002ff852058dd3ed
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
For HTTP/1 it's done when no data expected and response headers received -
protocol handler emits channel->allDone which handles the status code and
sets (if needed) a redirectUrl. HTTP/2 protocol handler cannot emit allDone
(it has many requests multiplexed and actually cannot say allDone yet).
So we set a redirect url if we have the corresponding status code and
found 'location' header.
Task-number: QTBUG-63471
Change-Id: Ibd3438ef918c245a46b8c0128910a89b9a418448
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
When Cmd+W is used to close a window, check if m_platformWindow is still valid
before accessing window property.
Task-number: QTBUG-63389
Change-Id: I9abda19b8482e7a1fd07b07d8981b6a768e96c2e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
QWindowContainer assumed that a widget could never change from
native to non-native. This is not a fact when the window container
is reparented to toplevel and back. In this case, usesNativeWidgets
would be stuck at true, and parentWasChanged() would go down the
native widget path, triggering an assert.
The solution is to always recalculate the usesNativeWidgets bool.
Task-number: QTBUG-63168
Change-Id: I88178259878ace9eb5de2ee45ff5e69b170da71c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Swapping from RHEL 7.2 to 7.4 produces new autotest failures.
Task-number: QTBUG-63433
Change-Id: I3e59aa73b5874cfec06e166f521e06b0c7829743
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Apparently it's all meant to be in alphabetic order by feature name
(except for where it isn't). So move my new addition to it to where
that would put it, re-order everything else to follow that rule and
add a comment documenting it.
Change-Id: I6f00d3d18fc8c492992e9f701520f3e8731739b5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This definition causes a build error if concrt.h is included.
According to Microsoft [1], this macro is unsupported. It was added in
f5908363 to silence compiler warnings that are generated when exceptions
are turned off and certain STL headers are included.
We specifically disable the warnings in question now.
[1] https://blogs.msdn.microsoft.com/vcblog/2015/07/14/stl-fixes-in-vs-2015-part-2/
Task-number: QTBUG-63409
Change-Id: I567d5d46292fbd7898394e217bb0987fbcdca9de
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In case connectToHostByName() returns 'true', we should fetch the
connection parameters and emit connected() signal.
Change-Id: Id36b6d71005b8cec070a1b12e7bb0caf8bf0bcb9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
glXGetVisualFromFBConfig according to documentation can return NULL [1].
This may result in a crash when running Qt applications using ARGB windows
with XLIB_SKIP_ARGB_VISUALS defined.
Also guard QXlibScopedPointerDeleter against illegally calling XFree(nullptr).
[1] https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glXGetVisualFromFBConfig.xml
Task-number: QTBUG-58910
Change-Id: Ie076a1e906ed632543bdab03ef365f699533a61a
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
_a[1] was reinterpret_casted twice in a row, which triggers
clang's warning undefined-reinterpret-cast:
"dereference of type '_t *' (aka ...) that was reinterpret_cast
from type 'void **' has undefined behavior "
only the last reinterpret_cast is kept
Change-Id: I71d52c5ff08c674003aec29f8a907c90905c0d4c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
By the time we call setKeyboardMode(true), the menu may
already have taken focus. This change sets keyboardFocusWidget
before opening the popup, and makes sure that keyboardFocusWidget
is not set to the popup. (We cannot remove the assignment from
setKeyboardMode(), since it's called from several places.)
[ChangeLog][QtWidgets] Fixed widget losing focus after showing
menu second time.
Task-number: QTBUG-56860
Change-Id: Ic01726bf694e6f365dd7b601ad555156e0fdf6c5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
When dragging a window by its border, detect the screen by mouse position
to prevent it from oscillating between screens when it resizes.
Task-number: QTBUG-62971
Change-Id: I0a4a584ef8ff3bb7288d1abec4de51fb4091dccd
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
QMAKESPEC is added in makefile generator,
it is not in INCLUDEPATH.
Change-Id: I2451b3c7b30bc237157e68e5ce9de67f55e784b2
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
It was being mis-described in some places by a QT_CONFIG(timezone)
test, replacing older QT_BOOTSTRAPPED checks; but it has no time-zone
dependency (until 5.10). So make it a separate feature in its own
right.
It turns out QAbstractSpinBox's presumed dependency on datetimeedit
was an illusion caused by use of QDATETIMEEDIT_*_MIN symbols actually
provided by datetimeparser; so remove its bogus dependency.
Change-Id: Ibc12f4a9ee35acb64a39a1c7a15d2934b5710dc0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
qt_metacast is not const so there is no need to use const_cast.
This fixes a warning in generated code.
Task-number: QTBUG-63352
Change-Id: I0c37442ac268a654316bc0e7e04f77fb51cae019
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The leap second record sizes were not properly taken into account. The
comments in the code were right, but not the code itself. Fortunately,
on most Linux systems the leap seconds are not stored in the tzfiles, so
we never ran into a parsing issue.
Task-number: QTBUG-63205
Change-Id: I6e1fe42ae4b742a7b811fffd14e4a57f5d142f97
Reviewed-by: Maximilian Baumgartner
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We should only copy the minimum bytes-per-line when saving an image.
Task-number: QTBUG-30515
Change-Id: Idd34a389cf88210c3f127599ccf54d27d3ec9a06
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Due to the complex event forwarding logic between QCompleter,
QComboBox, QLineEdit and QWidgetLineControl, in some cases the
same single user return key press could result in duplicated
activated() signals being emitted by QComboBox. The first one
would be emitted because QLineEdit emitted editingFinished()
as a result of QCompleter::eventFilter() having forwarded the
return key press event to QComboBox. The second one, would
happen right after, as QCompleter::eventFilter() would process
the same event on behalf of its popup.
(We recall that QCompleter is installed as its own popup event
filter. That's also the case for the completer's widget, although
the purpose there is limited to focus-out events).
The current fix consists on skipping the emit as a result of
QLineEdit::editingFinished() if the completer's popup is still
active. For this to be accurate, it helps to test whether the
completer's popup is visible, so we will not be hiding it in
QWidgetLineControl::processKeyEvent() anymore. Indeed, we know
that if the popup is visible, that means that processKeyEvent()
was called after being forwarded by the completer's popup event
filter. Furthermore, the popup will be hidden by its event filter
shortly after it returns from said event forwarding call.
Based on a patch by Alexey Chernov <4ernov@gmail.com>.
Task-number: QTBUG-51858
Task-number: QTBUG-51889
Change-Id: I013f6c3000ae37b5b0ec20eaf5cf7746c9c903e3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
QCompleter::popup() is used to lazily create the popup itself.
However, we oftentimes call this function only to check if the
popup is visible.
Change-Id: I55531e1e6810c02a44f5f65124cf641b1a89de69
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
We end up calling setUpLayout() quite a few times and, in
particular, every time we add a new tab. Even if the tab
widget is hidden, we set the layout item margins to ensure
that whatever layout will contain the tab widget can get
the proper sizing.
For all practical purposes, layout item margins don't depend
on the contents itself, but are rather a simple constant
returned by the style. This means that QStyleOptionTabWidgetFrame
::tabBarSize, among a few other properties, is not needed
right away. This property in particular is quite expensive
to compute because it requires measuring the text size of each
tab. This can lead to a quadratic behavior: the size of each
tab's text will be computed for each tab we add. Besides, text
size computing has become a relatively expensive function in
itself (see QTBUG-53151, for example).
The current solution just uses a partially initialized style
option object for the sole purpose of getting the tab widget's
layout item margins from the style. The performance improvements
detailed show the creation time for QTabWidget with the specified
amount of tabs (times in ms):
Tabs Before After
-------------------
1 6 5
5 6 6
10 8 6
50 57 17
100 178 21
200 673 33
Task-number: QTBUG-55126
Change-Id: I79505dbd0014f6ed185da28047d8b68f9462ba94
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
MariaDB allows only a single call to mysql_library_end(), all subsequent calls
to mysql_library_init() or any other API call will fail. Since QMYSQLDriver
calls mysql_library_end() function whenever the refcount drops to 0, this
breaks applications that close and reopen database connections.
This change registers call to mysql_library_init() via qAddPostRoutine()
when compiled against MariaDB, so that we only call it once.
Task-number: QTBUG-63108
Change-Id: I22c1f0c5b081216f12596a32748dca25cae919e9
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
It's included unconditionally from qxcbconnection.cpp and qxcbscreen.h.
Task-number: QTBUG-53537
Change-Id: I6e1fe42ae4b742a7b811fffd14e5d374155660f3
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
When QT_SCALE_FACTOR=1.5 or other decimal, QWidget
draw QGraphicsEffect in error size. Use QPaintDevice::devicePixelRatioF
instead QPaintDevice::devicePixelRatio() will fix it.
Change-Id: I423e224d73b948ecdeca0e6b24c51f12a724a0ba
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Commit 12c5264d9a fixed the calculation of
SHA-3 in QCryptographicHash: we were previously calculating Keccak.
Unfortunately, turns out that replacing the algorithm wasn't the best
idea: there are people who need to compare with the result obtained from
a previous version of Qt and stored somewhere. This commit restores the
enum values 7 through 10 to mean Keccak and moves SHA-3 to 12 through
15. The "Sha3_nnn" enums will switch between the two according to the
QT_SHA3_KECCAK_COMPAT macro.
[ChangeLog][Important Behavior Changes] This version of Qt restores
compatibility with pre-5.9.0 calculation of QCryptographicHash
algorithms that were labelled "Sha3_nnn": that is, applications compiled
with old versions of Qt will continue using the Keccak algorithm.
Applications recompiled with this version will use SHA-3, unless
QT_SHA3_KECCAK_COMPAT is #define'd prior to #include
<QCryptographicHash>.
[ChangeLog][Binary Compatibility Note] This version of Qt changes the
values assigned to enumerations QCryptographicHash::Sha3_nnn.
Applications compiled with this version and using those enumerations
will not work with Qt 5.9.0 and 5.9.1, unless QT_SHA3_KECCAK_COMPAT is
defined.
Task-number: QTBUG-62025
Discussed-at: http://lists.qt-project.org/pipermail/development/2017-September/030818.html
Change-Id: I6e1fe42ae4b742a7b811fffd14e418fc04f096c3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Nowadays, there is no need for this additional timer. It was intended to
forcibly disconnect the socket if an appropriate write notification has
not arrived. After several fixes in the notification system this does
not occur anymore, because otherwise we might have seen the hangs in the
regular data transmitting.
Also, it can break a delaying disconnect of the socket, if a write chunk
is large enough.
Task-number: QTBUG-63000
Change-Id: I9b9fd46af0209f9ce006a6d5ee5bfac9ea85482d
Reviewed-by: Anthony Groyer <anthony.groyer@airliquide.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The comment was back-to-front on the meaning it needed to address; and
the #if-ery used a deprecated define, now changed to match what
sanity-bot asked for.
Change-Id: I0a971ab2e405e5908066da86964d67c8b852f114
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This autotest is blacklisted as it is deemed flaky.
Task-number: QTBUG-63262
Change-Id: I216985e81d1c1cb3528fd8a005be48cad2a31ab7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
When focus is put back onto an itemview and the current item is editable
then the WA_InputMethodEnabled attribute should be set. Likewise this
should be set/unset when the current index changes too, depending on
whether the index is editable or not.
Change-Id: Iaea075e669efd21bdaa89a49c500c449272d098b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Log only relevant input events which are ignored. This reduces the
output when COIN re-runs failing item view tests with full debug
output enabled.
Change-Id: Ifce9a56fdf313b7572baff9de8fb298b38e8b33a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>