The pixmap-based cursors and some of the standard cursors we
create from resource pixmaps need to be separated per screen.
Use a QScopedPointer containing the per-screen cursor instead
of the previously used QSharedPointer containing the cursor
shared by all screens.
Task-number: QTBUG-49511
Change-Id: I5203fcc4ecf5a7ff3fea833a4eaeb5300a6e6d54
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Windows opened from keyboard (e.g. keyboard shortcut) are not active on
Marco or Xfwm4. These windows are under the window which received the
key event. This patch fixes the problem by updating XCB timestamp on
every key press like Qt4 does.
Task-number: QTBUG-49567
Change-Id: I9ea483784ac361d0b645d0f11f643868b367ac2c
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Due to recreating the underlying framebuffer we absolutely need a
re-render. However, going directly through paintGL() is wrong since
application code may override paintEvent() instead. Such code would
then miss these repaint requests.
To overcome this, simply rely on paint events, like the normal code
path does.
Task-number: QTBUG-49466
Change-Id: I6ddb9eb53bedb1655a9714b9b77faa1c439766a2
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
The recent changes added a widgetTexturesFor() helper function. There
has to be a dummy version of this for -no-opengl builds because
QPlatformTextureList is not available in such builds at all, meaning
the real function is not suitable outside !QT_NO_OPENGL.
Change-Id: Ib108b1804f539796631b1927de89937236781d2a
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
When built in by the debian scripts, a symbol PLATFORM_API_TOUCH would
be defined for relevant target platforms. Here in Qt, this does not apply.
On a correctly installed system, the UBUNTU_PLATFORM_API_BACKEND
variable is not required at runtime, since the system's value will be
read from a settings file under /etc.
Also, the previous hardcoding would mean that it could not be
overridden at runtime.
Change-Id: I24ddfaa254005b4113f3328b66edb1c6bbc509e2
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
This is the simplest step we take on the way to supporting color bitmap
glyphs with FreeType "out-of-the-box".
Change-Id: Iebdb7acf937734f66a7944d153026d0735cb53d1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Check that we can use std::forward, and that the compiler
synthesizes move special member functions when it should.
MSVC only supports the latter since the Nov 2013 CTP,
which, for our intents and purposes, means VC2015.
Change-Id: I8d8e4ae064abce90076a05b3b637950ab7d21dac
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Move the QT_USE_NAMESPACE up, so any use of Q* classes won't result in
compilation errors when Qt is configured to be in a namespace.
Change-Id: Id559c86798529f6cad43a75fce303c108ce820bc
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Check that it works on C arrays, with auto type deduction
and with types that only provide free begin()/end()
functions that can only be found through ADL.
Change-Id: I760722a0f56c9ebe967070ff68af90b96ed77e66
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Obtain the system setting via SystemParametersInfo(),
amending fac71528cc.
Task-number: QTBUG-49561
Change-Id: Ie7a956fdc6b175ad09356949645c1e8937053abd
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Pass 0 window to High DPI scaling function to prevent it from
trying to find a screen and applying a screen offset.
Task-number: QTBUG-49516
Change-Id: Ib3e1919985f2c6df1dd8369f6e28b3ee1fdb7afe
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Applying scaling to the pixmaps used in pixmap cursors
requires applying a scale factor in a code path
now in a constructor of QWindowsWindowCursorData (nested
into QWindowsWindowCursor). This needs to be split and
the code paths for cursors created from a Qt::CursorShape
value and pixmap cursors need to be further separated.
Replace the QSharedDataPointer-based QWindowsWindowCursor
class by a simple, non-copyable class CursorHandle
managing the HCURSOR handle and pass it around using a
QSharedPointer. Split the cache in QWindowsCursor into one based
on Qt::CursorShape and one based on the cache key aggregated
from the pixmap cache keys (using QWindowsPixmapCursorCacheKey
renamed from QWindowsCursorCacheKey), simplifying the standard case
based on Qt::CursorShape.
Reuse class CursorHandle in
QWindowsOleDropSource::CursorEntryCursorEntry, which used a
similar class.
Remove QWindowsCursor::createSystemCursor().
Avoid the construction of temporary QCursor objects for the
standard cursors constructed from using resource pixmaps by
introducing a struct PixmapCursor containing pixmap
and hotspot.
Task-number: QTBUG-49511
Change-Id: I5393d64bd70f7dab68c0a8c2255c7685ac367b2f
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
When looking for the keyword in a preprocessor directive, we were
checking for non-word characters to find its end. If that check
failed (i.e. we had a word character) we would then check for EOL
(which necessarily failed, on a word character). That made no sense.
However, we genuinely have no interest in a directive with nothing
after the keyword, so do check for EOL after the loop (once we've
skipped spaces after the keyword).
The loop itself was made needlessly complicated by, on finding the end
of the keyword, skipping over later space inside the loop. Moved this
outside the loop.
Change-Id: Iccc2d445bf44deb75604e7fa60f2464e7397d8ed
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
The C preprocessor does believe in a # [nothing] line; and we may as
well give up before checking for keywords if we've run out of buffer.
Change-Id: I64dc3ad2808435389d0d7b56dcbc9d92ae72aa6e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
A loop to skip space and comments was meant to break on anything else
but would have not broken on a division operator (where it should) due
to it getting caught in the check for a comment-start, without falling
back suitably when it didn't complete that check.
Managed to contrive a suitably twisted change to findDeps test to
reveal the bug; broken previously, now fixed. Not ideal, as it relied
on another bug to fail previously - backslash-newline shouldn't end a
preprocessing directive line - but it should still pass once that's
fixed, too. Exercising a bug in qmake usually involves code that
won't compile anyway, making it tricky to write a test that reveals
the bug but that passes once it's fixed.
Change-Id: I08a1d7cc5e3d7fd1ac0a48e5c09dfdfbb7580b11
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Principally *(buffer + expr) -> buffer[expr] changes, with some hspace
normalization on affected lines. Made some empty loops more visible.
Pulled out a repeated character class test as a function.
Change-Id: I03d1b633550ad1814fa383d69ea04138dd0f82cd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
No-one is known to use it - we don't even have a test for it. It
plays poorly with the real preprocessor and it has not produced any
output since at least Qt 4.0 (unless qmake is invoked with at least
one -d flag, drowning the output in level 1 debug output).
This incidentally means no preprocessor directive we care about has an
underscore in its keyword.
Task-number: QTBUG-49487
Change-Id: I123a945c1dfe29d1d3ceee1129cfedc043f2e7d4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
qt_framework and {app,lib}_bundle imply darwin, so there is no point in
testing for it.
Change-Id: I9fe48c26c8e271a5575b17e92df8674d3c3a3204
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
CONFIG+=qt_framework is actually put into qconfig.pri, so it's always
set in framework builds. things (sometimes) worked only by virtue of the
qt_framework checks being in "else" branches of "static" checks. use
lib_bundle instead, which triggers the actual framework build anyway.
amends b72d1db44.
Change-Id: Ib725c43476d9fb38bad940ce09905d29ff3edfa3
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
While all apps need to have internetClient as a capability, the option
to provide further capabilities via qmake has been removed in the
template.
Instead we add the required items inside the prf and keep the manifest
template as generic as possible.
Task-number: QTBUG-49504
Change-Id: If26b9da277a5269a57b34e74c146b40b1b64d091
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
It can speed up window resizing using on XCB platform
(like in Qt4 or GTK). It doesn't affect QRasterWindow,
but it affects all QWidget-based windows and OpenGL windows.
This code uses XCB Sync Protocol on all windows when it is supported.
In previous code the XCB Sync Protocol was used only when window
doesn't support OpenGL (on QRasterWindow),but QWidget can use OpenGL,
so it doesn't use the XCB Sync Protocol.
With XCB Sync Protocol which is implemented in Qt XCB plugin,
windows can be resized smoother/faster. You can see bigger difference
when you use non-composited window manager to test it:
- Kwin without compositing and fast style,
- Marco,
- Xfwm4,
- Openbox.
Task-number: QTBUG-46641
Change-Id: Ia18dee94616e64ba7e11bd4b062d2326ec530748
Reviewed-by: Martin Gräßlin <mgraesslin@kde.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
QWindowSystemInterface::handleKeyEvent runs the shortcut override
unconditionally; use QWindowSystemInterface::handleExtendedKeyEvent
instead, because it allows bypassing the override (as the back button
press is not a valid shortcut). This also prevents an unnecessary mutex
lock.
Change-Id: I8d8bb957e1556ac47e031cfe6fca6481f7c3220d
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Opt-in by setting
QT_EVENT_DISPATCHER_CORE_FOUNDATION=1
This will make QCoreApplication and QThread create
a QEventDispatcherCoreFoundation instead of a
QEventDispatcherUNIX.
With this change we can now support calling native API
that requires a running Core Foundation event loop
on the QCoreApplication main thread and secondary
threads. Previously this was only supported on the
QGuiApplication main thread.
Rewrite the #ifdef event dispatcher logic slightly:
both OSX and GLIB now gets an "else" branch for the
UNIX event dispatcher, instead of the current "dangling
else" pattern which only works for one #ifdef case.
Change-Id: If853567fa097fe007502b0804c2307a989719866
Task-number: QTBUG-46625
Task-number: QTBUG-48758
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fix the include path of the event dispatcher which changed after
08a4b7f745.
Change-Id: Ie679b189bd65dc3388ba0d28d01036e3d05683e7
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Currently QOpenGLWidget and QQuickWidget do not support having native
child widgets inside the same top-level window. In some cases this is
inevitable, f.ex. multimedia may require native windows when used from
widget apps. winId() calls made for various (valid or invalid) reasons
are also problematic.
There are no blockers for supporting this setup, however. By storing
multiple texture lists (one for each subtree where the root is a
native widget), adding the missing markDirtyOnScreen calls, letting
each native widget access the correct texture list (i.e. the one
corresponding to its children) when they are (separately) flushed, and
fixing composeAndFlush() to take the update region and the (native
child) offset into account, it can all be made functional.
The change also fixes the issue of keeping GL-based compositing
enabled even after all render-to-texture widgets in the window become
hidden. Due to the changes of how such widgets are gathered,
composeAndFlush() is not invoked anymore when no such widgets are
discovered for a given native parent. This is great since having
compositing enabled infinitely is an issue for applications like Qt
Creator that implement certain views with QQuickWidgets but cannot
afford the cost of texture uploads in other places (e.g. for the text
editor) on slower machines.
The openglwidget manual test is greatly enhanced to test various
situations (MDI, scroll areas, tab widgets, QOpenGLWidget as native
child, QOpenGLWidget with non-tlw native parent, etc.)
Task-number: QTBUG-48130
Task-number: QTBUG-49172
Change-Id: Iad098359c8bcf749f01c050da0853415e1550eda
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
This used to work by accident but now with the recent build system changes
the problem became apparent. Not listing the X11 libs is wrong anyway.
Change-Id: I6f75dafa81510d6d6a7571a9fe156cc7b968c8dc
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
The ppm decoder used a fixed size buffer to discard comment lines,
which would fail for comments longer than 100 characters.
Task-number: QTBUG-49414
Change-Id: I92e910e025cf7584a6ff1c0e5b0e8a4ab281d479
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
The QXmlStreamAttribute move operations expect QXmlStreamStringRef
to have move special member functions, but in fact the non-trivial
QXmlStreamStringRef dtor prevented them from being generated by the
compiler. We can't remove the dtor, because it's exported :(
So provide all the move special member functions by hand, and since
their presence in turn prevents the copy special member functions
from being generated, provide those too.
Change-Id: I494aea24981cdb661abe33a96976a363cfe7ef1b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Requires adding member swap. Member-swap is also
necessary to fix the deleted move-assignment operator
of this class, on which QXmlStreamAttribute heavily
relies for its own move assignment operator.
That's why it's not proposed for dev, but 5.6.
Change-Id: Id7d0823d44fc6e55ada7c096ae95444f6bb50963
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Faster, and, thanks to the new reverse_iterators, just as convenient.
Change-Id: Ibc6c64051a8ede4a47428e9271ffbeaa921fc255
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Call begin/endResetModel() in QSqlQueryModel and all
derived classes.
Task-number: QTBUG-49404
Change-Id: I11492d6386efb4c945c246a6379aaa6ca4502a25
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
statically linked qt does not compile, as versionKeyLiteral() is unused,
causing clang to complain:
error: unused function 'versionKeyLiteral' [-Werror,-Wunused-function]
Change-Id: I6a233081e7c58fce75ece82616f937f29a23a81b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Since the iPhone 6(S) Plus devices have a PPI of 401, we change the
logic from storing the unscaled PPI to storing the scaled PPI, and
applying that to a scaled geometry when computing the physical size.
Task-number: QTBUG-49467
Change-Id: I1741ff075749a301d2434cd35f642fcc9ea4b581
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Otherwise, we have unexpected channel close initiated by reply
destructor.
Change-Id: I15ad076ff20546e78787e19155544a2e5f8047a1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
Low-level input handling uses the native coordinate
system and the (device independent) coordinates from
QScreen needs to be converted.
Change-Id: I501dc77f5e51be01a42e533cd0609e069b8d228b
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
QPlatformScreen works in native pixels and the
(device independent) coordinates from QWindow
needs to be converted.
Change-Id: I85ff45d66dc501e8c3c1c7a18f87448c92d79b9d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
It's a QPlatform* class and works in the native (platform)
coordinate system.
Change-Id: Ibf36bc68d84ecd668b35e0c22e1fa35cfc456a5d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Support use of Qt::AA_EnableHighDpiScaling and
QT_AUTO_SCREEN_SCALE_FACTOR.
This makes the high-dpi scaling system use the screen
configuration set with QT_QPA_EGLFS_PHYSICAL_WIDTH and
QT_QPA_EGLFS_PHYSICAL_HEIGHT.
Implement QEglFSScreen::pixelDensity() and make it return
the scale factor for the display. The scale factor is computed
as the ratio of the logical DPI to the base DPI.
Change-Id: I14ed5da058024128479cb5508e056c39bd2f7563
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>