Add a coordinate scaling layer to QtGui, which supports 'devicePixelRatio'
type high-dpi on all platforms, in production and also for
development and testing purposes.
High-DPI scaling is opt-in, by setting environment variables:
QT_SCALE_FACTOR - sets a global scale factor
QT_AUTO_SCREEN_SCALE_FACTOR - sets per-screen scale factors,
where the scale factors are provided by the platform plugin.
This QtGui scaling can be used instead of or in addition to scaling
done by the window system. This distinction is not visible to
applications [when they use Qt API], which will see a change in
the value returned by the devicePixelRatio() accessors as usual.
Introduce a new (private to Qt) coordinate system: native pixels.
The coordinate system stack now looks like:
device-independent pixels (app, upper parts of Qt)
native pixels (lower parts of Qt Gui, platform plugins)
device pixels (backing stores and OpenGL)
Add private QHighDpi namespace with scaling functions that convert
between device-independent pixels and native pixels:
T toNativePixels(T, QWindow *);
T fromNativePixels(T, QWindow *);
Add scaling calls the QWindow (and friends) cross-platform implementation,
around the calls to QPlatformWindow functions. QPlatformWindow now uses
native coordinates - platform code remains largely unchanged since native
coordinates are window system coordinates.
QWindow now uses (possibly) scaled coordinates. This means that
platform plugins no longer can rely on QWindow::geometry() and
related functions. QPlatformWindow::windowGeometry() and other
convenience functions have been added for use when the platform
plugin needs to convert scaled geometry to native geometry.
Add Qt::AA_NoHighDpiScaling, which can be use to disable any
scaling in QtGui, effectively ignoring the environment variables.
(Note that this does not disable any scaling done by the window
system.)
Contributions from Friedemann and Paul.
Task-number: QTBUG-46615
Change-Id: I673bbd69c130e73b13cce83be11bfb28f580bf60
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
The QSslCertificate tests only covered certificates with RSA keys, this
extends the test coverage to DSA and EC keys.
Change-Id: Ibee26f449cf6c1d97cbac6b511972eb44d6f0bd2
Reviewed-by: Richard J. Moore <rich@kde.org>
Until now we'se set the screenGemetry to 0,0 until the layout is
created, but some controls needs it before that.
Task-number: QTBUG-44271
Change-Id: I7d00e2a142572e27fc77e46566bb2cdb37f58035
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
The native Windows file dialog does not support displaying
files in the directory chooser.
Task-number: QTBUG-46982
Change-Id: Ib58f3d888df564d42044b81ad8e67b8aeae5f3c6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
All overloads of QProcess::start will now check whether the program
string is empty and in that case
- set error to FailedToStart,
- set errorString to "No program defined",
- emit error.
Until now only one of the three overloads behaved like this.
As a side effect, start(QString(), QStringList()) will not crash on
Windows anymore.
Task-number: QTBUG-47404
Change-Id: I2f93657204fe3643b1d74a74817843c05fc4a96b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Work around QPaintDevice::metric's int return type
by adding a new metric that returns a scaled devicePixelRatio.
Choose a scale factor that gives us more than enough
range.
The QPaintDevice::devicePixelRatio() convenience accessor
is public API and can unfortunately not be changed
to return a qreal. Add devicePixelRatioF() which
returns the (unscaled) devicePixelRatio.
Change all call sites of QPaintDevice::devicePixelRatio()
to use QPainDevice::devicePixelRatioF().
Task-number: QTBUG-46615
Change-Id: I97ec4000fe379b7ff5e1624a871ae2512790aad9
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
- Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer).
- Replace Q[TRY]_VERIFY(smartPointer == 0) by
Q[TRY]_VERIFY(smartPointer.isNull()).
- Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and
add casts where necessary. The values will then be logged
should a test fail.
Change-Id: I4e4a319c5918d697a33f6d6032c36b8c9660ca05
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Implement the new QPlatformScreen API for power state.
[ChangeLog][QPA][eglfs][kms] Allow to set DPMS mode and get the current
value for each screen.
Change-Id: I5abfb53c3e2f6579a2d6ff19d780b67f424903bf
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Allows platform plugins to set the power state for each screen.
Change-Id: I4164ca63cbae9fa2ab186dc84c8f704c33fd7c69
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
The common case of QVersionNumber is that there are few segments and
each segment is a small integers. So instead of allocating a
QVector<int>, just store those numbers in the class itself if
possible. Think of this as a "Small String Optimization" for
QVersionNumber.
QVector<int> costs 16 + 4*N bytes, plus malloc overhead. After this
change, QVersionNumber(5,4,0) will have an overhead of zero.
The memory layout is explained in the header. I've coded it so big
endian also works, but I have not tested it at all.
Aside from the special functions for QVersionNumber and operator>>, all
the rest of the algorithm could have been left unchanged. I only updated
segments(), normalized(), compare(), commonPrefix() and fromString() to
take advantage of the smaller implementation in a more efficient way.
Note: QVersionNumber's constructors often leave half of the object or
more uninitialized. That's not a problem.
Change-Id: I4a2a0ce09fce2580f02d678e2f80b1dba74bac9d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Introduce overloads in the API to allow specifying multiple color
attachment sizes and formats. When these are in use and MRT is supported,
a texture or renderbuffer is created for each of GL_COLOR_ATTACHMENT0, 1, 2, ...
[ChangeLog] Added support for multiple render targets in QOpenGLFramebufferObject
Task-number: QTBUG-39235
Change-Id: Ie7cfd81d1b796a9166b80dff7513aafe0120d53d
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
It will be reintroduced as a cross-platform feature.
Task-number: QTBUG-46615
Change-Id: Ia6d03275018b2a25ebed438fe51f15e491f1c3ff
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
There are multiple QString and QStringRef functions that document
behavior "if n is greater than size(), ...", but a comprehensive,
correct statement is "if n is greater than or equal to size(), ...".
Change-Id: I5d2112e08013edaf6f2f6d7e8a6740ea26a076e2
Task-number: QTBUG-47479
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
QDoc needs to ignore Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6,
introduced in commit 075769ca, to avoid failures when parsing
the header files.
Change-Id: I07510248590e290e7a2460d51c8333c135647bcb
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
- Fix QDoc warnings for broken links
- Use \badcode for code snippets that are not C++ or QML code
- Remove/update obsolete information
Change-Id: Ie5ce6ec588709059fc7ba7b47e0cc8ad5385c42f
Reviewed-by: Martin Smith <martin.smith@digia.com>
QDoc already recognized "group" as a document type selector, but provided no
way of defining which group the members should be selected from.
This commit adds that feature, by allowing 'group:groupname' as a selector.
All members (from the local tree) of the specified group are added to the
subproject.
Introduce up-to-date selector names for QML types and documentation pages,
but keep the old legacy names for compatibility.
Add documentation for the selectors.
Change-Id: Ic3f60a028d15f5f8e0035d28fbc503630af8f1d1
Task-number: QTBUG-32985
Reviewed-by: Martin Smith <martin.smith@digia.com>
According to history, the test was supposed to verify
the correct parsing of the command line on Windows by the qWinCmdLine()
function in corelib. It did not test anything since the test
application printed out argv[1] instead of
QCoreApplication::arguments()[1]. Since qWinCmdLine() has been replaced
by the WinAPI CommandLineToArgvW(), the test no longer makes sense
and also starts to fail then warnings are printed to the error output.
Change-Id: Idf642783ebb56eaa8fba9004174557485563a84f
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This is just to make the code cleaner. The static variable will control
whether we've detected that the system call exists -- if it does, we are
expected to always use it.
Change-Id: Iee8cbc07c4434ce9b560ffff13cb4adc049413c1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
It's more efficient than we are. This also enables the code to work in
the unlikely case of an ELF platform without RTLD_DEFAULT.
Change-Id: Ib306f8f647014b399b87ffff13f12f8aeeb2589a
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
In the normal case, this change is a no-op. In case RTLD_DEFAULT isn't
defined, this makes the job of the optimizer easier to detect that the
static variable is never modified and that it can do a lot of dead code
elimination.
This also enables the optimization in the next commit.
Change-Id: Ib306f8f647014b399b87ffff13f12f40a359233b
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
That version of uClibc has neither pipe2 nor eventfd.
There were two problems with our detection. First, it checked for glibc
incorrectly, so the comparison was always true as
__GLIBC__ << 16 = 0x20000
Second, we needed to check for uClibc's version.
Task-number: QTBUG-47337
Change-Id: Ib306f8f647014b399b87ffff13f3023b7f8d6d4a
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
So we can have interoperability with algorithms.
Motivated by inefficient code like qDeleteAll(hash.keys())
[ChangeLog][QtCore][QHash] Added key iterators, accessible through
keyBegin() and keyEnd().
Change-Id: I1f9db8a7a4294e1556cbb50b8fe5ebdcf0dc29a2
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
So we can have interoperability with algorithms.
Motivated by inefficient code like qDeleteAll(map.keys())
[ChangeLog][QtCore][QMap] Added key iterators, accessible through
keyBegin() and keyEnd().
Change-Id: Ieee2f9ad031e9d1e845a71447746699bbe95b96c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The comment about non-OpenSSL backends not reproting a specific error
for self-signed certificates contained a typo, this fixes it.
Change-Id: I3010981d5d87d68ebf5e984c003b8bbbfb019b96
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Non-OpenSSL backends are not able to report a specific error code
for self-signed certificates.
Change-Id: I56bf130335b2afa65cf2bd5248a40ac0e32f74c2
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
Rename the test slot eventFilter() to testEventFilter(), which fixes:
tst_qgraphicsproxywidget.cpp:101:10: warning: 'tst_QGraphicsProxyWidget::eventFilter' hides overloaded virtual function [-Woverloaded-virtual]
void eventFilter();.
Change-Id: Ia05d188b18dcbf3a0b093dcea19a7122bcde6e62
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
tst_qgraphicsanchorlayout.cpp:144:5: warning: ignoring return value of function declared with warn_unused_result attribute [-Wunused-result]
layoutGeometry.adjusted(+right, +top, -left, -bottom);
Change-Id: I411ccaa867e418f36869fc244ea2eeaa5b117312
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Fix warnings:
tst_qtcpsocket.cpp:245:9: warning: private field 'numConnections' is not used [-Wunused-private-field]
int numConnections;
^
tst_qtcpsocket.cpp:1834:9: warning: private field 'exitCode' is not used [-Wunused-private-field]
int exitCode;
tst_qcheckbox.cpp:86:10: warning: private field 'tmp' is not used [-Wunused-private-field]
uint tmp;
^
tst_qcheckbox.cpp:88:10: warning: private field 'tmp2' is not used [-Wunused-private-field]
uint tmp2;
Below warning is caused by code #ifdefed for OS X only, make it a local variable:
tst_qlabel.cpp:114:16: warning: private field 'test_edit' is not used [-Wunused-private-field]
QLineEdit *test_edit;
Change-Id: I53c755545fe2e7ca1f053f40c8c0e50aec2efcdd
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
- Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer).
- Replace Q[TRY]_VERIFY(smartPointer == 0) by
Q[TRY]_VERIFY(smartPointer.isNull()).
- Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and
add casts where necessary. The values will then be logged
should a test fail.
in tests/auto/other, tests/auto/printsupport and tests/auto/xml.
Change-Id: I28cbdc89d36791f179425f17f90b697c60660938
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Add a link to the topic that lists all Qt modules with links to
their documentation.
Change-Id: I0f488ea8c2f3479c7bace6ffbdbb7a70324c1649
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Patch 53d289ec4c caused it not to select
property change events, which are needed separately for each tablet
device. It's not enough to select them on the master device.
Change-Id: Ibb6c7990d2edd865019eacfa7eed4bf818f7557e
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Consider a project that does the following:
launch_images.files = $$PWD/LaunchImage.xib
QMAKE_BUNDLE_DATA += launch_images
In that case we end up overwriting launch_images.files in default_post, and
at the same time, add launch_images a second time to QMAKE_BUNDLE_DATA.
The result will be that we copy our own launch image twize into the bundle.
To prevent this, prepend our internal variables with qmake_
Change-Id: I24f870874017b5388248e3bfadecd461422ffe35
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Compositing stays active for the window even when all such widgets get destroyed.
Task-number: QTBUG-46937
Change-Id: Ib4acc90689151fd7de234806c4b5c0c472c13a5c
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Fixes a typo which breaks the parsing of certificates with DSA public keys
when using a non-OpenSSL backend (WinRT, SecureTransport).
Change-Id: I250ba9948d5bd7739e281d7cd1b95cfbcb10e402
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
The docs for QList advised users to choose QList
over QVector for efficiency reasons. The advise
should be to use QVector over QList for efficiency
reasons. This update corrects that misunderstanding.
Change-Id: Ie04c99ab7fe6aef4bd1d39175c9564455b0122de
Task-number: QTBUG-47196
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Preparing the replacement of Q[TRY]_VERIFY(a == b) by
Q[TRY]_COMPARE(a, b) for non-boolean types.
Change-Id: Iab6ec2f0a89a3adc79e18304573994965013dab5
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>