If this callback is not set then OpenSSL will call the callback
used for <= TLS 1.2 unconditionally when connecting. If using PSK it
will call it again later once the preshared key is needed.
We don't currently handle the TLSv1.3 PSK, but we definitely should.
But for now we can work around it - when psk_use_session_callback is
called we simply change the PSK callback to a dummy function whose only
purpose is to restore the old callback.
This is mostly done to keep behavior the same as it is now for users
(and to keep our tests running).
Later we can add a new signal and handle this new feature properly.
Task-number: QTBUG-67463
Change-Id: I4aca4ae73ec4be7c4f82a85e8864de103f35a834
Reviewed-by: Simo Fält <simo.falt@qt.io>
In this threaded setup the server can sometimes have the data before it
calls "waitForReadyRead", what happens then is that we fail the wait and
as a result the test fails overall.
Let's check if we actually got some data after all and then continue if
we did. Since both the client and the server currently wait the same
amount of time (2s) the max timeout for the client was increased by
0.5s so it has some time to notice that the server got the message.
Change-Id: Ib5915958853413047aa5a7574712585bcae28f79
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit e79b1dcdf5)
Reviewed-by: Simo Fält <simo.falt@qt.io>
We use global object to store errors found by q_X509Callback.
Thus, we also use a lock/mutex. It would appear all tests
involving in-process server and QNAM are prone to intermittent
failures on our Windows VMs - it's always about timeouts due
to the client socket (QNAM) locking and the server socket blocking
main thread while trying to acquire the same lock.
The real fix is to get rid of global variable/locking, we'll
have it later (quite a change and requires a lot of accuracy).
Task-number: QTBUG-76247
Change-Id: Iffc90d9e16783f17f62e836e01c35f22681bdd39
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 91ab70d17f)
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
If the app is finished and going to shutdown,
qNetworkConfigurationManagerPrivate() returns nullptr.
Change-Id: I01915021d8698802b3a1d0dee43203cd3d4aba74
Task-number: QTBUG-76090
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
[ChangeLog][Third-Party Code] Updated bundled SQLite to version 3.28.0
Change-Id: I3561ec3bcf80fe6062ccab27f1008dfda66e1187
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
This commit improves QAndroidInputContext's conformance to Android's
InputConnection interface and/or consistency of it's behavior with
Android's native EditText control.
* Composing region is now completely independent from cursor and
selection, as required by InputConnection documentation. Also, Qt will
now never clear composing region (i.e. call finishComposingText())
without receiving a command to do so from the keyboard. This is
important for the following reasons:
- Some keyboards misbehave if we change composing region without
receiving a command from them. Notably, Samsung Keyboard does
(QTBUG-68822).
- Due to asynchronous nature of interaction between QAndroidInputContext
and the keyboard, when user drags cursor handle quickly, the keyboard
may call setComposingRegion() to mark a word, which is no longer under
the cursor. This was causing text corruption (QTBUG-43156,
QTBUG-59958). Also SwiftKey makes such calls when user presses Enter
key (QTBUG-57819).
- For similar reasons selecting a word with a double-tap could cause
text corruption. The keyboard may call setComposingRegion() in
response to the first tap after the second tap has been processed and
the word has already been already selected.
This is achieved by keeping track of start and end of composing region
independently from the editor. Whenever possible (i.e. when there is no
selection and the cursor is inside composing region), the composing text
is represented as preedit text inside editor. And whenever that is
imposible, the editor is told to commit, but QAndroidInputContext keeps
information about composing region internally to be able to correctly
interract with the keyboard.
* deleteSurroundingText() has been re-written to work correctly when
there are selection and/or composing region. Some keyboards (e.g Ginger
Keyboard) do call deleteSurroundingText() when there is non-empty
composing region.
* All operations are now performed inside a batch edit (i.e.
QAndroidInputContext now calls beginBatchEdit() and endBatchEdit() on
itself) to ensure that an intermediate state is never reported to the
keyboard, whenever an operation requires more than one
QInputMethodEvent. BatchEditLock helper class was added to call
begin/endBatchEdit() in RAII style. m_blockUpdateSelection has been
removed because m_batchEditNestingLevel is now used instead of it.
* Selection start and end positions are now reported to the keyboard so
that start <= end. Some keyboards can not handle start > end.
* getTextBefore/AfterCursor() now exclude selected text from their
return values. While Android docs say "text before/after cursor", what
they really mean is "text before/after selection" because "the cursor
and the selection are one and the same thing". Some keyboards (e.g.
Gboard) were behaving incorrectly when selected text was being returned.
* getExtractedText() now tries to obtain and return the whole text from
the editor. This is to fix compatibility with some buggy keyboards
(e.g. Samsung Keyboard, Minuum) that ignore startOffset field and
assume that selectionStart and selectionEnd are absolute values. Then
they issue commands with wrong indexes in some cases.
Fixes: QTBUG-43156
Fixes: QTBUG-59958
Fixes: QTBUG-57819
Fixes: QTBUG-68822
Change-Id: I7e71f3bcfbb2c32248d653a4197293db03579a79
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Android's native text editing controls do not allow user to clear
selection by dragging selection handles. Qt apps should behave in the
same way.
Change-Id: I9a7c3a2aafa484eed8ff2bbd46dd48c705195291
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
If the cursor handle was dragged by only a few pixels, position of the
cursor did not actually change, but finishComposingText() was called
anyway. So the keyboard was thinking that nothing changed and a word is
still being composed, but the app was thinking that there is no preedit
string. This was resulting in invalid handling of following key presses.
This commit essentially inlines
QPlatformInputContext::setSelectionOnFocusObject() into
QAndroidInputContext::handleLocationChanged(). This allows us to call
finishComposingText() and to send a QInputMethodEvent only when position
of the cursur actually changes. This also allows us to add a
QInputMethodEvent::Cursor attribute into the event for consistency with
QAndroidInputContext::longPress().
Change-Id: I2fc82f138f717991f34024cdf521236845dc0adf
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
As per GLX_EXT_swap_control, the GLX swap interval is specified on a
per-drawable basis. However, QGLXContext only tracks it per-context
using the m_swapInterval member. If a new drawable is made current to a
context, it is still necessary to call glXSwapIntervalEXT to change the
swap interval, even if it has been previously called for the same
context with a different drawable. However, currently,
QGLXContext::makeCurrent doesn't do this if its m_swapInterval field
matches the new swap interval. This change removes m_swapInterval from
QGLXContext, instead tracking it in QXcbWindow. This still avoids
unnecessary calls to glXSwapIntervalEXT, while ensuring the swap
interval is always set for new window drawables.
Change-Id: Idc34101476c6af618059f6f3d8925dee743994a3
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The code for generating round line joins is optimized with a shortcut
for the inner, normally invisible joins. For certain joins of a
tightly turning bezier, this optimization would lead to visible
painting error. Fix by avoiding the optimization if the next control
point is so close as to allow such tight turns.
As a driveby, make the angle > 90 test cheaper, since absolute
precision is not required in the optimization choice.
Fixes: QTBUG-75008
Change-Id: I293e0776003310dc36fa7f43fbcd9c25f1f8fa5d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
More aggressively skip processing empty spans.
Tested with the qpainter benchmark on armv7; yields
small but measurable improvement.
Change-Id: Ie0ed0f824a0be7bcc2de3a9aa98ebccb0e8accae
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
@3x is in use on iOS already, so extend the handling in QImageReader
to all single-digit factors, like QIcon does.
Fixes: QTBUG-76273
Change-Id: Ic9442731c0549dbe8f797e1ddb1a09d8447e8441
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Fix test for systems that do not resolve their hostname to localhost.
Not using name resolution also makes the test more robust.
Change-Id: I558b9a975b9021536709db87fbf6a3b314f7ca79
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Set name for pthread instead of "name too long" for easier tracking.
Change-Id: Iab22cbeac01277e4dc1325399c7892de2e5bd551
Reviewed-by: Timo Aarnipuro <timo.aarnipuro@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In order to be able to link against the created ANGLE libraries, MinGW
needs decorated symbol names inside the .def files.
Task-number: QTBUG-76087
Change-Id: I090dbfb8fd468e2ea18de3785e2b694294f4b63a
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
The regular expression with the alternative is not portable.
Use a separate QMAKE_PRL_INSTALL_REPLACE item.
This amends commit f00de33.
(cherry picked from commit 015d7f16cb)
Fixes: QTBUG-75950
Change-Id: I78e172053f8b05be7d595a1c9e1695ea658b0547
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
In the case of building a Qt module repository against an installed
qtbase the .prl files contain absolute paths to Qt dependencies e.g.
'/install-prefix/lib/libQt5Core.so'.
Those must be replaced with $$[QT_INSTALL_PREFIX]. The .prl
replacement code however only takes $$MODULE_BASE_OUTDIR/lib into
account.
(cherry picked from commit f00de3322e)
Fixes: QTBUG-75804
Change-Id: Ibf0f90a860d5089f416f903c1d18483d3dcc2ee6
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
f1033567aa improved resize of windows with custom titlebar by adding
more margin, but the check was too tight.
d2d6c6f781 tried to fix the regression, but not totally
The mode is only set *after* the mouse press. It will always
be NoWhere the first time, so that check will always discard
the mouse press, making moving the window always fail the first time.
Also, if the rect+range contains the press, then surely the mode
won't be nowhere once set.
There's still room for optimization, like bailing out early it was
the right button instead of the left button, but that's out of scope
for this bug fix, and also not worth for 5.12 branch.
To reproduce the bug, simply:
- Run examples/widgets/mainwindows/mainwindow
- Click the red button of the blue dock widget, to make it float
- Drag the title bar (not too slow).
Fixes: QTBUG-66454
Change-Id: I0eebfb932dab95267ebadccd757de11a8bfe419d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Nathan Collins <nathan.collins@kdab.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
The value of NColorRoles got changed since 5.11. It introduced one more
role called "PlaceholderText" in the ColorRole enumeration.
When using QDataStream (5.12) to read QPalette objects from a file
written by 5.9 (<5.11), the processing results are inconsistent.
Fixes: QTBUG-74885
Change-Id: I14d57f9603a26e5890b4fd57c7e464c5b38eb3f2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The qmake code to read output from dependency-generation was adding
QByteArray values to a QString, thereby tacitly converting from UTF-8;
this is misguided. Hopefully, the command emits its output in the same
local 8-bit encoding that QString knows to convert from.
Simplified needlessly verbose loops (that violated Qt coding style) in
the process.
Fixes: QTBUG-75904
Change-Id: I27cf81ffcb63ebc999b8e4fc57abdb9a68c4d2b3
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
The state of the module is done, not deprecated, so we shouldn't
recommend users to move away from it in all cases. There's also
no direct replacement for the DOM API.
Fixes: QTBUG-70629
Change-Id: Ifaff9757234bd68a411a3da1403c57bbbcb94693
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
It seems like an optimization on the itemsDirty flag
caused a bug to be re-introduced. When a popup is shown
on a new screen, the itemsDirty must however be set to
ensure that new correct sizes are calculated.
Task-number: QTBUG-59794
Change-Id: Ifb5c233b1f9d4d38bd0cd7a9a71cc32ad3212f8c
Reviewed-by: Morten Kristensen <msk@nullpointer.dk>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
QMetaEnum fromType() also works for enums declared with Q_{ENUM,FLAG}_NS.
This hadn't been added to the message when we added Q_{ENUM,FLAG}_NS.
Fixes: QTBUG-75829
Change-Id: Ib71dae83dd8d837adf46b73cd299b8e61bdb1f64
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When trying to find the screen, the function would always
try to determine the screen by checking parents, despite
QWindowPrivate::positionAutomatic being false.
Determine the screen from the initial geometry when
QWindowPrivate::positionAutomatic is false. Bail out when
positionAutomatic and resizeAutomatic are false.
Fixes: QTBUG-75940
Change-Id: I3cd1b16feab16c89d29856cf3e1bccf2c89280c7
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
The test is failing in 5.13 for unknown reasons.
Task-number: QTBUG-72296
Task-number: QTBUG-72344
Change-Id: I24c1ad1b6def3096de99caeeebeee6e204cc75ca
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Without this some readers will fail to display the image or position
the image at the start of a paragraph rather than inline.
Change-Id: I2b9257e3193e5e68eb20112017a0c23be1d06cb0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
If an embedded image is already encodeded as an png or jpg write the
data as is instead of decoding to a QImage and re-encoding as a new
image.
Change-Id: I479ae1fddbf59900a500497dd1bdf7449c21f273
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Replace QWindow / QScreen / QPlatformScreen overloads with template
functions that take a generic context argument.
The API now no longer supports implicit conversions from
QPointer<QWindow> to QWindow *, add explicit data()
call to usage in qxcbdrag.cpp.
Change-Id: I63d7f16f6356873280df58f4e7c924bf0b0eca5b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Fix the condition introduced by that determines whether
a completion is started on signal QFileSystemModel::directoryLoaded()
(introduced by 416ec00e7c859a844a5bcb24c7a31147aed974c / Qt 4).
Observe case sensitivity and the native separator and return true for
root directories.
Task-number: QTBUG-38014
Task-number: QTBUG-14292
Change-Id: Ie425c04d2df256248e84250ba777793a8106a738
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
getTextBeforeCursor() and getTextAfterCursor() were not properly
handling the case when the cursor is in the middle of preedit string
(just as TODO comments inside these functions were saying). This was
causing problems with Gboard when the user focuses a text editor by
tapping in the middle of a word.
Fixes: QTBUG-58063
Change-Id: I4a580a74d79965816557bfb342337975348d1c45
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
According to Android docs start == end in a call to setComposingRegion()
means finish composing. But this case was not being handled properly:
m_composingText was being assigned an empty string, but
m_composingTextStart was being assigned the value of start, which is
never -1.
There is one other possible cause of "Input method out of sync"
warnings, but it is tightly coupled with another bug, so it will be
fixed by a separate commit.
Change-Id: Ie475df84f330453ce4fc623e8b631b435d7d0042
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Send the aboutToShow() signal to QMenu before synchronising the
widgets for the menu items. This fixes a bug where if new
QWidgetActions are added to the menu from a slot triggered by the menu's
aboutToShow() signal, then such new actions do not shows up correctly on
Mac. Other platforms are not affected by the change.
Fixes: QTBUG-75826
Change-Id: Ic245d3fbc7ddde6944cca6cdb8e8951380c846ec
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Change-Id: I6c1d83624838362f6a3daa6c2b309fb518a25d4b
Fixes: QTBUG-75673
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
This allows closing, minimizing and maximizing the window.
Fixes: QTBUG-74999
Change-Id: I8b3ad806a1767586c8cf7e5a1848fc0e525621cd
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
If the native color dialog is in use we haven't created any of the
widgets and will crash when trying to update them.
Change-Id: I6c43cc47359110c3b9db7cacb62581446cc6f7a3
Fixes: QTBUG-75858
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Qt on macOS has traditionally not included a BOM in the UTF-16 data,
but due to iOS requiring it it was changed in 4e196159. This had the
unfortunate side effect of breaking macOS applications that were not
prepared for the BOM, even if the public.utf16-plain-text UTI can have
an optional BOM, most notably Microsoft Excel. It also resulted in the
public.utf8-plain-text having a BOM, as that's automatically generated
by macOS based on the UTF-16 content we give it. Having a BOM in UTF-8
is technically fine, but not required, and recommended against.
The fact that iOS requires a BOM is a bit dubious, and most likely a
result of applications or system frameworks decoding the data using
NSUTF16StringEncoding, which assumes big-ending byte ordering if there
is no BOM, as opposed to public.utf16-plain-text which assumes native
byte ordering. Since we can't fix iOS our best bet is to include a BOM.
For macOS though, we revert back to the old behavior of not including
a BOM, since that seems to surprise macOS frameworks and applications
the least, even if having a BOM in public.utf16-plain-text should be
fully supported.
Longer term we should look at what kind of UTIs we generate. Most apps
on macOS do not generate public.utf16-plain-text, but instead generate
public.utf16-external-plain-text, which differs from the former in that
it assumes big-endian byte-ordering when there's no BOM. On iOS apps
seem to generate public.utf8-plain-text, and do not generate any UTF-16
UTIs. Moving Qt over to these UTIs would fix the problem as well, but
is a larger change that needs more research.
Change-Id: I4769c8b7d09daef7e3012e99cacc3237f7b0fc1a
Fixes: QTBUG-61562
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The window tends to grow to span screens in multi-screen setups; force it to
be on the primary screen by showing it maximized in that case.
Change-Id: I984ba7a4cd4abd1f862c59c8dca0e2275f44c724
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
- Use nullptr
- Use range-based for
- Use correct static invocation
- Set a title on shown windows to make it possible to identify
slow tests
- Fix the class declarations, use override, member initializations
- Use Qt 5 connection syntax where possible
- Ensure top level widget list is empty after each test, delete left-over
menu bars and disable menu animations
Change-Id: Ieeb943ea669cd139f1835088b816802e777a9676
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Introduce origin(QWindow *), which returns the point
around which coordinates should be scaled: the screen
origin for top-level windows, and (0, 0) for child windows.
The code paths for top-level and child windows can
then be combined.
Change-Id: I6b9cdbd9e7c2d9406e9137e325c4eb5c79e3ac9a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
When the left or right mouse buttons are pressed over the window title
bar a WM_NCLBUTTONDOWN/WM_NCRBUTTONDOWN message is received. But when the
button is released, no corresponding UP message is received, but only
a WM_NCMOUSEMOVE or WM_MOUSEMOVE. This makes the internal mouse button
state stored in QGuiApplication get out of sync with the actual state,
resulting in an incorrect button state being used in QWheelEvent.
This patch detects the button release condition and generates the missing
release event.
Change-Id: I6dd9f8580bd6ba772522574f9a08298e49c43e61
Fixes: QTBUG-75678
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
When bringing an application back to foreground, args may contain NULL.
These nullptrs should not cause application crashes.
Fixes: QTBUG-75843
Change-Id: I642e3c359216e7706bcb13508399999a51a4fc2d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>