The value of start for a QInputMethodEvent::Cursor attribute must be
specified relative to the start of preedit string, but longPress() was
specifying it relative to start of surrounding text. This was causing
QQuickTextInput to return wrong values of cursor and anchor rectangles.
And this was causing invalid positioning of cursor selection handles
after a long press.
Change-Id: Ief67e86dd90b09ebf2ba191a2b0311ff803afdd9
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
If an application enables FP exceptions our FP-based unpremul will
raise the INVALID exception. Since disabling them locally might be slow
just take a slow path when detected.
Fixes: QTBUG-75592
Change-Id: Ie22a032a4f62229f68ad21ede359c62291adc9bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This was disabled in 9f22ac0aa0 under the
assumption that the windowDidResize callback was sufficient, but in the
situation when macOS native tabs are enabled, AppKit will report the
wrong geometry for the first windowDidResize callback when a new tab
is created.
We could potentially remove the geometry change in windowDidResize,
as the viewDidChangeFrame callback should be enough for content
views, but this is something that needs more investigation.
Change-Id: I85045507da1a01b4a906e6f88301f3321c660943
Fixes: QTBUG-75482
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The bounding rect was computed based on the font metrics HarfBuzz gave
us, but those may not be 1:1 with what CoreText ends up using. When that
happens, drawInRect: will line-break the last word, which makes it fall
completely outside of the single line bounding rect. This is not a good
failure mode, so we prefer to draw the text at a point instead, allowing
the resulting text to draw slightly outside of the bounding rect. This
is preferable to adding a random padding to the width and hoping it will
be enough to solve the problem.
Change-Id: Ifa58a33bd9fad689ed4ee947327b7079f3c1b61d
Fixes: QTBUG-74565
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
[ChangeLog][QtCore][Global] Added the QT_NO_FLOAT16_OPERATORS macro in
order to work around a Microsoft <= VS2017 compiler bug that is
exposed when using std::bitset along with any Qt header that includes
<qfloat16.h>.
This is fixed in MSVC 2019[1], but the workaround is needed for
earlier versions.
In this case, cl.exe fails with
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(270): error C2666: 'operator /': 10 overloads have similar conversions
C:\Qt\5.12.0\msvc2017_64\include\QtCore/qsize.h(364): note: could be 'const QSizeF operator /(const QSizeF &,qreal)'
C:\Qt\5.12.0\msvc2017_64\include\QtCore/qsize.h(194): note: or 'const QSize operator /(const QSize &,qreal)'
c:\qt\5.12.0\msvc2017_64\include\qtcore\qmargins.h(427): note: or 'QMarginsF operator /(const QMarginsF &,qreal)'
c:\qt\5.12.0\msvc2017_64\include\qtcore\qmargins.h(213): note: or 'QMargins operator /(const QMargins &,qreal)'
c:\qt\5.12.0\msvc2017_64\include\qtcore\qmargins.h(207): note: or 'QMargins operator /(const QMargins &,int)'
C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(205): note: or 'double operator /(int,qfloat16) noexcept'
C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(205): note: or 'double operator /(qfloat16,int) noexcept'
C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(195): note: or 'float operator /(float,qfloat16) noexcept'
C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(195): note: or 'float operator /(qfloat16,float) noexcept'
C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(194): note: or 'double operator /(double,qfloat16) noexcept'
C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(194): note: or 'double operator /(qfloat16,double) noexcept'
C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(193): note: or 'long double operator /(long double,qfloat16) noexcept'
C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(193): note: or 'long double operator /(qfloat16,long double) noexcept'
C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(176): note: or 'qfloat16 operator /(qfloat16,qfloat16) noexcept'
C:\Qt\5.12.0\msvc2017_64\include\QtCore/qpoint.h(402): note: or 'const QPointF operator /(const QPointF &,qreal)'
C:\Qt\5.12.0\msvc2017_64\include\QtCore/qpoint.h(206): note: or 'const QPoint operator /(const QPoint &,qreal)'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(270): note: or 'built-in C++ operator/(::size_t, )'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(270): note: while trying to match the argument list '(::size_t, )'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(266): note: while compiling class template member function 'std::bitset<8> &std::bitset<8>::set(::size_t,bool)'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(39): note: see reference to function template instantiation 'std::bitset<8> &std::bitset<8>::set(::size_t,bool)' being compiled
..\Qt5.12.0-C2666\main.cpp(7): note: see reference to class template instantiation 'std::bitset<8>' being compiled
Invoke this workaround by defining the macro QT_NO_FLOAT16_OPERATORS
in user code prior to the inclusion of Qt includes in a translation
unit.
Arithmetic operators from qfloat16 will then not be present in that
compilation unit.
[1] https://developercommunity.visualstudio.com/content/problem/406329/compiler-error-c2666-when-using-stdbitset-and-cust.html
Task-number: QTBUG-72073
Change-Id: I58f8400bf933ad781d4213731695e20e0c482166
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
It's not part of the QBackingStore API, but clients such as the Qt Quick
software renderer access it through the platform backingstore, to grab
the window.
Change-Id: I203484ce13a5f8fb6815d27ab07f874fa9d16b8c
Fixes: QTBUG-75467
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
CMAKE_QT_STEM already contains the _debug suffix.
Do not add it again.
This amends commit bb8a3dfc.
Fixes: QTBUG-75520
Change-Id: I6c311f0913ea83fcf299a21a0ee1f28c3861371f
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Include screen and MINMAXINFO values in the message about not being able to
set the geometry.
Suppress output of some window finding functions unless verbose.
Change-Id: Iaaae59ecb302438b3444735067d018c77d2af162
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This backports the following upstream fix from angle:
63cc351fba
Change-Id: Id80dba62c69f3505eb836f758367b4bf054b1fd5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
As seen in several occasions, both in user code and in Qt proper,
people make these mistakes. What makes it harder to spot is that it doesn't
look like a typo, and feels natural (natural as Q_OS_LINUX instead of Q_OS_LIN feels).
There's been a P1 in qtdeclarative/ and currently there's a Q_OS_WINDOWS usage
in qtwebengine.
This is a recurring problem, no matter how much people test and review
these errors will happen, so the alias is justified.
Change-Id: If6943b52e17f0c8b238c36bb1f7834802123f12a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If the deadline is far in the future, the conversions to nanoseconds
or internal arithmetic may overflow and give an invalid object, thus
the deadline may end up in the past. Added a test to the testlib
selftest for sleep.
[ChangeLog][QtCore][QDeadlineTimer] Fixed integer overflows
leading to immediate timeouts.
Task-number: QTBUG-69750
Change-Id: I9814eccdf9f9b3add9ca66ec3e27e10cd5ad54a8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Make sure "this" still exists when we're done sending the
readNotification.
The crash manifested itself when connecting to certain websites as they
would reply with status 403, then close the connection. On our end we
would then handle this "remote host closed" followed by handling the
data we received. The http code handles the data successfully and sees
we are done and there is nothing more to do, so it closes the
connection. Which leads to closing QAbstractSocket, which closes
native socket again and then deletes it.
Fixes: QTBUG-75620
Change-Id: I233c67f359aa8234f1a2c4ea9463108b08c9165f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Add it to the name lookup and add verbose formatting
to the debug operator.
Task-number: QTBUG-73014
Change-Id: I31ee31bc28ef563fdbc0adedcea03546ced5faad
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
The bezier shifting algorithm compared coordinates exactly, and so
could end up in an endless loop when values were at the edge of the
number resolution. Fix by using fuzzy comparison instead.
Fixes: QTBUG-75522
Change-Id: I61346edbd87389f66965a906ac337fc1f5300e5c
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
We can't rely on the previous screen and current screen to accurately
reflect whether or not the window has been moved from one screen to
another, or if the window just stayed on the same screen but the screen
was reconfigured by macOS. The reasons for this are many-fold, but
include factors such as Qt using the screen of the top level window
to resolve the screen of the child windows, and AppKit delivering
screen change events in an order that makes things harder to track.
The result is that we need to always send screen change events, for
all windows, including child windows, and we also need to restart the
display link by re-requesting an update request if needed, so that
child windows that are running animations will continue to animate
on the new screen.
Change-Id: I0b87849c41323e92c08f5115842be067fa8f8490
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Calling super will push the default arrow cursor, so we should only
do that if our own cursor has been unset.
Change-Id: I71d8934e7eab2b15e150730e2282e7063ada305a
Fixes: QTBUG-75552
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Setting transparency (WS_EX_LAYERED) causes a WM_PAINT to be sent to
the invisible windows, which causes a resize to the default size
(640x480) to be sent from QGuiApplicationPrivate::processExposeEvent().
Suppress these messages.
Fixes: QTBUG-75455
Change-Id: Idc540aa7f9bf0047e78ec7c27db260940483f7c4
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Fixes: QTBUG-75612
Change-Id: I0e90a84697c1eb055c4150f2519829977fce7244
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
window.contentView can be of any NSView subclass.
Get to the QCocoaWindow via QCocoaNSWindow instead.
Change-Id: I8c761fd22e6078b075d8dd035ad767b9e4cb6da2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
QWidgetTextControl and consequently QTextEdit did not emit
cursorPositionChanged() signal when cursor position was changed by a
QInputMethodEvent with a QInputMethodEvent::Selection attribute.
This is especially important on Android because QAndroidInputContext
uses such events extensively to move the cursor and also relies on
cursorPositionChanged() signal being emitted by the focus object. If the
signal is not emitted, QAndroidInputContext does not notify the virtual
keyboard about cursor position change which results in various glitches.
Change-Id: I7edd141258c483e6f103adcd6e40049b49c13387
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Change-Id: Id95c096700a8bfa733d8620064c2a37eb19cc3db
Fixes: QTBUG-72741
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Note that the test is still disabled, but this is needed in any case.
Change-Id: Ib7523ba800b94c32690c1bd09b23fc2078c71d4e
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
We have been rather sloppy in how read-only versus editable is handled.
According to the definition, editable signifies that in principle a
widget allows the user to change its text. Read-only means that this
ability is (currently) disabled.
Task-number: QTBUG-75002
Change-Id: I5d71843abcdaac52f4a60a1abcac2604341f6c96
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
OpenGLES specification does not support GL_TEXTURE_SWIZZLE_RGBA,
it supports only per-channel calls. And since Qt supports QpenGLES,
it should use the latter approach only.
The regression was introduced in Qt 5.12 by commit
ede3791df8
Task-number: QTBUG-74968
Change-Id: I9c531b248715992fb30df6af95dfa605e2ee2a25
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
When both mouse and tablet events are handled by QWindowsPointerHandler,
m_currentWindow variable is shared among the two event streams, therefore
each stream should ensure it does equivalent operations, when changing it.
Here we should subscribe to the Leave events, when we emit Enter event
from the inside of the tablet events flow. Without whis subscription,
the cursor may stuck in "resize" state when crossing the window's
frame multiple times.
Change-Id: I88df4a42ae86243e10ecd4a4cedf87639c96d169
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
The formatting of times in Norwegian has reverted to using dots in
place of colons, as it did before v31 (commit 82deb0ad1), so reverted
the tests to their state before that.
Change-Id: I8a09ce253731bb0f0f3caca117f06ad568940a81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
It was up to date with v34 (and seems to cope with v35.1) but only
clained support for v29.
Change-Id: I686cae1977824a4deec4633f19604b91061fe78a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Our conversion from CLDR's format to our own was missing some things
it could support sensibly, and some it could do better than ignore or
treat as literal, while mis-handling the 'E'-based formats for day
names. At least in CLDR v34 this doesn't actually make any difference
(on regenerating our locale data, the only change is the date of
generation).
Task-number: QTBUG-70516
Change-Id: I9d27b9bf24afd168c2f8a5258143d3d695bca0ad
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Information about header files is cached by qmake. The key is the
filename of the #include directive. For system includes (<stdio.h>) this
is unique, according to the search order in INCLUDE_PATH.
For local includes, given as "foo.h", there may be name collisions. Usually a
compiler first searches in the directory of the current file (stored in the
sourceDir variable), and only in case of a miss the INCLUDE_PATH is
considered.
The dependency generation now distinguishes local header files by their full
relative path. This is implemented by forcing the use of the full relative
path as key into the SourceFiles data structure if the flag try_local is set.
Change-Id: Ifd75325b53496824054595f7fc98d71bbd9d8aa6
Fixes: QTBUG-72383
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The high part was not copied to output.
Fixes: QTBUG-75559
Change-Id: I9350e52d256510f52b3fcc0015bf879d2c609532
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Also de-duplicate the "monospace" string in qgenericunixthemes.cpp,
and add tst_QFontDatabase::systemFixedFont() to verify that
QFontDatabase::systemFont(QFontDatabase::FixedFont) really returns
a monospace font across platforms. Replace commented-out qDebug()s
with qt.text.font.match and qt.text.font.db logging categories to
troubleshoot when the test fails (among other uses). Add qt.qpa.fonts
logging category to unix themes to show default system and fixed fonts
(font engines on other platforms are already using this category).
Fixes: QTBUG-54623
Change-Id: I2aa62b8c783d9ddb591a5e06e8df85c4af5bcb0c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Add documentation on how to use a module from CMake, alongside
the existing documentation about qmake. Separate generic info
from module-specific examples, to make it possible to use one
include file in all modules.
While at it, also remove the mentioning of the central include;
it is not something we should actively advocate anymore. Instead,
the documentation of every class gives the correct include to use.
Task-number: QTBUG-73058
Change-Id: I6b3c0e5ea218dd9c06a491c8fb799a7fcf42dd92
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
x86_64 libs are located in ANDROID_PLATFORM_ROOT_PATH/usr/lib64
not in ANDROID_PLATFORM_ROOT_PATH/usr/lib .
Fixes: QTBUG-47672
Change-Id: Ia1f74f7c2a30b276b95fd0e7dcf8370d739e3c41
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Qt starts drag-and-drop on a mouse button press event. Cococa in
this case won't send the matching release event, so we have to
synthesize it here.
Task-number: QTBUG-72417
Change-Id: I645b6a2733c1ea11ac4545cf3405f826af45fa47
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Do not store this variable locally, because
a) it might change if the SDK location changes
b) does not play well with Qt installer packages which would provide the
include path of the build machine.
To achieve this we introduce the (usual) magic value - for
QMAKE_EXPORT_INCDIR_VULKAN to denote "do not export this value".
Fixes: QTBUG-73796
Change-Id: Ied26ee12cbcdf7f5f6e1caef5d29dadf6309c5d6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
I was using a cheap usb-stick from ALDI supermarket with fat32,
and my application crashed because filesystem was empty.
Unrealistic scenario, but still just returning here false is better
than a crash
Change-Id: I8979d5a4e19ce57770ab03983e847b272ebf7019
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We get a call to storeFont for each supported script-type of
a font, but we use the font signature to register all the supported
types at once, and can thus save ~3/4 calls to addFontToDatabase.
Change-Id: I9d06252fb7f805e7babac58d82fa412ec4e0e36a
Fixes: QTBUG-59360
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
In Windows there are package-based systems like MSYS2 that provide
pkg-config for packages lookup.
This change skips autodetection only for MSVC which doesn't
provide the aforementioned feature.
Task-number: QTBUG-57436
Change-Id: Iaed517e93031adbd2fd9dbf350764f76569b94ea
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
With some keyboards (ASOP, SwiftKey) it was not deleting any new lines
when using backspace. So this ensures that it is correctly deleting at
these points. Tested with the Samsung, Gboard and SwiftKey keyboards.
Fixes: QTBUG-74824
Fixes: QTBUG-57798
Change-Id: Id2e4f96c18c3fec0e7f444b55dd3db2653625fd0
Done-with: Vova Mshanetskiy <vovams163@gmail.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Previously there were two issues:
- A QNetworkReply could be aborted but be in NoError state.
(GOAWAY frame with 0 as error)
- Streams in a connection would be aborted prematurely when a GOAWAY
frame with a lastStreamId of 2^31-1 was received.
Fixes: QTBUG-73947
Change-Id: Iddee9385c1db3cc4bb80e07efac7220fff787bf3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
In 5.12 only the variadic argument version is left (as all
supported compilers have variadic templates). Remove the docs
of the nullary overload, and fix the docs for the remaining
overload.
Change-Id: I54cc7ea71cc61ba1330a9ad92e4fa2ae7f749bac
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Encode the consumed/filtered state in the _exit tracepoint and remove
the separate tracking of receiver event handling. Combined, this
reduces the size of the trace file.
Change-Id: Icb3cb2dd47798543905cea450046d6fad559a15b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>