Commit Graph

30989 Commits

Author SHA1 Message Date
Laszlo Agocs
c06627a230 rhi: metal: Eliminate redundant setCullMode and setFrontFaceWinding calls
Task-number: QTBUG-78605
Change-Id: Icc3a9636055b5f45418da28cc05aa02e19370c02
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-26 17:02:28 +02:00
Laszlo Agocs
30e27328e3 rhi: Unify handling of special cases for scissor and viewport rects
With OpenGL a scissor (or viewport) rectangle is not allowed to have a negative
width or height. Everything else is allowed. This is also the semantic we wish to
keep for QRhiViewport and QRhiScissor.

This raises some problems. For instance, when we do bottom-left - top-left
rectangle conversion, the case of partially out of bounds rects needs to be
taken into account.

Otherwise, Qt Quick ends up in wrong scissoring in certain cases, typically when
the QQuickWindow size is decreased so the content does not fit because that will
then start generating negative x, y scissors for clipping (which is perfectly
valid but the QRhi backends need to be able to deal with it)

Then there is the problem of having to clamp width and height carefully, because
some validation layers for some APIs will reject a viewport or scissor with
partially out of bounds rectangles.

To verify all this, add a new manual test, based on the cubemap one. (cubemap was
chosen because that is an ideal test scene as it fills the viewport completely, and
so it is visually straightforward when a scissor rectangle is moving around over it)

Fixes: QTBUG-78702
Change-Id: I60614836432ea9934fc0dbd0ac7e88931f476542
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-26 17:02:05 +02:00
Eskil Abrahamsen Blomfeldt
d5abda313d iOS: Fix fallback fonts on iOS 13+
Since iOS 13, the cascade list for the default UI font contains
meta-families for several writing systems, such as CJK. Since
these font families were never populated to the database, we ignored
them in Qt, and thus got missing glyphs for the characters in question.

The fix is to make sure these fonts are populated in the database.
It contains a partial backport of 922d195020,
which adds the qt_isFamilyPopulated() accessor to allow us to check
if the family has been populated in the font database. In Qt 5.14,
there is public API for this in QPlatformFontDatabase, so this is
a temporary resolution until then.

Fixes: QTBUG-77467
Change-Id: Ia9ebb8a19ad2367eb764ae1496a52966b465336b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-09-26 10:32:25 +00:00
Edward Welbourne
06a7aba731 Fix QCalendar::isValid(): make it const
Spotted in API change review, thanks to Albert Astals Cid.
Also added documentation of this method.

Change-Id: I2ef2c526a98b571a3cb3bb5f93d1952b1b0d63a9
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-09-26 09:53:23 +00:00
Friedemann Kleint
dc042c6dee Windows: QSysInfo::prettyProductName(): Improve version formatting
For Windows 10 and higher, the SP version and major/minor versions
are not relevant any more; the release id (displayed by the winver
tool as "Version" should be displayed instead. Add helpers and
change the output accordingly.

For Windows 7, output the build number.

[ChangeLog][QtCore][Windows] QSysInfo::prettyProductName()
now returns a version including the Windows 10 release id or Windows 7
build number respectively, resembling the version string displayed by
the winver tool.

Change-Id: Ia783272a0da234d2f7ff35c4a9a6fc296da277e0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-09-25 17:15:29 +02:00
David Faure
947883141d QWidget::setFocusProxy: adjust focus widget properly
My commit 3e7463411e adjusted the focus widget by setting
QApplicationPrivate::focus_widget directly, while there is a method for
doing this properly, including setFocus_sys() and emitting signals.

Fixes: QTBUG-77364
Change-Id: I218acf7a9de39173d282ced46def4f65594f80b4
Reviewed-by: Florian Bruhin <qt-project.org@the-compiler.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-09-25 15:21:15 +02:00
Friedemann Kleint
8810f82f3f QWizard/Aerostyle: Fix "&Next" shortcut
The fix for QTBUG-35203 set the Alt+Right shortcut on the next
button, clobbering the Alt+N shortcut from parsing the text (similar
for other languages). Add a separate shortcut for Alt+Right since a
button may not have several shortcuts.

Amends 6714196f45.

Fixes: QTBUG-78604
Change-Id: I1367da739c35fbd011d11f850c9bc3915113c644
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-09-25 15:14:36 +02:00
Allan Sandfeld Jensen
d512f5ac3a Handle returned bitmap glyph when not requested
Add back code to handle bitmap glyphs returned when we did not request
a bitmap glyph. This is a can happen on some configurations where
bitmaps are not suppressed.

Fixes: QTBUG-78116
Change-Id: Ie0c6cfbf9c50456431b0e3a23e568f3399e5a879
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-09-25 14:46:36 +02:00
Andy Shaw
c3faeb8528 Fix CVE-2019-16168 in SQLite
v3.29.0 is the latest and there is no indication as to when the next
release is so we will apply this separately for now and it can be
reverted once it is in a release that we ship with.

This patch is taken from https://www.sqlite.org/src/info/98357d8c1263920b

Change-Id: I82d398b093b67842a4369e3220c01e7eea30763a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-25 10:09:50 +02:00
Andy Shaw
f88476569a sqlite: Update to v3.29.0
[ChangeLog][QtSQL][sqlite] Updated to v3.29.0

Change-Id: Ibf61c829dcd24dc8cdf00f5b57078255b0ad5ef1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-25 10:09:34 +02:00
Thiago Macieira
abfac029ce QFileInfo: clarify documentation about handling of symlink attributes
On Windows, shortcut ".lnk" files are treated as symlinks, and
attribute queries on a shortcut file return the results for the
shortcut target.

Fixes: QTBUG-77523
Change-Id: I907a43cd9a714da288a2fffd15bada7eba37d3ba
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-09-25 01:25:30 +00:00
Thiago Macieira
1872d1a41d Doc: Q_FLAG should be applied to the enum, not the QFlags
moc extracts he name that is inthe Q_FLAG macro and that gets used in
qDebug(). As the documentation described, qDebug would have printed:

  QFlags<LoadHints>(QLibrary::ResolveAllSymbolsHint)

which doesn't compile (though we could have partially specialized
QFlags<QFlags<E>> to be QFlags<E>). The semantically correct output is:

  QFlags<LoadHint>(QLibrary::ResolveAllSymbolsHint)

which is what this change gets. The ideal output would be:

  LoadHints(QLibrary::ResolveAllSymbolsHint)

But that's not a doc change.

Fixes: QTBUG-77216
Change-Id: I0635172f4f2a4c51a435fffd15b59a859886e90c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-09-24 18:25:21 -07:00
Thiago Macieira
70e6e9fe59 Filesystem: avoid crashes on exit in case the locale codec is null
On exit, QLocale::codecForLocale() can return null as the codec may have
already been destroyed. In that case, pretend that Latin1 was the
locale, so any file name is acceptable. This matches QString:

    QTextCodec *codec = QTextCodec::codecForLocale();
    if (codec)
        return codec->toUnicode(str, size);
 #endif // textcodec
    return fromLatin1(str, size);

Note that if we're wrong and the locale was *not* Latin1, files that you
had a name to may not be encoded or decoded the same way.

Fixes: QTBUG-78446
Change-Id: Iece6e011237e4ab284ecfffd15c54077728a17ca
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-09-24 18:24:00 -07:00
Shawn Rutledge
06cc5d3071 Ensure that QFont::fromString() doesn't parse empty font specifications
Fixes: QTBUG-78236
Change-Id: Iba060e7a24080cdc8f317ecb6dc616b2cd918acb
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-09-24 14:38:40 +02:00
Friedemann Kleint
27782af821 QWizard: Use member initialization in private classes
Remove superfluous constructors.

Task-number: QTBUG-78604
Change-Id: I8a422cfeaaedf89ce310e06d5db80907cd1102d4
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
2019-09-24 09:50:14 +02:00
Andy Shaw
fdae0ccc5f Fix connection string code snippet for ODBC on Windows
Fixes: QTBUG-15133
Change-Id: I86d77aec039fdfaf262ad056c944c7cfc30e0041
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2019-09-24 08:42:11 +02:00
Andy Shaw
54d3059ccf Move DialogButtonBoxLayout case to be before MouseDoubleClickDistance
This amends 9be66cb282 so that the
DialogButtonBoxLayout case is moved to be before the
MouseDoubleClickDistance one in case the fallthrough is triggered.

Change-Id: I843dad6b55ccffe6b6c275cd75587f04659e512f
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-09-24 06:17:20 +02:00
Christian Ehrlicher
70c053ee68 QAbstractSpinBox css: properly honor spincontrol-disable-on-bounds
The css style 'spincontrol-disable-on-bounds' was not properly honored
within QAbstractSpinBox::initStyleOption() because the affected widget
was not passed to QStyle::styleHint(). Therefore QStyleSheetStyle did
not find the correct render rule.
Fix it by passing 'this' as third argument to QStyle::styleHint().

Fixes: QTBUG-18008
Change-Id: Iabcebf0b83143f45309b4e7066bccb8d20bd0419
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-09-23 18:39:08 +02:00
Andre de la Rocha
a8ec52d5e7 Windows QPA: Fix close button not working on Windows 7
A previous change modified hit testing in the non-client area of
fixed-size windows, in order to prevent showing a resize cursor when
the windows are not resizable (QTBUG-77220). The change assigned
HTCAPTION for any point over the entire title bar, including the top
bar buttons, which on Windows 7 classic or basic desktop caused these
buttons to become unresponsive. The present fix changes this behavior
to redefine only the outer sizing frame, while letting the rest of the
title bar be handled by DefWindowProc().

Fixes: QTBUG-78262
Change-Id: Id6e821a805c8333a67988f87c3727bed0c93290e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-09-23 17:36:34 +02:00
Shawn Rutledge
da46ea92e5 doc: add a note to QFileSystemWatcher about files saved by re-creation
Fixes: QTBUG-46483
Fixes: QTBUG-53607
Change-Id: I434f177b35689d55aa1deea360bf7e6ae009ad68
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2019-09-23 17:33:52 +02:00
Allan Sandfeld Jensen
c4956dbb67 Do not pass nullptr as '%s'
Fixes GCC 9 warning.

Change-Id: I2a21d863267b444a29697aa026c21b47e3ac8382
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-09-23 16:38:39 +02:00
Laszlo Agocs
b8d8e0dfbb Follow platform plugin change wrt layer size
Have to set the drawableSize ourselves.

This is not yet fully correct in the sense that does not ensure
what the platform plugin patch tries to enable, namely atomic frames
when it comes to the drawable size. Going to fix that up in separate
patches, maybe it will need some QRhi API changes as well so won't
mix that in here.

Change-Id: I47a3816930bc6a87a2c96d4a6c4c85b2577147dc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-09-23 15:10:13 +02:00
Liang Qi
2dfeea921b Avoid unused parameter 'grab' warnings
Android (5220042 based on r346389c) clang version 8.0.7:

src/plugins/platforms/android/qandroidplatformwindow.h:68:35: error: unused parameter 'grab' [-Werror,-Wunused-parameter]
    bool setMouseGrabEnabled(bool grab) override { return false; }
                                  ^
src/plugins/platforms/android/qandroidplatformwindow.h:69:38: error: unused parameter 'grab' [-Werror,-Wunused-parameter]
    bool setKeyboardGrabEnabled(bool grab) override { return false; }
                                     ^

Change-Id: I4d8a18d5e3bfbc13c05b47f0cdfe10370673e359
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2019-09-23 14:04:38 +02:00
Tor Arne Vestbø
0642ca3528 macOS: Don't update Metal layer's drawableSize automatically
Like our other rendering code paths, the Metal path should allow the user
to resize their surface when they see fit. This is the case today with
e.g QBackingStore::resize() and QOpenGLPaintDevice::setSize().

[ChangeLog][macOS] The drawableSize of Metal layers is no longer updated
automatically on window resize or screen change. Update the size manually
in response to resizeEvent(), or at the start of each frame, as needed.

Change-Id: I9ed6d4326d0e0a3f4e3c63984d3b193e8bb77cae
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-09-23 13:59:00 +02:00
Tor Arne Vestbø
04dcc902eb macOS: Handle backing property changes in a single place
Change-Id: I70d57632a1756f74249f64d4d4c405cb3120a179
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-09-23 11:46:29 +00:00
Allan Sandfeld Jensen
6db83e2584 Fix crash with gamma-corrected text blending disabled
Change-Id: I7e3ca78278bf8bf2dda44711eb57d64aa6f455ce
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-09-23 10:47:50 +02:00
Mårten Nordheim
895a786827 Fix crash when using signaldumper and sender is deleted
Testlib's signaldumper functionality would crash inside
testlib as it dereferenced the sender after it was deleted.

Change-Id: I6013b75b0a121e2768429d8a3cf0339a940314f2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-09-23 08:27:18 +00:00
Liang Qi
6572650641 Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/widgets/styles/qstylesheetstyle.cpp

Change-Id: If11da7799075cc2d5768da5603c5fc46773c4eae
2019-09-23 08:35:49 +02:00
Allan Sandfeld Jensen
d0d18b0645 Handle transparent pen color in fast text path
Switches the text blending to be SourceOver as that is
much more common than Source, and means we can now handle
semi-transparent text colors there.

Task-number: QTBUG-72165
Change-Id: I7b3aedb22412e6fb6f60197596b37f26c6008784
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-09-22 17:15:26 +02:00
Shawn Rutledge
bc35941dbb Add QQuickMultiPointTouchArea as a friend of QTouchEvent
QQuickMultiPointTouchArea needs to understand whether a stationary
touchpoint has relevant property changes, to decide whether to emit its
updated() signal. Amends 217dd1b3b0

Task-number: QTBUG-77142
Change-Id: I85e031820bef9d687369b7d67a57c67fe2875b4b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-09-22 14:25:15 +02:00
BogDan Vatra
ec0e9f29df Android: Fix loading of plugins
In 5bb178c479, the Android platform plugin was moved from
platforms/android to platforms/. The unforeseen consequence of this was that the plugin
loader for plugins/platforms would now find it, whereas before it would be ignored. It
would therefore be detected as the appropriate plugin, but since it was intended to be
loaded as a static plugin, loading it dynamically would fail.

Instead of fixing the static plugin loading, we remove this hack.

