This technically just changes a compile time check to a run time check
and better options should be explored later, but it removes the compile
time dependency for now.
Change-Id: I58c5599baf2c338e88bd558a82093835124d6f67
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Also use canonical contact url.
Change-Id: I7faf9b329f4dd2c2a422d02e171bc2d39c359ed3
Reviewed-by: Rolland Dudemaine <rolland@ghs.com>
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Also use canonical contact url.
Change-Id: I61bf0990698a7021f1240deaf3eef2aff8f90a7e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Replace outdated LGPL21 with LGPL license header.
Use GPL-EXCEPT for all autotests.
Also use canonical contact url.
Change-Id: I6e5cc8a4285569c4f862730a980f492b8a933a72
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Change-Id: I34821150f66255df30d12572b27779e0e729ebc8
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
I suppose that once upon a time, the plug function used to return the
rectangle of the new item. But right now, the 'result' is not used
so we can remove all the code that computes it.
Change-Id: I786e1f1ead82ac64a5eed632f3a3836f67c59c10
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
The FP16 extension in IEEE mode is mandatory for Aarch64, so there is
no aarch64 configuration where the tables will be needed for conversion.
Change-Id: I9804e55c193cc9b5adcaedb720d8b980624139cc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Glen Mabey <Glen.Mabey@swri.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The implementation now uses the relaxed-constexpr
qCountTrailingZeroBits() function from QtAlgorithms, making the
QSizePolicy(Policy, Policy, ControlType) constructor constexpr on
C++14 compilers. The explicit check for DefaultType remains to keep
the constructor C++11-constexpr when called with just (Policy,
Policy).
Extend the constExpr tests a bit.
Change-Id: I59690f0921d9bdee08e3615d0d1f4a9b92870c32
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Recent Darwin system have a new system call that allows cloning the
contents of a file from another one if the underlying file system (for
example, APFS) supports it.
Change-Id: I90ec53b8abd2b1dc4000070f295e226d0fb4c672
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use of these macros implies defined(Q_OS_DARWIN) so don't complicate the
usage point (since the preprocessor cannot handle, for example
defined(Q_OS_DARWIN) && QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE when the
latter macro is not defined).
Change-Id: I47995351f0e46d8a1d07708117f8eed63d87ba0f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Even though we revoke its Q_COMPILER_UNIFORM_INIT for certain bugs
that affect existing usage in Qt, it turns out that MSVC 2013 supports
enough of braced initialization to make the macro magic in
Bits::transformed() moot.
Change-Id: I824d7fa298a2b95b4ad45c9e259e91c5ececfc0c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
[ChangeLog][Platform Specific Changes][Android] QWidget::createWindowContainer()
is now supported on Android for embedding OpenGL-based QWindows into widget UIs.
Task-number: QTBUG-59175
Change-Id: I84d3703bcd44c63b1fdfe6772b7f3de9d5c18ddf
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This is not a bug in QImageWriter, but caller code. We should be
explicit about what the problem was so it can be fixed.
[ChangeLog][QtGui][QImageWriter] Add QImageWriter::InvalidImageError to
communicate invalid attempts to write a bad QImage (for instance, a null
QImage).
Change-Id: I0333b8263f1da1c672bed17dab48bfd6cafe41a2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The cumbersome complex calls to QMatrix were surely easy to write
thanks to copy-and-paste; but this left the reader to either
laboriously check or guess that all the copies were the same (and
notice that there were two, in fact). DRY.
Since QMatrix wants qreal data, change the float deg angle to a qreal
and work in qreal throughout. Passing the angle to a function instead
of repeating it obviates the need for a local variable in the calling
code, to hold its value.
Change-Id: I6bb4adf438a893083ca19f27942502c1e5c518aa
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This was a mistake in cb37ab8298
Change-Id: I5897ceb34ab4aa1655efd20697d0e761cf7796b1
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
Use Q_RELOCATABLE_TYPE now that we have it.
Change-Id: I04bb946695ebb9f0899bb73becbef301805389ef
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Embeddeding a QWindow via QWidget::createWindowContainer() fails to
deliver the SurfaceAboutToBeDestroyed event. This breaks any OpenGL
or Vulkan based QWindow that releases resources upon this event, and
is particularly critical with Vulkan where the only way to do properly
ordered swapchain - surface cleanup is via this event.
In the non-embedded case close() eventually ends up in an explicit
destroy() in QWindow. In the embedded case destroy() only gets called
from ~QWindow. This then silently breaks since the subclass' reimplemented
event() virtual is not getting called anymore.
To remedy the problem, simply add an explicit destroy() to
QWindowContainer.
Task-number: QTBUG-55166
Change-Id: I1671e8f4d39f6c44e19eca7b9387f55fe3788294
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Not that it changes much since one tyically gets sRGB capable by default
on AMD and NVIDIA at least, but let's handle the QSurfaceFormat flag
correctly via WGL_EXT_framebuffer_sRGB.
Task-number: QTBUG-50987
Change-Id: I898c3757ab6fea51323d6c041b2511bea780c3fb
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Just requesting an sRGB texture for a QOpenGLWidget does not lead to
anything useful when it comes to the end result, the content will just get
darkened. For proper operation the target window's default framebuffer
must be sRGB capable and linearization during blending must be enabled.
Task-number: QTBUG-50987
Change-Id: Ibad0657c29a720590fa22c84c4bc303302de6dc0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
...in order to support sRGB framebuffers.
Add a --srgb option to the qopenglwidget example to allow testing.
[ChangeLog][QtWidgets][QOpenGLWidget] Added support for specifying
custom internal texture formats in QOpenGLWidget in order to make it
possible to have the widget backed by an sRGB-capable framebuffer.
Task-number: QTBUG-50987
Change-Id: I112e2f0ab0b1478c69e601031aa0bafaa87fa847
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Backend implementation is done for GLX for now. WGL and EGL may follow
later on.
[ChangeLog][QtGui] Added support for requesting OpenGL windows with
sRGB-capable default framebuffers. While this is implicit on some
platforms, QSurfaceFormat now has the necessary flags to request
such windows in a cross-platform manner.
Task-number: QTBUG-50987
Change-Id: I4df1f786e41e63396f46920a81afdf5ecb5eedea
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Improves performance when appending temporaries, esp. since
the aliasing fix in the lvalue overload in 0f730ef made that
overload correct, but a bit slower across reallocs.
The unit tests already also pass rvalues, so the function is
covered in the existing tests.
[ChangeLog][QtCore][QVarLengthArray] Added rvalue overloads
of append() and push_back().
Change-Id: If3a6970f03a160cba5b42d33d32d3d18948f6ce3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We always send mouse move events through the application event filters
even if the widget has no mouse tracking enabled. This code portion is
an almost verbatim copy of QCoreApplicationPrivate::sendThroughApplicationEventFilters().
The only difference is that previously the filter and the widget had
to be in the same thread. Now, we compare the filter's thread to the
application's. This is without consequence since widgets must live in
the application thread.
Change-Id: Ifee9c041e06d80ea0c2d2a947231e58ee4dfa24d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
A QDockWidgetItem will be leaked if a QDockWidget is dragged out of a
floating tab window, and then plugged back somewhere.
The problem is that QMainWindowLayout::unplug was not returning the
QDockWidgetItem* from the floating tab's layout. When that's the case,
a new QDockWidgetItem is created in QDockWidgetPrivate::startDrag
and will be put into the layout, leaking the old QDockWidgetItem.
Change-Id: Ifb9c1c562cb74383ebff1df0f91ee225c5cdb296
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Originally inherited from Btrfs, recent Linux kernels have a system call
that allows cloning the contents of a file from another one if the
underlying file system supports it.
Change-Id: I9df66b65faef99f3bbed8a88fb6b6009baeef32e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QHttpThreadDelegate doesn't take into account the password to compute the
key of the networkconnection hash. So if only the password for a proxy has
changed, the wrong data gets used for the connection.
This patch simply adds proxy->password() to the key.
Here are the steps to reproduce the bug:
* Use an authentified proxy and provide the correct username but a wrong
password
```
QNetworkAccessManager networkAccessManager;
QNetworkProxy proxy(QNetworkProxy::HttpProxy, PROXY_HOST, PROXY_PORT,
"goodusername", "badpassword");
networkAccessManager.setProxy(proxy);
``
* As expected, the reply returns ProxyAuthenticationRequiredError
* Using the same QNetworkAccessManager, setup a new proxy with the
correct credential:
```
QNetworkProxy proxy(QNetworkProxy::HttpProxy, PROXY_HOST, PROXY_PORT,
"goodusername", "goodpassword");
networkAccessManager.setProxy(proxy);
```
* The reply still returns ProxyAuthenticationRequiredError
[ChangeLog][QtNetwork] Fix proxy-authentication issue, after a wrong password
has been used, when supplying the right password.
Change-Id: Id3b5a2ce71fda81780f3ef2568a73d0022b38815
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Add support for reporting available modes.
[ChangeLog][QPA][eglfs][kms] List screen modes, current and preferred mode.
Change-Id: If64c1512271fadbafbb8c9fd715e64663d598599
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
CID 176641: Control flow issues (STRAY_SEMICOLON)
A "while" statement with no block followed by a stand-alone block
is suspicious.
CID 176639: Program hangs (INFINITE_LOOP)
If "dx > 64L" is initially true then it will remain true.
Fixes a bug introduced in 8c31f75fd3.
Coverity-Id: 176641
Coverity-Id: 176639
Change-Id: I5daa563fe94316633f9525583d8addb8864c42c0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Replace an array of pairs of pointers with an array of pairs of
arrays. Remove the unused end marker. Add a static_assert to
verify that the size of the array matches the constant all loops
use.
Also extract the common part of the mime-type name and append it when
building a QByteArray from it. This is free, as both the new
QStringBuilder expression as well as the old construction from a const
char * incur one memory allocation each.
Replace one indexed loop with ranged-for.
Results on optimized GCC 6.1.1 Linux AMD64 builds:
text -96B
data -160B
relocs -16
Change-Id: Ic23eb06bacbf70afb6f60e2fb8a140bdd3880aca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Turn arrays of pointers into arrays of arrays.
Results on optimized GCC 6.1.1 Linux AMD64 builds:
text -264B
data -512B
relocs -43
Change-Id: I0b64615913d50c286596e66675e89758ce1ec2ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remove the dead QByteArray(data, size) fall-back. We've been
requiring lambdas since Qt 5.7.
Change-Id: I4d9023ab4583f2ee80a74a828fba0d95c2fdb0df
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>