Conflicts:
src/corelib/tools/qlocale_data_p.h
(Regenerated by running the scripts in util/local_database/)
src/gui/opengl/qopengltextureuploader.cpp
Done-With: Edward Welbourne <edward.welbourne@qt.io>
Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io>
Change-Id: I12df7f066ed0a25eb109f61c4b8d8dea63b683e2
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>
The triangular tab shape is not reproducible with setting style border
options, so it should be painted with the usual code path, also when a
custom background has been set.
Fixes: QTBUG-72096
Change-Id: I7bc1c0579386b8ea7266ce6456534c2519d9addf
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
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>
Try to replace all wordings like '.. to 0' with '.. to \nullptr'. Also
checked for 'null pointer' and similar.
Change-Id: I73341f59ba51e0798e816a8b1a532c7c7374b74a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The user can remap the stylus buttons using tablet driver settings.
This information is available to the application via CSR_SYSBTNMAP
WinTab feature. We should fetch this information every time the
stylus gets into proximity, because the user can change these settings
on the fly.
Change-Id: Idc839905c3485179d782814f78fa862fd4a99127
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@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>
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>
Document public macros in Qt5CoreMacros.cmake. This will replace
the list in the current CMake Manual.
Task-number: QTBUG-72159
Change-Id: I377412fe0c1d0a9b232162bbab88ac830d2cac80
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Use a fuzz check (cf 6309062722) and a minimum
size similar to tst_qwidget to make the test pass on large monitors with or
without active scaling.
Change-Id: I5a9e28e38e1d007057894c349c94f0e6fe12009c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
- Use nullptr
- Fix C-style casts
- Fix redundant bool expressions
- Fix else after return
- Remove unnecessary casts to int from registered enums
- Fix most signedness-related warnings
- 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
- Remove unused variables
- Streamline code in some cases
Change-Id: I1350b382b0b7d0f3198039fdc78892cfa1dd498d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
- Use nullptr
- Fix C-style casts
- Remove unnecessary casts to int from registered enums
- Fix most signedness-related warnings
- 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
- Streamline code in some cases
Change-Id: I4c9b99126cff02136def0e03accdf1129fe6d72b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
- Use nullptr
- Fix C-style casts
- 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; use lambdas where applicable
to remove helper slots
- Streamline code in some cases
- Replace helper function to convert touch points by the one in
QWindowSystemInterfacePrivate
- Use a logging category for the debug outpt, silencing some output
Change-Id: Ia46c7ad7c08f3afc8e5869ea99b66e406de97781
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
The code compared the attribute names of the properties against the
m_registeredWidgets hash which contained the qualified names
(self.widget) and thus reported errors without actually generating
anything.
Replace the m_registeredWidgets hash by a lookup of the attribute name
in the m_widgets hash and add a function widgetVariableName()
returning the qualified variable name for an attribute name and use
that for the checks.
Remove unused m_registeredActions hash and rename some variables to
make it clearer.
Task-number: PYSIDE-797
Change-Id: Id31d95c1141d21c51eb85bcd8f8fc63486eb36a5
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Add a platform option to the plugin (-platform windows:reverse) that
enables reverse mode. It sets WS_EX_LAYOUTRTL on RTL windows, forces normal
orientation on all HDCs created for the window, fixes
ClientToScreen()/ScreenToClient() accordingly and transforms mouse events.
[ChangeLog][Platform Specific Changes][Windows] It is now possible
to enable RTL mode by passing the option -platform windows:reverse.
Fixes: QTBUG-28463
Change-Id: I4d70818b2fd315d4e8d5627eab11ae912c6e77be
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
The is a copy of the QString::SplitBehavior enum, but scoped
in the Qt namespace instead of inside QString, where it creates
problems using it elsewhere (QStringView, in particular).
Overload all QString{,Ref} functions taking QString::SplitBehavior
with Qt::SplitBehavior.
Make Qt::SplitBehavior a QFlags for easier future extensions (e.g.
a hint to use Boyer-Moore searching).
Added tests in QStringApiSymmetry.
[ChangeLog][QtCore] Added new Qt::SplitBehavior.
[ChangeLog][QtCore][QString/QStringRef] The split functions now
optionally take Qt::SplitBehavior.
Change-Id: I43a1f8d6b22f09af3709a0b4fb46fca61f9d1d1f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The filterEvents() implementations used a QMap<GestureType, int> for
tracking whether a given type was already seen. The mapped_type was
completely unused.
Since the expected number of gesture types is very low, go directly to
QVarLengthArray, not QSet, as the reduced number of allocation will
dwarf the low overhead of O(N) search vs. O(1) for QSet or O(logN) for
QMap.
Change-Id: I98b6af69f11cca753e3c7c4fbb58e8f2e935e0d5
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Extra difficulty: the lock is conditional. Not a problem with std::unique_lock, which is movable.
Change-Id: Ib5515838ccb10100d5aa31163ab7f171591c04c4
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Instead of a bad copy of remove_if, with quadratic complexity, use
an ok copy of copy_if, with linear complexity.
Port to QStringRef as a drive-by.
Change-Id: I47fde73b33305385835b0012f6d332e973470789
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
QMutableListIterator::remove() is linear, so called in a loop, the
loop potentially becomes quadratic.
Fix by porting to std::remove_if. In this case, since the old code
unconditionally detached, anyway, we use remove_copy_if to build a new
list. That's still more efficient than the old code, even if nothing
is removed. It also prepares the code for when Java-style iterators
will be deprecated.
Since the same code appears in two different functions, do an Extract
Method into a file-static function.
Lastly, restore NRVO for most compilers by returning the same object
from all return statements of the function.
Change-Id: I6909c6483d8f7acfd1bf381828f020038b04e431
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Trivial.
Java-style iterators are going to be deprecated.
Change-Id: Ie94658be988cc095fb3b05d0d4ef6e7e3bf9a2af
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Java-style iterators are scheduled to be deprecated.
The general pattern used in the patch is that instead of copying an
input list, then iterating over the copy with some calls to
it.remove() (which leads to quadratic-complexity loops), we simply
copy conditionally (a la remove_copy_if instead of remove_if).
To make clearer what's going on, rename the outgoing list to
'unhandled'.
To avoid having to touch too much of the loops' structure, which
sometimes is quite convoluted, use qScopeGuard to do the append to
'unhandled', unless the original code removed the element.
Saves a surprising almost 5KiB in text size on GCC 9.1 optimized
AMD64 Linux builds.
Change-Id: Ifd861de9aa48d66b420858606998dd08a8401e03
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Java-style iterators are going to be deprecated.
Change-Id: Ia55070608d3826bd84ed5d56a593c1c4918a6063
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
The original is much more subtle, so don't try to be a 100%
replacement. Most users will be able to use std::make_unique these
days. This is just a minimal implementation to enable using the
functionality in the implementation of Qt libraries. In particular,
it does not attempt to deal with arrays.
It is therefore not proposed as public API. It is placed in a new
private header, since the only header in QtCore that already
includes <memory> is sharedpointer_impl.h, and that did not seem
to be a good place to add it. It is probably too much of a
compilation-time drain to add <memory> to qglobal.h...
Change-Id: Ie206ef7ae9beb36c63aef4ec46dbde6c73e0d9f5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The whole reason of QCharRef/QByteRef existence is to have a magic
operator=. This operator= delays the actual detach up to
the moment something is written into the Ref, thus avoiding
spurious detaches to the underlying string/byte array.
operator= has also an extra feature, it allows this code to
succeed:
QString s("abc");
s[10] = 'z';
assert(s == "abc z");
This last behavior is *extremely* surprising.
The problem with all of this is that this extra convenience is
outweighted by the massive pessimization in the codegen for
operator[]; by the maintenance burden (QChar APIs need to be
mirrored in QCharRef, etc.), and, for the automatic resize, by the
fact that it's an super-niche use case.
Cherry on top, std::basic_string does not do that, and no Qt or std
container does that. In other words: any other container-like class
exhibits UB for out of bounds access.
We can't just go and change behavior, though. This is something
coming all the way back from Qt 2 (maybe even Qt 1), which means we
can't deprecate it at short notice.
This patch simply adds a warning in debug builds in case the special
resizing behavior is triggered. While at it, removes some code
duplication in QByteRef.
[ChangeLog][QtCore][QString] The behavior of operator[] to allow
implicit resizing of the string has been deprecated, and will be
removed in a future version of Qt.
[ChangeLog][QtCore][QByteArray] The behavior of operator[] to allow
implicit detaching and resizing of the byte array has been
deprecated, and will be removed in a future version of Qt.
Change-Id: I3b5c5191167f12a606bcf6e513e6f304b220d675
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Honor the RO3, doing copies of the members where it belongs
(and not in its subclass), and properly handling the refcounting
by disabling the copy assignment
* Clean up construction of QPainterPathData by using ctor-init-lists,
getting rid of a warning because the base class copy constructor
wasn't being called by the subclass' copy constructor.
* Mark everything for cleanup in Qt 6.
Change-Id: I143a322dc816e2e12b454a9e5ffe63f1a86009a5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>