Fixes: QTBUG-78440
Change-Id: Idcb6c075fdebaf67644f32a59d7aaf0d1c0bbe20
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-09-22 14:25:11 +02:00
Andy Shaw
ac5e198db4 Add SQLite specific documentation when specifying a database name
Fixes: QTBUG-67847
Change-Id: I3c640233526260b596e8224dc48f713a3f0cff56
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-09-21 11:29:58 +02:00
Andy Shaw
9b6179cf95 Ensure all children of a widget get updated when a stylesheet changes
Before, only the direct children would get an update when the
stylesheet changed, any children below that would be unchanged.

Fixes: QTBUG-77006
Change-Id: Id668eaae74a8289d78d66644f077e6a3302960cd
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-09-21 01:09:51 +02:00
Eirik Aavitsland
b8a911fbeb QPainter: Avoid leaking memory on unbalanced save/restore
If a QPainter ended without all saved states having been restored, the
state stack would leak memory.

Fixes: QTBUG-77843
Change-Id: I760904d6391de24a4867be54fa1bebf76be14ba7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-09-20 13:01:14 +02:00
Paul Wicking
e9190eda1a Doc: Remove broken example snippet from Q_ENUMS
The code snippet is used by both Q_ENUMS and Q_ENUM. Therefore,
remove the example snippet from Q_ENUMS documentation, as it is
obsolete. Also, move recommendation to use Q_ENUM in new code to the
very top of Q_ENUMS' documentation.

Fixes: QTBUG-63203
Change-Id: I12a9f45e0b3bd75dfe98e1ecbc45e299a688b80c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2019-09-20 09:07:50 +02:00
Joerg Bornemann
73f880d393 Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	qmake/generators/makefile.cpp
	qmake/generators/makefile.h

Change-Id: I4c2deac4f6376c85f5e4fe7fb0ccc9ab9a013cd7
2019-09-20 08:20:47 +02:00
Leena Miettinen
0d9f43d534 Doc: Edit QNetworkProxy::QNetworkProxy() default proxy type
Fixes: QTBUG-61771
Change-Id: Ideafe6f8f81c156e941f0548c152021b01b606a1
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-09-19 10:18:31 +02:00
Friedemann Kleint
1ceb48c6a6 QWizard/AeroStyle: Fix condition introduced by previous fix
Set the variables within the condition introduced by
6c0e1dba40, as otherwise, the code
might not be executed.

Task-number: QTBUG-78300
Change-Id: Ia83db6fce197ebf16783f3b0c6d6fad7ebd2ba52
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-09-19 09:34:05 +02:00
Jani Heikkinen
1283ee3245 Revert "QReadWriteLock: replace (QWaitCondition, QMutex) with std::(condition_variable, mutex)"
This reverts commit 319c478603.

Reason for revert: QTBUG-78450

Change-Id: Ifaea83626296508558591d4ff207d4e0c883f841
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-09-19 04:15:04 +00:00
Morten Johan Sørvig
cd92049a95 Prevent crash in QWasmScreen::resizeMaximizedWindows()
screen() may return a null QScreen pointer during
screen initialization.

Fixes: QTBUG-78118
Change-Id: Ide26eb3f06861c38cd7ae56789dd010d4cd7e572
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-09-18 12:59:37 +00:00
Friedemann Kleint
6c0e1dba40 QWizard/AeroStyle: Fix crash when Qt::AA_NativeWindows is set
Prevent recursive platform window creation from the events
received during window creation (WM_POSCHANGING, etc).

Fixes: QTBUG-78300
Change-Id: Ie2bb4308af645c30e556666589e2dd08f14d4035
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2019-09-18 11:49:55 +02:00
Joerg Bornemann
20d8186c24 Fix passing FREETYPE_LIBS and friends to configure
On systems where the pkg-config source fails, configure falls back to
a library source of the type 'freetype'. This ignored variables like
FREETYPE_LIBS users can pass to configure.

The qtConfLibrary_freetype function now diverts to
qtConfLibrary_inline which handles all those variables.

Change-Id: Icef70deb130ce6d2de1520af4344ccccd677f287
Fixes: QTBUG-77643
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-09-18 11:07:25 +02:00
Joerg Bornemann
392931662d Fix qtConfLibrary_freetype's include paths
The variable QMAKE_DEFAULT_INCDIRS was misspelled, which means we
never really looked for freetype in the default paths.

Change-Id: I20c35a783505678169ecb642927f74b339e55b68
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-09-18 11:07:17 +02:00
Thorbjørn Lund Martsum
57e8fe86bd QStyleSheet: Resolve the rule font before it is used
The styleSheet font cannot know about e.g dpi or other settings
(e.g from the current screen) so we should resolve font settings
from the original font. This patch ensures that the stylesheet
font is resolved with a relevant font before it is used.

This likely fixes many dual/triple screen issues.

[ChangeLog][QtWidgets][QStyle] Style sheets now only
use the part of the stylesheet font that it knows
about. The remaining will be resolved/inherited from
the context.

Fixes:  QTBUG-77502
Change-Id: I3b1f821e1be9707506a6c1d1e93f76eeac4007e0
Reviewed-by: Morten Kristensen <me@mortens.dev>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit b68ade8282)
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-09-18 08:47:46 +02:00
Friedemann Kleint
a96c4b3aab QHighDPI: Fix wrong conversion for native child windows
Do not try to find a screen for native child coordinates.

Fixes: QTBUG-78158
Change-Id: I78ba814929f4db3dfd7dd43c09f7c7642222f4fb
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-09-18 08:29:23 +02:00
Morten Johan Sørvig
3278eae577 wasm: recreate backing store texture with valid gl context
The compositor context is not current during the resize()
call, but will be during updateTexture().

Change-Id: I29c2e06aa251b564b5d622dc9380ec994e15aab0
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2019-09-18 08:29:06 +02:00
Simon Hausmann
4d289edb14 Disable debug-and-release builds for MinGW
The requirement to separate debug and release DLLs on Windows stems from
the Visual Studio C run-time library appearing in two different variants
(debug and release) and not mixing well. It's possible to perform builds
without optimzations and with debug symbols while linking against the
release version of the C run-time, but at the same time the debug
version of the run-time brings other developer visible advantages.

MinGW on the other hand does not have this distinction, does not ship
with separate DLLS and does also not require the VS C runtime library.
Therefore we do not need this separation for MinGW, which means that our
packages can be reduced in size and application developers wishing to
debug their applications do not have to use debug builds of the Qt
libraries or run into Qt internal debug code.

Task-number: QTBUG-78445
Change-Id: Idf588606091298dc44262c4c89e689df18d34747
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-09-18 06:28:16 +00:00
Fabian Kosmale
cdb7d013cb QGraphicsScene: register ItemIndexMethod enum for property
Fixes: QTBUG-57903
Change-Id: I2b2725bceb5189dd21102bbacb10e9775740cf5d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-09-18 07:54:18 +02:00
Laszlo Agocs
6096f9d0d5 Another load() -> loadRelaxed()
Change-Id: Iab74325da3bd0a22c1f69856b038d0b5615e4e63
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-09-18 00:23:13 +02:00
Shawn Rutledge
7db335a77e Add back QWheelEvent position() and globalPosition() docs
Change 7d29807296 removed the docs for
the obsolete pos() and globalPos() accessors, but the text should have
been reused to document their replacements.

Change-Id: If4d64e0f07666a99d9a0a4f0de9fca42d3acf0f8
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2019-09-17 23:05:19 +02:00
Shawn Rutledge
217dd1b3b0 Mark stationary touch points as updated if pressure or velocity changes
This is to inform Qt Quick when a stationary touchpoint is delivered
that it is because of a changed property. Qt Quick still needs to avoid
delivering item-customized events (with only the touch points that occur
inside the item) that contain only stationary touch points without
changed properties. To be able to check this private flag,
QQuickPointerTouchEvent needs to be a friend.

Task-number: QTBUG-77142
Change-Id: I6ee0dffbbeca9e513c77227b757252e2eec6a4ef
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-09-17 21:05:16 +00:00
Cristian Adam
ff8e7fd7d3 Enable debug plugin check for MinGW / Unix in debug_and_release mode
In the case when the Qt build is debug_and_release the debug plugin
check should be enabled, otherwise the mixture of Qt debug and Qt
release libraries will cause crashes (e.g. QTBUG-77431)

Task-number: QTBUG-78445
Change-Id: Ice0b03e63ddad893334a0e1a4ede1f6ace83007b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-17 21:05:12 +00:00
Nils Jeisecke
4a240bb67e QTextDocument: Fix device scaling for QTextFrameFormat margins, padding and border
Those values must be scaled to device coordinates - otherwise borders,
margins etc. will be too small when rendered on high dpi devices
(printers etc.).

This change will add the scaling to those values.

QTextDocument::print applies 2cm margins to the root frame of a
unpaginated QTextDocument. Those margins were previously scaled to
device coordinates in order to give the correct result. But because
scaling is now done inside QTextDocumentLayout that scaling must be
removed and pixel values based on qt_defaultDpi are provided instead.

Fixes: QTBUG-78318
Change-Id: I6fe6dcc25f846341f6a2fe5df2f54baea473fdfd
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-09-17 23:05:09 +02:00
Shawn Rutledge
15e1c15986 evdevtouch: Add fallback definition of ABS_MT_PRESSURE; fix alignment
Fixes: QTBUG-78298
Change-Id: Ib6acb1fdca551a84aba5dec2f28cf784a212692c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-09-17 15:30:43 +02:00
Friedemann Kleint
2dd781df87 Windows QPA: Fix missing resize when changing the scale factor
Do not suppress the resize event caused by the handling of
WM_DPICHANGED unless the screen really changed.

Fixes: QTBUG-76510
Change-Id: I8b9ae41ad7deb863c1633ec5901bc04304b2165c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-09-17 15:19:18 +02:00
Edward Welbourne
6cee284001 Fix mis-handling of actual TLD in qIsEffectiveTLD()
If the domain passed down is an actual TLD that's the subject of a *
rule, e.g. "ck" subject to *.ck, then we were finding no dot in it and
concluding that it couldn't be the subject of a * rule.

Added a test for the specific .ck case and commented on where we could
get some canonical test data that I tripped over while researching
this. Cross-reference the cookie-jar test from the QUrl test, too.

Fixes: QTBUG-78097
Change-Id: Id858a9dae22e6b306a68df3fc199e0160f537159
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-09-16 17:05:09 +02:00
Edward Welbourne
da3c2cc6a8 Reflow documentation after indentation change
Combining this with the indentation would be counted as mixing space
changes with non-space changes, so they're separate.

Change-Id: Iac57050717b1c4c86a253866c9a6cd5ea7add8f7
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-09-16 17:00:47 +02:00
Edward Welbourne
0cd134ed13 Standardize indentation of calendar code's documentation
There was a haphazard mix of 4-space and 2-space indents.
Use four spaces throughout.
This commit includes no reflow (which is needed), as the inanity-bot
will complain about the mixing of space changes with "non-space"
changes if I do that.

Change-Id: If55ab035da02d0770471e77ecfe00eb168a3da15
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-09-16 17:00:25 +02:00
Martin Smith
01ce9c05a3 doc: Remove ifndef Q_QDOC
qdoc needs to see these declarations now because... clang.

Change-Id: I93264125db5bcea6adb1a4636e5459ec80702de1
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-09-16 13:15:36 +02:00
Tor Arne Vestbø
7f0faddf9f CoreText: Modernize style hint fallback lookup
The DefaultFontFallbacks.plist system file that we used for looking up
style fallbacks does not exists in macOS 10.15, nor did it ever exists
on iOS. Instead of relying on this file, we hard-code a set of default
families, that we then look up the fallbacks for.

The result of QFont::defaultFamily() on macOS is now:

  QFont::Helvetica --> "Helvetica"
  QFont::Times --> "Times New Roman"
  QFont::Courier --> "American Typewriter"
  QFont::OldEnglish --> ""
  QFont::System --> "Lucida Grande"
  QFont::AnyStyle --> "Lucida Grande"
  QFont::Cursive --> "Apple Chancery"
  QFont::Monospace --> "Menlo"
  QFont::Fantasy --> "Zapfino"

And on iOS:

  QFont::Helvetica --> "Helvetica"
  QFont::Times --> "Times New Roman"
  QFont::Courier --> "American Typewriter"
  QFont::OldEnglish --> ""
  QFont::System --> "Helvetica"
  QFont::AnyStyle --> "Helvetica"
  QFont::Cursive --> ""
  QFont::Monospace --> "Menlo"
  QFont::Fantasy --> "Zapfino"

Fixes: QTBUG-78240
Change-Id: Ie9bc13c9c1031d89f024199e4736a046c568a48d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-16 11:26:07 +02:00
Friedemann Kleint
9c76b82885 Windows style: Fix size of controls in multimonitor-setups with scaling disabled
The function calculating a correction for the size of
windows metrics depending on screen would bail out when high
DPI scaling was disabled. This is wrong since the correction
is also needed in that case, delete the clause.

Task-number: QTBUG-64890
Change-Id: Idef22e18fc616a211ccac48400490fc52393a338
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-09-16 10:48:38 +02:00
Friedemann Kleint
7252251768 Brush up the Windows styles
- use range-based for loops where possible
- use nullptr
- use member initialization
- remove a lot of C-style casts
- use override
- fix some signedness warnings
- add some missing break statements

Task-number: QTBUG-76493
Change-Id: Ica6ed65ec29e958406e54d816b8a679ed81bd177
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-09-16 10:48:07 +02:00
Christian Ehrlicher
e2431b619d QPSQL: Fix crash when a prepared statement is deleted after the db was removed
When a prepared statement is still alive after the database was removed
with QSqlDatabase::removeDatabase(), the cleanup routine is trying to
access the driver which is no longer alive which results in a crash.
Fix it by checking if the driver is still alive similar to
5f66486cc2.

Fixes: QTBUG-43889
Change-Id: Ib466a76d014e32c055d203bda15b075ad3dff3d9
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
2019-09-16 10:04:18 +02:00
Giuseppe D'Angelo
5f3bbd0cf0 Revert "Revert "Deprecate QAtomic::load() / store()""
This reverts commit 5859f7d0d9.

Reason for revert: the blocker for qtdeclarative has been merged
(in qtdeclarative/c060f6e765a2f155b38158f2ed73eac4aad37e02).

