createPlatformOpenGLContext() used to silently set the widget
compositor's context as the context to share resources with.
This works mostly, but is the wrong level to enforce the resource
sharing. For example, QOpenGLContext::shareGroup() becomes
inconsistent since from QOpenGLContext's view there was no
shareContext specified.
The inability to test via shareGroup() is the reason eglfs started to
show warnings when exiting applications. The resource sharing was in
place on EGL level but QOpenGLContext knew nothing about it.
Therefore, let's switch over to the way other components, f.ex. Web
Engine use: set the internal global share context pointer to the
widget compositor's context. This way everything remains consistent:
the widget compositor's context is stored upon creating the main
QEGLFSWindow, QWidget::shareContext() picks this up then, and as a
result we have sharing set up on QOpenGLContext's level instead of
sneaking it in in the QPlatformOpenGLContext implementation.
Task-number: QTBUG-50707
Change-Id: I5fc1dec58c69c46aa83c7b4cab1eadce6fa633ce
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
After creating the swapchain we set an initial size for the content
matching the screen size. Only afterwards append it to the canvas.
This fixes problems where dialogs were scaled wrongly, sometimes up to 4
times too big.
Task-number: QTBUG-50335
Change-Id: Ie3ad9aa3509dfa105ae2ac2b95d2662ff25cdeba
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
There is nothing guaranteeing there is a context current when the
backingstore dtor is invoked for widget windows that do not contain
render-to-texture widgets. In some cases the eglfs compositor's
context is still current, while in other cases (esp. when having
popups and other top-levels) there is none.
To prevent not releasing the backingstore texture and the incorrect
warning about incorrect context, make the correct context current via
an offscreen surface, when necessary.
Change-Id: Id8257650c1ec8cf96910a4f285b779419c3558a8
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
QWidgetBackingStore::sync() has two variants. The widget texture list
logic was only present in one of them. This led to problems on eglfs
in cases when the other variant got invoked. (for instance using the
scroll area in the qopenglwidget example)
eglfs relies on the texture lists's lock status to properly serialize
its somewhat asynchronous built-in compositing mechanism and therefore
is the only platform affected. The patch moves the code to be invoked
from both sync() variants.
Task-number: QTBUG-50668
Change-Id: I4c62987b7bb3cc40f98a4e94447368d2f740dbfd
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
This partially reverts the source and binary incompatible parts of change
d921a9bd15 that made public members in an
exported class private and changed signature in one case.
Task-number: QTBUG-50703
Change-Id: I2719f276256206347d3c27d80a16db34a4ea2888
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
This fixes a regression when entering data in a password field.
The important part is to simply not call convertLineOffset for
single line text edits. The reason is that the function when dealing
with password fields gets an empty string back when calling textAt etc.
This is good since we don't want to leak passwords through a11y apis.
The problem with the functions returning empty strings is that we end up
in an infinite loop in convertLineOffset.
Task-number: QTBUG-49437
Change-Id: I76faa7e33e3ad5c3aeb5c75d8c4b93f1b8227bfc
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Usually when getting an object from an interface, the object
can be assumed to be valid. We need to check isValid though
since the screen reader access is inherently asynchronous and
objects might be in the QWidget destructor where the QObject is
still valid.
Thus check QAccessibleInterface::isValid in all uses of it in the
OS X implementation.
Task-number: QTBUG-50545
Change-Id: I6e142f6ead1b3281cab2cbc61ce1406bbfe29f69
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
For non-scalable fonts, the units_per_EM in FreeType is
documented to be undefined and will default to 0, which means
that any division by it will cause an exception.
The emSquareSize() function already checks if the font is scalable
and returns y_ppem if not, so lets use it instead in all locations
where we're not already sure the font is scalable.
[ChangeLog][Text][Freetype] Fixed a divide-by-zero exception
when accessing bitmap fonts.
Change-Id: I8839d4c83047fb3f6bb4d69af0258e94a258a4d9
Task-number: QTBUG-45963
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Previously offscreen surfaces were only needed to properly shutdown Qt
Quick applications and the scene graph to have something to potentially
render into but not show on the screen.
However, Canvas3D requires a fully functional surface, preferably
offscreen. Hence we use the QEGLPbuffer provided by eglconvenience in
platformsupport.
Task-number: QTBUG-50576
Change-Id: I1a32820bb2f2c6823be4e96dd92cf7965566f2c3
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Whenever there are spies installed, we call out to the main thread to
call to the kded/kiod message spies. This allows the spy code to do just
about anything, where previously it was restricted in what it could do
to avoid deadlocking or triggering assertions if it recursed back into
QDBusConnection code in the manager thread. After the spies are done,
the message is re-inserted into the QDBusConnection processing pipeline.
This commit moves the spy handling to after the check for disabled
dispatching, as doing otherwise would mean the message could get
postponed again for no good reason. It's also possible that the main
thread isn't done installing the hooks, so waiting until the dispatching
is enabled is a good idea.
For simplicity, this commit also restricts spying to method calls
only. Signals are no longer spyable.
Change-Id: I3d11545be52c43119f0fffff142b0e9d447415c2
Reviewed-by: David Faure <david.faure@kdab.com>
Commit 5c7f000cd4 greatly reduces the
number of repaints for QOpenGLWidget. Unfortunately, this included when
the widget changes screens.
Change-Id: Iaabcb94925e4519cb5d8561b47aaddcfdc7b01ac
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
The srcRect is already in device window coordinates. Converting it
again via deviceRect(QRect, QWindow) causes it to be overly large.
Task-number: QTBUG-50613
Change-Id: Iaae390499c0d1add842bde6eec22fb07c8de663b
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Instead of creating a QByteArray, possibly normalizing a leading
'--' (one allocation, plus possibly one copy), simply use the
old 'ol str(n)cmp, skipping the first character if the argument
starts with '--'.
It also fixes parsing of -stylesheet and other options which
were erroneously parsed using indexOf() != -1, when they
should have used startsWith().
Also saves 504/742/522b in text size for QtCore/QtGui/QtWidgets,
resp., on optimized GCC 5.3 Linux AMD64 builds.
Change-Id: Ida868badac3fb9b77285417ee537c861ccc4fc06
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When resolving the signal/slot of connect(&Foo::bar, ...) we place a meta-call
to map the address to the method index. Once we have found the index, we don't
need to continue but can return the result right away.
Change-Id: I67bb22df394d7c22dc1731367c0961b958ed77b3
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
-developer-build enables -Werror=undef, which uncovered a bug inside
qcompilerdetection.h.
According to the Dinkum headers, it is necessary to account for three different states
concerning the values of the _HAS_* macros:
1. undefined
2. 0
3. 1
Therefore, it is necessary to check both whether it is defined and if it is
not 0. Only checking whether a given macro is 0 will generate a trap by
-Werror=undef.
(__GLIBCXX__ is the sole exception).
Change-Id: Ib95e485698ee38858a1671d930d7e960b75bb041
Reviewed-by: James McDonnell <jmcdonnell@qnx.com>
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is needed to correctly handle show on non-primary
screens.
Change-Id: I80b13372b3a92786987a66f0da385af6b4a6a863
Task-number: QTBUG-47950
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
QDateTime::toString for Qt::TextDate unconditionally uses the system
locale (because QDate::shortDayName and QDate::shortMonthName do).
Setting the default QLocale has no effect. If you ask me, those two
QDate methods are buggy, but they are documented that way.
Change-Id: I408dcb81ba654c929f25ffff1427366b04da5a43
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Both constructors were taking a pointer, so they participated in
overload resolution along with QTextDocument and QTextFrame pointers.
Instead, make them take references and move them to the private section
of QTextCursor. That necessitated adding a method to QTextCursorPrivate
to access that private constructor from non-friend classes.
Change-Id: I7e6338336dd6468ead24ffff1410e3bc534d77dd
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
QFileInfo::exists(f) is somewhat faster than the version which creates an temporary object.
Change-Id: I5f931a86d9dfad57d99efe04ca115422de43def9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
These variables were never used or set to anything meaningfull.
Change-Id: Ic68ac5c38a3db28d7a5a05be004bcb6a554a1483
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
When building QNX on MS-Windows, make magically adds the Msys root as
prefix to variables whose values look like paths; this applies to both
environment variables and variables given values on the command-line.
When we don't actually want to install under the Msys root, this is
unwelcome "help". So (for MinGW's make) support a magic prefix of our
own, @msyshack@, that'll make a path value for INSTALL_ROOT not look
like a path to make; we can then strip it off when we come to use it.
Change-Id: I951ad3c8fe3e5cfb49e6e361d7fff779f3a9d716
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Create a MedianDouble class and V2 version of BlockSizeManager, which
use a fixed size array of double (since we always use 7 elements
to calculate the median anyway).
Change-Id: Ife90b90336a9a8c037b90726dee4cd2a1b8b6cd9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Handle special case mapping of length 1 explicitly;
Skip calculating of high surrogate for the same plane;
Optimize branch prediction with Q_LIKELY/Q_UNLIKELY;
Replace peekNext() + advance() with just next() in the caller function.
Change-Id: I0d37969749bd8ca855321242e6a0e72c405c5f8d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Do ourselves and our users a favor by pointing out why Qt (Quick)
apps perform horribly on commonly used distros on the RPi. Using
a software rasterizer on such boards is not going to cut it.
Task-number: QTBUG-50533
Change-Id: I087f502ddb9c6bdde84343e6abd85c87cdc474f0
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
Commit 6e6f27b6 made it possible to set the PKG_CONFIG variable using
CROSS_COMPILE as a prefix. The problem with that solution is that it makes
pkgConfigExecutable() skip the environment setup for pkg-config as well,
as it expects the pre-set command to be self-contained - which it isn't.
To avoid this problem we need to store the pkg-config define in the
device spec in a separate variable.
Change-Id: Id8ae7fb03d9253be55840e23fe73b30815ee86c3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
A switch had a case whose body was in a #ifndef; when that got elided,
this case fell through into an entirely misguided case. Give the #if
a #else clause so that it break;s in the defined case. Code review
revealed another, then I searched for more following the same pattern.
Change-Id: I57fb59b6c8d349604f3fc6c8b1d424fb3c775d50
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
According to the spec, pixmap type is ARRAY(INT, INT, ARRAY BYTE).
This also matches our QXdgDBusImageVector typedef.
Also fix the D-Bus Introspection class info.
Change-Id: Ic13e8a078299b9c76d2742055d64cfdc54460d58
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
When initializing the font members in the QGnomeTheme constructor,
the QFont constructor called QGuiApplication::font() which in
turn calls initFontUnlocked(), initializing
QGuiApplicationPrivate::app_font to QPlatformFontDatabase::defaultFont()
("Deja Vu 12") since QGuiApplicationPrivate::platformTheme() is still
0 at that point.
Change the fonts to pointer members and initialize them
delayed in QGnomeThemePrivate::configureFonts() instead.
Task-number: QTBUG-49095
Change-Id: I3282ea8484e04827be2a424f5ea3e34d607c4bc5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
The native socket engine used strcpy for WinRT, which tries to copy
terminating null character. The QSocketNotifier::async_readDatagramSlot
autotest uses a buffer of size 1, which causes readDatagram to overwrite
the buffer on the stack.
Hence use memcpy instead to protect from additional copies beyond
barriers. Note that we cannot use qstrcpy as that does a buf[size-1] =
'\0' at the end, which would remove content for a buf size of 1.
Change-Id: I20baf9e63646cd28c1c954a20b8ae9c7d5873c31
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
msvc2015 reintroduced a couple of functions from the win32 API
towards WinRT.
Enable usage of those and simplify the file system engine.
Furthermore update the autotests.
Change-Id: I9eafffba0ddfd05917c184c4a6b9e166f86d71d9
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Use reverse_iterator, now that we finally have it.
Change-Id: If74ead1a6075c5437c1d111206913481a495a014
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The ABI says that PC-relative displacements should be on 32-bit fields,
even on 64-bit builds. For -mcmodel=large, it should use R_X86_64_GOT64
relocations, like 32-bit.
Task-number: QTBUG-50537
Change-Id: I1041122c530b4f5bbaabffff142ade5b3cbfc4c5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
It's possible to configure an interface so that it isn't the case. I have
no idea if this is a valid scenario, but the unit test shouldn't enforce
that.
ip addr can report:
inet 192.168.1.1/32 brd 192.168.1.255 scope global vlan0
valid_lft forever preferred_lft forever
Change-Id: I8de47ed6c7be4847b99bffff141c337575760bd9
Reviewed-by: Richard J. Moore <rich@kde.org>
If SIOCGIFADDR fails, then don't bother trying to get the broadcast
address or netmask, and especially don't add the empty
QNetworkAddressEntry to the interface. This can happen on interfaces
that have no IP address assigned (for example, inactive interfaces).
Change-Id: I8de47ed6c7be4847b99bffff141c326d94ecca78
Reviewed-by: Richard J. Moore <rich@kde.org>
Certain Linux interfaces have no addresses at all (hardware or IP), like
the nlmon interfaces. They weren't being reported.
Change-Id: I8de47ed6c7be4847b99bffff141c2b60c2089ad3
Reviewed-by: Richard J. Moore <rich@kde.org>
This shortens an earlier over-long line of declarations and makes
visible that these are declare-and-initialize.
Change-Id: I39fa9613196c34f7e2b2da04da729324d7f83a55
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
QDateTimeParser::parseFormat()'s top-level scope has a const int max;
this was shadowed by a short-lived max in an inner scope; and the
outer scope's max could be re-used one more time after that to save
re-evaluating the same unchanged expression it held.
Change-Id: I9f07452bb0b4e5ff4bcf6396d42d1419de6276fa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
A check for a backslash before a quote neglected to pretest that the
quote wasn't the first character in its string.
Change-Id: Ib5226836d1111e37bed984938f7c667be59eb1c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
An if () {...}'s close-brace was hiding on the end of a break; line,
an idiom used in several places for braces that existed to contain a
case (for the sake of local declarations). This made it hard to see
that there was an if() whose else was the resulting (commented)
fall-through. So put that close-brace on the comment's line and make
the comment clearly indicate it's an else.
Change-Id: Ie7e7c7063bef96536d6231297b083fc384f2363e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The important one is EET, for the benefit of our CI system; but other
European zones and the USA's coastal zones likely have enough hackers
in them to make this worth checking.
Change-Id: Idcc703bce29808e1a0a6279680cc8d3cbed38dac
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Time zones change on the whim of politicians. Consequently, we can
seem to be in CET/CEST or on UTC (because we tested sample dates when
our zone coincided) when we aren't (i.e. we're in a materially
different zone at the time probed by some particular test). Make the
initialization of the globals that test this more robust against
governmental meddling and document the unfixable problem with Algeria:
a DST transition *on the epoch*.
Change-Id: I17c5c81d339b80af12f4ffab367e28052dd6c2fa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There are several European time zones; the only one relevant to the
tests here is CET. They won't work with WET, GMT or EET. So name
them and related variables for CET, not for Europe.
CET's summer-time isn't called CST; and the (existing) spring forward
test works only in CET/CEST, not elsewhere in Europe.
Change-Id: I55c7544bf792de7495700b749b935ec534831d8b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When using QUrl::PreferLocalFile we do want to strip the leading slash,
as toLocalFile() would do as well.
Behavior change by means of an example:
QUrl url(QUrl::fromLocalFile("C:/file.txt")
url.toLocalFile() --> "C:/file.txt"
Before:
url.toDisplayString(QUrl::PreferLocalFile) --> "/C:/file.txt"
After:
url.toDisplayString(QUrl::PreferLocalFile) --> "C:/file.txt"
Task-number: QTBUG-41729
Change-Id: I7d425541f6077ebcf3fcf46feeb7e0f03a0d7fe2
Reviewed-by: Dominik Haumann <dhaumann@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>