Handle hard zero independently in each coordinate, otherwise hard zero
is never equal to anything but itself.
Task-number: QTBUG-69368
Change-Id: I8b1131472bb92efc706a04e0b067e2211a5ccb0c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We need to use macros because MSVC is a crappy C compiler.
Change-Id: Ieb48f7c0dd0e4e0fb35efffd153b8af62d34ebdf
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Libraries are placed in a subdir "haswell/" of the main library dir,
whereas plugins are simply named with ".avx2" appended to the plugin
name (plugin.so.avx2). The "haswell/" library directory suffix is a
convention found in glibc since version 2.26, whereas the ".avx2" and
".avx512" suffixes are a convention found in the Clear Linux OS for
Intel Architecture.
This patch implements this for all Unix OSes, except for Darwin, where
the fat file format already has a sub-architecture for Haswell
(x86_64h).
We could also implement the "sse2/" subdir search for libraries, but I
don't think it's worth the cost in 2018.
Change-Id: Iff4151c519c144d580c4fffd1539fe5ee9a4d7b1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
As the comment says, Haswell is a nice divider and is a good
optimization target.
I'm using -march=core-avx2 instead of -march=haswell because the latter
form was only added to GCC 4.9 but we still support 4.7 and that has
support for AVX2.
This commit changes the AVX2-optimized code in QtGui to Haswell-
optimized instead. That means, for example, that qdrawhelper_avx2.cpp
can now use the FMA instructions.
Change-Id: If025d476890745368955fffd153129c1716ba006
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
We never call [QNSView init] directly, so there's no point in splitting
up the logic.
Change-Id: Ie40705a3a78c0d732a3f3378c6e8fa76dc6c68e7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Items in the cache may be part of the parent/child hierarchy. Make sure
not to have dangling pointers in the cache, but rather cleanly remove
all interfaces that get deleted since they may delete each other (TabBar
deletes its child interfaces for example.
Task-number: QTBUG-69283
Change-Id: Iad17cd1d3356804b3d8cbba8632ec22b836c3521
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The button interface is faking everything to represent the buttons when
it comes to accessibility, since they are not represented by a QWidget.
When the parent TabBar is in its destructor, isValid should return false
to prevent accessing it.
Task-number: QTBUG-69283
Change-Id: Ifedf3fa45f9106723afb0b04922b071a3c5467c3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
[ChangeLog][QtCore][QByteArray] QByteArray::toInt(),
QByteArray::toDouble() and the other number conversion functions
now ignore leading and trailing whitespaces, as their QString
counterparts already did. For consistency reasons, the same
behavior was added to qEnvironmentVariableIntValue() also.
Task-number: QTBUG-66187
Change-Id: I8b5e478ea8577b811d969286ea9e269f539c1ea4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We use GCD for marshaling the display link update over to the main
thread, as Qt requires that the update request is delivered there.
Change-Id: I318a5b8f27dc5094ce71244401308a4044c41b39
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Window setup should happen in QCocoaWindow::recreateWindowIfNeeded(),
and there we already call setWindowFilePath(), which takes care of
setting the window icon.
Change-Id: Iaa2f42c694cf8d251703cc56648e5819edd79bec
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
... and various other cleanups.
This patch re-factors tests that relied on QCursor API (directly or indirectly via
QTest::mouseMove widget overload) to use the QTEST_QPA_MOUSE_HANDLING code path.
Misuse of QCursor API causes tests to be flaky.
Removed Qt::X11BypassWindowManagerHint as it is not really needed. Based on
the comment where this flag is used, it would be needed for all test functions
that use mouse events. That assumption is not valid. A window is expected to have
received its final position when QTest::qWaitForWindowActive() returns. There were
issues with this on Unity, but those have been fixed.
Un-QSKIP-ed QTBUG_6986_sendMouseEventToAlienWidget for Q_OS_WIN.
Un-QSKIP-ed hoverEnterLeaveEvent for all platforms.
Un-QSKIP-ed bypassGraphicsProxyWidget for Q_OS_MAC and Q_OS_WIN as the test
passes on those platforms. According to QTBUG-33067 it used to crash with 5.2.0.
Removed unnecessary mouseMove() and stray mouseRelease() in mouseDoubleClickEvent().
Removed unnecessary show()/setVisible() on items that are being added to the scene -
items are visible by default.
Among other randomly spotted issues, one worth mentioning is that when adding
items to the scene after the view is already shown, we need to ensure that the scene
is updated (e.g QSignalSpy + QGraphicsScene::changed) before interacting with it. As
an example, mousePressReleaseEvent() only passed because of random luck that the
invalid coordinates were still within the bounding rect of the button. This patch
does not attempt to cleanup all instances of this anti-pattern.
Task-number: QTBUG-52546
Task-number: QTBUG-26948
Task-number: QTBUG-33067
Change-Id: I2ccbc004c1cb4f5b31c70c8568ee591c458d8446
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
Similar to commit cd64a96b31 we also need
to normalize the strings before comparison in order to be compliant with
the ECMAScript test suite.
This patch also adds the remaining test cases from
built-ins/String/prototype/localeCompare/15.5.4.9_CE.
Since the same tests are also failing with strcoll/qt_compare_strings,
this simplifies the code to always normalize except when using ICU
(which gets it right by default).
Change-Id: I16b32da7fc70dc7e6725c49f66fe9941d0bf3a47
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
The QSslCertificate class can parse and provide details about SSL
certificates without a proper backend, this can for instance be used
by QtWebEngine to provide metadata about certificates, even on Windows
builds without OpenSSL, as QtWebEngine does not use Qt's SSL stack.
Change-Id: Ib48f1ed7315c5bc66721ec87ee651d8372f07f71
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
We rely on AppKit repositioning the window if the original position
is not on any of the available screens. We do this by keeping the
original position, but using the primary screen as reference.
This doesn't work unless the window has a title bar, so in the corner
case where the window has an invalid position, we apply the title bar
style mask for a brief moment, so that AppKit will place the window
correctly.
Task-number: QTBUG-69221
Change-Id: If66cac36bf36f051570ba5854951ce4504fe771f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
There isn't a lot of efficiency gain, since QCborValue was already
refcounted. This saves two atomic operations and an out-of-line call. In
the case of QCborValueRef (which includes QCborMap), because we reset
the container pointer in inline code, the call to QCborValue::dispose()
is also suppressed.
Change-Id: Icc2c231dc2c44abdb087fffd1533eaba7a9c70fa
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
So that users don't get a warning if using
-Wzero-as-null-pointer-constant
Change-Id: Ia15b5f380a2f6a93e05eec06646608e480cdf5d2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This makes QCborValue more future compatible, as code written today for
tags that QCborValue does not recognize will continue to work if
QCborValue gains support for it in the future.
This change also obviates the need for reinterpretAsTag(), which I had
not written unit tests for as I knew this change was coming.
Change-Id: I052407b777ec43f78378fffd15302bdc34f66755
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The types have the same size. So it's stupid for it to make the issue a
warning...
qkmsdevice.cpp:737:88: error: format specifies type 'unsigned long long' but the argument has type '__u64' (aka 'unsigned long') [-Werror,-Wformat]
Change-Id: I117816bf0f5e469b8d34fffd153e640b62bef635
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
qbsdfbscreen.h:57:10: error: 'initialize' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
Change-Id: I117816bf0f5e469b8d34fffd153e649318d2fd7c
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
The -[NSView setWantsLayer:] method may have side effects that
extend beyond just setting an internal boolean property, so
we need to ensure it gets called.
This was observed on e.g. macOS 10.12.5, where the method
ends up creating the internal backing layer. On later macOS
versions the method just emits KVO notifications for wantsLayer,
but these may in turn result in similar logic being triggered.
The issue was masked somewhat by AppKit itself calling the
method from e.g. -[NSWindow setContentView:], so we still got
the backing layer created. The problem appeared when running
binaries built against an older SDK (10.6 in this case), which
triggered AppKit to not call -[NSView setWantsLayer:], due to
__NSViewLayerBackWindowFrame() in that case returning false.
This change removes the overridden -[NSView wantsLayer], and replaces
it with an explicit call to -[NSView setWantsLayer] when creating
a new QNSView, essentially revering c8c8cc790a.
Task-number: PYSIDE-724
Task-number: PYSIDE-734
Change-Id: Idaff4ed38838311b37da4925b1eec241e077dbcc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The existing network test server has some limitations. Most notably, it
is not accessible by every Qt developer. Also, some services don't allow
simultaneous access, which causes flaky test results.
Instead of centralizing all the services to one physical machine, the
idea is to build up several dedicated servers inside separate Docker
containers.
1. Create testserver.pri and integrate it into the make check command of
Qt Test.
2. Define QT_TEST_SERVER flag for changing test parameters at compile
time.
Task-number: QTQAINFRA-1686
Change-Id: I0422ddb97eb8c11b4818771454851d19671253b1
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Ryan Chu <ryan.chu@qt.io>
According to RFC 6347 a DTLS server also must retransmit buffered message(s)
if timeouts happen during the handshake phase (so it's not a client only as
I initially understood it).
Conveniently so an auto-test is already in place and needs just a tiny
adjustment - handshakeWithRetransmission covers both sides.
Change-Id: If914ec3052e28ef5bf12a40e5eede45bbc53e8e0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Variable was declared outside #if-ery but only used inside,
leading to warnings when the define wasn't set.
Change-Id: Iad6a236bdf76b8ca0a58a84509d19f7e1a3e2df2
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Turn all the static members and functions into regular members and
functions.
Change-Id: Ib37d9bdd1a84e512013af7d334e04cd2b1da640e
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Use C++11 alignas instead of a union to pad the
xcb_*_event. It allows using the struct directly
without accessing a union member.
Change-Id: I221a6708ef7af844bd6b71a57dcbab75e1319c72
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Since the .cpp files in the implementation don't actually include the
offending X11 headers they don't need the fix. This just adjusts the
headers themselves to unbreak the namespace for just long enough to
declare the right enums.
Change-Id: If33757aa2289f8fe7b81836f9c08b0ad4592bc32
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Qmake accidentally replaced all occurrences of the library name in the
build path. This would lead to problems if the (shadow) build path also
contains the library name.
Task-number: QTBUG-69279
Change-Id: If99acccc779ff0874433b193be7e7fc53625b245
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
QSKIP() discards the whole test it appears in; so is not the right way
to announce that (and why) the test has just skipped a few sub-tests.
This was concealing a later failure on macOS, here fixed.
Change-Id: I9b07208413b9e101569a22505ad41f07ade4062b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
QSKIP() discards the whole test it appears in; so is not the right way
to announce that (and why) the test has just skipped a few sub-tests.
This was concealing a later failure on macOS, here fixed.
This matches an earlier fix for tst_QDateTime.
Change-Id: Idaf34a9d60d84202fd41d15455209457cc281f60
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit also fixes a grammar mistake (endian → endianness) and the
fact that some functions failed to list that they supported the unsigned
integer types as template arguments.
Change-Id: I19445f335e82420fa654fffd15334e52ef3e744d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This is just the low-hanging fruit. Those algorithms could be much
further improved, but they are so seldom-used that it's not worth it.
Change-Id: I6a540578e810472bb455fffd15332b2a7a1ac901
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The compiler was generating some vectorized code for qresource.cpp but
it wasn't very efficient. So improve upon it and make use in other
places where we read UTF-16BE strings.
[ChangeLog][QtCore] Added an overload of q{To,From}{Big,Little}Endian
that operates on a memory region.
Change-Id: I6a540578e810472bb455fffd1531fa2f1d724dfc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
I'm going to add code in the next commit.
Change-Id: I6a540578e810472bb455fffd153329de04c1c332
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Happens a lot because of the implicit conversions. So I made it inline.
Change-Id: Icc2c231dc2c44abdb087fffd1533f311b95460b8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Questions:
1) should QCborMap::extract return value_type (a pair) instead of just
the value?
2) should the both return the iterator to the next element too, like
erase()?
Change-Id: I052407b777ec43f78378fffd15302a9c14468db3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>