Change-Id: Ie69cb1567417173f543e88f659658fe03ba28830
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-09-16 01:39:42 +02:00
Tor Arne Vestbø
02e43e6fa6 widgets: Remove use of deprecated activated(const QString &) API
Change-Id: I71c6a10f6593ac28bf8f60d9db8d167cf88715cb
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-09-14 14:49:18 +02:00
Tor Arne Vestbø
4534522ff0 macOS: Keep default NSWindow background unless window is frameless
The logic was changed in ee82f8661 to only draw a window background
when the window was textured, and otherwise ask for a clear window
background. This has an unfortunate side-effect on macOS 10.15 that
the window's title bar will be partially transparent and reflect the
content under the window, with a blur effect.

It also inadvertently broke the use-case of setting the NSWindow
background color explicitly.

With this patch we're back to the behavior before ee82f8661, and
users who still want to have a non-borderless window with a clear
background can still do this by setting the background color to
the clear color manually.

Task-number: QTBUG-77637
Change-Id: I8a11bc46e6393b29a37f002ea123a987048106b9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-09-14 14:49:10 +02:00
David Faure
00d0a53035 QDpi: divide the forced DPI by the scaling factor, as Qt 5.13 did
When setting a DPI in xrdb, it should have the same effect on apps that
enable scaling and apps that don't (including Qt4 and GTK applications).
That's what happened in Qt 5.13, while the recent changes removed that
division, and as a result the fonts were huge in Qt5 apps compared
to Qt4/GTK/kwin/plasmashell/krunner (which don't scale, but do honor
the font DPI).

Change-Id: Icd7be2d15a9b50982ae624e41bd9e546f315d58b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-09-13 15:36:11 +02:00
Edward Welbourne
c6bde29e14 Doc-fix: correct some misinformation about QDateTime's handling of DST
Tidy up QDateTime::offsetFromUtc's doc, in the process. We don't take
DST into account for dates before the epoch; that should be mentioned
when saying we take DST into account. Also, referring to *this as the
"current" time begs to be misunderstood.

The \class comment also misleadingly claimed that we don't take into
account any changes to time-zone before DST; where, in fact, we only
ignore DST changes before 1970, not changes to standard offset.

Change-Id: I090e668edf0338c825f5afcc67f894579a129c46
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-09-13 10:47:45 +02:00
Edward Welbourne
8286daba03 MS TZ data: avoid calculating a date in year 0
There is no year 0 in the proleptic Gregorian calendar, so QDate()
won't be happy if asked for a date in it. Tweak scanning of the data
we get from MS-Win so as to avoid a date calculation that could
otherwise happen in year 0 when constructing
QDateTime(QDate(1, 1, 1), QTime(0, 0, 0), QTimeZone("Australia/Sydney")).

Added a test for this case, which Oliver Wolff has kindly verified
does reproduce the assertion failure. However, Coin is unable to
reproduce, as all its MS builds are configured with -release, so
Q_ASSERT() does nothing. (The relevant code then skips over year 0,
albeit for the wrong reasons, and gets the right results, albeit
inefficiently, leaving no other symptom by which to detect the
problem.)

Fixes: QTBUG-78051
Change-Id: Ife8a7470e5bd450bc421e89b3f1e1211756fc889
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-09-13 10:47:41 +02:00
Laszlo Agocs
39b0a6f152 rhi: gl: Pick up context loss
...and change the return value of makeThreadLocalNativeContextCurrent() to
a bool since we expect this to mirror QOpenGLContext::makeCurrent().

Change-Id: I339507152e461fe28fcf7fe777165e6d0072f055
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-13 10:47:34 +02:00
Mårten Nordheim
af1c3bf884 qnetconmonitor_win: Mark destructors virtual
After these two classes were no longer marked final clang started
complaining because their dtor is not marked virtual.

Amends 9dc594b2bf

Change-Id: I42b78c0b444935d3e0cb4d476d3881fd5fb5c3cb
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-09-13 10:47:30 +02:00
Marc Mutz
29e40c1f6f QWinRTUiaValueProvider: optimize SetValue()
The code followed a pattern used elsewhere whereby a return value is
transmitted out of a task executed on a separate thread by way of
shared ownership of the value using QSharedPointer.

In the present case, however, the pattern was applied to an argument
of the task, not its return value, so remove all the sharing machinery
and just copy the argument (a QString) into the task (a lambda).

Change-Id: Ib997322ed70201781b6012c7e4f945b124b05868
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-09-13 10:47:27 +02:00
Marc Mutz
6eaa1d07e1 Eliminate the last QList<QPoint> in QtBase production code
QList<QPoint> is horribly inefficient™ (on 32-bit platforms).

Fix by using a QVector instead.

Change-Id: Id85cb71404f329049c3e9997e51113035569e1b4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-09-13 10:47:24 +02:00
Marc Mutz
319c478603 QReadWriteLock: replace (QWaitCondition, QMutex) with std::(condition_variable, mutex)
It turns out that QWaitCondition is a std::condition_variable_any. The
_any variant works with any mutex type, but requires a native mutex
for the native condition variable. So, QWaitCondition and
std::condition_variable_any both require two different mutexes: the
one the user passes in, and an internal one.

std::condition_variable, however, only works with std::mutex, and
since both are backed by the native API, condition_variable can use
the mutex passed in by the user instead of having to use an internal
one.

So, port from 2 × QWaitCondition + QMutex (2 × native cond + 2 ×
native mutex + Qt mutex) to std::condition_variable + std::mutex (2 ×
native cond + native mutex), shaving the overhead of two additional
mutexes (one Qt, one native) as well as the memory allocation
performed by QWaitCondition (for its Private).

Speeds up the writeOnly case by ~1/8th:

  PASS   : tst_QReadWriteLock::writeOnly(QReadWriteLock)
  RESULT : tst_QReadWriteLock::writeOnly():"QReadWriteLock":
  -   39,703 msecs per iteration (total: 39,703, iterations: 1)
  +   34,950 msecs per iteration (total: 34,950, iterations: 1)

Change-Id: I196cb13a27242fc1cb99723dfab5b2e5f8522143
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-09-13 10:47:20 +02:00
Marc Mutz
68b30a23a8 Port QReadWriteLock from QMutexLocker to qt_unique_lock
Most of these are unique_locks because they call QWaitCondition::wait()
and it doesn't feel right to use qt_scoped_lock if the lock is dropped
within the scope.

Change-Id: I506eede63008dad135c21112e578da4f7684e528
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-09-13 10:47:17 +02:00
Marc Mutz
351c738fc4 QPointer: some simplifications
- don't write explicit meta functions, use std::conditional
- = default the default ctor

The class is already not trivially-copyable, so making the default
ctor trivial doesn't change the ABI.

Change-Id: I8e35bbbb35973c9ff8fc48dfbfc10061de4bfd30
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2019-09-13 10:47:13 +02:00
Qt Forward Merge Bot
908e80d8bb Merge "Merge remote-tracking branch 'origin/5.13' into 5.14" 2019-09-13 01:00:28 +02:00
Qt Forward Merge Bot
104f0535a1 Merge remote-tracking branch 'origin/5.13' into 5.14
Change-Id: Idcf8fc1d79bcd84b494d7f43308e6fe82d60e1a4
2019-09-13 01:00:15 +02:00
Shawn Rutledge
117175a2f2 macOS dark mode: set the link color
Fixes: QTBUG-71740
Change-Id: I49f49338c7f3a28845de63c2a6bf2dc8495dd108
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-09-12 23:54:05 +02:00
Christian Ehrlicher
16da0b2cf8 QTranslator doc: use QCoreApplication::installTranslator()
The example snippet was using app.installTranslator() even
installTranslator() is a static function. And since app is a
QApplication instead a QCoreApplication this could lead to the
assumption that a QTranslator can only be used for gui applications.
Therefore use the correct static invocation
QCoreApplication::installTranslator().

Change-Id: Ia3ce00f25230c2fe2bdc159ec14c88c961924651
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-09-12 23:54:02 +02:00
Laszlo Agocs
3d7207414b rhi: metal: Configure the layer's opaque property as appropriate
Task-number: QTBUG-78089
Change-Id: I6cd95e24d38562cf1931c107bb6b719e340583a8
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-12 16:28:42 +02:00
Laszlo Agocs
ef78a2e8f9 rhi: Add a flag to indicate preferring a software adapter
...if there is one and the concept is applicable in the first place.

Change-Id: Iab202c1c1cdd229f4910159de4cae7ce30805ea9
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-12 14:28:23 +00:00
Laszlo Agocs
8fef0ffc16 rhi: vulkan: Report device lost
Typically caught in vkQueueSubmit().

The WaitIdles that can be hit upon cleanup must be guarded by
!deviceLost because they inexplicably cause an infinite blocking
wait when the device was already reported as lost. (with NVIDIA
at least)

Change-Id: I7142e2461e1aed9ee3068b2b963cdf2c678ca4e0
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-12 12:40:30 +02:00
Laszlo Agocs
0616e14de0 rhi: Better handling of device loss
Starting with D3D11. The other backends will follow later.

Change-Id: I4f165c9f1743df0fb00bdce1e898917575bf5f6e
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-12 10:40:16 +00:00
Laszlo Agocs
d39d1a9e67 rhi: Clarify the swapchain alpha flag docs
Change-Id: Iff0edf0ae40b830af0209403d899def922e6088c
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-12 10:40:02 +00:00
Laszlo Agocs
6f592ea300 rhi: gl: Avoid crash when reading back the swapchain backbuffer
Change-Id: I9a632c06d8b9e666d99d0f135d3396d2de03f92a
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-12 12:39:57 +02:00
Laszlo Agocs
1fbe3c2316 rhi: d3d11: Fix enabling alpha compositing
Task-number: QTBUG-78089
Change-Id: I4e33665947debe007abcb976641e515224fa8451
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-12 12:39:46 +02:00
Laszlo Agocs
1c63605c10 rhi: Make the clang code model happy as much as we can
When interfacing with reality (i.e. native platform APIs provided in C,
ObjC, or COM), each of the APIs has its own idea of what types it likes
to use for sizes, points, rects, etc.

Out of the hundreds of warnings Qt Creator throws at us with the default
clang check level when opening one of the rhi backends not a single one
is useful. Regardless, let's try getting rid of what we can. This mostly
involves throwing in int/uint conversions in order to get the signedness
change warnings to shut up. The things that are either unacceptable to
change or are beyond our control are left untouched.

Change-Id: I6e4cb7cd373bf48dc990eaf83344242bbf30bd66
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-12 12:39:39 +02:00
Tor Arne Vestbø
d1486e2982 Simplify QColorSpacePrivate initialization
QColorVector and QColorMatrix are default-constructed following the
Qt philosophy of types always being well-defined. The corner-case where
we need uninitialized versions of these types for performance reasons
is handled explicitly.

Change-Id: I629334d1ffc63563ec9fd1298c623946e0799d1d
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-12 12:39:33 +02:00
Laszlo Agocs
f567129bb5 rhi: d3d11: Add the device lost testing machinery
The device can be lost when physically removing the graphics adapter,
disabling the driver (Device Manager), upgrading/uninstalling the
graphics driver, and when it is reset due to an error.

Some of these can (and should) be tested manually, but the last
one has a convenient, programmatic way of triggering: by triggering
the timeout detection and recovery (TDR) of WDDM. A compute shader
with an infinite loop should trigger this after 2 seconds by default.

All tests in tests/manual/rhi can now be started with a --curse <count>
argument where <count> specifies the number of frames to render before
breaking the device. Qt Quick will get an environment variable with
similar semantics in a separate patch.

Change-Id: I4b6f8d977a15b5b89d686b3973965df6435810ae
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-12 12:39:12 +02:00
Timur Pocheptsov
447ee95d5e QHttpThreadDelegate - remove unneeded code
Found while cleaning up SPDY remains: I've noticed that for H2 case
I never check if incomingSslConfiguration is nullptr or not, but
the code several lines below - does it, which looks kind of moronic.
This configuration is initialized when the delegate is created, so
no need to have this if-statement. Instead, assert, making this
behavior a requirement.

Change-Id: I90fb84337be925a3288252aa2491b4c23d6c6cbb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-09-12 11:15:31 +02:00
Marc Mutz
08ad96404b QCoreApplication: work towards replacing a QRecursiveMutex with a QMutex
At first glance, libraryPathMutex is only recursive because
setLibraryPaths(), addLibraryPath() and removeLibraryPath(), all of
which lock libraryPathMutex, may call libraryPaths(), which does, too.

This is easily fixed by splitting libraryPaths() into public
libraryPaths() and private libraryPathsLocked(), the latter expecting
to be called with the libraryPathMutex already held. And this is what
this patch does.

However, on second glance, the building of the initial app_libpaths
calls a monstrous amount of code, incl. QLibraryInfo, and some of
that code probably re-enters one of the library-path functions.

So while this patch is a step towards making libraryPathMutex
non-recursive, it's probably not the end.

Change-Id: I3ed83272ace6966980cf8e1db877f24c89789da3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2019-09-12 04:38:52 +00:00
Marc Mutz
0f219d2054 QReadWriteLock: use NSDMI to simplify the Private ctor
Change-Id: I7267dedb152186ad8c74cbf2eddd863c3bc0845f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-09-12 06:38:35 +02:00
Marc Mutz
e8bca8e763 QtGui: replace some QMutexLockers with (new) qt_{scoped,unique}_lock()
In QImageReader, also replace a QMutex with a QBasicMutex, making the
code similar to the corresponding code in QPicture.

Change-Id: Ia1cd546eccd3662837762e506235e350b7a08647
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-09-12 06:38:30 +02:00
Andy Shaw
137cbd1c72 Cocoa: Set the accepted action to be the one from the response
By setting the accepted action to be the one from the response it will
enable the user to set the drop action in their code and this will be
reflected at the platform level.

Change-Id: I7b9459b228c00ef01d91649b3405316729713164
Fixes: QTBUG-77427
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-09-12 05:39:26 +02:00
Allan Sandfeld Jensen
bc34784d05 Handle robustness with OpenGL < 4.0
We need to have the right idea of robustness, so check for extension.

Fixes: QTBUG-78107
Change-Id: I26987269e5c50bee20e2e3cc6d75f91a6c9af25e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-09-11 10:25:27 +02:00
Shawn Rutledge
78437ef0d2 Add qt.core.filesystemwatcher logging category
QFileSystemWatcher has open bugs, so users should be able to help
troubleshoot.

