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>
All other colors are hard-coded in here, only the background followed the
palette.
Change-Id: If8033a72f85f953358ffeec4edd80a36b8494c7f
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
As of change a094af0017, X11 now joins
other platforms in having a fake screen if no physical screens are
attached, rather than ever allowing QGuiApplication::screens() to
return an empty list or QGuiApplication::primaryScreen() to return
null. This is more consistent across platforms and helps to prevent
bugs in applications which want to use QScreen in some context but
fail to check whether it exists.
[ChangeLog][X11] In case there are no physical screens attached,
QGuiApplication::screens() and QGuiApplication::primaryScreen() will
return a placeholder QScreen object.
Task-number: QTBUG-42985
Change-Id: I0f58afbfe2a034fb9e872a5d1dbdabad2c7dbf9e
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
- Introduce Qt 5 signal-slot connection syntax.
- Merge MainWindow::createMenus()/createActions()
into MainWindow::createMenus(), removing the need
to store the actions as member variables.
Use QMenu::addAction() for brevity.
- For actions in QActionGroups, carry the Valuator enum
in QAction::data so that the slot to handle the selection
does not need to compare the QAction pointer itself.
- Use a non-modal QColorDialog, so that the user
can change colors more easily while drawing.
- Choose saner shortcut keys: control-Q should not
override the default usage for quitting the application,
and using shortcuts for About dialogs is anyway dubious.
- Improve the example documentation.
Change-Id: I57aaf5f5b885c13a953482dbcc41275dd3d6bff4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
Replace the large switch in QStandardPaths::writableLocation()
by a function mapping QStandardPaths::StandardLocation
to the int clsid required by SHGetSpecialFolderPath(). Warn if
SHGetSpecialFolderPath() fails for config location and append
prefixes (cache/application name/organization) only on success.
Change the logic in QStandardPaths::standardLocations() to append
the writable location first, avoiding the prepend().
Task-number: QTBUG-50570
Change-Id: I9d80e83d1ca7af3ea8d3ac2c720ee981b1b2c32a
Reviewed-by: Joerg Bornemann <joerg.bornemann@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>
... but they were only marked as bidirectional.
Fixed.
This change is slightly BiC, because if some class used tag
dispatching on this iterator type, a recompile might now
pick a different overload, and the old one may not be
available to a user anymore (no longer instantiated).
I do not think Qt uses that technique, yet, though. Not on
iterator categories, at least.
Change-Id: I75fb334af7e191f882d11575dec83c879a6b50ee
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We depend on the assumption QFontCache::findEngine(key) for key.multi=1
returns a font engine of type QFontEngine::Multi;
guarantee that by checking it in a single place.
Change-Id: I287da4fd62deb22fc5520cde5b0505bc44547609
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@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 QLatin1String, operator== is overloaded, so comparing to a latin-1
(C) string literal is efficient, since strlen() is comparatively fast.
OTOH, QStringLiteral, when not using RVO, litters the code with
QString dtor calls, which are not inline. Worse, absent lambdas,
it even allocates memory.
So, just compare using QLatin1String instead.
Change-Id: I761b2b26ab5b416bc695f524a9ee607dacf0a7b2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
When the window container already has a window handle, allow embedded
windows to use this handle as a parent. This change will allow proper
window stacking and clipping.
Task-number: QTBUG-50477
Change-Id: I8d656ecb99e0c42ae7a7ac461e5e5b5d801f5493
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
c7e5e1d9e0 assumed shortcut handling could be done at the QPA
level, but this fails on async platforms where there are e.g
activation events in the QPA queue and we then try to handle
the shortcut synchronously.
This commit restores the handling to QtGui for non-OS X platforms,
and we should fix OS X by adding callbacks through the IME for
the special case of OS X.
Task-number: QTBUG-50467
Change-Id: I7460184cc60d0319f07771eec487325a17d7e7e7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
- put it in a separate private header
- add a protected QFinalState constructor that takes a
QFinalStatePrivate
- when passing through, also export QStatePrivate, so the linker can
find the symbol
Change-Id: I8563da16739731d9d6142be438a8769fc29de148
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This test ensure that a connection made to either an invalid host or an
unreachable host fails properly.
Task-number: QTBUG-47452
Change-Id: If31d23d815e496fc21ef2e1e19c34c2723bd3504
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The QFontCache instance is stored in QThreadStorage and thus calling
QFontCache::instance() isn't really cheap; avoid calling it multiple
times where possible.
Change-Id: I1b7a83089698a06c49dac08b2a3a8e9c3c75a500
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Since the likelyhood that decoration_size is greater than 0 then we can
save time with explicitly ensuring that it does not call the functions.
Change-Id: Iaf991a6c77bbc4908c459307ca7e645cf3b3ca20
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
The error message was not informative enough to troubleshoot.
Change-Id: Ib21fce238c80b31d21939d139fc173b48eb5ceb8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@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>
Makes it clear that the engine for font with no Latin WS support
won't be cached as "shared" engine and thus shouldn't be normally
expected in the cache, so don't even try to find it there.
Change-Id: I9e6275b4919607f4057a193b446825c98932bd23
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
by inlining and reordering the condition.
Change-Id: I68a91e75071975a4cc26333094db3433afbaeb72
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
The old code did the equivalent of strcpy(), thus stopping
at the first NUL byte, ignoring the QLatin1String's size().
That is not acceptable, for two reasons:
1. Appending QLatin1String to a QString uses the size(), too.
2. The QConcatenable claims an ExactSize = true, so
it cannot go and write less data than it's own
size() said it would. Even worse, it will happily
write _more_ data, too, if the QLatin1String is
not properly zero-terminated.
This change has low risk, because the equivalent change
to the QString branch has been applied between 5.2 and
5.3 (in fd0f1bc3), with no complaints from the user base.
It is also in a branch that is very unlikely to be taken:
Since QConcatenable<QLatin1String> is setting ConvertTo
to QString, any QStringBuilder expression containing it
will only implicitly convert to QString, not QByteArray.
In fact, I don't even know how to make it invoke the
changed code in normal operation...
Change-Id: I486a76352af7f318ba05da845d3afee7d826c92a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.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>
Set the NSImage size (which is in points/device
independent pixels) to inform Cocoa DnD about the
intended image visual size.
Change-Id: I6fadd77f4e0173e8e9773725fab3b35f70a055ff
Task-id: QTBUG-44179
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Uses a time derived via .toUTC() to ensure the .toLocalTime() comes
out at the time we expect.
Task-number: QTBUG-49008
Change-Id: I2005127929c7eab1b7a3cbaba8d21df8c9585d17
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- Make it possible to pass an optional root widget to dumpAllWidgets().
- Add option to output size constraints of widgets/windows.
- Output normal geometry of top levels.
Change-Id: Ib48809d070c5721fe4688a2ad39cb99f286618de
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Modules relying on font support via platformsupport (Qt Wayland) need
the static libqtfreetype.a. Add CONFIG+=installed to get it copied
during make install.
Task-number: QTBUG-50659
Change-Id: Ie6252e7f2dda1dc3da97fee258b9d53b7ca349c0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
10240 describes the first official non-preview Windows 10 SDK. 10586 was
the SDK for the first November update.
Change-Id: Ieb61b944295946eab594b3c7bf234155a67b752e
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
This allows users to add mobile specific features. Also it implicitly
enables support for continuum on Windows 10 Mobile.
Change-Id: I965123722f46df6e84fd279c3bfce478c1172632
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Hide the native view in constructor and in destructor.
Task-number: QTBUG-40159
Change-Id: I200b28af9ac2928c38299b71395a97e39f1bbe6d
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Knowing the real virtual keyboard height will be easier for us to
decide if we pan or resize the current view.
The virtual keyboard is re-shown if current virtual keyboard height
is different from previous one.
Task-number: QTBUG-43739
Change-Id: I1bb41a70cced4c1d0e5f05a6c554831459b7a917
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.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>