This patch makes sure that all events posted using Qt on top of the
GLib event loop have the loopLevel counter incremented.
This is done since Qt depends on the fact that all deleteLater() calls
are issued within the scope of some signal handler (in other words,
triggered by the chain sendEvent() -> notifyInternal2()).
There is a side effect though: in the conditions affected by this
patch, that is deleteLater()s issued within a glib event handler for
example, manually calling processEvents() or sendPostedEvents() with
or without the QEvent::DeferredDelete flag has the same effect, and
deferred deleted events are always processed.
While this is not a currently working feature which the patch breaks,
this side effect seems to be difficult to avoid without separating
sendPostedEvents() and processEvents() into a public and a private
method, in order to detect when they are manually called.
Such change could perhaps be done for Qt6.
An autotest for QTBUG-36434 is also included.
Autotesting for QTBUG-32859 seems to be more challenging in this
respect, due to its dependency on GLib.
Task-number: QTBUG-18434
Task-number: QTBUG-32859
Task-number: QTBUG-36434
Change-Id: Ib89175aa27c9e38bca68ae254d182b2cd21cf7e9
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
QPlatformWindow::mapToGlobal() should be used to obtain global coordinates
for foreign/embedded windows. They do not have a parent QWindow, but the
geometry passed in might be local to their native parent window.
For normal top-level windows, this is a no-op.
Task-number: QTBUG-50206
Task-number: QTBUG-41186
Change-Id: I00889b28db69ae65057f48b9e74bd4d8cfffa136
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Ensure no detaching occurs by using Container::constFirst()
and QImage::constScanLine().
Change-Id: Ie197d795d9329de8be76ed388ba2c71ccf201f5c
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Preparation for Apple tvOS support, which shares a lot with the iOS
platform.
Change-Id: I543d936b9973a60139889da2a3d4948914e9c2b2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
The user-defined copy assignment and copy constructors
inhibit the move special member functions.
We cannot do something about it in Qt 5, because the
class is exported (which it shouldn't be), and because
making it trivially-copyable might change how it is
passed to functions by value, so we need to supply all
the missing member functions manually.
Change-Id: Ic710b449f6abd386449fa6df71e8bc9bd0f98d2b
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Unfortunately, we cannot rely on Q_DECL_EQ_DEFAULT, so I
needed to code the special member functions by hand.
The 'reserved' field is pretty useless, since the
existing ctors didn't initialize it, but just in
case someone finds a way how to store information
in there, deal with the field in the usual way:
set to nullptr in the move ctor and swap in the
move assignment operator.
Also schedule all this for removal again come Qt 6
(then without the reserved field).
This amends a83be780ae,
which only dealt with QXmlStreamAttribute.
Change-Id: I6898e5d0423c9519f7c07d23e2c6d2700508151e
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
The user-defined dtor inhibits the move special member
functions.
We cannot do something about it in Qt 5, because the
class is exported (which it shouldn't be), and because
it's polymorphic (which it also shouldn't be), so we
need to supply all the missing member functions manually.
Add a note to remove the inheritance from QPixmap in Qt 6.
Change-Id: I86a1a3fe7b84247b3e604cb008aa17bb673c8468
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Running on Raspberry Pi casting to IInputPane2 fails with E_NO_INTERFACE
as there is no input pane available for the device.
However, if E_NO_INTERFACE is returned from the lambda, then deletion of
the ComPtr holding the AsyncAction in runOnXamlThread() crashes
somewhere deep internally of Release().
As we do not check for the return value anywhere, avoid the crash by
returning S_OK instead.
Change-Id: Icd38ec482b365285a482e5ff792ec1b4f13317d5
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Change-Id: If31dd078aeb92e479db8c1f0a5e58e56b549b5f6
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Our abstract item views are using a timer before starting autoscroll.
Constant dragginUpdated (re)starts this timer again and again and it
actually never times out (== no autoscroll). It looks like a bug in Cocoa since 10.11,
they test: respondsToSelector:@selector(wantsPeriodicDraggingUpdated:) with
':' at the end, though they need a method without parameters; as a result
QTBUG-32761 was re-introduced.
Let's make them happy and respond to this selector also (never gets called
actually).
Change-Id: I3b7bb0a455124f84c97fc350f69486bf0fc5d5fc
Task-number: QTBUG-32761
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
Those were added in ancient times to make QWindowsPipeWriter compile
on Windows CE. It was never used though.
Change-Id: Ica71b182f7ee4e47d9e33638d78475842b2ecdff
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
... for poor compilers (such as GCC).
The test (!d) was changed to match what other
member functions test for, e.g. toVariantHash().
Change-Id: I85aee0df6e50da3623ad0afce24abb586e0bd1bc
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Convert rgba64 color table to a new rgb32 color table only once. Use
this cache when required.
This patch can 2x speed up gradient painting using 32bit color format.
Task-number: QTBUG-50930
Change-Id: I9212e01e397c2e0127cdf3070cc49880a2d8df88
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
- don't call QList::removeAt() in loop. Just call erase() with two iterators.
- don't re-evaluate QList::count() because of result is already cached.
Change-Id: I4b3596df4a388f1d39b523c27decad612044cec6
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
It must clear the previously cached sharedData->staticSelectors,
or else QFileSelectorPrivate::updateSelectors() does nothing and
the newly added static selectors end up being ignored.
Change-Id: If6997664629199be9f00de64c5dd01de2bf0a044
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
TUIO is not a standard "device" as the first application takes
exclusive ownership, this patch makes it deliver the events to the root
window when the app is not focused, allowing for interactive
application development on simulators running on the same desktop.
To force delivery set the environment variable
QT_TUIOTOUCH_DELIVER_WITHOUT_FOCUS to 1
Change-Id: I157f59982a1b2025ef8efdf709fe40c78339c1b4
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
... by replacing them with C++11 range-for loops.
The function QObject::children() returns by const-reference,
so they can be passed to range-for without further changes.
Change-Id: I8cd2921165c45020914dd3a23b1f18b519fe7900
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... by replacing them with C++11 range-for loops.
To avoid detaches of these mutable Qt containers,
wrap the container in qAsConst().
Change-Id: I90fd517ad542ef92034403c15ebb8300a56ac693
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Unbundled TUIO messages were being ignored. TUIO protocol
defaults to bundled but states it should work with any
Open Sound Control (OSC) implementation. Unbundled handling
was already in place, just fixed the logic to make it work.
Change-Id: I6d91449bd2069ac891e493fb7f50c010bcc3e8be
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
- Don't iterate over QMap::keys(), but directly
over the map, saving a temporary QList and
double lookups.
- Always append the item separator, and chop
it off once at the end, which allows to
fold the separator into the existing string
builder expression.
Change-Id: Ibd20ea292695098e0fc575025b1827a75aabfd1e
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
The user-defined copy assignment and (on QMatrix) copy
constructors inhibit the move special member functions.
We cannot do something about it in Qt 5, because these
classes are exported (which they shouldn't be), and
because making them trivially copyable might change
how they are passed to functions by value, so we need
to supply all the missing member functions manually.
Change-Id: I59e480d7ba02cac7e3d654cb3345f541e0701f4c
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... by replacing them with C++11 range-for loops.
This is the simplest of the patch series: Q_FOREACH took a
copy, so we do, too. Except we don't, since we're just
catching the return value that comes out of the function
(RVO). We can't feed the rvalues into range-for, because
they are non-const and would thus detach.
Change-Id: I457942159015ff153bdfc6d5f031a3f0a0f6e9ac
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Optimize the string splitting by using splitRef(),
avoiding the creation of lots of substrings. Twice.
While touching the for loop, port to C++11 range-for.
Change-Id: Ia666896bc5b96c4b6973498cc4a9eeb24cadba6d
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Q_FOREACH over a QVarLengthArray is a partcularly
bad idea.
Use C++11 range-for (without qAsConst(), because
QVLA isn't CoW).
Change-Id: I5ee55557577f183151d3871e4518382c4adf0237
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
QPainterClipInfo is larger than a void*, so holding it in QLists
is needlessly inefficient. Worse, the code could come to depend
on the fragile property of (inefficient) QLists that references
to elements therein never are invalidated.
Fix by marking it movable and holding it in a QVector instead.
Port from op<< to append() to reap rvalue push_back().
Change-Id: I3af17eca2443d26a795381635510b8b9a5795e5f
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Buddy is larger than a void*, so holding it in QLists is
needlessly inefficient. Worse, the code could come to depend
on the fragile property of (inefficient) QLists that references
to elements therein never are invalidated.
Fix by marking it movable, and holding it in a QVector instead.
Since QVector requires a default ctor, drop the pointless
existing ctor and use aggregate initialization instead.
Use QVector's rvalue append.
Change-Id: I696ca4f03dbe362a5438be209debbcd966fe8130
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
The only place such headers can live is qtbase. Exporting headers
under QtPlatformHeaders from other modules would conflict.
Change-Id: I13d78fe54b50c5eaccc29bb166efdaafba70e6e2
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
This adds the functionality to build Qt with clang under Windows against
the Microsoft Visual Studio 2015 runtime.
In order to replicate this, a Clang 3.8 build with Visual Studio 2015
Update 1 is needed.
Adds compiler detection to Qt to distinguish correctly the clang compiler
and Windows with Visual Studio.
Clang has some built-in numeric functions, there is no need to use the
Microsoft versions, which also conflict here.
Task-number: QTBUG-50804
Change-Id: Ia4b267a298310ac7d73edf473b12792991249d8a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Blacklisting all tests, which were failing locally.
Task-number: QTQAINFRA-949
Change-Id: I40c25ab0155b8977596d61297ab252a546515f87
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
On OS X, the default scrolling mode of item views should be
per pixel instead of per item. We enforce this through a new
style hint. On all other platforms, the behavior remains the
same.
It's still possible to override the style hint by using the
regular scroll mode setters. Any subsequent style change will
result in a no-op once the setters have been called and until
the properties are reset.
Some auto-tests had to be update to to take the new behavior
into account.
[ChangeLog][QtWidgets][Styles] Added SH_ItemView_ScrollMode
style hint.
[ChangeLog][QtWidgets][Item Views] Item views scroll per pixel
on OS X now.
[ChangeLog][QtWidgets][Item Views] QAbstractItemView::verticalScrollMode
and QAbstractItemView::horizontalScrollMode are now resettable.
Change-Id: I3f923275c99aa4389323b52fc1c5455fe71f8d73
Task-number: QTBUG-50102
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
These types are larger than a void*, so holding them in QLists
is needlessly inefficient. Worse, the code could come to depend
on the fragile property of (inefficient) QLists that references
to elements therein never are invalidated.
Fix by marking them movable, and holding them in a QVector instead.
Change-Id: I42f494ed87854eadc33d78db4479203ff5e0370f
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Introduce utility function to check using
QWindowsXPStylePrivate::isLineEditBaseColorSet().
Task-number: QTBUG-40634
Change-Id: Iaa6962a17217352aa59d0c54421b764ad47d3bf8
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Introduce QWindowsXPStylePrivate::isLineEditBaseColorSet() checking
whether the base color has been set in the widget's palette taking
into account the QSpinBox special case and simplify the code
accordingly.
Task-number: QTBUG-40634
Change-Id: I0e7527031b333d71727fbd30db6dd80aa715c9ab
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Labels would use a statically defined font for <pre> blocks.
Use the one defined by the QPlatformTheme instead, through
QFontDatabase::systemFont(FixedFont)
Task-number: QTBUG-50564
Change-Id: I5491bd0defce651bdf809bcbc6a529a900f4959b
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
They were forgotten from the movable containers for Qt 5.0.
Make sure we don't forget for 6.0, either.
Until then, mark with new Q_RELOCATABLE_TYPE.
Change-Id: I279a96c02a718a1432040303bb0d001739f59a17
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We would ignore the vertical hinting when calculating the
bounding box, giving an off-by-one error in the base line of
some characters when rendering with PreferVerticalHinting,
which is the default when doing High-DPI on Windows.
Task-number: QTBUG-50940
Change-Id: I2846765ec044eaf317026ee8c7bb9588257bf05c
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
Introduce a special scaling function fromNativeLocalExposedRegion()
for exposed regions that uses the floor of the top left point
and the ceiling of the bottom right point similarly to how it
was done in the XCB plugin in 5.5.
Task-number: QTBUG-46615
Task-number: QTBUG-50463
Change-Id: I95e4a571b814357c014605ed79e374a821fa155b
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
To achieve that, add a new virtual setHasExclusiveGroup() method to
QPlatformMenuItem class (optional because we don't want to break existing
platform themes), call it when converting QActions into platform menu items,
and use it when exporting the menu items over D-Bus.
Also, send ActionChanged event for actions when their group is changed, so
that the platform menus are updated too.
Change-Id: I8d951ace8c4097decec2a0154163e3672214effb
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
The layout and phrasing of these two QFileSystemEntry methods was such
as to obscure what they actually test. (Overlong lines, extraneous
parentheses, spurious conditions and poor line-breaking.) Rewrote to
make both clearer; and, in particular, to make it obvious that they
are *not* mutually complementary. Behavior is not changed.
Change-Id: If748e48d41fe3a76bab3a1f840c7b7ca62442f8f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>