These code paths are actually never exercised at all.
Change-Id: I95a5cfa0173e265573c30378ec2e03a2ddf954e4
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Required for implementing upcoming QStringView's member functions such
as compare(), indexOf(), endsWith(), ...
Most implementations of the function body just add the length to the
begin pointer to obtain an end pointer and then either no longer use
the length, or decrease it in lock-step with increasing the begin
pointer.
The only exception is MIPS DSP's qt_ucstrncmp_mips_dsp_asm(), which
gets the length passed in as an uint, implicitly converted from the
int parameter, proving that calling the function with negative length
was always undefined behavior, and therefore using an unsigned type
does not introduce incompatibilites.
I don't stand a snowball's chance in hell to fix the assembler
routine, but since the code is only included for MIPS32, we don't need
to do anything except be paranoid, add a static_assert that uint is
the same size as size_t, and keep calling the old code.
Dropped Q_COMPILER_LAMBDA in some places. We require lambdas since 5.7.
Also hold lambdas by value, not by reference. This stuff is supposedly
completely inlined, anyway, so there's no reason to make the code more
complicated with magic lifetime extension of temporaries bound to
references.
Change-Id: I0c7bdc47648b873992b51b2e9d47d808390320ea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The extension of ucstrncmp to size_t will introduce the first user
of this loop unrolling construct with size_t indices.
Instead of choosing between int and size_t, make the index type a
new template argument to facilitate a step-by-step transition from
int to size_t users.
Change-Id: I9d8fa7aaefa572130403bd19e11f52c58dff0a4d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
While they're relatively Mac-specific, conceivably multiple style
implementations could use them, and it breaks a tight coupling between
QStyleOption and QMacStyle.
Change-Id: I5915c519129538a9ac39a34d5cfc3aeb838145d6
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
These checks are now done entirely at runtime.
Change-Id: I63cfee6123fc8465cee2ee36049ece0e5262ce8f
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
We can use Q_GLOBAL_STATIC for this, which is thread safe.
Change-Id: Ifea6e497f11a461db432ffff1449afe930f72d5d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Return a QLatin1String instead and only if that is not empty,
convert it into a QString.
Also saves 320B in text size on optimized GCC 6.1 AMD64 Linux
builds.
Change-Id: I5432d213a6200e45414626bedb9f216bafaf1108
Reviewed-by: David Faure <david.faure@kdab.com>
The lastPoints is used outside of the mutex-locked area, so of course
it cannot be a reference.
Change-Id: Ic69f9acd643366f8086e96b026a47d5de40cd77b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
These appear in insertSpacing() and insertWidget() only
and without any justification of why they may be needed.
Several other instances of the pattern these try/catch
blocks were guarding, i.e. allocate new QBoxLayoutItem
and insert to the list of items, were left unguarded,
leading us to believe this may not be useful at all and
can be safely removed.
Change-Id: I887fbde9d10e10f4f5daaa37f6f2892bd4038d58
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
If the cache insertion fails, regexp is deleted and
"subject.contains(*regexp);" is UB.
Coverity-Id: 176868
Change-Id: Ibf9340e019f09fdb8b2a82de8877cdfb2ffe1372
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Move non-monitor-specific members of QXcbScreen to QXcbVirtualDesktop:
they relate to an X screen rather than to a monitor.
It allows to save some memory and X server callings that were
previously made for each monitor.
Change-Id: I079cdec5f27ca93a2aade00c3040936a0e50b494
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
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>