Instead of two 16-byte loads, if AVX2 is present. Otherwise, it's
exactly the same.
Because of the way the SIMD instructions were extended to 256-bit in
AVX2, we gain nothing doing two 32-byte loads, aside from the loop
unrolling.
Change-Id: Ib48364abee9f464c96c6fffd152e531925814ac2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This instruction is somewhat slow and requires a lot of inputs to be
correctly set. Instead, use the PMIN trick, which does have unsigned
comparison support.
This commit moves the helper function to a lambda inside qt_to_latin1,
to make it easier to reuse the constants in the next commit and to avoid
warnings of unused static functions.
Change-Id: Ib48364abee9f464c96c6fffd152e9e84f4ad3ae8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
setAutoRepeat() is failing on macOS and Windows when run together with
defaultAndAutoDefault(). It succeeds when run on its own. Adding the wait allows
it to succeed when run with the other tests as well.
Amends 0cb940b1d3, which removed the wait.
The comment is the same as before. I couldn't see a better way to replace the
wait (QApplication::topLevelWidgets() already returns only the testWidget and
testWidget->isActiveWindow() returns true).
Another theory I had was something waiting for the KeyRelease so I changed
QApplication::sendEvent() uses to QTest::keyClick(). It did not help but that
still seems preferable.
Change-Id: If87d1e6e018751f3068ea4c913ae6731aba41ff0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
dialogs/qprintdialog_unix.cpp:149:15: error: private field 'm_printer' is not used [-Werror,-Wunused-private-field]
QPrinter *m_printer;
^
Change-Id: Idce515a3e66019756b6ad2d305072e0a89bb823b
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
If the input is already known to be Latin 1, we don't need to check and
merge in question marks. QJsonObject already needed this code, now we
can make it more efficient.
I'll need the same code in CBOR.
Change-Id: Ib48364abee9f464c96c6fffd152e508f078404e5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
We don't have _mm_cvtsi64_si128() (the REX.W expansion of MOVD [0F 6E]),
but we do have _mm_loadl_epi64(), the SSE2 expansion of the MMX MOVQ at
opcode 0F 7E. Ditto for _mm_cvtsi128_si64() and _mm_storel_epi64(). And
those work even in 32-bit mode. By doing this, we can reduce the tail
unrolled loops by half, reducing code size.
I'm not adding these new SIMD sections to -Os builds.
Change-Id: Ib48364abee9f464c96c6fffd152e405310ef67be
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Improves performance a little. This is just because I can and the
function is right there for the taking, as this qt_urlRecodeByteArray
function is only used in deprecated QUrl code.
Change-Id: I5d0ee9389a794d80983efffd152d290e570af387
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
We can just reuse the code I added for QtPrivate::isAscii(), adding the
update to the ptr parameter in the failed case.
Change-Id: I5d0ee9389a794d80983efffd152d277e2adf444d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Use new helper functions for mouse events and buttons
Change-Id: Idb74fbd4ffde0c22b3d4bbddb5761567081bdf7c
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
First of all, this removes the UB that used to try and calculate the
distance between the two strings. That's a valid technique in assembly,
but dangerous in C++ and totally unnecessary. The compiler is perfectly
able to generate loops with a single induction variable all on its own.
Second, this commit makes the main loop use 32-byte comparisons (16
characters at a time), which is a reasonable size for strings. We use
AVX2 if that's available, or an unrolled pair of 16-byte loads
otherwise. After the existing 16-byte comparison, this commit inserts an
8-byte (4-character) comparison and then reduces the final, unrolled
comparison to just 3 characters.
Change-Id: Ib48364abee9f464c96c6fffd152e474b39e1f293
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
std::unary_function and std::binary_function are gone. Remove their
uses.
Change-Id: I5d0ee9389a794d80983efffd152c96f0f2149b40
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Starting with QtCreator 4.6.1* we introduce a new way to debug Qt on Android apps,
which doesn't need this support anymore.
Of course to debug Qt 5.12+ the user must use QtCreator 4.6.1+
* 429c596395697ff3533e679a848ad26cd1ee97cb
[ChangeLog][Android] Remove old debugging way. To be able to debug Qt on Android apps
the user must use QtCreator 4.6.1+
Change-Id: I16d08312628c9afb7cfa47eb906b25a87af5ba55
Reviewed-by: hjk <hjk@qt.io>
[ChangeLog][QtCore][Global] Added the QT_TR_N_NOOP(),
QT_TRANSLATE_N_NOOP(), and QT_TRANSLATE_N_NOOP3() macros for numeral
dependent delayed translation.
Change-Id: I57c5b1ad4006267f49a57b0cbc40216b8e0399ff
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
Fixes build with -no-feature-library, because the qlibrary.h header
contains QT_REQUIRE_CONFIG(library).
Change-Id: If64ece8bd77e8824b86dc91f95dd9062cb2a1644
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Filters are usually in format (Name (*.foo *.bar)), but valid filter is
also (Name ( *.bar *.foo )), containing additional spaces. When we split
content in the brackets divided by spaces, there will be then empty
strings which we need to filter out, otherwise the result we send over
DBus is not valid.
Change-Id: Iaa265189408f47324bc9b269d534bf4c8d7d2cae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QDialog::exec() has a number of problems due to spinning an inner
event loop (to counteract its being synchronous). We've had
QDialog::open() as a better alternative for a long while now,
so encourage people to use that instead.
Change-Id: I51a69a018dcbf6133adb6c2f69c7caf442008b36
Reviewed-by: Martin Smith <martin.smith@qt.io>
Add a scaling overlooked in 63d08003cf.
Task-number: QTBUG-68194
Change-Id: I97c771435e4316ec55aacc527335b62cb4dfd9ec
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
QTableModel::setItemData() did not treat Qt::EditRole and
Qt::DisplayRole as the same. This lead to inconsistencies between
setItemData() and QTableWidgetItem::setData()
[ChangeLog][QtWidgets][QTableWidget] Fix handling of Qt::EditRole and
Qt::DisplayRole in setItemData().
Change-Id: I456f4c8e654de701dcd579236162b8aaa8ba1e53
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Invalid syntax due to missing closing brackets and
exception not being handled when calling .close()
on a stream.
Change-Id: If8f191fbc44fe1b031fd86abff5163bca434156a
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
tst_QProcess hangs sometimes in QEMU. Based on my experiments in a debug VM the
offending test seems to be processesInMultipleThreads(), since that was were I
was able to reproduce the hanging in.
Since the whole test executable hangs, blacklisting is not enough, so skip the
test.
Task-number: QTBUG-67760
Change-Id: I34f8852be955a8612deac22b369f68d79a139d11
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Otherwise using it later is a compile error on ARM if no header including it has
been included before.
Change-Id: I422eeb948da4a22bc3f649daff39740703039372
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The added test case contains the binary JSON equivalent of
["ž"]
with the modification that the string's length has been set to INT_MAX. In
Value::usedStorage this length is used through the pointer d like so
s = sizeof(int) + sizeof(ushort) * qFromLittleEndian(*(int *)d);
Because 2 * INT_MAX is UINT_MAX-1, the expression as a whole evaluates to 2,
which is considered a valid storage size. However, when converting this binary
JSON into ordinary JSON we will attempt to construct a QString of length
INT_MAX.
Fixed by using String::isValid instead of Value::usedStorage. This method
already takes care to avoid the overflow problem. Additionally, I've tried in
this patch to clarify the behavior of Value::isValid a bit by writing it in a
style that is hopefully more amenable to structural induction.
Finally, the test case added in my previous patch had the wrong file extension
and is renamed in this one.
Task-number: QTBUG-61969
Change-Id: I45d891f2467a71d8d105822ef7eb1a73c3efa67a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The macOS, Windows, and XCB implementations are identical
and can be moved to QBasicPlatformVulkanInstance.
Change-Id: Id84b27ffd87f86afe3798c4ad2743ba05e6190d3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The macOS, Windows, and XCB implementations are identical
and can be moved to QBasicPlatformVulkanInstance.
Change-Id: I1380b2bd03080710084a1458bdce3a362ba5c287
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
If glibc's <unistd.h> does not define SYS_statx but <linux/stat.h> did
define struct statx and related constants, we failed to compile.
Task-number: QTBUG-68205
Change-Id: I04a43ee94975482f9e32fffd151e66bbe6988554
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Not sure this makes the code faster, but it removes two functions.
Change-Id: I5d0ee9389a794d80983efffd152d830da44b1bfe
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
When QMAKE_TARGET_BUNDLE_PREFIX is set in the .pro file then
this value should be used instead of the default value for
PRODUCT_BUNDLE_IDENTIFIER. Therefore, PRODUCT_BUNDLE_IDENTIFIER
should be set inside default_post.prf so that it can take the
value of QMAKE_TARGET_BUNDLE_PREFIX after it may have been set.
Task-number: QTBUG-66462
Change-Id: Iec1e2a43632efe6021b9d6bfdb78bd941326c456
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
QAbstractItemModel::dataChanged() gained an optional role parameter
with Qt5 which was not filled within QTableWidgetItem setData() function
Task-number: QTBUG-48295
Change-Id: I82289b6db78eeef09d586da267046032984952da
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The property name for SP_DialogDiscardButton is missing the 'dialog-'
prefix to match the property described in knownStyleHints.
Task-number: QTBUG-58674
Change-Id: Ie5b7412765e19defb3644d7cac2fe08bf8119a8d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
QImage::transformed() can sometimes return an image with a different
image format than the original. This might be unexpected, so explain
it in the doc.
Task-number: QTBUG-50087
Change-Id: I165fc7b44439b770b542be52d3108fd70bf0ae99
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Add API to activate previously added Metal layer implementation.
This provides minimal support, and unlike VulkanSurface
there is no separate QWindow subclass.
What this does do is configure the QWindow to use a
Metal layer, and to send expose/update events when
the layer content should be redrawn. Qt will also update
the layer’s drawableSize and contentsScale when needed.
Application code can make use of this by accessing
the QWindow layer, which will be a CAMetalLayer:
CAMetalLayer *metalLayer = reinterpret_cast<CAMetalLayer *>(
reinterpret_cast<NSView *>(window->winId()).layer);
Change-Id: I514f5186133c3e610fd4e53ca91fe9c85c6d016e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Previously the test worked because the client was the last party to know
when encryption was established. However, due to changes in the TLSv1.3
handshake the server is now the last one.
In either case, relying on both to be encrypted when one of them is
finished is not great, so now we only quit the event loop when both
client and server have emitted 'encrypted'.
Change-Id: Ic1fc75671206d866f7ea983805fd58a99657aac6
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Didn't compile with it when I was moving it out.
Change-Id: I3645af71ea3295a61f20000a6bc4716b6e996ce5
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The check for having N valid characters is ptr + N <= end, because
ptr + N == end indicates that we have exactly N characters in the
string.
Change-Id: I5d0ee9389a794d80983efffd152d28d5aa485ce4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
QHeaderView::reset() did not reset the cached size hint which could lead
to wrong geometries when the model was reset.
Task-number: QTBUG-67927
Change-Id: I5100b28a741cc816133a229c422f9abf83f2187e
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
tst_QHeaderView::sectionSizeHint() did set some values but did not check
the return values.
Change-Id: Id606d7a06935a3d6783bc9a8c10bf05d953adec6
Reviewed-by: David Faure <david.faure@kdab.com>
Fix a typo to properly link to setInputMask instead setMask.
Task-number: QTBUG-61775
Change-Id: I0cb00de8dcaece613467e25b41e93661d6e98308
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
It seems there is a subtle bug in the Wacom tablet drivers for Windows that is
triggered in the very particular case where the running executable is named
"tablet.exe", regardless of its installation path. It causes WM_POINTER*
messages not to be delivered to the application, initially, but only after the
application's window is reselected, after another application's window had
been selected. It happens at least on Windows 10 systems with Wacom Bamboo
tablets and drivers, and was reproduced with non-Qt-based applications also.
It looks like a bad compatibility setting that makes "tablet" a cursed target
name for applications using tablet functionality. It seems older versions of
the drivers used to contain an executable with this name, although it seems to
be absent in newer versions. Unfortunately, the Qt tablet example uses this
name, which breaks it when used with upcoming WM_POINTER* messages support.
Change-Id: I931cc725b9117b4604267f7b0172110ae61700de
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>