Mark QPlatformGraphicsBuffer and QSystemTrayIcon as internal.
Change-Id: I39e5b4f635fca21ab0544cd840a113514b6b1e99
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Now we have a swap() member, remove the comment.
Amends bbb440bab2.
Change-Id: I3640d544bbd0927109460d843252c8e5f0aefaf5
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Re-add the move operations, add a swap(), mark as shared
(we're already using them in containers).
QJsonValue is slightly tricky, because it has an anonymous union,
which can't be easily moved in C++. Use the implementation of
the copy constructor as inspiration for the move.
[ChangeLog][QtCore][JSON] QJsonArray, QJsonDocument, QJsonObject
and QJsonValue now have move operations and a swap() member function.
Change-Id: Idfb94a93370ace96100efbd6559ef05b4c5adc39
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Allows categorized logging before QCoreApplication has been created,
which otherwise would silently fail to output anything because the
category would never be enabled, despite QT_LOGGING_RULES being set.
Change-Id: Ia733105c5b6f28e22af511ced5271e45782da12b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Preserve the device pixel ratio in the various helper functions
and when drawing.
Task-number: QTBUG-60026
Change-Id: Ieac9360b00044b6aedd0d3e1ad6e3b16d436f20f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reasons:
* Tag means nothing to the platform, tag is something
the Qt side code will store and then restore, but it's meaningless
for the platform, since it can be either the pointer to an
action (qmenu.cpp) or an item count (qcombobox.cpp)
* Since it's meaningless to the platform you don't know what
to do when trying to implement a platform, this shows in how
the field was being initialized, some initialized to this,
some initialized to 0
On a followup commit we will remove the virtual tag but first
need to fix up other QPAs that don't live in the main repo
Change-Id: I15ac83f3bf7e4c741153d31ac761dbbe6f4b1b52
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
qhstspolicy.cpp:105: warning: Undocumented parameter 'flags' in QHstsPolicy::QHstsPolicy()
qhstspolicy.cpp:105: warning: No such parameter 'includeSubDomains' in QHstsPolicy::QHstsPolicy()
qnetworkaccessmanager.cpp:732: warning: Undocumented parameter 'knownHosts' in QNetworkAccessManager::addStrictTransportSecurityHosts()
Change-Id: I24217d328df12febab30e19e2abd351e87007959
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Mention that it is a private function. Also mention using
QTest::createTouchDevice() for adding simulated touch screens
to autotests.
Task-number: QTBUG-26647
Change-Id: I08c12225768e76b1b9e3fc0fda00af86d44ca766
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Bo Thorsen <bo@vikingsoft.eu>
Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
A bit-field was necessarily equal to either zero or its (single-bit)
mask; so comparing to the mask was superfluous.
A local value set and then conditionally over-ridden could easily be
made const by using the condition in a ?: assignment.
A use of qMin() lent itself to turning into a simple conditional
assignment.
Change-Id: I541d98044b23b8c51e6169f617a5841ba8fffc55
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
skipToNextSection() returned via a local temp that served no purpose.
The accompanying comment didn't quite explain what it set out to.
Change-Id: I31581323df374653db9c2558a3bd63409aafb178
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Several cases all fell together; their code tested away one of them;
so putting it last and falling through to it avoids the need to test.
Change-Id: I0bf555710604a56faa61b60bfe5484d5c5a1ee6b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Since QMacPasteboardMimeTiff was moved out of the cocoa
plugin and into platformsupport, we take the opportunity to
give the code some overhaul as well.
Change-Id: I7d5425d336ba41474698915008b2086e98ea49dc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This will add copy/paste/dnd support for QPixmap and QImage
to all darwin platforms (and not just macOS, as it is today).
Task-number: QTBUG-57428
Change-Id: Iefc876c0a347077322f195b55c49f2c1c4b4a34b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
There's no reason to use it only on some functions with return values
and not others.
Change-Id: If50a669f49e9e2f71173dea94465a5de58a7783e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We have two functions to get a substring without doing some
calculations involving size():
- mid(p): mid(p, size() - p)
- right(n) : mid(size() - n, n)
(left does not involve size(), so isn't in that set). What was missing
was a name for
- f(n): mid(0, size() - n)
As an action, it's called chop(), so call the transformation version
chopped().
I made chopped(n), n < 0 or n > size(), undefined, because QString(Ref)
::left() is broken[1], while the QByteArray implementation is not. This
is the only way to get consistent behavior among the three classes.
I's also the correct thing to do.
[1] instead of returning the empty string for negative indexes, it
returns the whole string.
[ChangeLog][QtCore][QString/QStringRef/QByteArray] Added chopped(n), a
const version of chop(n).
Change-Id: I6c2c5b16e0060fa924ced5860f21f2d0f23bd023
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
A QVariant can only be converted to a QByteArray if it has user type
QMetaType::QByteArray or QMetaType::QString. The way it stood, we
always tried to convert the mime data to a QByteArray, and
then put the result into a QVariant. This would fail if the mime
data contained e.g a QPixmap.
This patch will inspect what kind of data the QMimeData contains, and
convert it to a QVariant using the expected API.
Task-number: QTBUG-57428
Change-Id: I67054424fe8c45873bab8305e7b44de939aae0fb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
If the mouse cursor is over a menu entry with a submenu, and the
submenu is open, quickly moving the mouse to a near menu entry and
clicking it sometimes results in the click being eaten: this happens
when the mouse is pressed before the submenu disappears and released
after it disappeared: the submenu resets d->mouseDown that is a static,
causing the mouse release event on the action we want to have no effect.
Set d->mouseDown to 0 only when the window is hiding is the actual
window that contains the mouseDown, otherwise is still valid.
Change-Id: I2c981b9432728e9e7518c30a146c9595199f8afe
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Initialize a deleter for a new object, created by
QSharedPointer::create(), only after the object is actually
constructed.
[ChangeLog][QtCore][QSharedPointer] Fixed undefined behavior when
creating an object with QSharedPointer::create() and its conscructor
throws an exception.
Task-number: QTBUG-49824
Change-Id: I07f77a78ff468d9b45b8ef133278e8cdd96a0647
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
drmEventContext has grown by one pointer, so the build fails with an
error about a member without initialization.
qeglfskmsgbmdevice.cpp:147:5: error: missing initializer for member ‘_drmEventContext::page_flip_handler2’ [-Werror=missing-field-initializers]
Change-Id: I0e1a09998253489388abfffd14b6014b1ddc90e1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Clang 3.8 has support for __attribute__((target(xxx))) and its SIMD
headers can be included unconditionally.
Change-Id: Ic15b7ff417c8412893e5fffd14b5b42b950b48d7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Some are enabled by the recent addition of QStringView, but some were
wrong already before.
Change-Id: I3f900a80c47011af4c0370e32acb7478404b4867
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
_mm_cvtps_ph is usually defined as a macro:
qfloat16.h:122:37: error: use of old-style cast [-Werror=old-style-cast]
Change-Id: Icd0e0d4b27cb4e5eb892fffd14b516ec47826c0c
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This enforces decoupling and in the case of QMacStyle, isolates
QtWidgets and therefore end user applications, from Carbon/HITheme.
Windows and Fusion are platform independent, so they remain built-in
(but mostly because the Windows style is tightly coupled to other styles
like QStylesheetStyle).
Task-number: QTBUG-59428
Change-Id: Id6519fe0c5269c1bce5b5921f9db06257032a1c9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
The late geometry update on the widget has been confusing
some of our users.
Change-Id: I7f2600322be0a0c54fac3beb42065413a0693f74
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
When tearing off either a non-scrollable multi-colume menu
or a scrollable menu, displaying the torn-off menu crashes.
The root cause is when the torn-off menu is created, the
tear-off menu's style, margins and other attributes are not
set to it. The patch is to ensure the torn-off menu has
the same attributes as the tear-off menu does and set the
torn-off menu with a correct menu size.
Task-number: QTBUG-24815
Change-Id: Icea45f149ea8792671af4a62e62cad6ee01a1f95
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Currently the contents margins and the menu paddings are not considered
for calculating the menu size, the positions and the size of tear-off
bar, scrollers and the positions of the menu items when scrolling the
menu, which results in the following problems when valid contents
margins and/or menu paddings are set:
- The tear off area is displayed in a wrong position. The mouse events
are not handled correctly in the tear off area. For example, when you
click in the tear off area, the menu should be torn off but nothing
happens
- For a multi-column menu, the menu width is not calculated correctly
- For a scrollable menu,
- the menu width is not calculated correctly
- the menu items are not displayed in correct positions
- the scrollers are not displayed in correct positions
- menu items are displayed on the area of borders and margins when
scrolling the menu
- the last menu item is not displayed above the bottom of the content
area when scrolling the menu to the end.
The changes are to fix the problems above.
Change-Id: I7931e1088dff0029f2d4825e2aa34b4e32fdccd9
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Seems like an obvious omission.
[ChangeLog][QtCore][QVariant] Can now convert QUuid to and from
QByteArray, not just QString.
Change-Id: Ib56ae86ca0c27adaf1e095b6b85e64fe64ea8d18
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When multiplying a QMatrix4x4 by itself, we were clobbering the very
matrix we read from. Employ read-caching to avoid this aliasing problem.
[ChangeLog][QtGui][QMatrix4x4] operator*=() now calculates the correct
result even if the RHS and LHS are the same object.
Change-Id: I8534d56cfdd62c336577125127f05173fcec2873
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
QMovie has an error signal, but it is not possible for users to
"catch" all errors, for instance, if they occur at construction time, and
furthermore, it may not be convenient to add interception of the signal
just to find out what the error was.
[ChangeLog][QtGui][QMovie] Added lastError and lastErrorString accessors,
as a convenience over connecting to the error() signal.
Change-Id: I9c6ef70694c67986ecd30b5dc1b321c4dfa5c315
Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
If a file cannot be opened for some reason (like running out of FDs),
emit the error signal.
Change-Id: I9586dda34b2f2cef73593c6dcb855b29d63c2dbc
Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
The original commit only added support for GCC and Clang, but not ICC.
Amends 73331eeb
Change-Id: Id7638cf1b538edb1008fb3aa10754c1f517a994f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Later, the Windows XP style will be removed entirely by means of
being merged with the Windows Vista style (which inherits from the
XP style).
There was actually no reason for these styles being separate
classes in the first place, because both result in the same
appearance for controls on the running version of Windows.
Therefore, the windowsxp style merely appears as a "broken"
version of the windowsvista style, with only minor differences
based on the additional metrics that the vista style provides.
The windowsxp style does NOT, and never did, allow users to get
a Windows XP style appearance on Windows 7 and above (which is
currently Qt's minimum supported platform). Therefore, now that
Qt no longer supports Windows XP, the windowsxp style is unusable.
[ChangeLog][QtWidgets] The windowsxp style is no longer available
as a separate style, because it did not (and cannot) actually
provide an XP-style appearance on currently supported Qt platforms.
Change-Id: I513d9bce3f247f97cfb28dfee88fe888469e0a6f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>