Change-Id: I6b703e25f294944469d20fd36012b6a55133732a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-09-11 10:02:37 +02:00
Timur Pocheptsov
0fd6595d5e Add a missing ConnectionTypeHttp2Direct in several if statements
Found while preparing SPDY retirement.

Change-Id: I30f923fdeb0f6f0b5e808a3e7b7d81ddb9c4ef12
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-09-11 05:16:18 +02:00
Friedemann Kleint
66a4001fa2 Fix qdoc warnings
src/corelib/global/qnamespace.qdoc:3279: (qdoc) warning: Can't link to 'QGuiApplication::setHighDdpiScaleFactorRoundingPolicy()'
src/corelib/time/qislamiccivilcalendar.cpp:49: (qdoc) warning: Can't link to 'QJijriCalendar'
src/network/ssl/qsslsocket.cpp:1510: (qdoc) warning: Can't link to 'QSslConfiguration::defaultCaCertificates()'
src/network/access/qhttp2configuration.cpp:49: (qdoc) warning: '\brief' statement does not end with a full stop.
src/gui/text/qtextformat.cpp:532: (qdoc) warning: Undocumented enum item 'TableBorderCollapse' in QTextFormat::Property
src/gui/text/qtextdocument.cpp:2066: (qdoc) warning: Undocumented enum item 'UnknownResource' in QTextDocument::ResourceType
src/gui/kernel/qguiapplication.cpp:3500: (qdoc) warning: Undocumented parameter 'policy' in QGuiApplication::setHighDpiScaleFactorRoundingPolicy()

Change-Id: I3573ef98cf9b58d16525c356270fe009fdffcf45
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-09-10 13:57:06 +02:00
Marc Mutz
b1698e9bc2 QWinRTUia*: remove anti-pattern passing new'ed QSharedPointer into lambdas
QSharedPointer is made for passing around by value. It is unclear why
in so many repeated cases a QSharedPointer is created on the stack,
then a copy of it is new'ed up, passed into a lambda to be deleted
inside it.

First, it requires an additional heap allocation. Because it's passed
as a raw pointer to QSharedPointer, however, there's also always the
danger that it's leaked by seemingly-innocuous changes such as adding
an early return from the lambda (and some of them could really use
one, with the ifs nesting several levels deep).

All this is not needed, though. It's perfectly ok to store a copy of a
QSharedPointer, by value, in a lambda, and keep one copy outside
it. Poor man's std::future, if you will.

So, do away with all that, just pass the shared pointer by value into
the lambda, and, as a drive-by, replace some ephemeral QLists with
QVLAs. In one case, replace a QPair<int, int> with a struct to make
the code using that type more accessible ('first' and 'second' are
really, really bad variable names if they, in fact, represent
'startOffset' and 'endOffset').

Also port directly to shared_ptr / make_shared. Saves one memory
allocation each, due to the co-allocation of payload and control
block, and even though there's QSharedPointer::create, which does
this, too, std::shared_ptr is simply much lighter on the use of
atomics (copying a QSP ups two ref counts, copying a std::shared_ptr
just one). Since these variables live behind the API boundary, there's
no reason not to prefer the more efficient alternative.

Change-Id: I4b9fe30e56df5106fc2ab7a0b55b2b8316cca5fe
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-09-10 12:51:51 +02:00
Friedemann Kleint
c0b3c06a7d QFileDialog: Fix volume name display on Windows
The volume names displayed did not match those of Windows
Explorer; for example "New Volume (X:)" would be displayed for
mapped network drives.

Replace GetVolumeInformation() and manual formatting by the
normal display name of IShellItem.

Fixes: QTBUG-78043
Change-Id: Ia742b7733e8ddc31e9506f15d90d065b985a111d
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2019-09-10 12:47:49 +02:00
Shawn Rutledge
648dac1ceb QMenu::popup(): don't change the menu's screen if called from exec()
Since b3fc5e1ea3,
topData()->initialScreenIndex has always been short-lived: it only
remembers the screen in case the widget parent is a QDesktopScreenWidget
(gotten from QDesktopWidget::screen()), only until the window is
created.  Then it is reset.  In the case of exec() we need to avoid
calling setScreen() twice, because that would set the screen once, then
forget which screen it was supposed to be on, then set the screen again
when exec() calls popup().  This is achieved by using the stored
eventLoop pointer to detect that popup() is being called from exec(),
and avoid calling setScreen() a second time in popup(), because exec()
already needed to call createWinId() before it created the event loop.

Amends 82da8306bc

Task-number: QTBUG-76162
Change-Id: I70da517b9d530630e59d103cb2a1ce11c897b2c8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Joni Poikelin <joni.poikelin@qt.io>
2019-09-10 08:54:45 +02:00
Mårten Nordheim
e5e8f1d67c Schannel: handle SEC_E_INCOMPLETE_DATA in acceptContext
It's not a failure state, we just need more data. It is handled properly
in other functions.

Change-Id: I9450a78c71a3f4fe9506a7a79de6efa2db08697c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-09-10 07:22:16 +02:00
Mårten Nordheim
97b9af1519 Schannel: unbreak renegotiation (and likely gracious shutdown)
The reason it wasn't working before was a couple of things:
1. Due to an extra 'else' it would not process the SEC_I_RENEGOTIATE
or SEC_I_CONTEXT_EXPIRED branch.
2. The peerCertVerified boolean was not only wrong, but also
broke renegotiation even if the 'else' wasn't there.

My previous attempt to fix it ended up being a noop, so:
Reverts e21fa577dd

Change-Id: Ifbad55d4bb066b7566bb88cead48e329cbd574f9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-09-09 22:19:47 +00:00
David Faure
e018d11600 Dpi settings: QT_SCREEN_SCALE_FACTORS enables scaling again
commit 900f2cb6f7 removed this from the condition, which breaks the
(common) case of having QT_AUTO_SCREEN_SCALE_FACTOR=0 and
QT_SCREEN_SCALE_FACTORS set. This used to obey the screen scale factors,
so it should still do so (despite the deprecation warning).
This is what the Plasma `kcmshell5 kscreen` module actually sets (via
startkde).

Change-Id: I5f4efed11b937498049ebf1b107954721cf54147
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-09-10 00:09:02 +02:00
Friedemann Kleint
8c41e25bea Merge "Merge remote-tracking branch 'origin/5.13' into 5.14" 2019-09-09 19:03:43 +00:00
Christian Ehrlicher
5f570aa64d QComboBox: add documentation for textHighlighted/textActivated
The documentation for textHighlighted/textActivated was not added within
bdf1c4f671 so add it now.

Change-Id: Ifa7ad72af4490d4ce1d6de00d0963c0e76013f42
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-09-09 20:43:22 +02:00
Laszlo Agocs
7af6649e88 rhi: gl, metal, d3d: Reuse shader objects when source is the same
Now that Qt Quick's batch renderer misses one level of shader source
caching due to the nature of pipeline state objects, it can be useful
to keep and reuse shader objects when the hash of the source code
matches.

The goal here is to allow Qt Quick to be on par with what the direct
OpenGL path has when it comes to caching shader sources and compilation
results. The program binary disk cache is not in scope in this patch.

Also adds QRhi::releaseCachedResources(), similarly to what the scenegraph
has. This can be called to clear caches such as the shader object
cache we keep here.

Change-Id: Ie3d81d823f61fa65ec814439e882c498f7774d43
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-09 20:42:38 +02:00
Friedemann Kleint
1d53b6d9f2 Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp

Change-Id: Idd3ca5cb9a2b95a4c3513b2a4c8966e6f56193f1
2019-09-09 07:51:49 +00:00
Thiago Macieira
5cea83a8a2 QRandom: retry the use of RDRAND instruction as recommended by manuals
The Intel whitepaper[1] recommends retrying RDRAND some 10 times even
after it fails, since the hardware has a fairness algorithm and reseeds
itself quite quickly.

[1] https://software.intel.com/en-us/articles/intel-digital-random-number-generator-drng-software-implementation-guide

Change-Id: I907a43cd9a714da288a2fffd15baafd88242d8b6
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-09-08 16:05:34 +00:00
Allan Sandfeld Jensen
89d0a03c06 Remove BT.2020 support from QColorSpace
BT.2020 is an HDR color space and its luminance range doesn't match
that of the rest of the currently available color spaces. Without
support for white-point luminance in 5.14, there would be a behavior
change when luminance support is later introduced, so it is better to
remove it now, and reintroduce it when the necessary handling of
different luminance levels is available.

Change-Id: Ie29e4dd757faae3ac91d4252e1206acce42801dc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-09-08 16:19:14 +02:00
Qt Forward Merge Bot
1f35c8caa0 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I371c5ae1af6f58e32e579671f485b92b586e0b76
2019-09-08 11:33:28 +02:00
Marc Mutz
c2e32a29c3 QWindowsUiaTextRangeProvider: replace ephemeral QList<QRect> with QVLA
QList<QRect> is horribly inefficient™. Since the container only lives
for the duration of the function call, use QVLA instead.

Change-Id: I2d179caef37bb78efface5547ff8bfcdc8f9a6ac
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-09-08 11:12:42 +02:00
Alexandru Croitor
4ac872639e Make Qt relocatable
[ChangeLog][QtCore] Qt installations on the host system can now be
relocated, i.e. moved to other directories.

Add a new feature 'relocatable' that's by default enabled for
non-static builds
  - on platforms where libdl is available,
  - on macOS when configured with -framework,
  - on Windows.

If the feature is enabled, the directory where plugins, translations
and other assets are loaded from is determined by the location of
libQt5Core.so and the lib dir (bin dir on Windows) relative to the
prefix.

For static builds, the feature 'relocatable' is off by default. It can
be turned on manually by passing -feature-relocatable to configure. In
that case, QLibraryInfo::location(QLibraryInfo::TranslationsPaths) and
friends will return paths rooted in the user application's directory.

The installed and relocated qmake determines properties like
QT_INSTALL_PREFIX and QT_HOST_PREFIX from the location of the qmake
executable and the host bin dir relative to the host prefix. This is
now always done, independent of the 'relocatable' feature.

Note that qmake is currently only relocatable within an environment
that has the same layout as the original build machine due to absolute
paths to the original prefix in .prl, .pc and .la files.
This will be addressed in a separate patch.

Task-number: QTBUG-15234
Change-Id: I7319e2856d8fe17f277082d71216442f52580633
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-07 20:02:45 +02:00
Qt Forward Merge Bot
a9db729095 Merge remote-tracking branch 'origin/5.12.5' into 5.12
Change-Id: I41a252fdbf22551aadb0b1a6e9ecf3f95f99fbd4
2019-09-07 13:08:26 +02:00
Mårten Nordheim
9a0ef07f15 qrhid3d11: Remove unused variable blockDim
Clang emits a warning

Change-Id: Ie2bf77248df2b2ecf23e24429688563f9725dd0d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-09-07 12:43:40 +02:00
BogDan Vatra
891b1f51b9 Android: Fix cmake generator
Fixes: QTBUG-29859
Change-Id: Id0b5f9ab8b4866483361ba9f15cf51dc0d2627d0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-07 06:53:19 +03:00
Laszlo Agocs
228f0c1d2e Allow render-to-texture widgets to tell if they want premul blending
Instead of assuming they do not (like in >= 5.12.3) or they do (like
in < 5.12.3). QOpenGLWidget and QQuickWidget will likely want the
opposite. So allow specifying this with a QPlatformTextureList flag,
similarly to how we do it for sRGB for QOpenGLWidget.

Task-number: QTBUG-77471
Change-Id: I594ca919c8eca190fa70c6aa84f46f456fcd80e1
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-09-06 09:59:06 +02:00
Laszlo Agocs
6de5cf2df8 rhi: metal: Avoid upsetting validation in viewport and scissor
When running with the threaded render loop of Qt Quick, it could be that
the drawable changes size while the render thread prepares the command
buffer with setViewport and setScissor. Those have no chance to see
such changes, which is normally not a big problem because the resize will
get processed eventually.

However, in debug builds running in XCode, Metal validation checks the
viewport and scissor rects against the (more or less) actual drawable
size, and so would abort Qt Quick apps from time to time when resizing
the window interactively. To solve this, we just query the drawable size
in setViewport/setScissor to keep validation happy.

Change-Id: I451f398bd1f88e3f49ea4624fc45bbb4b70e7f07
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-09-06 09:58:53 +02:00
Timur Pocheptsov
d1a22bd298 A follow-up to a recent fix in QHttpNetworkConnectionChannel
While working with HTTP/2, we are not re-sending failed requests.
In case we receive a GOAWAY frame, we properly handle it by
processing some active streams if possible, and aborting streams
that will not proceed further with ContentResendError. But it's
possible that some server failed to send us GOAWAY (for example,
it died) or closed the connection not finishing the streams that
were still active and valid (ID <= value from GOAWAY frame).
Now that we will not re-connect, there is no reason to be quiet
about us not progressing - emit RemoteHostClosedError on any
remaining active stream/request we cannot process further.

Fixes: QTBUG-77852
Change-Id: I4cd68a1c8c103b1fbe36c20a1cc406ab2e20dd12
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 543769666f)
2019-09-06 03:01:52 +00:00
Christian Ehrlicher
a42a451339 QShortcut: call base class implementation in event()
QShortcut::event() did not call the base class implementation
QObject::event() which caused that e.g. QEvent::DeferredDelete was not
handled.
Fix it by calling QObject::event() when the event was not handled.

Fixes: QTBUG-66809
Change-Id: Ideebc980bc658f8f2b9ec4417e738bccda5eeab5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-09-05 20:41:43 +02:00
Timur Pocheptsov
543769666f A follow-up to a recent fix in QHttpNetworkConnectionChannel
While working with HTTP/2, we are not re-sending failed requests.
In case we receive a GOAWAY frame, we properly handle it by
processing some active streams if possible, and aborting streams
that will not proceed further with ContentResendError. But it's
possible that some server failed to send us GOAWAY (for example,
it died) or closed the connection not finishing the streams that
were still active and valid (ID <= value from GOAWAY frame).
Now that we will not re-connect, there is no reason to be quiet
about us not progressing - emit RemoteHostClosedError on any
remaining active stream/request we cannot process further.

