... by replacing them with C++11 range-for loops.
To avoid detaches of these mutable Qt containers,
wrap the container in qAsConst().
Change-Id: I9158c507f9249a7322b11c982bfcab1e6ed4a38a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
... (or trivially marked const) local variables,
parameters, or data members with trivial loop bodies,
by replacing them with C++11 range-for loops.
Change-Id: I25e9e2148abd7676305ebd18754dc647f217e48b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
These types are held in QVarLengthArrays, so benefit
from being trivially relocatable. They are also part
of the private API, so there's no BC issues with
potential uses of these types in QList.
Change-Id: I8adc0c801885f8fffa05eb1f173d7e4bb085ba7b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
QAtomicPointer is CopyConstructible, but std::atomic<T*> is not,
for a reason. So avoid putting them in a QVarLengthArray, using
a dynamic heap allocation instead. This sounds wasteful until
you realize that virtually all users of QMutexPool (and we know
them all) use the global instance(), and that each QMutex (131,
by default) is heap-allocated, too.
Change-Id: Ie9c95671ec42a1f51919c18631b623aad2c0d6ba
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When IM hints changes (e.g as a result of transferring focus
between Qt objects), we sometimes need to reconfigure the keyboard.
And the way we do that is to create a new QIOSTextResponder that
matches the new configuration and tell it to become first responder.
And in that process we need to ensure that we don't clear the
focus object when the old text responder resigns. After all, it was
the one requesting the new IM configuration in the first place.
Since we set FirstResponderCandidate to point to the new text responder
just before telling the old one to resign, we can use that variable
to check if were in a first responder transition before clearing the
focus object.
Change-Id: I05bfb8180700a92a8f14f496044457583bcd38d3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Mark the overloads taking an additional QVariant as \internal as (cf
QTextEdit) and the overridden functions as \reimp.
Amends change ab67a5b7b6, fixes warnings:
qtbase/src/widgets/widgets/qlineedit.cpp:1755: warning: Cannot find base function for '\reimp' in inputMethodQuery() /
Change-Id: I9949bf3850ab4200ee500cbe33a44faacecc30b0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Adding strings in a single expression gets mediated
efficiently by QStringBuilder, where using += repeatedly
forces premature consolidation.
Change-Id: I6c1abb9c9801a016ce6c151cffdf8c7ac9502f4e
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
For CoW types, prefer const methods to avoid needless detach()ing.
Change-Id: I211ae74434bf3705914764e1e9d02ae823a1be3a
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The synthesis of mouse events for unhandled tablet events is now in
cross-platform code, so the platform plugins don't need to do it.
xi2HandleTabletEvent's signature included an eventListener which is
no longer needed; removing it makes it look needlessly inconsistent
with the signature of xi2ReportTabletEvent; and while we're at it,
might as well make the events const and deal with the repercussions.
Task-number: QTBUG-47007
Change-Id: I0f76c8ed2d2b0baed0652bc68286f1734b8b72ff
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
so it turns out that the 'unix' conditional in moc.prf meant that the
feature was not enabled *anywhere* by default, as the unix configure
disabled it everywhere.
amends b3fcaea5.
Change-Id: Ie41ed2ebc338e560b8d6bfbb0bb18888e31b6d13
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... with STL-style iterators or with algorithms.
Java-style iterators have overhead.
Introduce local template separate_if algorithm from kleopatra
project to simplify current code.
http://api.kde.org/4.3-api/kdepim-apidocs/kleopatra/html
Done-with: Marc Mutz <marc.mutz@kdab.com>
Change-Id: Ib154f80f46f8041d9cafd81bed0e1982b21541cf
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The QTextBlockFormat::FixedHeight overrides the line height
regardless of its calculated height. If the line contains
objects or text which is higher than the specified line height,
using FixedHeight will cause them to overlap with the previous
line. This is not what happens in normal web browsers. The
expected behavior is that the line height given in CSS is the
minimum height, but that we still reserve space needed to display
everything without overlaps.
To make it possible for people to retain the old behavior, we
introduce the -qt-line-height-type property, which allows them
to override the default.
This also fixes output from toHtml() to use the new property
rather than set the minimum height of the paragraph or the
"line-spacing" property, which does not exist in either CSS nor
in Qt.
[ChangeLog][QtGui][Important Behavior Changes] When line height
is specified in pixels, this is now interpreted as the minimum
line height rather than an absolute line height to avoid overlaps.
To get the old behavior, use the -qt-line-height-type property in
CSS and set it to "fixed".
Task-number: QTBUG-51962
Change-Id: Ic2dde649b69209672170dad4c2de1e1c432a1078
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... with known size and known value by corresponding ctor.
Don't use appending for this case.
Change-Id: I70f5b943cda7e55eeb45becf439f79c9aee77278
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
For CoW types const methods will be called.
Mark store_persistent_indexes() as const,
because this method does not modify the object.
Change-Id: Ic867913b4fb5aaebfbaaffe1d3be45cf7b646403
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
For CoW types, prefer const methods to avoid needless detach()ing.
Change-Id: Iefc33552d826aa30320e52acd2d421c9bdae127e
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Iterate the keys directly off the QMap itself.
Change-Id: I7792414db250d8ae63a935513a16a01eb184ebde
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Commit b9d386f2cc neglects to account for
the scanline padding requested by the X server. This can result in visual
artifacts if padding is required. This commit fixes this by factoring in
the X server's requested scanline padding when calculating image stride.
Change-Id: I082cb7101ec3a9c554b9b58a76f53f780b87d31e
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Separates the generic kms classes into a own kms static lib
called QtEglFsKmsSupport. The eglfs_kms plugin was changed
to use these base classes and got renamed accordingly to
QEglFSKmsGbm*.
The eglfs_kms_egldevice plugin got extended to also derive
from the kms base classed and by this provides multi-screen
support
Change-Id: I6de6a754e94cb8d52cf8e658b03c6bd6637674a1
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Undoes part of c327fb79e1 so perspective
transforms are still handled by QTransform on the path.
Change-Id: I4801f24898a401ff93a96a852170ea6b7b70ce1c
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
QtQuick Controls 2.0 is going to have capitalized style names (Material,
Universal, ...) so move the toLower() call to QApplication where widgets
make use of styleOverride.
Change-Id: I5a8c5ee38517690728f5f8f01024d4e692c81668
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Blacklisting those autotests that prevent us to get RHEL 7.2 in the CI.
The same tests have already been blacklisted for RHEL 7.1.
Change-Id: I2aa62647f7bd75681ea9e1d69bc62f9542fda5e2
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
If a mask region contains a point - the event is _not_ masked out.
Task-number: QTBUG-52533
Change-Id: I56d0276f5e3853479c2687addb95c2600edd3cda
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
m_context.getClass() returns the top class and this way QtApplication can't find
the proper class Name (QtActivity and QtService).
This patch passes the right class names to QtLoader/QtApplication.
Task-number: QTBUG-52373
Change-Id: Ib69446cdaa38ac8b489872c4850210e5d503492e
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Both cursor and anchor rect will change locally when
scrolling. So inform IM about it, so that any overlay
done from e.g the platform plugins for dealing
with text selection etc. can respond to the change.
Change-Id: I4e839e691a20ad07d2aa062e028d22cf5f31b7fa
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
This benchmark requires QtScript1 headers, and can not build as is.
Change-Id: I98e57ca2db82270a0887462d7959ff00e352166b
Reviewed-by: hjk <hjk@theqtcompany.com>
Implement support in QWidgetTextControl for the new API that lets
you specify a position argument when querying for Qt::ImCursorPosition.
Change-Id: I123e2522d33e783e6f3467b81be872e3620d6d15
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Since we now have the possibility of providing an extra
position argument when querying for Qt::ImCursorPosition, we
need to ensure that we translate it from scroll view to
local coordinates before passing it on to QWidgetTextControl.
Change-Id: I4383ae3ea984b6140d8e9b4198047aec8b7e100b
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Follow up f8dbed12, and implement support for IM queries that
can take an extra QVariant argument. We use this to implement
support for ImCursorPosition with a QPointF argument that
specifies that we should return the text position under
the given point rather than the current cursor pos (0bb645b).
Change-Id: I03ae7af698241f454d35dec84f248ecd5bb6ad51
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Implement support in QWidgetTextControl for the new enum
Qt::ImAnchorRectangle.
Change-Id: I7978915454a6dd93b2f491ed15619016cda85c7e
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Specifically, those that compare UTF-8 octet-streams:
- QByteArray <-> QByteArray
- QByteArray <-> const char*
For more, Qt first needs to gain a nothrow UTF-8 <-> UTF-16
comparator.
Change-Id: Ibccbdcdc3ebed5b1ac0e65c971f6f7d1bd15b6da
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
qtbase/src/corelib/global/qnamespace.qdoc:101: warning: Undocumented enum item 'AA_SynthesizeMouseForUnhandledTabletEvents' in Qt::ApplicationAttribute
qtbase/src/corelib/global/qnamespace.qdoc:2554: warning: Undocumented enum item 'ImAnchorRectangle' in Qt::InputMethodQuery
qtbase/src/corelib/statemachine/qsignaltransition.cpp:154: warning: Can't link to 'Q_COMPILER_DELEGATING_CONSTRUCTORS'
qtbase/src/gui/image/qiconloader.cpp:160: warning: Cannot find 'QIconCacheGtkReader' specified with '\class' in any header file
qtbase/src/gui/painting/qpaintengine_raster.cpp:1382: warning: No documentation for 'QRasterPaintEngine::fillPath(const QPainterPath &path, QSpanData *fillData)'
qtbase/src/testlib/qtest.h:176: warning: No documentation for 'QTest::toString(const QHostAddress &addr)'
qtbase/src/testlib/qtest_gui.h:77: warning: No documentation for 'QTest::toString(const QColor &color)'
Change-Id: If9ac0807accf2530ec7fc2ca7db71a110f9f79bb
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
The majority of these changes is about #ifdef-ing the Linux-specific use
of /dev/fb0.
The display handle is also acquired using fbGetDisplay(), which is
equivalent to fbGetDisplayByIndex(0) but is also portable.
Change-Id: I6f460edc9c06ae7461a6aab2a816ac6f645208c4
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
Whenever we notify about ImAnchorPosition, we also need to notify about
ImAnchorRectangle
Change-Id: Ia449396e1b9e91fa0e6f95c323e31533da660171
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Detect if DirectWrite 2 is available, and support color fonts if possible.
One limitation worth mentioning is that if the color font contains regular,
monochrome glyphs as well, then these will be drawn in black, and not in the
pen color. Fixing this would require some elaborate rewrites in the font
rendering system, since we would have to have two font caches per
color font (one for mono and one for colors), or do some sort of trick where
we make argb(r, g, b, 0) mean subpixel alpha instead, and detect glyphs that
are not correctly premultiplied when blitting to the screen.
Another limitation is that the approach does not work with distance field
rendering. In principle we could support this on Windows, since the
format is vector based, but it would also require substantial work and
it is not possible to support for Apple/Google fonts anyway, so it would
just lead to code which is not cross-platform.
[ChangeLog][Windows] Added support for color fonts (color emojis) when
DirectWrite 2 is available.
Change-Id: I6a608dd5d2aa3a7e762a06830902bddac7c550a5
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Minor cleanup of QOutlineMapper to take advantage of QTransform.
Change-Id: I15534970a821c7f1de42f4a5a2560f04ae420d16
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Follow-up to commit 6fd205d5: document which version of danted shall
make one work-around redundant, document that another work-around is
still needed even with that v1.1.19; and remove a comment that
referred back to an XFAIL that commit 6fd205d5 removed.
Change-Id: I270b662528127c82184bff20b3cecea4f0c41b41
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
QSKIP() causes the whole test to be skipped, where this work-around
for a known quirk of the test server only requires skipping a single
Q_COMPARE(); the rest of the test passes fine without it.
Change-Id: Ie4612bd428f4cb4b342fad908cc2784fbadf069c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
it doesn't appear to be referenced in any way, either.
Change-Id: Ifd30b435e3e628cd5e48ae24e9aef01c662d6d61
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Before this change QFile::errorString function was returning an
"Unknown error". Now it will return the typical ENOENT string.
Task-number: QTBUG-45259
Change-Id: Ib7634f1aa5d91f77151cf92c58d3956e20a4cc6b
Reviewed-by: hjk <hjk@theqtcompany.com>
Not only we don't need Cocoa to display it for us, but it also
seems to take a lot of time after the call to -[NSView
setNeedsDisplayInRect:].
While resizing a large and busy widgets window, we can decrease
the relative time spent in -[QNSView flushBackingStore:region:
offset:] from over 15% down to around 3%.
Change-Id: I2a8d51be28b77c4c3da2588d9a14e461e7910167
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
This is not done for other platforms (iOS or Windows) and eliminates a
maintenance burden and potential of inconsistencies with other parts of
the documentation (as illustrated by the fact that this page indicates
the wrong minimum supported version). The Supported Platforms page will
be the authoritative (and only) source of which particular versions of a
given operating system are supported.
Change-Id: I5a31f68965265f2dcd6515b1fa9385a9e9078274
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>