We now have qtHookData, which is a better (and cheaper) way to add hooks
for object creation and deletion. For binary-compatibility reasons we
cannot remove it in Qt5.
Change-Id: Iecd9f4e1195f90279c395845fa26c6301b67b9a1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Other methods that call this method check for errorMessage to be
nullptr, so better check here, too.
Change-Id: I8cf4e9d4f5eaafcfc8309dc351ae3b7027c40a98
Reviewed-by: David Faure <david.faure@kdab.com>
The contact patch of a finger on a touchscreen tends to be roughly
elliptical. If we model it as a QRectF, it's not clear whether the
ellipse should be considered to be inscribed in the rectangle and then
rotated, or whether the rectangle represents the outer bounds of the
rotated ellipse. In practice, since most touchscreens can't measure
rotation, it is effectively the latter. But modeling it that way means
information is lost if the touchscreen can measure rotation: you can
determine the bounds of a rotated ellipse, but you cannot derive the
rotated ellipse from its bounds. So it's better to model the axes
of the ellipse explicitly. This has the added benefit of saving a
little storage space: we replace 3 QRectF instances, whose width
and height will normally be the same, with 3 positions (bringing the
total to 12 QPointF's) and one set of axes. Further, most applications
only care about the center of each contact patch, so it's better to
store that explicitly instead of calculating QRectF::center() repeatedly.
In the past there may have been an assumption that the width of the rect is
the same as the horizontalDiameter of the ellipse, so the rect could be
considered to be rotated, and the ellipse to be inscribed. But in
d0b1c646b4 and
40e4949674 the point was made that the rect
is actually the bounding box of the rotated ellipse.
[ChangeLog][QtGui][QTouchEvent] TouchPoint::rect(), sceneRect() and
screenRect() are deprecated; a touchpoint is now modeled as an ellipse,
so please use pos(), scenePos(), screenPos(), horizontalDiameter()
and verticalDiameter() instead.
Change-Id: Ic06f6165e2d90fc9d4cc19cf4938d4faf5766bb4
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Provide appropriate alternative documentation where applicable.
Change-Id: I73d810938bb961a74d06d8cedb05c38675363ef0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This adds documentation for QOperatingSystemVersion::OSType and cleans
up some extraneous quotes.
Change-Id: Idaeb163caded9a51ce0fbcc812eb622b4227844e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
[ChangeLog][Platform Specific Changes][Linux] Added support for
cross-compilation for the MIPS CI20.
Task-number: QTBUG-57411
Change-Id: I5be2f53323b1d3c2323cd51064397590c143af1b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Q_COMPILER_REF_QUALIFIERS is not yet supported
on all platforms, so clangqdoc must ignore
functions that are defined only when it is
defined. This change adds && !defined(Q_CLANG_QDOC)
to some #if defined(Q_COMPILER_REF_QUALIFIERS) tests
to allow clangqdoc to use old declarations.
Note that Q_CLANG_QDOC should also be used instead
of Q_QDOC from now on, so that we know that uses
of Q_QDOC have been examined to see if they are
still required for clangqdoc.
Change-Id: I910be70df63eca09985728c7b9eba473aed141ba
Reviewed-by: Martin Smith <martin.smith@qt.io>
Some declarations in QProcess are declared only
for Windows. This change uses the Q_CLANG_QDOC
macro so that #if defined(Q_OS_WIN) becomes
This ensures that Windows-specific documentation
always gets generated. The macro is added in
both .h and .cpp files.
Change-Id: I632fc52d010cd7c0399fd191f44cbacf6ed25aff
Reviewed-by: Martin Smith <martin.smith@qt.io>
Duplicate qdoc comments removed for setPreciseRemainingTime(),
remainingTime(), and deadline(). Added qdoc comments for swap(),
and two new assignment operators. Also added a few parameter names.
Change-Id: I5c19ca3bdef876019c5742397249ea9e0c066bf3
Reviewed-by: Martin Smith <martin.smith@qt.io>
GLint, GLuint, GLfloat, and GLenum must be declared for
clangqdoc because it must generate the documentation for
opengl support whether or not opengl support is provided.
Change-Id: I1dccac86fe72a30509bc563dda0b60bcb156bc0b
Reviewed-by: Martin Smith <martin.smith@qt.io>
It's a bit large for an inline function.
Note for Qt 6 that this function is nonsense.
Change-Id: If6af5d3538aac86d55313ba6accdb13f892e6564
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This new API addresses the use case where we want to replace
a widget by another one inside the splitter. Up to now, the
way of doing would include removing one widget and add the
new one at the same place. However, this triggers a series
of resize and paint events because of the successive changes
in the splitter's children leading to a relayout of the
remaining children.
The new widget inherits the same properties as in the previous
slot: geometry, visibility, and collapsed states. The previous
widget, returned by the function, loses its parent and is hidden.
Change-Id: I3dddf6b582d5ce2db8cff3c40bc46084263123ac
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
“tlw” suggests that the API accepts top-level QWindows
only, which is not the case. Use “window” instead.
Change-Id: I9f58c638c33b33c3333c52a3cf291f311d799fe2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Make a QRGba64 helper function for LCD blending following our standard
form.
Change-Id: Ib29cf8e780a042ed46554c55c67a698a0e3eddcd
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Also remove references to WinCE in comments.
Change-Id: I175e0ba5f9597b09532c507497a51a55f9e0b5c0
Task-number: QTBUG-56853
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Use C++ 11 member initialization in value-type structs.
Task-number: QTBUG-51673
Change-Id: I668389b4a0ad1d862a505b740d67357cb9c2a3dc
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Prevent icons from overlapping by adding a small margin (as does
QWindowsVistaStyle) should the total height equal the icon size.
Task-number: QTBUG-52353
Change-Id: Iad0b7374a22129ee92ff3cc4479118c10db377aa
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
The aim of this patch is to allow the configuration of the connect
timeout used by QAbstractSocket that is currently hardcoded to 30
seconds.
Using QNetworkConfiguration for this allows to adapt the timeout per
network configuration (e.g. 2G vs wired lan)
[ChangeLog][QtNetwork] The connect timeout from QAbstractSocket
is now configurable through QNetworkConfiguration.
Change-Id: I1dc4051be2c74f925f7a9e0a9ccef332efc2e370
Reviewed-by: Lorn Potter <lorn.potter@canonical.com>
Fix
QtGui: WARNING: qtbase/src/gui/opengl/qopenglprogrambinarycache_p.h does not have the "We mean it." warning
Amends change 85f868e73e.
Change-Id: Id2e8c3e7ac4fa732c0a3d99faab91f08121fba96
Task-number: QTBUG-55496
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Fix warning:
socket\qnativesocketengine_win.cpp: In member function 'bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType, QAbstractSocket::NetworkLayerProtocol&)':
socket\qnativesocketengine_win.cpp:337:26: warning: 'WinVersion' is deprecated: Use QOperatingSystemVersion [-Wdeprecated-declarations]
QSysInfo::WinVersion osver = QSysInfo::windowsVersion();
^
In file included from ..\..\include/QtCore/qsysinfo.h:1:0,
from ..\..\include\QtCore/../../src/corelib/global/qglobal.h:1150,
from ..\..\include\QtCore/qglobal.h:1,
from ..\corelib\global\qt_pch.h:56:
enum QT_DEPRECATED_X("Use QOperatingSystemVersion") WinVersion {
Change-Id: I9b060d886af3b627ac4b6eeb3321629734cc1e46
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
To support multiple displays in the emulator, it is necessary that an
additional EGLFS device integration be added to query information about
the available screens, and to help associate a window surface with a
screen.
Change-Id: I852c27bd66f5f32a92c4ff876838ac2f6fbde86a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Fixes MinGW developer build:
qwindowsnativeinterface.cpp: In member function 'virtual void* QWindowsNativeInterface::nativeResourceForWindow(const QByteArray&, QWindow*)':
qwindowsnativeinterface.cpp💯12: error: enumeration value 'OpenVGSurface' not handled in switch [-Werror=switch]
switch (window->surfaceType()) { ^
cc1plus.exe: all warnings being treated as errors
Amends change dafd0955c6.
Change-Id: I43f7148281fcf47613958427e25a784f42920806
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Use C++ 11 member initialization in value-type structs.
Task-number: QTBUG-51673
Change-Id: Ic45ab21c738ec7b7d526e30a1de2e19206da89ed
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Add a QFbScreen implementation that uses DRM dumb buffers and page
flipping, thus implementing a vsynced, double (triple) buffered plain
software platform plugin. Besides better supporting systems that by
now only do fbdev via (possibly buggy) emulation, this can also be an
enabler for implementing certain types of 2D accelerated compositors
e.g. for Wayland.
Enable with QT_QPA_FB_DRM=1. Right now there is no good way to
autodetect the support for dumb buffers early enough so the default is
always the traditional fbdev path.
Long-term this will also enable proper multi-display support like with
eglfs' DRM backends. Multiple QScreens are not yet reported currently
due to the single-screen limitations of fbconvenience.
The generic DRM code is shared with eglfs, meaning configuration
happens via the JSON file specified in QT_QPA_(EGLFS_)KMS_CONFIG. This
allows changing the screen resolution, disabling outputs, etc.
[ChangeLog][Platform Specific Changes][linuxfb] Added experimental
support for DRM dumb buffers. Enable by setting the environment
variable QT_QPA_FB_DRM to 1.
Task-number: QTBUG-56306
Change-Id: I4bdcf16fff67412183220dffa0c4ea235c5cad3d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Double-tapping on a touchscreen typically requires a higher threshold
than double-clicking with a mouse, because it's harder to hit the
same point twice with your finger. This is intended for use in
QtQuick's new TapHandler.
[ChangeLog][QtGui] environment variable QT_DBL_TAP_DIST customizes
the amount of movement allowed when detecting a double tap via touch.
Change-Id: I83a9be363f22c1086fd39580aa95055f2b3ff5c7
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Introduce a glProgramBinary-based disk cache in QOpenGLShaderProgram.
By switching the typical
program->addShaderFromSourceCode(QOpenGLShader::Vertex, ...)
program->addShaderFromSourceCode(QOpenGLShader::Fragment, ...)
invocations to
program->addCacheableShaderFromSourceCode(QOpenGLShader::Vertex, ...)
program->addCacheableShaderFromSourceCode(QOpenGLShader::Fragment, ...)
the compilation may be skipped via gl(Get)ProgramBinary and a disk
cache, when supported. Such QOpenGLShaderProgram instances will have
no QOpenGLShader instances attached. Instead, the entire program
binary (which is driver-specific) is loaded as-is.
Support means OpenGL ES 3.0 or the presence of
GL_ARB_get_program_binary, in combination with >= 1 supported binary
formats. Note that some drivers claim program binary support but
expose no formats. This amounts to no support in practice.
When support is not present, calling the new functions is equivalent
to the non-cacheable variants. If the OpenGL driver changes (vendor,
renderer, version strings), recompilation and storage of the new,
potentially incompatible binary program will happen transparently.
The cache can always be disabled by setting
QT_DISABLE_SHADER_DISK_CACHE=1 or the new application attribute
Qt::AA_DisableShaderDiskCache.
Location-wise the primary choice is the shared cache
(GenericCacheLocation). If this is not available or is not writable,
the per-process one (CacheLocation) is used instead.
In addition to the new public APIs in QOpenGLShaderProgram, the main
shader users in QtGui are migrated as well. (OpenGL paint engine,
glyph cache, blitter, eglfs mouse cursor). This means that any
application using QPainter on OpenGL or widgets with eglfs will
benefit from the improved startup times. Qt Quick will follow suit as
well.
[ChangeLog][QtGui][OpenGL] QOpenGLShaderProgram offers a built-in
program binary disk cache for systems with OpenGL ES 3.x or
GL_ARB_get_program_binary. This can lead to significant increases in
performance when it comes to application startup times for
example. Usage is opt-in for direct C++ users of the class, however
Qt's own main users of shaders, including Qt Quick and QPainter's
OpenGL engine, are migrated to use the new, cache-enabled APIs.
Opting out on application level is always possible via
Qt::AA_DisableShaderDiskCache.
Task-number: QTBUG-55496
Change-Id: I556f053d258bfa6887b1d5238c9f6396914c5421
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Turns the two set of tables in QDrawHelperGammaTables into two
QColorProfile classes that use similar structures and can be reused for
other gamma correction.
At the same time clean-up and improve the comma-correct blending code
to use the new profiles and QRgba64 precision.
Change-Id: I302bd87a5c836e1010fff6d633eeb56fd4ae2ff0
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Now that the generic DRM code is shared between multiple platform
plugins, the QT_QPA_EGLFS prefix is not that ideal anymore. Introduce
aliases without EGLFS.
Task-number: QTBUG-56306
Change-Id: I0cf374f8c8d12aa0eab2f026ffa9201b3af35ce2
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Unifies the three conditions where we do not treat a window as a
top level window.
Uses QWindow::isTopLevel() instead of manually checking parent.
Updated the comment about embedded windows, which applies to all
embedded windows, not just QAxServers windows.
Change-Id: I7f9dbdf50044bf375ca21818ac29fbd3fe502166
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Last used in 2011, to determine QCocoaWindow::globalGeometry(),
which probably shouldn't have used transientParent in the first
place.
The parent is available through casting QPlatformWindow::parent().
Change-Id: I93fbcb41765944fbe0b79981ccf7d0062bb57719
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Use newly introduced EnableNonClientDpiScaling() function to fix
the decoration having the wrong size in multimonitor setups with
per-monitor DPI awareness.
Task-number: QTBUG-53255
Change-Id: Ic6e2f2a92f790259107d2a0837b96177cf3adb5f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Analogous to QWidget::setAttribute(), introduce an API to easily
enable/disable a single window flag without having to resort to
w.setFlags(w.flags() | Qt::NewFlag).
Change-Id: Ib0f7254a34c8d884cdec181c41b99e5ef035d954
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
clangqdoc must parse the declarations for QSctpServer and
QSctpSocket, not just for Q_OS_WIN, so Q_CLANG_QDOC must be
tested as well.
Change-Id: I70f5a0542b654826d9d36fe68930752e68caf6b6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
clangqdoc must parse the declaration for QWinEventNotifier
for all platforms, not just for Q_OS_WIN, so Q_CLANG_QDOC
must be tested as well.
Plus the qdoc comment for an invisible static function is
converted to a non-qdoc comment in qvariant.cpp
Change-Id: Ic41731decca55b3be837f9c5f832310513773e60
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Giving the URL of unicode.org isn't much use; the standard is enormous
and the reader shall have trouble finding the specific table that
enumerates the direction types. Found a more specific URL (that looks
like it should be stable) for this one link.
Change-Id: I8abcedf530baf692d7e0c7f146f3066df223951f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Instead of relying on AdjustWindowRectEx() and dirty-handling,
capture the rectangles before and after the processing of
WM_NCCALCSIZE and calculate the frame from that. This allows
for changing window frames by handling WM_NCCALCSIZE and
monitor-dependent window frames when using High DPI scaling.
Task-number: QTBUG-53255
Task-number: QTBUG-40578
Task-number: QTBUG-56591
Change-Id: If8364a5440a6324ea5d470bf5b74e68942285abe
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit re-enables support for OpenVG in Qt, but not in the
same way as in Qt 4.8. The first part is about adding a test
and using the new configure system to enable OpenVG.
There is still support code in Qt for setting up EGL to provide a
surface and context for rendering with the OpenVG API, this commit
enables a path to do so.
Normally to get access to an EGLContext from a QWindow you do so via
QOpenGLContext, but in setups without OpenGL but with EGL and OpenVG
this doesn't make sense (there would be no QOpenGLContext). So the
intended way is to use a QWindow to get an EGLSurface, then create
an EGLContext directly (without going through QPA).
Change-Id: I0f75aadbaa3cd006deb7e6fd12cfbb574870fba4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
It is possible to have support for EGL without having support for OpenGL
for example with OpenVG. Unfortanately many features of EGLFS require
OpenGL (Cursor, MultiWindow, QEGLPlatformContext, QBackingStore), so the
plugins become pretty useless on their own. This is necessary if you
still want to use Qt as a method to provide an EGL surface to render to
via QWindow. This is the method by which Qt Quick uses OpenVG to render
its content when available.
Change-Id: I34973b21bf1932865950ce6a78b71b3a29360d65
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>