Fixes: QTBUG-77852
Change-Id: I4cd68a1c8c103b1fbe36c20a1cc406ab2e20dd12
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-09-05 20:40:30 +02:00
Edward Welbourne
d49daa3f27 Clarify documentation of daysInMonth()
Change-Id: I86258512c33cabec8d11ff3c794934f40850e413
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-09-05 18:41:48 +02:00
Mårten Nordheim
e21fa577dd Schannel: retain extra data after renegotiation is requested
I realized this is a potential scenario where we will have leftover
data, but it wasn't covered.

Change-Id: Ibaf1015bf2aee120e4a4d98888925b88ecb6ddfd
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-09-05 18:18:38 +02:00
Allan Sandfeld Jensen
f92d8fd64e Combine BGR30_to_RGB30 and BGR888_to_RGB888
And let the meat of the function be shared with the rbSwap routine.

Change-Id: I0ea18b30c26ff050c17dcb3ad4d654bfbb8c6221
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-09-05 17:41:21 +02:00
Marc Mutz
236d4637b2 Optimize QEventDispatcherWinRT::runOnMainThread()
- use std::make_shared instead of QSharedPointer
  - two memory allocations saved
- co-locate semaphore and HRESULT object in a single State object
  - one more memory allocation saved
- pass the shared_ptr<State> by value into the runnable
  - two more memory allocations saved

Not only is the new code much faster, it's also much more readable.

Also use QSemaphoreReleaser, just in case the delegate should throw.

Change-Id: Ib99b9da86984d440d10b72e3071aa88099e24a1f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-09-05 15:40:40 +00:00
Christian Ehrlicher
42011c0361 QGraphicsView: mark obsolete flag DontClipPainter as deprecated
The enum OptimizationFlag::DontClipPainter is deprecated and not used in
the code since Qt4 times. Therefore also mark it as deprecated so it can
be removed with Qt6

Change-Id: I318a55cf42e7a233d13d4ec0144e1977251f5c92
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-09-05 17:40:29 +02:00
Edward Welbourne
63145bc705 Refine QCalendar::hasYearZero()'s documentation
Change-Id: I06697485c6be1c31998d0da54b357f3f5c8701e7
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-09-05 17:40:23 +02:00
Qt Forward Merge Bot
fa2589bbb5 Merge remote-tracking branch 'origin/5.13.1' into 5.13
Change-Id: Ic633850940bbe17dcedc1609217a052b6f81ce4b
2019-09-05 13:33:00 +02:00
Sona Kurazyan
43983b0b6f Remove QOperatingSystemVersion::WindowsVista
The minimum supported version is Windows 7. Remove
QOperatingSystemVersion::WindowsVista added by
b0cd007335 and replace with "true"
wherever it was used.

Change-Id: I08c0208467b655a921b6773f77d8bc099be69031
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-09-05 08:25:05 +02:00
Thiago Macieira
15edba4101 qFatal: make it so you cannot disable the message
Solves a few recursion problems in Qt, since then we won't try to
inspect the logging registry while creating the logging registry.

Fixes: QTBUG-78007
Change-Id: I44cc9ee732f54d2380bafffd15c0f51c7140682e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-09-04 23:03:57 -07:00
Edward Welbourne
46ec24d2b9 Rename calendar methods from m{in,ax} to m{in,ax}imum
Words should not be abbreviated.
Split a long line and reflowed some comments in the process.

Fixes: QTBUG-78008
Change-Id: I52d75409f02e2cecbed3e94d424617ad594c275b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-09-04 18:43:35 +02:00
Edward Welbourne
978f579a8c Use quiet NaNs instead of signaling ones
I see no good reason why the NaN returned when reading "nan" as a
double should be a signaling one; a quiet one should be just fine.

[ChangeLog][QtCore][QLocale] The NaN obtained when reading "nan" as a
floating-point value is now quiet rather than signaling.

[ChangeLog][QtCore][QTextStream] The NaN obtained when reading "nan"
as a floating-point value is now quiet rather than signaling.

Change-Id: Ife477a30bfb813c611b13a33c38ea82f9e8a93eb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-09-04 18:43:21 +02:00
Marc Mutz
effbf147a4 QUnicodeTables: use array for case folding tables
Instead of four pairs of :1 :15 bit fields, use an array of four :1,
:15 structs.  This allows to replace the case folding traits classes
with a simple enum that indexes into said array.

I don't know what the WASM #ifdef'ed code is supposed to effect (a :0
bit-field is only useful to separate adjacent bit-field into separate
memory locations for multi-threading), but I thought it safer to leave
it in, and that means the array must be a 64-bit block of its own, so
I had to move two fields around.

Saves ~4.5KiB in text size on optimized GCC 10 LTO Linux AMD64 builds.

Change-Id: Ib52cd7706342d5227b50b57545d073829c45da9a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-09-04 16:35:37 +00:00
Kai Koehne
90ae72d852 Doc: Remove 'f.i.'
Spell it out, or entirely remove it if it's not necessary.

Change-Id: Idc371427e9351d948245ce7b719e3457dfc27845
Reviewed-by: Matthew Woehlke <mwoehlke.floss@gmail.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-09-04 17:23:24 +02:00
Tor Arne Vestbø
c3e0e7a3eb Limit QColorSpacePrimaries export to auto-test
Change-Id: I997a5a7afa72f2fd527921ed81d6ccf5f339962b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-09-04 16:35:33 +02:00
Liang Qi
663c27a2b1 Merge "Merge remote-tracking branch 'origin/5.13' into 5.14" 2019-09-04 16:30:02 +02:00
Allan Sandfeld Jensen
21ba294345 Merge memrotate and blit feasability checks
Besides reducing duplicate code, this also improves the checks by
sharing optimized checks:
1. Fast memrotate will now also trigger with compatible formats (RGB32
over ARGB32)
2. Fast blitting will now also trigger with smooth transforms enabled,
if the coordinates are pixel aligned.

Change-Id: I576ebb34646d62ed472b1e1772e1b876b8121634
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-09-04 16:29:45 +02:00
Marc Mutz
2737b5e36a QUnicodeTables: pack Properties struct
GCC doesn't like the sequence

   : 5
   : 5
   : 8
   : 6
   : 8

and inserts a :6 padding between the :5 and the :8 and a :2 padding
between the :6 and the :8, growing the bitfield by 8 bits of embedded
padding and another byte to bring the struct back to sizeof % 2 == 0.

Fix by reshuffling the elements and adding a static_assert for the
next round.

Saves ~5KiB in QtCore executable size.

Change-Id: I4758a6f48ba389abc2aee92f60997d42ebb0e5b8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-09-04 10:06:19 +02:00
Liang Qi
6a36fe904c Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/corelib/codecs/qicucodec.cpp
	src/dbus/qdbusserver.cpp
	src/gui/painting/qbezier.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
	src/plugins/printsupport/cups/qppdprintdevice.cpp

Change-Id: I2703128bb64baf5580fbc2c2061b55b0f0611d2a
2019-09-04 07:03:54 +02:00
Friedemann Kleint
db57af5a0d QRegexp: Fix MSVC2019 warning about fallthrough not being followed by a case label
Move  fallthrough down, fixing:
tools\qregexp.cpp(3014): warning C4468: 'fallthrough': attribute must be followed by a case label or a default label
tools\qregexp.cpp(3054): warning C4468: 'fallthrough': attribute must be followed by a case label or a default label
tools\qregexp.cpp(3100): warning C4468: 'fallthrough': attribute must be followed by a case label or a default label

Change-Id: If25ddec5dc1d4929a3383729aabad89f5879e316
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2019-09-03 18:07:54 +02:00
Friedemann Kleint
18088d4706 QtGui: Refactor parsing of the High DPI scaling env variables
Use qEnvironmentVariable() where applicable and refactor the
parsing of QT_SCREEN_SCALE_FACTORS to use QStringRef.

Task-number: QTBUG-53022
Change-Id: I8956c6cecd7b634679eb5e66d2a87cccaf9e7936
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-09-03 18:07:00 +02:00
Tor Arne Vestbø
dfeb2e16e0 Don't export QIcc helper functions
Change-Id: I93209ae333aa4e7e7844b2699370c1cf2a2defbe
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-09-03 17:10:22 +02:00
Tor Arne Vestbø
cc1ea2bf47 Simplify QColorSpace named presets
We don't need a getter for the 'preset' of a color-space, as color
spaces can be compared to the presets directly. This allows us to
remove the Undefined and Unknown values from the presets.

Internally we still distinguish known presets from unknown or undefined
presets via the magic 0-value. The validity of a QColorSpace is not
based on this preset, but on its actual values.

Fixes: QTBUG-77963
Change-Id: I1e0a2a4be83021b8c82b3c778019f680fd46455b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-09-03 15:10:11 +00:00
Alexandru Croitor
098d7549c1 Android: Fix architecture extraction from file path in androiddeployqt
The regular expression was too greedy with the ".*" sub-expression,
thus if the prefix path contained underscores, the extracted
architecture value was wrong.

Example prefix:
~/dev/qt/qt514_built_android/qtbase

Example captured architecture:
built_android/qtbase/plugins/platforms/android/libqtforandroid_x86

First extract the file name from the given path, and then match
on just the file name.

Change-Id: I8e56e56747096c7a2398e959d91c2d1f65de2495
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-09-03 16:44:08 +02:00
Friedemann Kleint
f00e326656 Fix some qdoc warnings in 5.14
Mark QCalendarBackend as internal since it is in a private header
and fix some issues in the QCalendar related classes.

src/corelib/time/qcalendar.cpp:201: (qdoc) warning: clang found diagnostics parsing \fn int QCalendarBackend::daysInMonth(int month, int year) const
    error: incomplete type 'QCalendarBackend' named in nested name specifier
(repeats)
src/corelib/time/qdatetime.cpp:1426: (qdoc) warning: Unknown command '\override' (repeats)
src/corelib/time/qcalendar.cpp:642: (qdoc) warning: Undocumented enum item 'Last' in QCalendar::System
src/corelib/time/qcalendar.cpp:642: (qdoc) warning: Undocumented enum item 'User' in QCalendar::System
src/corelib/time/qcalendar.cpp:744: (qdoc) warning: Undocumented parameter 'year' in QCalendar::isLeapYear()
src/corelib/time/qcalendar.cpp:923: (qdoc) warning: Can't link to 'dateTimeString()' (repeats)
src/corelib/time/qcalendar.cpp:893: (qdoc) warning: No such parameter 'year' in QCalendar::partsFromDate()
src/corelib/time/qcalendar.cpp:893: (qdoc) warning: No such parameter 'month' in QCalendar::partsFromDate()
src/corelib/time/qcalendar.cpp:893: (qdoc) warning: No such parameter 'day' in QCalendar::partsFromDate()
src/corelib/time/qdatetime.cpp:1425: (qdoc) warning: Undocumented parameter 'nmonths' in QDate::addMonths()
src/corelib/time/qdatetime.cpp:1467: (qdoc) warning: Undocumented parameter 'nyears' in QDate::addYears()
src/corelib/statemachine/qstatemachine.cpp:2522: (qdoc) warning: Undocumented enum item 'StateMachineChildModeSetToParallelError' in QStateMachine::Error
src/corelib/kernel/qtimer.cpp:602: (qdoc) warning: Undocumented parameter 'connectionType' in QTimer::callOnTimeout()
src/corelib/time/qcalendar.cpp:159: (qdoc) warning: Undocumented parameter 'name' in QCalendarBackend::QCalendarBackend()
src/corelib/time/qcalendar.cpp:159: (qdoc) warning: Undocumented parameter 'id' in QCalendarBackend::QCalendarBackend()
src/corelib/time/qcalendar.cpp:529: (qdoc) warning: Can't link to 'registerCalendar()'
src/corelib/time/qcalendar.cpp:529: (qdoc) warning: Can't link to 'fromName()'
src/corelib/time/qcalendar.cpp:178: (qdoc) warning: Can't link to 'QCalendar::fromEnum()'
src/corelib/time/qcalendar.cpp:405: (qdoc) warning: Undocumented parameter 'jd' in QCalendarBackend::dayOfWeek()
src/corelib/time/qcalendar.cpp:405: (qdoc) warning: Can't link to 'weekDayName()'
src/corelib/time/qcalendar.cpp:405: (qdoc) warning: Can't link to 'standaloneWeekDayName()'
src/corelib/time/qcalendar.cpp:268: (qdoc) warning: Can't link to 'daysInMonth()'
src/corelib/time/qcalendar.cpp:268: (qdoc) warning: Can't link to 'isLeapYear()'
src/corelib/time/qcalendar.cpp:295: (qdoc) warning: Can't link to 'daysInMonth()'
src/corelib/time/qcalendar.cpp:313: (qdoc) warning: Can't link to 'isLuniSolar()'
src/corelib/time/qcalendar.cpp:313: (qdoc) warning: Can't link to 'isSolar()'
src/corelib/time/qcalendar.cpp:313: (qdoc) warning: Can't link to 'isLunar()'
src/corelib/time/qcalendar.cpp:340: (qdoc) warning: Can't link to 'daysInMonth()'
src/corelib/time/qcalendar.cpp:357: (qdoc) warning: Can't link to 'daysInMonth()'
src/corelib/time/qcalendar.cpp:544: (qdoc) warning: Can't link to 'fromName()'

Change-Id: Ia2fabefb917f8e4cfa361044d9b754717276f4aa
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-09-03 12:52:55 +02:00
Tor Arne Vestbø
60e1c3b698 macOS: Remove use of deprecated QMatrix APIs in style
Change-Id: If88a6a49b6289eb16b3cc6fca7fd340a93b72934
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-09-02 21:35:31 +02:00
Shawn Rutledge
1b0c45f683 Deliver stationary touchpoints that have changed pressure
As a rule, we don't deliver touch events containing only stationary
touchpoints.  To fix QTBUG-52510 we added an exception in
1bd0ab7050 : if the velocity changed,
deliver it anyway.  Now we need to do the same if the pressure changed.

Also, on the customer's hardware, pressure is indicated via ABS_MT_PRESSURE.

Change-Id: If7f7088df055d686cdd86967b999e38024f8170f
Fixes: QTBUG-77142
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-09-02 20:25:06 +02:00
Alexander Volkov
98c5f22161 Avoid invalid memory access in QIconCacheGtkReader::lookup()
If name argument is empty, e.g. an icon is created by
QIcon::fromTheme(""), then icon_name_hash() will access
a byte at index 1, which is outside of the string.

