Especially in examples, where we should show off our convenience
functions, prefer calling these functions over doing arithmetic with
M_PI (or approximations thereto) and 180 (give or take simple
factors). This incidentally documents what's going on, just by the
name of the function used (and reveals at least one place where
variables were misnamed; the return from atan is in radians, *not*
degrees).
Task-number: QTBUG-58083
Change-Id: I6e5d66721cafab423378f970af525400423e971e
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
It is needed to create private implementations of classes inheriting
from QTcpServer.
Change-Id: I623aa37a6f112dc5db761bf299978ac1ccd52a2f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
It is needed to implement Android Binder in Qt.
Change-Id: I8f6f8ef778f97a444a1b16d6f62e211e188b65cc
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
This patch-set implements a new QSslSocket backend based on OpenSSL 1.1.
1. General.
The code in this patch was organized to achieve these (somewhat contradicting)
objectives:
- keep the new code free of #if-ery, as far as possible;
- make it easy to clean away dead code when we're eventually able to retire
out-dated OpenSSL versions;
- reduce the amount of code duplication.
If changes in some file/component were insignificant (~5 one-liners per file),
we still use pp-checks like: #if QT_CONFIG(opensslv11) ... #else ... #endif -
the logic is simple and it's still easy to clean the code if we remove the legacy
back-end. Where it saved #if-ery, we also introduced 'forward-compatible'
macros implementing equivalents of 1.1 functions using older OpenSSL.
In case some class contains a lot of version-specific ifdefs (particularly where
nested #if-ery was complex) we choose to split code into: "pre11" h/cpp files,
"shared" h/cpp files (they preserve their original names, e.g qsslsocket_openssl.cpp)
and "11" h/cpp files. If in future we remove the legacy back-end, "pre11" should be
removed; "shared" and "11" parts - merged.
2. Configuration.
We introduced a new feature 'opensslv11' which complements the pre-existing
'openssl' and 'openssl-linked' features. The 'opensslv11' feature is enabled
by a simple test which either compiles successfully or ends in a compilation
error, depending on a value of the OPENSSL_VERSION_NUMBER constant. If the
feature was enabled, we also append an additional compilation flag
-DOPENSSL_API_COMPAT=0x10100000L to make sure our new code does not contain
deprecated structures, function calls, macro-invocations from OpenSSL < 1.1.
Change-Id: I2064efbe9685def5d2bb2233a66f7581954fb74a
Reviewed-by: André Klitzing <aklitzing@gmail.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
A deadline timer is more correct for timeouts.
Also starts the timer before trying to acquire the mutex for more
precise timeouts.
Task-number: QTBUG-58745
Change-Id: I230266a3a5d7b7af33981efed4e6882e5727a41c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Qemu uses some memory for each generated thread. This test creates
> 80000 threads and consumes about 10Gb of memory which is too
heavy for a VM.
Task-number: QTBUG-59966
Change-Id: I1bb8a0d7955778f5201948b41befcb9f1f391514
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
uikit/sdk.prf replaces QMAKE_MAC_SDK_PATH with a make expansion of that
variable, which of course does not work when we use the contents
directly.
amends 6d5489f5d.
Task-number: QTBUG-61690
Change-Id: Id77dff8ee7d737dd35f74cc7d39faaa50b4b1ab9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Fix one #include as only QCompleter is used and not QFSCompleter.
Change-Id: Ia1e722122f7e322c678d2db6962c6086c684ddd9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
A visibile QOpenGLWidget receives a QEvent::WindowChangeInternal which triggers
a QOpenGLWidget::reset(). A hidden QOpenGLWidget never received this event
so it was never reset, resulting in a black rendering.
Includes unit-test that fails without this patch.
Change-Id: I9d2c57d66fa629f631a9829a5ebf4de09998ad75
Task-Id: QTBUG-60896
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The getentropy function, first found in OpenBSD, is present in glibc
since version 2.25 and Bionic since Android 6.0 and NDK r11. It uses the
Linux 3.17 getrandom system call. Unlike glibc's getrandom() wrapper,
the glibc implementation of getentropy() function is not a POSIX thread
cancellation point, so we prefer to use that even though we have to
break the reading into 256-byte blocks.
The big advantage is that these functions work even in the absence of a
/dev/urandom device node, in addition to a few cycles shaved off by not
having to open a file descriptor and close it at exit. What's more, the
glibc implementation blocks until entropy is available on early boot, so
we don't have to worry about a failure mode. The Bionic implementation
will fall back by itself to /dev/urandom and, failing that, gathering
entropy from elsewhere in the system in a way it cannot fail either.
uClibc has a wrapper to getrandom(2) but no getentropy(3). MUSL has
neither.
Change-Id: Ia53158e207a94bf49489fffd14c8cee1b968a619
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Follow the usual pattern:
Add a config test and automatic include of GLES3/gl32.h if there
is a GLES 3.2 capable header+lib at build time.
Then, regardless of this being enabled, expose all new 3.2 API
functions in QOpenGLExtraFunctions and resolve them dynamically
at run time.
This way 3.2 functions will be available when deployed to a 3.2
capable system (or OpenGL 3/4.x with the functions in question
available) regardless of what was present in the sysroot at build
time.
Change-Id: Ia52551f3178591e1e56ceac8e45d89c6b13f4927
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
QT_CONFIG and some other macros are unavailable there.
Change-Id: Ia53158e207a94bf49489fffd14c8d306e2dbd9d2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
If an application proxy has been set or the usage of the system proxy
configuration has been turned off then these should be respected rather
than querying the system for the proxy. By using proxyForQuery() over
systemProxyForQuery() it ensures that it first checks if there is an
application proxy set before falling back to the system proxy, if using
the system proxy has not been turned off.
Task-number: QTBUG-61692
Change-Id: I65ed3e6bd7b3449cd4ae3757e583aa8d7724221b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
.. and remove it from qxcbconnection_xi2.cpp as this file is build
_only_ when xinput2 is available.
Change-Id: I66d6a299c120fc034f8519cd188e1b845d5bd1bc
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
The platform window is now protected by a QPointer, so we don't need
to juggle the NSWindow retain count.
Task-number: QTBUG-37287
Change-Id: Id55ea311f0793370e248aa58cc8e383b574fbb40
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
And their corresponding synthesizations. The compiler will take care
of it for us.
Change-Id: Ifa42e0732059008af6f3f65151bf203a1a19079d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Add a note saying that invalid input to QByteArray::fromPercentEncoding
and QUrl::fromPercentEncoding will produce invalid output, and provide
an example.
Change-Id: Icc68f59c23cf199640b646cd4a6ca8e4808a3f71
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We now track the platform window with a QPointer, so the event callbacks
can (and do) check the validity of the platform window before passing
them on. The window property of the NSView is also nil at the point of
even delivery, if we need another way to check if the event is still
valid.
Task-number: QTBUG-39211
Change-Id: I6179bdb3af9606cd0abf981c0fe6cacb9a2d98ab
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Some users don't want to download the full Xcode installation which can
weigh upwards of 5 GB download and 20 GB installed.
[ChangeLog][macOS / iOS] Qt can now be built using just the Xcode
Command Line Tools, without needing to install the full Xcode IDE.
Task-number: QTBUG-35928
Task-number: QTBUG-41908
Change-Id: I6d13c9a03ab9087b3ab56e8547f53f0cc2806c7b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Since the mkspecs always set QMAKE_APPLE_TARGETED_DEVICE_FAMILY, it will
never be empty, and the warning message and automatic fallback to
QMAKE_IOS_TARGETED_DEVICE_FAMILY will never be used.
Task-number: QTBUG-60430
Change-Id: I79e36d355dae3f8a4429d73e753fed3c090a5d24
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Fix regression introduced by 175f33ed8. 'expanding' property set to true
was ignored when QStyle::styleHint() returned Qt::AlignRight for
SH_TabBar_Alignment.
When we calculate tabs geometry, we put an empty tab at the front and
back and set its expansive attribute depending on tab alignment AND
'expanding' property.
Task-number: QTBUG-61480
Change-Id: I6a1827ae8a3f2c6bee5124c18c7f2b1c0a7862f3
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
In theory, there's nothing wrong with having it in the child process. In
practice, we've found that strerror/malloc can hang: if an application-
wide lock was held by another thread before fork(), the child process
could wait forever for an unlocking that will not happen (no threads
running). See https://sourceware.org/bugzilla/show_bug.cgi?id=19431
As an added bonus, we now use qt_error_string(), which may produce
slightly different text from strerror.
[ChangeLog][QtCore][QProcess] Added a workaround for a rare race-
condition bug in some C libraries that caused the child process started
by QProcess to hang after trying to launch a non-existent executable or
change to a non-existent directory.
Task-number: QTBUG-61634
Change-Id: I1eba2b016de74620bfc8fffd14cbce4b9f9af69b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
tst_qvariant.cpp(80): warning C4309: 'initializing': truncation of constant value
tst_qvariant.cpp(4635): warning C4309: 'initializing': truncation of constant value
tst_qbytearray.cpp(1438): warning C4267: 'argument': conversion from 'size_t' to 'uint', possible loss of data
tst_qbytearray.cpp(1440): warning C4267: 'argument': conversion from 'size_t' to 'uint', possible loss of data
http2srv.cpp(64): warning C4018: '<=': signed/unsigned mismatch
tst_qinputdialog.cpp(352): warning C4804: '<=': unsafe use of type 'bool' in operation
Change-Id: Id012d88b7b20c5c9f128f2ef53753cc1d479f358
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fixes GCC 7 warning:
socket\qnativesocketengine_win.cpp:888:21: warning: this statement may fall through [-Wimplicit-fallthrough=]
Change-Id: Idb4dce511b3ab634339ac1283d88def283a92028
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Print time in the error handler to get some diagnostics
about when the network connection is dropped.
Task-number: QTBUG-61673
Change-Id: I376bec81f52d75c9b601f2af9b7e0b63f5883bb0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Change-Id: I73c8385d4ef175acad218993be32494eb3a0d6e0
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>