Also add a test checking that devicePixelRatio is forwarded to
derivatives of QPixmap.
Change-Id: Idb2b3f033ccc0fd49bf54b11f5dffbce5a19b006
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
A string can parse as a non-zero double that's smaller than the
smallest float yet be a faithful representation of the smallest float.
So rather than testing for non-zero doubles less than the smallest
float, test for non-zero doubles that cast to float zero; these
underflow. This means small values close below the smallest float
shall round up to it, rather than down to zero, requiring a tweak to
an existing test. Added a test for the boundary case (and tidied the
test data).
Fixes: QTBUG-74833
Change-Id: I4cb30b3c0e54683574b98253505607caaf88fbfb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We should get the correct stylus position from the valuators,
not from the X11-provided global position. Global position is rounded
to the nearest FP16 values, which is not enough for smooth painting.
[ChangeLog][Platform Specific Changes][X11 / XCB] QTabletEvent
coordinates now come from AbsX/AbsY valuators in the X11 event, in
more precise 32.32 fixed-point format, scaled to fit the virtual
desktop. It's possible to revert to using the legacy 16.16-format
event_x/event_y coordinates as in previous releases by setting the
QT_XCB_TABLET_LEGACY_COORDINATES environment variable.
Task-number: QTBUG-45375
Fixes: QTBUG-48151
Change-Id: Ie701446b3586296bcb8fb09158f387ba6a7cbf07
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
for the case a custom style sheet is in use and QStyleSheetStyle
replaces the widget (close button) with its parent (QTabBar).
We still need this button though to compare against tabButton
on a hovered tab. This allows us to have, indeed, native-looking
tabs as documented (aka similar to Safari or the "Terminal" application).
Change-Id: I53ff78699e705db6d7c7b84774b8e188a1277535
Fixes: QTBUG-61092
Fixes: QTBUG-74689
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The QBrush constructor taking a QGradient would assert or crash if
passed a null (NoGradient) gradient. But it is not necessary for the
API to be as brittle as that: instead the result can simply be a null
QBrush object, i.e. the same as the default QBrush() constructor
creates (style == NoBrush).
This issue comes up now since with the recent introduction of
QGradient presets, the API opens for using QGradient directly, whereas
earlier, only the subclasses QLinearGradient etc. were to be used.
Fixes: QTBUG-74648
Change-Id: I1a9b1c4654e4375aa6684700a262cc0946851448
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
For applications that set VERSION the installation targets of pdb
files were wrong in qmake's nmake Makefile generator.
Replace code that tries to reconstruct that target's versioned
extension with TARGET_EXT which already contains the fully resolved
target extension.
Fixes: QTBUG-74265
Change-Id: I9553a5f70170e077a59c866079ae51647ae80bef
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
...like the install commands before Qt 5.9 did.
This ensures consistent permissions. Also, we can throw away the code
that took care of removing and re-adding the read-only flag on Windows.
Change-Id: I06bc3af8817f18c016119fbcb7360800d6c129bd
Fixes: QTBUG-74733
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
0bc4288689 in Qt 5.6 introduced support for premultiplied alpha in the
raster-rendered QWidget content. Unfortunately this introduced a
regression for OpenGL content from QOpenGLWidgets with WA_StacksOnTop
set: these used standard alpha blending in 5.5 and earlier, and
switching them to premultiplied (in case the - unrelated - raster
content has a _Premultiplied QImage format) breaks all content that
was done with non-premultiplied alpha in mind, for example the qopenglwidget
example's "Transparent background" checkbox.
Restore the pre-5.6 behavior.
Fixes: QTBUG-74285
Change-Id: I76fcadd53cd436efa2b619b8d6739270995d044f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
When cross compiling on Ubuntu with LTO enabled, the linker will complain about the "-fno-fat-objects" parameter even if the "-fuse-linker-plugin" is passed it.
But if the "-fno-fat-objects" parameter is removed, the linker will complain about "don't support linker plugin in this mode".
Remove both parameters can fix this.
Change-Id: I2d792ca70737f2e82a360bfc597f2b110513b954
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
After 'h2c' mode was implemented with the proper protocol
upgrade, the previously working 'direct connection' mode
was lost for clear text connections due to the erroneous
logic in the constructor: having !channel->ssl does not
necessary mean we started with HTTP/1.1 request, including
protocol upgrade header; it can also mean we connected a
plain socket and immediately sending h2 frames, without
any H2 negotiation at all.
Fixes: QTBUG-74765
Change-Id: Ice466d6bffb40048b7ab46fb064f2d3d795a12aa
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The DNS entry for the host has changed, dig answers with dns.google,
not with google-public-dns-a.google.com. While developing a proper
fix to the test, blacklisting this particular lookup allows
integrations to pass in the meantime.
Change-Id: Id37da6b24554803bf4e2c84be5b949ded40566e8
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Avoid using inline assembler
Task-number: QTBUG-72716
Change-Id: I696efb5a787416eb4fc5ba3a250461aaa9a4afc2
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Otherwise it can happen that we pick up the tool for the host system,
which will break compilation.
Users can still pass
-psql_config /path/to/pg_config
or
-mysql_config /path/to/mysql_config
manually.
[ChangeLog][QtSql] When cross-compiling pg_config, mysql_config
are not looked up in PATH anymore. Pass -psql_config path/to/pg_config
or -mysql_config path/to/mysql_config to explicitly enable PSQL or
MySQL in this setup.
Fixes: QTBUG-73565
Change-Id: I35ff32322bac69f1575ce6c846a56ac2ae3b8d55
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The Windows and Cocoa font engines ignored the stretch factor when
the pixel size is so large that QPainterPath rendering is used
instead of native.
Fixes: QTBUG-14315
Change-Id: I93390528ac264452b7d6af7d39f49f4b0dd56279
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Under the 'Dark' theme as a system one, in an application forcing
'Aqua' (and thus 'Light') appearance, disclose button (drawn as
a triangle) can suddenly become transparent (apparently selecting
a 'Dark' codepath internally). Different ways to fix this (attaching
NSButton to a view, setting appearance on this button manually, etc.)
- all seems to have no effect. We resort to manually drawing this
button on macOS > 10.14 if 'effectiveAppearance' is 'Aqua'.
Change-Id: I6f54c0c4cf8fdd1ba53263ba9535e3055be46d42
Fixes: QTBUG-74515
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
We may get calls to the MessageTypes-overload of addMessage via e.g.
qSkip, or other functions in QTestLog, so we have to implement the
function.
Change-Id: I9d58c73e93ca918c42448c246c37cc9ae6aa04de
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Fix styling and positioning of QTabWidget tabs on macOS Mojave while
using dark mode
Change-Id: Ibe0c90b7625c4f4ff895083fefaade74305ba0ea
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Fixes the text color displayed in the QToolBar on macOS Mojave dark
mode
Change-Id: Ic4415295e314a8fc1c4fbb58964386e0563b8d44
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
If the stretch is set to AnyStretch, then this is taken to mean
we should accept the font as it is. But on mac, there is a special
code path to scale the advances since the shaper doesn't do it
for us, and this neglected to check the stretch, thus it would
scale the advances by 0%.
This happened when loading a file directly in QRawFont and using
this in a QTextLayout, since no part of the code path will attempt
to calculate the stretch in that case. Reproducible in q3dsviewer
in Qt 3D Runtime 2.3.
Task-number: QT3DS-3132
Change-Id: I8f934f3fac41bf7a93c01cca0416d44003119907
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The --sysroot flag is added to QMAKE_CXXFLAGS by the gcc-sysroot
feature. However, when the makespec is reloaded, it can overwrite
QMAKE_CXXFLAGS.
Save QMAKE_CXXFLAGS before re-loading the mkspec and add it to the
value from the makespec, like we do for CONFIG.
Fixes: QTBUG-74326
Change-Id: Ie1fb713e2ffc9641d6db8c682bc5175581cd5b5f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
In the QNetworkAccessManager machinery we would treat "no-cache" as if
it meant "don't cache" while in reality it means "don't return these
cached elements without making sure they're up-to-date"
At the same time as this change is made let's add test data for
"no-store", which replaces the "no-cache" test data.
Fixes: QTBUG-71896
Change-Id: Ieda98f3982884ccc839cac2420c777968c786f6e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
It can happen that QDataStream is fed a QVariant that contains a QPixmap
representation, that will make the application crash when trying to
restore it
This is specially important for cases in which applications expose dbus
interfaces with QVariantMaps
Change-Id: Ife4feaef30f30e7e27d88464bd6b2a247f743123
Reported-by: Fabian Vogt <fabian@ritter-vogt.de>
Reviewed-by: Fabian Vogt <fabian@ritter-vogt.de>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Recurse down the sibling at column 0 of the index instead down the
index.
Change-Id: Ie78d8b28eab7438ca3f83ee0df177115ca82806e
Fixes: QTBUG-73864
Reviewed-by: David Faure <david.faure@kdab.com>
While an invalid time-zone shall have no transitions, so may various
constant zones, like UTC. The TZ data may include only the POSIX rule
for such a zone, in which case we should use it, even if there are no
transitions.
Broke out a piece of repeated code as a common method, in the process,
since I was complicating it further.
Added test for the case that revealed this; and made sure we see a
warning if any of the checkOffset() tests gets skipped because its
zone is unsupported.
Fixes: QTBUG-74614
Change-Id: Ic8e039a2a9b3f4e0f567585682a94f4b494b558d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Without ICU, the TZ-DB backend for time-zones tripped over an
assertion when running tst_QTimeZone::stressTest(), which happened to
probe a zone between its last transition and the first transition of a
POSIX rule that followed it. The code assumed there was no interval
between these two; apparently, there can be.
Change-Id: I3d0ad41fec0a255db2f9bfac54d33aa9b83938e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Set object names on the widgets in restoreState(), fixing:
QWARN : tst_QMainWindow::restoreState() QMainWindow::saveState(): 'objectName' not set for QDockWidget 0x7ffcb45e5e00 ';
QWARN : tst_QMainWindow::restoreState() QMainWindow::saveState(): 'objectName' not set for QToolBar 0x7ffcb45e5dd0 ''
QWARN : tst_QMainWindow::restoreState() QMainWindow::saveState(): 'objectName' not set for QDockWidget 0x7ffcb45e5e00 ';
QWARN : tst_QMainWindow::restoreState() QMainWindow::saveState(): 'objectName' not set for QToolBar 0x7ffcb45e5dd0 ''
Task-number: QTBUG-74242
Change-Id: I19f19e93de9df00d001b820a31836ce0b3cd2877
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
But only for the 'Light' theme. For "Dark" the system
color fits well (without our rather strange and random
0.5 we set for some reason).
Change-Id: Ic5c8372913515611a567090f82852ffc7ca14eb7
Fixes: QTBUG-74095
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Change-Id: I46363e5b8944459e8c48fffd158c03bca4b7394e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
So we don't need to have a high kernel requirement on its account.
I needed to introduce a configure-time check because we need to include
a header to get the __GLIBC__ macro, but we can't include any header in
assembler until we know it's glibc (we need to know that the header is
assembler-safe). glibc, uClibc and MUSL do provide an assembler-safe
features.h, but Bionic does not.
And we need to know that it's glibc's implementation, since the fallback
was not required. The other three libraries may not implement such a
thing when they get around to adding the system call.
Fixes: QTBUG-74526
Change-Id: I1004b4b819774c4c9296fffd158d14da98bf571c
Reviewed-by: Fabian Vogt <fabian@ritter-vogt.de>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The shortcut needs to be cleared if the native menu entry is being
hidden due to the fact it was changed. Otherwise it will not show the
shortcut anymore as it sees it as in-use.
Change-Id: Ifb10db855766e4de71db06ea006f6d63497f3193
Fixes: QTBUG-74113
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
QPlatformWindow::initialGeometry() would assign a default height to
the initial geometry of the QRollEffectClassWindow since it has height
of 0. This causes the obtained geometry to not match and subsequently
a geometry change being sent synchronously.
Introduce a new flag QWindowPrivate::resizeAutomatic similar to the
existing QWindowPrivate::positionAutomatic to prevent assigning a
default size and pass through the geometry as is where required.
Fixes: QTBUG-74176
Change-Id: I70c66490838a2c4dfe200ec86094d28bd984dd03
Reviewed-by: Kati Kankaanpaa <kati.kankaanpaa@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Introduce a logging category for the qDebug()-output.
Add a meta type registration for QList<QPersistentModelIndex>, fixing
numerous warnings like:
WARN : tst_QItemModel::remove(QStandardItemModel:invalid start, valid count 5) QSignalSpy: Unable to handle parameter 'parents' of type 'QList<QPersistentModelIndex>' of method 'layoutChanged', use qRegisterMetaType to register it.
Fix a Clang warning about potential misuse of operator ,
Task-number: QTBUG-73864
Change-Id: I60998403a44f5df8767926951ee13d1ed1e93c37
Reviewed-by: David Faure <david.faure@kdab.com>
To get appropriate aspect ratios for the splash screen, you usually
need separate drawables for the portrait and landscape versions.
We support this by adding two new meta data entries that can be used.
If they are not available, we will fall back to the generic one,
so we are still compatible with existing AndroidManifest.xmls.
[ChangeLog][Android] Added entries in the AndroidManifest.xml for
specific portrait and landscape splash screens. If one is present
for the current orientation, it will be preferred over the generic
one.
Task-number: QTBUG-74029
Change-Id: I5ffea56320aef85f62f21a59df4d077b4163a65a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
When painting into a pixmap, we would apply the system clip,
which is a rectangle that starts at the position of the current
widget relative to the window. If the widget was not positioned
at (0,0), we would therefore clip the top left part of the drawing
when drawing into a pixmap, which is obviously not intentional.
The solution is in accordance with how it is done in e.g. the OpenGL
paint engine, where useSystemClip is set to true only if we are
drawing to a widget. The system clip should otherwise be ignored,
so we do that in the X11 paint engine as well.
Task-number: QTBUG-70387
Change-Id: I9cad26019970280a8a452dc6f1015d229120cac5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
QIcon::paint() paints blurry icons on HighDPI screens.
In particular, it is called by QCommonStyle to paint
icons for CE_ItemViewItem's.
Change-Id: Iffe6bd01a8756e617656195ef63fe13c968e0832
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The patch causes an Assert on close and thus cannot be used as is. I do
not have ICC available to try to come up with an alternative solution so
the patch is reverted for the time being.
This reverts commit 93a78799c3.
Fixes: QTBUG-74467
Change-Id: Ic572dfa667a479686675eb3f9066d133657b4499
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Yuhang Zhao <2546789017@qq.com>
Copy the test data into a temporary directory and do all the work there
without tainting the source directory. More importantly, do not pull in
any settings from the Qt build to test what actual users will encounter.
Change-Id: I793b86bfadb7597efb47c8f2d3fc863384c78a79
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This will enable modules like QtWebView which needs to generate its
qmldir at qmake time since it changes depending on whether QtWebEngine
is available or not. This ensures that it is not created in the sources
directory and in the build directory and correctly picked up.
Task-number: QTBUG-65092
Change-Id: Iac628b97145d29778f554510e8e07102d588df64
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Fonts look ugly when they are drawn scaled without
antialiasing.
Change-Id: I64268db5b37d4bc763ffa23632aca2eaac5d8eae
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
INTEGRITY compiler searches for exact filename if the -l argument already
contains .a suffix. GNU linker uses exact filename if -l argument begins
with a colon.
Change-Id: I62be8f1e6b9c7dc7eaa5ab3d4bfc55460d729737
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>