Change-Id: I109c476718939d7dd252007ebac48c3dbbeceb72
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-09-02 20:51:59 +03:00
Timur Pocheptsov
dbfa374a86 QHttpNetworkConnectionChannel - avoid re-connecting on 'disconnected'
The _q_error slot has a special case for RemoteHostClosedError,
where the current channel's state is 'idle' and no request/reply
is in progress. The comment states that:

"Not actually an error, it is normal for Keep-Alive connections
 to close after some time if no request is sent on them. No need
 to error the other replies below. Just bail out here. The _q_disconnected
 will handle the possibly pipelined replies."

_q_disconnected, indeed, takes care about pipelined replies ... calling
'ensureConnected' even if we have 0 replies in pipeline, which makes
zero sense to me and results in QNAM endlessly trying to re-connect
to the server.

Fixes: QTBUG-77852
Change-Id: I6dcb43b36a6d432bc940246a08f65e1ee903fd24
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-09-02 19:51:56 +02:00
Allan Sandfeld Jensen
bc1f7c7cce Fixup includes
One include too many and one too little.

Change-Id: I9963adb02523305d753135c0f5a6baefb83a06f1
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2019-09-02 18:43:00 +02:00
Allan Sandfeld Jensen
c8d3eb35e7 Fixup move semantics of QColorSpace
Stop using QExplicitlySharedDataPointer, makes it possible to inline
the move constructor and assign operator.

Also protect other methods from nullptr d_ptr, and change the default
constructed value to also have a null d_ptr, to match the result after
a move.

Change-Id: I40928feef90cc956ef84d0516a77b0ee0f8986c7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-09-02 18:37:07 +02:00
BogDan Vatra
c9f8893000 Add support for aab
Change-Id: I4814a51b25d5e3953e5e1c71d9a0e1bf3fed7385
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-09-02 18:32:13 +03:00
Andre de la Rocha
1c55a6caf1 Windows QPA: Fix crash in UI Automation with Youdao Dictionary
Unlike other accessibility classes, QAccessibleTree is returning a
different instance, with a different ID, every time child()/childAt()
are called for the same child elements. This causes
ElementProviderFromPoint to return different IRawElementProviderSimple
instances every time, for the same coordinates, which causes the
NetEase Youdao Dictionary to call it in an infinite loop, allocating
new QAccessibleTableCell instances, until the application crashes.
The crash happened, for instance, just by using the mouse over
Qt Creator's project tree while Youdao Dictionary was running. While
the root cause seems to be QAccessibleTree not caching and reusing
objects, this change adds a layer of safety to the UI Automation
classes in the Windows QPA, to avoid causing a crash until
QAccessibleTree, and possibly other accessibility classes, are fixed.

Fixes: QTBUG-77974
Change-Id: I9b0c8174bc0fd9ef7f5626ee0b72c8a9626520ee
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-09-02 13:53:56 +02:00
Friedemann Kleint
60bea1c85a QFileSystemModel: Fix naming of Option enumeration
Fix an API review finding in 5.14, amending
6b9d319b26.

Change-Id: I6c67ebde91021b87a43a86ff831b724f098019aa
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-09-02 13:21:57 +02:00
Friedemann Kleint
f6b34ce173 Windows QPA: Update theme fonts when the primary screen changes
Call into the theme to update the fonts on a change. This
at least helps in the case of disabled High DPI scaling.

Task-number: QTBUG-77144
Change-Id: I2c8fd85259403eaaeea56cd096f99116fc6bba9a
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-09-02 12:08:37 +02:00
Kevin Funk
8ce653e048 Make sure QLatin1Literal fwd header is generated
This broke when QLatin1Literal got deprecated in change 45373c1924

Both hunks in this patch are needed. The hunk in syncqt.pl removes the
QT_DEPRECATED_X(...) macro if it appears solely on a line in source code,
the second hunk inserts a newline after the QT_DEPRECATED_X(...) macro usage
to trigger that code path in the Perl script.

Before/after comparison of the headers generated in include/QtCore:

```
% diff  ~/old.txt ~/new.txt
105a106
> QLatin1Literal
```

Change-Id: I468dd2dd54bf115521ed82c6182236905556f568
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-09-02 11:33:54 +02:00
Rainer Keller
af6ac444c9 Fix crash when text contains too many directional chars
In case a text to be layouted contains more than 128 directional characters
it causes the application to crash

The function initScriptAnalysisAndIsolatePairs() collects information of
RTL/LTR chaaracters into vector "isolatePairs". The size of the vector is
capped to 128. Later the function generateDirectionalRuns() iterates
the text again and tries to access items from the previously capped vector
above the upper bound.

Task-number: QTBUG-77819
Change-Id: Ibb7bf12c12b1db22f43ff46236518da3fdeed26a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
(cherry picked from commit 1232205e32)
Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-31 08:29:31 +00:00
Qt Forward Merge Bot
3176c821bf Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I9823da32168e99bbece2f8337d0bd4d33e6d634c
2019-08-31 01:00:48 +02:00
Marc Mutz
e45e6efa72 QTouchDevice: don't play ping-pong with q*PostRoutine()
Removing a qPostRoutine is an O(N) operation. It's perfectly ok to
keep calling it even if the list has become empty before.

Just qAddPostRoutine in the deviceList's ctor and never remove it
again.

Add a missing qAsConst as a drive-by.

Change-Id: I25f824b74012146214568cfccb22c5dba3ca38ef
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-08-30 22:38:37 +02:00
Rainer Keller
1232205e32 Fix crash when text contains too many directional chars
In case a text to be layouted contains more than 128 directional characters
it causes the application to crash

The function initScriptAnalysisAndIsolatePairs() collects information of
RTL/LTR chaaracters into vector "isolatePairs". The size of the vector is
capped to 128. Later the function generateDirectionalRuns() iterates
the text again and tries to access items from the previously capped vector
above the upper bound.

Task-number: QTBUG-77819
Change-Id: Ibb7bf12c12b1db22f43ff46236518da3fdeed26a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-30 21:17:32 +02:00
Joerg Bornemann
c53f843001 Doc: Clarify QJsonDocument::toJson()
Mention that this method returns an indented document.

Change-Id: I0cadcc1c894c9a87910cfce389c6a5288238044d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-08-30 16:21:10 +02:00
Edward Welbourne
fc49d73c44 Fix spelling of primarily in QCalendar::isSolar()'s doc
It was missing a y.

Change-Id: I12dac02e451addff966f554811ca1999acadbb1b
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
2019-08-30 13:57:20 +02:00
Volker Hilsheimer
ca3be92234 Remove QFileInfo::type and related enum from 5.14
The API is problematic for several reasons:
- the mixing of flags and enum in a single enum type
- the name "type" as somewhat overloaded
- the ease of misuse when comparing the result rather than testing
  for a bit being set

In light of this, focus for 5.14 on the new isShortcut and
isSymbolicLink functions, thus migitating the problematic
isSymLink which conflates the two concepts.

Change-Id: I57e02321edd5061f69a775f04a0932ef89adf866
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-30 13:20:07 +02:00
Shawn Rutledge
f00bbd5eb7 Update QPA mouse event handling in offscreen and VNC plugins
This is needed after a37785ec76
deprecated the versions of QWindowSystemInterface::handleMouseEvent()
that were in use here.

Change-Id: Ib704ae2be905436f5a4a80ae6686b5fe3972d34c
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-08-30 12:40:31 +02:00
Marc Mutz
c78a716b72 QDateTimeParser: replace QVector with QVarLengthArray<12>
The lists of month and day-of-week names usually currently do not
exceed 13 elements (incl. possible leap months), so don't use
QVector, use QVarLengthArray with Prealloc = 13.

This value may be increased when ISO week-as-month is merged, but
the container remains valid even with 52 "months" (though the code
that calculates its runtime size will naturally need to be adjusted).

Change-Id: I4ead897d933f89fc092850fcc22ca41da0a6ddc6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-30 09:06:34 +00:00
Edward Welbourne
2faa6cafa9 Pass QDate, QTime as value classes, rather than by const reference
This can, of course, only be done in private APIs - but comment on
public APIs to do the same at Qt 6.

Change-Id: I3c79951572be3c37b0b0c5b1b05bced051a40964
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-08-30 10:54:27 +02:00
Edward Welbourne
20f69beae4 Optimize QDate by shortcutting some gregorian calendar methods
Add some static methods to QGregorianCalendar, some of which serve to
implement its methods, that QDate can use to bypass vtables and
exploit fixed truths of the Gregorian calendar in its default
handling.

Change-Id: Iec191cdf4d52945dbd5679e609180cb4fe59b5fd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-30 10:52:42 +02:00
Fredrik Orderud
7b2dfb37ee Remove hardcoded qt_instdate field from binary
Move hardcoded date to the only client code in the repo.

This field is currently modified by MaintenanceTool and possibly windeployqt,
which contributes to breaking the DLL signature on Windows. Removing the field
should avoid this problem.

Task-number: QTBUG-76985
Change-Id: I01386136ac493ea50c99c05879a3e215f3f6344c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-08-30 07:03:02 +02:00
Mårten Nordheim
108382e236 Mark QNetworkAccessManager::autoDeleteReplies as const
From the API review.

Amends cd816d4b6a.

Change-Id: I3d3e2ef331501fa498545c5eec0e321544165b0d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-29 18:16:52 +02:00
Alex Trotsenko
81408c0e76 QEventDispatcherWin32: avoid livelock in a foreign event loop
According to Windows docs, GetMessage() function retrieves the messages
from the input queue in defined order, where posted messages are
processed ahead of input messages, even if they were posted later.
Therefore, if the application produces a posted event permanently, as
a result of processing that event, user input messages may be blocked
due to hard CPU usage by the application.

It's not a problem, if an internal Qt event loop is running. By calling
sendPostedEvents() on the beginning of processEvents(), we are sending
posted events only once per iteration. However, during execution of
the foreign loop, we should artificially lower the priority of the
WM_QT_SENDPOSTEDEVENTS message in order to enable delivery of other
input messages.

To solve the problem, it is proposed to postpone the
WM_QT_SENDPOSTEDEVENTS message until the message queue becomes empty,
as it works for the internal loop.

Task-number: QTBUG-77464
Change-Id: I8dedb6837c6fc41aa6f497e67ab2352c2b4f3772
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-08-29 09:12:29 +00:00
Laszlo Agocs
2602209f54 rhi: vulkan: Introduce secondary command buffer usage
As an option. Must opt in via setting ExternalContentsInPass in
the flags for beginFrame(). It is somewhat unfortunate to require
declaring this up front, but forcing using secondary command buffers
always, even though beginExternal() may not be used in many applications,
would be an overkill.

Change-Id: I8d52bcab40c96f89f140c4c7877b6c459925e3c7
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-08-29 10:23:15 +02:00
Laszlo Agocs
0077e0f88c rhi: vulkan: Add missing VK_QUERY_RESULT_WAIT_BIT
Mainly to get the validation layer from newer Vulkan SDKs to shut up.

Change-Id: I3a00d2e7b5617eb1656625b1b2a919bb3c07feb9
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-08-29 10:23:05 +02:00
Laszlo Agocs
4e97c4061e rhi: Attempt to fix up the logic around beginExternal()
Mainly for Vulkan where it lacked the recording of the still queued
commands. Uncovered by Qt Quick examples that integrate custom Vulkan
rendering.

This still has an issue that needs to be tackled separately. (we probably
will switch to using a dedicated secondary command buffer with
RENDER_PASS_CONTINUE_BIT for the external commands, and then just have
a vkCmdExecuteCommands in our own queue instead of recording everything in
beginExternal).

The possibility of losing glMemoryBarrier() calls due to begin/endExternal()
with the OpenGL backend is fixed too. The logic here mirrors Vulkan
to some extent except that we do not have a concept of (and so the trouble
with) renderpass instances.

Clean up around the implementations of finish() as well. Attempting to share
code via a "flushCommandBuffer" function is admirable but is not worth it
since some semantics are different. (finish() cannot be called within a
begin/endPass, unlike begin/endExternal).

Change-Id: I5137db598d6a40d484e53678f5c919abf750d9ed
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-08-29 10:22:56 +02:00
Laszlo Agocs
2d7fc7a152 rhi: vulkan: Expose the VkRenderPass via the usual mechanisms
Qt Quick in turn will expose it via QSGRendererInterface. Essential when
adding custom Vulkan rendering into a Qt Quick application because the
custom pipeline state objects will need to reference a VkRenderPass.

Change-Id: Idf4092cfc3937830fb8123164081059b0d8d030e
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-08-29 10:22:41 +02:00
Volker Hilsheimer
d6551fe125 QTree/TableView: Don't emit clicked when releasing after double click
If an item is double clicked, then without this fix, the views emit the
clicked() signal when the mousebutton is released after the double click
event. This is unexpected and wrong.

QAbstractItemView keeps track of the item the mouse was pressed on, to
verify that the release occurred on the same item before emitting
clicked, and to make sure we have a valid pressed item before initiating
drag'n'drop. By resetting d->pressedItem when a double click has been
handled, we can prevent the emission of a clicked signal in the next
release event.

[ChangeLog][QtWidgets][QTreeView] Don't emit clicked signal after a
doubleClicked signal.

Fixes: QTBUG-77771
Change-Id: I05988e9e2222157f4216cebc40c22507e8d83b82
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
2019-08-29 09:52:10 +02:00
Rainer Keller
02a6209487 Fix invalid end range appended to HTTP request
When the end range of a byte range in a HTTP request is skipped the download
manager adds 0 it its place when resuming that download.

When there is no end range given the value is skipped.

Task-number: QTBUG-77867
Change-Id: I52358c94cf56c88217fcc91abb102ed393ac7242
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-08-28 15:34:08 +02:00
Kai Koehne
351f6eb52b Add Third-Party code in qregion.cpp to qt_attribution.json file
This makes it visible also in the overview documentation of the module,
and can be used to automatically generate attribution documents.

The code actually mentions the names and file versions (CVS?) where things
got copied from; however, X11 seems to have stopped using CVS a long time
ago, and without a server it's hard to determine the exact X11 version that
was copied from. It arguably doesn't matter, anyhow, because we won't update
the code anymore.

