qt_x11_set_global_double_buffer() is dead code since Qt 5.
Change-Id: Ie9a33b6f03dc2e39f12bc790292bb0d227f05c44
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Fix compilation with topleveldomain, textodfwriter
and cssparser features disabled.
Change-Id: I3f061fb09eef36cd640256a46cf77dde85a54d3d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Tests are not supposed to write into the build/application directory,
but rather should output to the temp directory.
Change-Id: Idcdf51226a2d547514aea2fbb2054998d8a3437e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
There is logic for clearing the qgl_curent_fbo pointer
in release(), but it is not always called, causing
the pointer to become stale on QOpenGLFramebufferObject
deletion.
As a last resort, clear the qgl_curent_fbo pointer
on the current context if it’s pointing to the object
that is being deleted.
Change-Id: I0a91d686cec5fcbe4c1520a9ba96cea833bb2249
Task-number: QTBUG-56639
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Add better boundary checks and catch (hopefully all)
cases where invalid binary JSON could cause crashes.
Change-Id: I206510b7c5e3ba953802a5f46645878e65704ecc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Avoid looking up by key twice in a row in various locations, but instead
using iterators and index lookup.
Change-Id: I61a079115199ab9c041ad3a26d36b45ee3f775e0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Do not move on to glGet since the behavior is undefined.
Task-number: QTBUG-48986
Change-Id: Ifd279635ed1b8441f92697965d15ae3ecb59a7e3
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Recent Khronos headers decided to break the world by guarding all
function prototypes with GL_GLEXT_PROTOTYPES which has traditionally
been used for extension headers only.
Until this gets corrected - see
https://lists.freedesktop.org/archives/mesa-dev/2016-September/128654.html
- add the define to the config tests and qopengl.h.
While 5.7 already has some of the qopengl.h fixes due to an upgraded
ANGLE shipping with newer headers, this is a cross-platform issue that
will surface everywhere eventually. Therefore we target the full set
of fixes to 5.6.
This time we also make sure the forced define of GL_GLEXT_PROTOTYPES
is removed before including the ext header, thus apps get the ext
protos only if they actually requested them.
Task-number: QTBUG-56764
Change-Id: Ib2c6d2e7b71b8fb8683424f43e6289e64e4ee46c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
That relation is incorrect. We can have tslib support without evdev.
Task-number: QTBUG-54998
Change-Id: I2c09bad73210fa4a13000077480c70365d482e2e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
On Mac, we use QComboMenuDelegate specifically as
item delegate for the popup list. It happens that
the order of resolving the font for each item
individually would prioritize QComboBox's font
instead of whatever the assigned model's FontRole
would specify.
The fix only requires checking whether FontRole is
valid before falling back QComboBox's properties.
Change-Id: I7208ad1911b30cc52c826c1884a1e19f5acd9fb4
Task-number: QTBUG-56693
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Similar to what we recently did with the Windows font databases.
The goal, again, is to add platform font database support for the
minimal QPA plugin.
Change-Id: Ide5f4ec452c920f169cc31c617cbcf19d8d1764d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
the include path must be absolute, as otherwise the external module pri
will contain a bogus path.
amends 9a088e78.
Task-number: QTBUG-56934
Change-Id: I701f5778d8c1b5586310b08e7763858460455d63
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
No-break-spaces should not be counted in the space data, but rather
be treated as any other non-breakable character. We were already
taking care of this in the loop we reach if the item starts with
a character which isn't whitespace, but there is a second loop for
items that begin with whitespace characters.
The result of this was that in certain circumstances where you gave
the nbsp its own format and made the line wrap, the previous line
would count an extra trailing space and it would swallow the first
character in its following line.
[ChangeLog][QtGui][Text] Fixed a bug where a no-break space would
sometimes cause the first character of the containing line to not be
displayed.
Task-number: QTBUG-56714
Change-Id: Idd760a389052e6de70f6cc397122b217987fa5f2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
When we already have the hash-value we can give it to findNode to avoid
recalculating it, and if don't need it later, we don't need to request
it.
Removes around 1% of qHash calls when running QtCreator.
Change-Id: I0e5e61e26a407f4ac7e029a3ac13ddd553e4994b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
No need to specify a format with alpha for the screen. Comparing to
Windows, Format_ARGB32_Premultiplied was only set in the constructor,
but never actually during runtime as detection enforces eith RGB32 or
RGB16.
Change-Id: I4c2fabbab0d14ee296f9b7e43b02de8a9836d5bb
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Someone cut-and-pasted but forgot one of the changes.
Change-Id: I647dc8117ebfe8ce3d4b26d468b80c15d4e533e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Parameter in setPageSize is QSizeF. Without a specified unit it is hard to know
what to use as input. Units depend upon the underlying paint device
Change-Id: If001b3e9587d6085cc18017680fa20396e936adb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@theqtcompany.com>
Reviewed-by: Steve Schilz <sschilz@pasco.com>
Any other use than for enums should use std::is_[un]signed. Make this
explicit by renaming the type traits.
Change-Id: I494158563c95c710e710d0d337f4e547006df171
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Since the macro is now just a wrapper for std::is_enum,
its use is also deprecated.
[ChangeLog][QtCore][Global] Q_IS_ENUM is deprecated.
Use std::is_enum<>::value instead.
Change-Id: I09b9f4559c02c81f338cace927873318f2acafde
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QLabel already does that for QPixmap, so just do the same for
QMovie's current pixmap.
Task-number: QTBUG-48157
Change-Id: I7b26460f778e56ff017a5efd433f8929f30e4b41
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
We do not need to check for an invalid timer id, as this can only happen
if the above check is already true. Hence, this was doing the same check
twice.
Task-number: QTBUG-56756
Change-Id: Icca9b26c32ce88eab76dd02c6c10b24af07bfad7
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
The intention has probably been to reset a reference, which is not
required.
Task-number: QTBUG-56756
Change-Id: I1ef44b6c9b8365ac5c8d48234137e518558e9398
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Clang warns about self assignment, so use the same mechanism as
Q_UNUSED for HB_UNUSED.
Change-Id: I0894c72fb0936074b15198053464f5bc4b8991d4
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
D2D support has been partially added to recent versions of
MinGW, which one day could make compiling the plugin possible.
Change-Id: I53f91c483d3b900698f4424cb6a72f626e32e60b
Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
Same change as in QColor (d38f86e50b).
No text and data reduction numbers (ubsan build).
Change-Id: I7280a511e785c9442a3a6a1ed55e10011ce0a84e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The old code employed a switch statement to filter timer events,
but fell unconditionally through to the default case of calling
QObject::event(). The final return statement following the switch
is thus dead code.
Fix by turning the switch into an if and returning QObject::event()
unconditionally afterwards, which much better describes the intent
of the code, and also fixes the GCC 7 warning about implicit fall-
through in the switch (which wasn't implicit to a human, but GCC's
comment-reading-capabilities are somewhat limited at this point).
Change-Id: I6756a65b3679a446d09fd721dfd0adc24fdf7772
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
If the QEvent::GraphicsSceneMousePress case falls through, it does so
because d->hasDecoration() == false or the virtual call to
windowFrameEvent() returned false.
It falls through to the case for QEvent::GraphicsSceneMouseMove, etc,
which ensures d->windowData and then checks hasDecoration() again,
with some other conditions on top, and calls the same virtual
function, windowFrameEvent(), with the same arguments again.
Now, it could, theoretically, be possible that that second call would,
due to the presence of a windowData that wasn't there before, return
true when before it did return false. But the only modification to
*this between the calls to windowFrameEvent() is the potential
allocation of d->windowData, which, if actually effected, will have
d->windowData->grabbedSection == Qt::NoSection, hence
windowFrameEvent() won't even be called a second time
It is therefore safe to assume that a break was intended here, so add
it.
Discovered independently be GCC 7 and Coverity.
Coverity-Id: 11149
Change-Id: Id708a1689ed0f0c914622e388c456ea4576fda02
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Change to QT_POINTER_SIZE instead of Q_PROCESSOR_WORDSIZE. The latter
is 8 due to targeting 64-bit, but pointers are 32-bit still in such
builds. For the condition in question it is the pointer size that
matters.
Task-number: QTBUG-56686
Change-Id: I96c203cae91ceb8404606de605c4fdb1a02a9d5f
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remove most type traits from qtypetraits.h, but keep the custom
implementation of is_signed/is_unsigned. This gets rid of
BSD-3 licensed code from Google in a public header (hugh!).
The custom implementations for is_signed/is_unsigned are kept
because the implementations in gcc's standard headers do not
work as we expect for enums - both is_signed and is_unsigned
always returns false there - see also
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59027
[ChangeLog][QtCore][General] Qt now relies on type traits from
the C++ standard library.
Change-Id: I3f2188b46949f04ca4482a6ac9afd3482103f0e1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's arguably better to return a non-existing location than no location
at all. This makes it in line with the documentation for e.g.
QStandardPaths::writableLocation that says
Note: The storage location returned can be a directory that does not
exist; i.e., it may need to be created by the system or the user.
Finally, this was also the behavior of code that used
SHGetSpecialFolderPath before.
Change-Id: I5ee44747a38434535610e45a4d303b36ef79d42a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
SHGetSpecialFolderPath is declared 'unsupported' by Microsoft, and has
problems with non-ASCII characters. Replace it by the newer
SHGetKnownFolderPath.
To fix compilation with MinGW, we have to link in libuuid also in
the bootstrapped tools. The alternative is redefining all GUID's
(like we did for FOLDERID_Downloads), which is arguably less elegant.
Task-number: QTBUG-50570
Change-Id: If99be559bc72de3734ae1fa4d50f960659739898
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Define NTDDI_VERSION, just like _WIN32_WINNT, to be Windows Vista.
Usually NTDDI_VERSION is automatically set by MinGW headers to the value
that matches _WIN32_WINNT. However, for precompiled headers the inclusion
order is that _WIN32_WINNT is set _after_ the relevant MinGW header is
parsed, so this can fail.
The alternative would be to set _WIN32_WINNT via a compiler flag, e.g.
in the mkspecs.
Change-Id: Id59e7083f0d3e00491b54e87647c6c9fabb99795
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use QDataStream to obtain cache key for a palettes that are different
from the default QPalette. This results in unique keys for palettes
created from QStyleSheetStyle's render rules.
Task-number: QTBUG-56743
Change-Id: Icbfe165f705ef3e1c9e88cfc9dca88ff1d1e81e6
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
The existing cursor logic had a couple of issues:
- It made the faulty assumption that we could not use
the NSWindow invalidateCursorRectsForView API for
child NSViews.
- It used NSWindow invalidateCursorRectsForView and
NSView resetCursorRects. This API has been replaced
by the more general NSTrackingArea API.
- It did not implement falling back to the parent
window cursor if the current window has no cursor
set.
Document that QWindow cursors work the same way as
QWidget cursors in that a QWindow with no set cursor
will fall back to the parent window cursor.
Change the cocoa platform code to use NSTrackingArea
exclusively and implement NSView cursorUpdate which
sets the cursor. Handle immediate change on QWindow::
setCursor() manually.
Add QWindow::effectiveWindowCursor() and
applyEffectiveWindowCursor() which finds the correct
window cursor.
Add a manual test for the child window, child widget,
and QWidget::createWindowChild cases.
Task-number: QTBUG-33479
Task-number: QTBUG-52023
Change-Id: I0370e11bbadb2da95e8632e61be6228ec2cd5e9d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
There is logic for clearing the qgl_curent_fbo pointer
in release(), but it is not always called, causing
the pointer to become stale on QOpenGLFramebufferObject
deletion.
As a last resort, clear the qgl_curent_fbo pointer
on the current context if it’s pointing to the object
that is being deleted.
Change-Id: I36cca511da295412332193524219e32607ef8261
Task-number: QTBUG-56639
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
A pending interrupt of a QEventLoop may interfere with
native runModal calls, resulting in Cocoa's main event
loop to be stopped unexpectedly.
After commit 9ab60b9c processEvents() no longer resets
the event dispatcher interrupt flag.
Add QCocoaEventDispatcher::clearCurrentThreadCocoa
EventDispatcherInterruptFlag(). Use it to clear the
interrupt state before calling runModal and variants.
Work around the inability to use platform API in
the print support code.
Change-Id: I52f26f99a63cbb46969db42f65b09a3c3119ad15
Task-number: QTBUG-56746
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
KDE will set the screen scale factors to 1 by default. Make sure
we don't turn off font hinting in that case.
Task-number: QTBUG-56797
Change-Id: Ieab18a7cfe4c1cb7087caab4d881932a4a991bc8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
A pending interrupt of a QEventLoop may interfere with
native runModal calls, resulting in Cocoa's main event
loop to be stopped unexpectedly.
After commit 9ab60b9c processEvents() no longer resets
the event dispatcher interrupt flag.
Add QCocoaEventDispatcher::clearCurrentThreadCocoa
EventDispatcherInterruptFlag(). Use it to clear the
interrupt state before calling runModal and variants.
Work around the inability to use platform API in
the print support code.
Change-Id: I3e03e7ec21ff6c49442c7a6e803a7200aac0b58d
Task-number: QTBUG-56746
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Adds a few missing parts of the conversion from QVariant to QJsonValue
after the introduction of the nullptr QVariant. The conversion the other
way is already implemented.
Change-Id: I8b25dec4b476c4761c5098a60944ff11c36f8bec
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The timerInfo list might get accessed concurrently and cause references
to become dangling. Hence, we need to protect usages with a mutex.
According to tests/benchmark there is no impact on performance.
Task-number: QTBUG-56756
Change-Id: I4bdffccff70d2dca99f4a39defad438afe571ada
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Commented its purpose and the guarded members for
readMutex.
Fixed places where guarded members were accessed without
using the mutex.
Use QMutexLocker instead of manually (un-)locking the
mutex.
Task-number: QTBUG-44357
Change-Id: I3049bb0df30f00659dc284c8e30ad7503c11e7c6
Reviewed-by: David Faure <david.faure@kdab.com>