Fixes: QTBUG-70556
Change-Id: Ib17117a1a3c4112b81982afbd51273048a43221a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-28 13:40:02 +02:00
Tor Arne Vestbø
79bf1b7e34 widgets: Mark widgets as needing flush during painting
Except for the case of syncing in response to an expose event,
where the platform asked us to flush a specific region, we
should strive to only flush parts that have been repainted.

And we should flush those parts to their nearest native child,
instead of unconditionally flushing the root/top level widget
as well.

By allowing drawWidget to schedule the flush we automatically
flush the minimal region, to the right widgets.

Change-Id: I73c143761d4a0da6991433b41dea0a0bc83a448a
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-28 13:22:59 +02:00
Tor Arne Vestbø
984df39c79 widgets: Add logging for widget painting
Change-Id: I551ec290812369e3848c1096fed7e813cd9e1cd6
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-28 13:22:50 +02:00
Karsten Heimrich
375f565060 Fix reporting the network interface type on macOS 10.14.5 and later
* initialize the structure used as argument to ioctl SIOCGIFMEDIA

The ioctl in ifType(...) returned -1 and set errno to EFAULT, thus
the code to determine the interface type was not executed.

Task-number: QTBUG-76408
Change-Id: Ib69c2c0cd4dda3604d568adf9746e0c9a280e9a0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-08-28 13:05:18 +02:00
Christian Ehrlicher
271d3bae38 QGraphicsItem: mark GraphicsItemChange::ItemMatrixChange as deprecated
The enum GraphicsItemChange::ItemMatrixChange is deprecated since Qt4
times. The corresponding matrix functions were also marked as deprecated
in 5.13 but the enum was forgotten. Therefore also mark it as deprecated
so it can be removed with Qt6.

Change-Id: I39bec89af14aaefe2e504f5a890ef314574766a1
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2019-08-28 13:04:21 +02:00
Tor Arne Vestbø
3542fc4958 widgets: Simplify QWidgetRepaintManager::flush
Change-Id: Icba88fa068aac2ac5d8bb04e46a3e3f34e279a48
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-28 10:41:29 +02:00
BogDan Vatra
4cc3615b4e Use QLatin1String where possible
Change-Id: I8f94ba4880bcac735e4445d71f0e22774d9f78eb
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-28 07:38:48 +03:00
Marc Mutz
00d972fa4f QReadWriteLock QT_NO_THREAD shell: make API compatible with the regular one
- add missing explicit
- drop static from member functions that aren't static in the regular version
  (ie. all functions)

As a drive-by, remove redundant inline keyword where it doesn't cause
wanton inconsistency with surrounding code.

Change-Id: I5aed73c3afa85d98d97b57c2c1874b1a5e664960
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-28 06:25:40 +02:00
Tor Arne Vestbø
ebec918722 widgets: Simplify markNeedsFlush in QWidgetPrivate::drawWidget
QWidgetRepaintManager::markNeedsFlush already ignores paintOnScreen
widgets.

Change-Id: I8b5d6f79c8fd60115f77d65aef05cc4baf840bdd
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-28 00:47:09 +02:00
Tor Arne Vestbø
25026defdc widgets: Clarify QWidgetRepaintManager::sync of specific widget
Change-Id: Ifa2a8245decfcb2b36c1952a39ec60b7eeca6e43
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-28 00:46:36 +02:00
Laszlo Agocs
af686f5aef Mark all rhi docs as internal
This is private API for the time being. Without this the QRhi*
classes show up in the class list in the docs.

Change-Id: I662abb9cc8eaae13ffe9266bd6313faa8e138353
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-08-27 23:08:09 +02:00
Allan Sandfeld Jensen
eb8d461171 Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" 2019-08-27 16:35:31 +02:00
Allan Sandfeld Jensen
afac8dac58 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/gui/painting/qdrawhelper.cpp
	src/gui/painting/qdrawhelper_p.h
	src/gui/painting/qdrawhelper_sse2.cpp
	src/gui/painting/qdrawhelper_x86_p.h

Change-Id: I83256bb38ab3a705776e353bc0629315b6c59a0f
2019-08-27 13:08:38 +02:00
Liang Qi
0f1f7fb97f Merge remote-tracking branch 'origin/dev' into 5.14
Conflicts:
	src/widgets/kernel/qwidget.cpp
	src/widgets/kernel/qwidget_p.h
	src/widgets/kernel/qwidgetrepaintmanager.cpp
	src/widgets/kernel/qwidgetwindow.cpp
	tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp

Change-Id: Ifae457d0427be8e2465e474b055722e11b3b1e5c
2019-08-27 09:45:52 +02:00
Kavindra Palaraja
46f3b40a6d Docs: Some cleanup of class documentation
Change-Id: I62f89157e57189a97151f9661bc354af9bd67468
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-08-27 09:19:35 +02:00
Christian Ehrlicher
f2f1a93c58 QToolBarLayout: fix position calculation
Fix a bug introduced in d493f676a3 while
calculating the size / position of the layout item.

Fixes: QTBUG-77115
Change-Id: I20ad1685659da7225009734e25287e590367aa9e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-08-26 20:23:10 +02:00
BogDan Vatra
5bb178c479 Say hello to Android multi arch build in one go
Multi arch build in one go is need to support the new .aab packaging format.

By default the users apps are built for all Android ABIs: arm64-v8a armeabi-v7a x86_64 x86
The user can pass ANDROID_ABIS to qmake to filter the ABIs during development,
e.g. qmake ANDROID_ABIS="arm64-v8a armeabi-v7a" will build only for arm ABIs.

[ChangeLog][Android] Android multi arch build in one go,
needed to support the new .aab packaging format.

Change-Id: I3a64caf9621c2a195863976a62a57cdf47e6e3b5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-08-26 12:59:15 +03:00
Tor Arne Vestbø
e8c70fb07f widgets: Rename QWidgetPrivate::repaint_sys to paintOnScreen
Change-Id: Ic853e42cbed9b770bef0e1d7c7376c861bceb891
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-25 23:14:52 +02:00
Tor Arne Vestbø
6dd5cb40ef widgets: Handle all flush tracking via markNeedsFlush
Change-Id: I3652c09012e36468ef90870637988b3fe8c5e735
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-25 23:14:48 +02:00
Tor Arne Vestbø
10e8faa72c widgets: Merge QWidgetRepaintManager::topLevelRect into callsite
Change-Id: Ia9bb0c396b8175f644e337ca73086208c637ed2d
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-25 23:14:44 +02:00
Tor Arne Vestbø
9b3935492b widgets: Remove unused QWidgetRepaintManager::dirtyRegion
It is no longer needed after qt_dirtyRegion was removed in e2a1fb901.

Change-Id: I120df76b08808842b304cb8de10de23ccd0e2845
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-25 23:14:40 +02:00
Tor Arne Vestbø
74be54684c widgets: Clarify how widgets needing flush is tracked
Change-Id: Ia2c2c4b830e4441e50c66dd3fef5bc060f76551e
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-25 23:14:36 +02:00
Tor Arne Vestbø
787314c230 widgets: Clarify top level flush region in QWidgetRepaintManager
Change-Id: I9a8d11569d33bf580bd50b710cf072952ea3626b
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-25 23:14:32 +02:00
Tor Arne Vestbø
dbab68a127 widgets: Use single return in QWidgetRepaintManager::markNeedsFlush
Change-Id: Ia21c5c57e4c642af2aa87b0539c4af51500a4827
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-25 23:14:28 +02:00
Tor Arne Vestbø
0af7e5564c widgets: Simplify QWidgetRepaintManager::sync
Change-Id: Ifd0cdcd7f4c03112fd93c24707e43273e211f688
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-25 23:14:24 +02:00
Tor Arne Vestbø
36d734b3f8 widgets: Rename markDirtyOnScreen to markNeedsFlush
Including renaming the member touched by this function. This leaves the
logic for appendDirtyOnScreenWidget, which still needs investigating.

Change-Id: I405a5e3757f0a79992f88d9f70867aeb7b9764d8
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-25 23:14:21 +02:00
Tor Arne Vestbø
ca3b48539d widgets: Share more code in appendDirtyOnScreenWidget
Change-Id: I0ed936c7d8b004d498a8956b1ba246ade41ce43d
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-25 23:14:17 +02:00
Tor Arne Vestbø
655e8b6eab widgets: Class initialize QWidgetRepaintManager members
Change-Id: Icc06ae8f5f542810d651e4834055cbcd1c1a4e2e
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-25 23:14:13 +02:00
Tor Arne Vestbø
1c2bcdb57a widgets: Rename a few missed uses of QWidgetRepaintManager
Change-Id: Ie28d5dea6fdf1c8728a68d419b487bc5e3e3ee16
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-25 23:14:09 +02:00
Tor Arne Vestbø
b553335651 widgets: Remove unused member in QWidgetRepaintManager
Change-Id: I2f7eac2916bdcd9101e96e78a3d7c3c6c395dde7
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-25 23:13:47 +02:00
Tor Arne Vestbø
5bcfe771a5 widgets: Merge QPlatformTextureListWatcher into implementation file
Change-Id: Icf177a5b559bd1c108a66ee14a51fb23cd36e083
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-25 23:13:43 +02:00
Marc Mutz
b3dc0c13e8 Fix assertion on passing nullptr QLatin1Strings to qt_compare_strings
qstrnicmp() has an assertion that the lhs string is not nullptr.

Fix by moving the length check back to the front, regardless of cs's
value.

Amends cad7100fda.

Change-Id: I31f808936c8dc6fbb10a70a59923746ef3e675e9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-08-25 17:37:52 +02:00
Marc Mutz
77de5a329c Long live QColorConstants!
QColorConstant is a C++11 version of Qt::GlobalColor, except that instead
of Qt::red being an enum, QColorConstants::red is an actual QColor instance,
a bit like in the Qt 3 days.

In addition, the SVG names that QColor understands are also available,
with the same values. Technically, when building a QColor from a color
name, QColor ignores casing and whitespaces; we stick to the SVG/CSS
official color names (which are lowercase), and prefix them with Svg
to clarify where they come from. For instance, note how SVG's gray
is not Qt::gray.

[ChangeLog][QtGui][[QColor] Added QColorConstants, a namespace
containing constexpr QColor instances.

Change-Id: Ic9fab26a9a537fcc43cc230da28f4c6314a32438
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-25 16:31:32 +02:00
Marc Mutz
fd785c3899 QtCore: port all QMutexLocker users to qt_{scoped,unique}_lock
... except four instances in QCoreApplication that would conflict with
another change.

Replace a locally-defined MutexUnlocker with a call to unlock() +
qScopedGuard'ed lock() to avoid having to spell out the locker type
while we can't depend on C++17 CTAD, yet.

In QSettings, move the new mutex locker into and out of
initDefaultPaths(), such as is idiomatic for std::unique_lock, but
wasn't possible with QMutexLocker (which is not movable).

Change-Id: I23056e13ecaa76159db583c7dccc6e05715e0788
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-08-25 12:00:28 +00:00
Mårten Nordheim
0d336ab313 QNetworkConnectionMonitor(win): Fix memory leak
Through some misconceptions about ComPtr I ended up thinking that it did
not call AddRef internally on creation. But it does. This lead to always
having > 1 ref-counter.

Also stop the monitor on destruction if it hasn't already been stopped.
As was already done for QNetworkStatusMonitorPrivate.

Change-Id: Ic72a2f5cb3325f86c018f90b497caaec834cb214
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-08-25 09:54:06 +00:00
Marc Mutz
97db8e04ac Port away from QMutexLocker in public headers
We can't use qt_scoped_lock/qt_unique_lock here, so port to
std::unique_lock and std::lock_guard for now.

This is in preparation of deprecating QMutexLocker in favor
of std::unique_lock and std::scoped_lock.

In QFutureInterface, change the return type of mutex() from
QMutex* to QMutex&, so we don't need to deref when passing
to std::lock_guard. We need to keep the old method around
for BC reasons, so the new one needs an artificial function
argument for disambiguation. This will vanish come Qt 6.

Change-Id: I1a0f0205952a249512ec2dbd3f0f48dd209b1636
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-08-25 04:48:11 +00:00
Volker Krause
23cfdf74cb Also fall back to direct write for Android content: URLs in QSaveFile
We cannot rename into content: URLs, so that is the only option, and this
is particularly relevant here as the native file dialog will give us
content: URLs by default for saving to.

Change-Id: Ie96fcfc404a0842d397c7d1554e3c76f06bb3074
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-08-24 11:22:25 +02:00
Tor Arne Vestbø
29b1ac0697 Don't defer platform backingstore creation if we already have a platform window
The creation was made lazy in 18f415e46d, for those platforms (macOS) that
need a platform window to successfully create a platform backingstore. But we
don't need to delay creation if we actually have a platform window at the time
of constructing the QBackingStore.

Change-Id: I6367736ddca82900dec2751a85a8bc35cc742bb5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-08-24 02:21:59 +02:00
Tor Arne Vestbø
e1b0dfc1d4 macOS: Choose appropriate NSWindow depth based on surface format
Change-Id: I67e63412096ca11a8f056f5755525311756906ef
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-08-24 02:21:54 +02:00
Thiago Macieira
f8d41309c8 Use qsizetype for qt_memfill functions
Just in case the image is larger than 2 GB (512 megapixels).

Change-Id: I343f2beed55440a7ac0bfffd15636cbc68dfa13d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 1e2bf51d3e)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-08-24 01:39:37 +02:00
Qt Forward Merge Bot
b29505bb37 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I60bb714ef11bced075d94addb74d23c3a3975519
2019-08-24 01:00:08 +02:00
Sona Kurazyan
1b7ce85a60 Remove usages of deprecated APIs of QWheelEvent
- Replaced the usages of deprecated QWheelEvent::delta() and
  QWheelEvent::orientation() with QWheelEvent::angleDelta().
  In most of the examples it is acceptable to use only the vertical
  component of angle delta.

- Made the docs APIs to build conditionally, based on the
  deprecation version.

Task-number: QTBUG-76491
Task-number: QTBUG-76540
Change-Id: Id4230d483f724af49e4b6349b44881c3944de2a2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-23 21:51:43 +02:00
Allan Sandfeld Jensen
5d94aac2ba Introduce QImage::Format_BGR888
Is pretty common on some architectures so we can avoid swizzling by
supporting it.

Fixes: QTBUG-45671
Change-Id: Ic7a21b5bfb374bf7496fd2b2b1252c2f1ed47705
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-08-23 11:54:09 +02:00
Marc Mutz
96ff6e8ebe QGuiApplication: drop mutex before emitting fontChanged()
Emitting a signal executes an unknowable amount of code. We shouldn't
hold a mutex while doing so. E.g., if the signal emission causes
another call to QGuiApplication::setFont(), the old code would
deadlock, since applicationFontMutex is not recursive.

Fix by taking a copy of the application font under mutex protection,
then dropping the lock for the emission of the signal.

Change-Id: Ib2569b3a08af6ef5f38459a19f74cb0db27b7772
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-08-23 10:39:43 +02:00
Marc Mutz
e913b690b9 QtDBus: port all QMutexLocker users to qt_{scoped,unique}_lock
Change-Id: Ibba27351a81b0b132ce702c1dfd49d56f23bd8c1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-08-23 08:44:03 +02:00
BogDan Vatra
3f603906b4 Android: Set RTLD_NODELETE on API 23+
Change-Id: Ia4b0a6abf862e79b6d7b4c2368f44de0d05a65e9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-08-23 09:29:11 +03:00
Lorn Potter
536cab1a93 wasm: add network object checking
This should help when things are moving fast, and downloads and
network object are destroyed before the callbacks finishes.

Change-Id: I1f65965bd61efc2e641d03eb071f23e684dd5c44
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-23 01:56:59 +00:00
Friedemann Kleint
d603ee689f Widget style: Use per-screen DPI in QStyleHelper::dpiScaled()
Pass the style option to dpiScaled() in order to get
the correct screen DPI. The style option contains the
font, which again contains the current DPI value.

Add QFontMetrics::fontDpi() accessors to get the DPI
from the QFont. This DPI will/should be updated on screen
change.

Replace hardcoded Q_OS_MAC DPI with hardcoded base
DPI. This makes per-screen DPI testable on macOS, too.

Task-number: QTBUG-45055
Change-Id: I75f8b37d45eb50c3334b46b8469a546d29712f1b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-08-23 01:41:33 +00:00
Morten Johan Sørvig
f1e40dd6d6 Add high-DPI scale factor rounding policy C++ API
This API enables tuning of how Qt rounds fractional scale factors, and
corresponds to the QT_SCALE_FACTOR_ROUNDING_POLICY environment
variable

New API:
	Qt::HighDPiScaleFactorRoundingPolicy
	QGuiApplication::setHighDpiScaleFactorRoundingPolicy()
	QGuiApplication::highDpiScaleFactorRoundingPolicy()

Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io>
Task-number: QTBUG-53022
Change-Id: Ic360f26a173caa757e4ebde35ce08a6b74290b7d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-08-23 03:41:23 +02:00
Morten Johan Sørvig
1de8b01d2b Deprecate QT_AUTO_SCREEN_SCALE_FACTOR
Replace by QT_ENABLE_HIGHDPI_SCALING.

QT_AUTO_SCREEN_SCALE_FACTOR has the usability problem that it mixes
enabling the high-DPI scaling mode with the method of getting screen
scale factors (“auto”). Due to this, it ends up with a slightly
strange name.

QT_ENABLE_HIGHDPI_SCALING matches the C++ option
(Qt::AA_EnableHighDPiScaling), and leaves the scale factor acquisition
method unspecified, possibly to be set by some other means (like
QT_SCREEN_SCALE_FACTORS).

Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io>
Task-number: QTBUG-53022
Change-Id: I30033d91175a00db7837efc9c48c33396f5f0449
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-08-23 03:41:14 +02:00
Friedemann Kleint
35da4eeba2 Update QT_SCREEN_SCALE_FACTORS
Store name->factor associations in a global QHash instead of on the
QScreen object, making them survive QScreen object deletion, for
example on disconnect/ connect cycles.

Make factors set with QT_SCREEN_SCALE_FACTORS override the screen
factors computed from platform plugin DPI values. This matches the use
case for QT_SCREEN_SCALE_FACTORS (but not the general scale factors
combine by multiplication”principle)

Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io>
Task-number: QTBUG-53022
Change-Id: I12771249314ab0c073e609d62f57ac0d18d3b6ce
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-08-23 03:41:03 +02:00
Morten Johan Sørvig
70a893e9be Move QT_FONT_DPI to cross-platform code
This makes it possible to test the effects of setting
Qt::AA_HighDpiScaling/QT_AUTO_SCREEN_SCALE_FACTOR, with different DPI
values on all platforms.

This also makes it possible to access the actual DPI values reported
by the OS/WS via the QPlatformScreen API.

A drawback is that there is no single place to check the environment
variable; currently done in three places. This may be
further simplified later on.

Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io>
Task-number: QTBUG-53022
Change-Id: Idd6463219d3ae58fe0ab72c17686cce2eb9dbadd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-08-23 03:40:53 +02:00
Morten Johan Sørvig
900f2cb6f7 Update Dpi and scale factor computation
Remove pixelScale() in favor of logicalBaseDpi(). Compute scale factor
based on logical DPI and logical base DPI, or optionally based on the
physical DPI.

Add policies for running the scale factor and adjusting the logical
DPI reported to the application. The policies are set via environment
variables:

  QT_SCALE_FACTOR_ROUNDING_POLICY=Round|Ceil|Floor|RoundPreferFloor|PassThrough
  QT_DPI_ADJUSTMENT_POLICY=AdjustDpi|DontAdjustDpi|AdjustUpOnly
  QT_USE_PHYSICAL_DPI=0|1

Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io>
Task-number: QTBUG-53022
Change-Id: I4846f223186df665eb0a9c827eaef0a96d1f458f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-08-23 03:40:35 +02:00
Morten Johan Sørvig
dd9da0441b Compute logical DPI on a per-screen basis
The logical DPI reported to applications is the platform screen
logical DPI divided by the platform screen scale factor.

Use the screen in question when calculating the DPI instead of
the values from the main screen.

QHighDpiScaling::logicalDpi now takes a QScreen pointer.

Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io>
Task-number: QTBUG-53022
Change-Id: I0f62b5878c37e3488e9a8cc48aef183ff822d0c4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-08-23 03:40:14 +02:00
André Klitzing
b1db1dd655 Fix build with -no-feature-printer on macOS
Fixes: QTBUG-62675
Change-Id: I3bfcd6d78c3124769ff8662941472333c795fdbe
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-08-22 21:27:23 +02:00
Paul Olav Tvete
181e5382e7 eglfs/kms: Add drm atomic blend_op property handling
Add support for specifying the blend operation used when alpha-
blending KMS planes. Only available with atomic modesetting.
Set the environment variable QT_QPA_EGLFS_KMS_BLEND_OP to
the enum value of the 'blend_op' property.

Task-number: QTBUG-75659
Change-Id: If0ef5ba314b88adb530113b608d20fc9c027c5ec
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-08-22 15:38:08 +02:00
Timur Pocheptsov
8d302aea33 HTTP/2: use a non-default MAX_FRAME_SIZE
And send it in our 'SETTINGS' frame. Add an auto-test
for this and (as a bonus) - fix a bug accidentally
introduced by the previous change.

Task-number: QTBUG-77412
Change-Id: I4277ff47e8d8d3b6b8666fbcd7dc73c827f349c0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-22 15:36:22 +02:00
BogDan Vatra
9b14950ff6 Android: Update clang mkspecs
Follow Google's BuildSystemMaintainers doc to simplify (a lot) the clang support
It is needed to support future NDK releases painlessly.
Also remove old workarounds.

[ChangeLog][Android] Android depends on NDK r20+

Change-Id: Ib4c07fc71e0f5a264d804b0b3baa18ff79d07630
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-08-22 16:32:47 +03:00
Tor Arne Vestbø
16868bd6a2 widgets: Clean up and reorder QWidgetRepaintManager implementation
Group functions by related areas and order them roughly by their
flow in a normal app repaint cycle.

Change-Id: I7a963f612134b3fdbaf748e0432606825b8db64e
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-22 12:10:13 +02:00
Marc Mutz
36cf237ea1 QWidget: two small fixes
- Use QPointer::data() instead of a C-style cast

- Remove an abuse of Q_UNLIKELY. Q_UNLIKELY is for error code. Using
  it for conditions that have a good chance of being true in normal
  operations just caused all the error handling code to be paged in
  needlessly.

Change-Id: I542a5b938b032ca84f2cf1f78fbc45049a12ad1a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-08-22 12:10:10 +02:00
Soroush Rabiei
2dee006216 Adapt QCalendarWidget and QDateTimeEdit to support choice of calendar
[ChangeLog][QtWidgets][QCalendarWidget] Allow choice of calendar, with
Gregorian remaining the default.

[ChangeLog][QtWidgets][QDateTimeEdit] Allow choice of calendar, with
Gregorian remaining the default.

Change-Id: Ia11dd895032393543aee534b177324e643dcfb20
Done-with: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-22 12:10:06 +02:00
Soroush Rabiei
7026645712 Add support for the Islamic Civil calendar
This has its own locale data, extracted from CLDR. This data may
potentially be shared with other variants on the Islamic calendar, so
is handled by a separate base-class, QHijriCalendar, on which such
variants may base their implementations.

[ChangeLog][QtCore][QCalendar] Added support for the Islamic Civil
calendar, controlled by feature islamiccivilcalendar, with locale data
that can be shared with other implementations, controlled by feature
hijricalendar.

Fixes: QTBUG-56675
Change-Id: Idf32d3da7034baa8ec5e66ef847e59a8a2f31cbd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-22 10:10:02 +00:00
Marc Mutz
a4d19654ed Simplify QBezier::split()
Now that result objects can't alias source ones anymore, the order of
writes no longer matters, and we can clean this function up. The
pattern of the algorithm now becomes visible. Before, it was just
drowing in noise.

Change-Id: I36c55ce09d6e13a994c7eda17d96cfe960e7fb95
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-08-22 11:41:31 +02:00
Laszlo Agocs
c47f436175 Avoid double QCache lookup in QOpenGLProgramBinaryCache
Change-Id: I4384a15f0b89e1f6d7f59bff1816fc2e6fc6adfe
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-22 09:40:52 +00:00
Giuseppe D'Angelo
a52a3b2aa4 Micro-optimize QAbstractItemModel::setItemData
If b becomes false, we won't call setData ever again.
Just bail out the loop early and return in that case.

Change-Id: I4b0ed7e21546d686bc3f785209a314a8bed08471
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-22 11:40:11 +02:00
Marc Mutz
d1b099c3e3 QBezier: replace out parameters by return-by-value in split()
At least QBezier itself is calling the old function with *this aliased
to one of the arguments. Consequently, the implementation looks rather
... shuffled, to avoid writing into members that it will read once
more later.

Fix by returning a std::pair<QBezier, QBezier> instead. This
simplifies the code that doesn't actually pass existing objects in,
and avoids aliasing problems cropping up under seemingly innocuous
reorderings of statements in the implementation going forward.

While I'm usually vehemently against use std::pair or std::tuple in
APIs, preferring simple structs with aptly-named members instead, this
is one case where the .first and .second actually fit, and pair allows
us to use std::tie, which was handy in qbezier.cpp.

This patch preserves the body of the function as much as possible. A
follow-up patch will clean it up.

Change-Id: I017dfee4a0e69a2e171ce21b89ba04654772c33d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-08-22 09:39:07 +00:00
Marc Mutz
5b2dfbc649 Long live QSize(F)::grownBy/shrunkBy()
These functions tighten the integration of QMargins(F) with the rest
of the geometry classes by providing a way to apply margins to sizes
(and later, rects).

Apply them in a few obvious cases across QtWidgets.

[ChangeLog][QtCore][QSize/QSizeF] Added grownBy(QMargin(F))/shrunkBy(QMargin(F)).

Change-Id: I8a549436824cdb7fb6125a8cde89d5bf02826934
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-22 11:38:54 +02:00
Jan Arve Sæther
529b271520 Don't excessively check all output files for failures
This is really just an optimization, but I suspect the author of the code
assumed that the bitwise &= operator short-cicuits. (It doesn't). So this
patch should then fix the code to have the intended behavior.

We don't have to check for failures in the remaining output files once
we've found one. pullFiles() returns just a bool indicating if one of the
output files has a recorded fail, so checking the remaining output files
after the first found failure is just a waste (and ideally they should
contain the same failure (however, flaky tests might break this ideal)).

Drive-by fix.

Change-Id: I951e500a69198e7ed124be32199ac81bbddb9bf7
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-08-22 11:21:38 +02:00
Timur Pocheptsov
4300dccba5 Fix a broken build
QHttp2Configuration is using entities (read definitions) from http2,
which is only conditionally included in the *.pri file (requires http).
So as a result we had linker errors.

Fixes: QTBUG-77759
Change-Id: I8b33b0a4802a295f67edad03da3743b24f7ce514
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-08-22 11:21:34 +02:00
Mårten Nordheim
6a2112c28c Remove use of QByteDataBuffer in QNetworkReplyHttpImpl
It's temporarily storing QByteArrays before we copy them directly to
QIODevice's internal buffer. We can save the extra work by just push
them directly into the buffer.

The signal compression is no longer useful performance-wise, but is
kept as it will throttle the amount of readyRead emissions the users has
to handle.

Reorder some of the operations as a result to make it more natural.

Change-Id: Ifc0481d56fec42545e95970125d883a5c68d647a
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-08-22 11:21:28 +02:00
Volker Hilsheimer
d97009a9f1 Remove obsolete API after qtdeclarative migrated
This is a follow-up to commit b7d073e990,
which refactored memory allocation of QMetaCallEvent.

Change-Id: I363256c80ee941b545e6f9c659c65556fff5c907
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-22 11:21:24 +02:00
Christian Ehrlicher
62015adadd QFont: remove unused member QFontPrivate::screen
QFontPrivate::screen was not used anywhere so remove it.

Change-Id: Ie9381d08b59b93c4e7bcaad58ebf1b389aa0a2e6
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-08-22 11:21:21 +02:00
Ulf Hermann
c8c724a3ce Cbor: Add overloads for QStringView
Change-Id: I8d22d0741c4d3852b438b12099f81ed87244871d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-08-22 11:21:17 +02:00