Commit Graph

10082 Commits

Author SHA1 Message Date
Sona Kurazyan
14ade9c476 Fix the build of the qgraphicslayout manual test
This was accidentally introduced by
2f33e030b8 and since manual tests are not
built by default, was not discovered earlier.

Change-Id: I5cb6d5cfe0911bdb01a33014f2648a47b7a48848
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-09-06 09:57:57 +02: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
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
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
Friedemann Kleint
d2894d968d tst_QPdfWriter: Fix deprecation warnings
Fix warnings:
tst_qpdfwriter.cpp:223:58: warning: virtual void QPdfWriter::setPageSize(QPagedPaintDevice::PageSize)’ is deprecated: Use setPageSize(QPageSize(id)) instead [-Wdeprecated-declarations]

by using the QPageSize-based API. Streamline the code by using
QPageSizeId.

Task-number: QTBUG-76491
Change-Id: I409f0e27de64bc66502a60a9109c6115f36e527d
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-05 16:08:47 +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
Qt Forward Merge Bot
f3a1048b61 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I065e212f0dc115efa1ffcb14cf9f679259da6b79
2019-09-05 08:58:25 +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
Friedemann Kleint
e82a1d6b29 Deprecate QDirModel
Deprecate the constructors, add guards.
Use a QStandardItemModel in tst_QCompleter::setters() instead.

Task-number: QTBUG-69410
Change-Id: If77298982bb3d0b5321ae1271fab3f33b196101d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-09-04 21:27:33 +02: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
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
Timur Pocheptsov
b9b48464df tst_http2::goaway - run in ALPN mode only
I was observing rare crashes on my mac, where I was using SecureTransport.
This would imply both the client (the test) and the server were working
in h2c mode. But this is against the test's logic - the first request
will be HTTP/1.1 (and upgrading protocol) and I wanted to send 3 HTTP/2
requests instead.

Fixes: QTBUG-77476
Change-Id: I048ca242e2096ca36dd112277807d1fee530150c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-09-04 15:35:50 +02:00
Daniel Smith
651dd26403 Update lancelot tests to use non-system-specific host info collection
Change the lancelot baseline test runner to use generic text files for
host info data collection. This also avoids relying on QProcess and
scraping the bash scripts output from stdout.

Fixes: QTBUG-71836
Change-Id: I88a46c99dbb11f71afc18cae5a6d2fbebcbe76c5
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-09-04 13:09:39 +00: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
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
Friedemann Kleint
efbba1e54a Brush up tst_QStyle
- Remove member m_testWidget; instantiate test widget on the
  stack where needed
- Introduce nullptr
- Use range-based for
- Streamline some code
- Fix static invocation
- Fix class structure, add override
- Use initializer lists
- Fix some style issues

Task-number: QTBUG-76493
Change-Id: If339d51a16bb77565cf10404ad1266c8f63a68b4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-09-03 15:00:13 +02:00
Friedemann Kleint
194d4946c7 tst_QStyleSheetStyle: Pass on High DPI screens
The test requires High DPI scaling to be disabled since it
manipulates the factors itself in a test.

Turn it off initially and introduce a member variable
containing a suitable size depending on the screen to make the
test pass on High DPI screens without violating minimum window
widths on Windows.

Task-number: QTBUG-76493
Change-Id: I7b908940413d6a35a4bee781b4df07a31069bb17
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-09-03 06:27:55 +00:00
Friedemann Kleint
0a1f48a082 Brush up tst_QStyleSheetStyle
- Fix includes
- Fix a widget leak (incorrectly parented QComboBox)
  and add a check in cleanup()
- Add window titles
- Introduce nullptr
- Replace C-style casts
- Use range-based for
- Streamline some code
- Fix static invocation
- Fix class structure, add override
- Use initializer lists

Task-number: QTBUG-76493
Change-Id: I035ec782fa1241a5a1d775e86b0591d9bd134359
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-09-03 06:27:44 +00:00
Sona Kurazyan
38d5ad2ee5 Fix the build with disabled QGraphicsItem::ItemMatrixChange
QGraphicsItem::ItemMatrixChange has been deprecated since 5.14. Fixed
the usage in tests to compile condinionally, only when it is available.

Change-Id: I63e892a01a50fb9ac51bf38eb761cb26375bc194
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-09-02 20:56:03 +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
Eirik Aavitsland
6bb51e0f08 QPainter lancelot test: improve drawImage testing
In QPainter, there is a shortcut code path for the drawImage(point,
image) call, relative to the full drawImage(targetRect, img,
srcRect). The lance script interpreter would only use the latter, so
the former was not covered by the tests.

As a driveby, remove the pointless usage of non-default dithering
flags in drawImage(), since it is more important to test the default.

Change-Id: Id373fd528a0c4c40b6bd8eea37b960fd7cdb2cc7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-09-02 12:08:40 +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
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
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
Edward Welbourne
acd7259a03 Extend QDate's benchmark
Test more methods.
Document what the existing test covers.
Use the right #include for QDate.

Change-Id: I051542c244e5bc381aafa3ae38144e246919db7a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-30 11:22:07 +02:00
Edward Welbourne
14aa481614 Convert foreach to ranged for in QDateTime benchmark
Change-Id: I05cf7b1916afa94a9f0f9b83af9b4ebe20a04cf0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-30 11:09:59 +02:00
Edward Welbourne
0556366ddb Deduplicate list-building code in QDateTime benchmark
Aside from the start-date and the end-date, and a variant with a
time-zone, the lists various tests were building were all built the
same way; so pack that up as a pair of functions (one without
time-zone, one with) to save duplication. Make the list in each
function const, ready for conversion of foreach loops to ranged for.

In the process, replace QList with QVector, reserve space before we
populate and use auto for the now-const list variables it's saved in.

Change-Id: I7d8cce459a4d6111cd645e8d3966ad769ab7e201
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-30 11:09:36 +02:00
Edward Welbourne
54f6c9bfd9 Fix unused variable warnings in QDateTime benchmark
Change-Id: Id123ace74cfa7b5ff406eabbfda0aad9f58c3fd4
Reviewed-by: David Faure <david.faure@kdab.com>
2019-08-30 10:55:46 +02:00
Edward Welbourne
06f69700af Fix some bogus date calculations in QDateTime's benchmark
Multiplying a Julian Day number by the number of milliseconds per day
does not get you a time since the start of 1970; it gets you a time
since the start of the Julian Day number system, which was several
millennia earlier.

Change-Id: Ic90a6c3de445baf9cfd30f28dd847f146e6a7adf
Reviewed-by: David Faure <david.faure@kdab.com>
2019-08-30 10:55:12 +02: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
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
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
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
Friedemann Kleint
c2aaa9e18e tst_QGraphicsScene: Pass on High DPI screens
The test requires High DPI scaling to be disabled since it
captures widgets.

Turn it off initially and introduce a member variable
containing a suitable size depending on the screen to make the
test pass on High DPI screens without violating minimum window
widths on Windows.

Change-Id: Ida9f306cff6abd48ee5de7001c7670a0da60c6c2
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-08-24 08:32:24 +02:00
Friedemann Kleint
ab55046862 Brush up tst_QGraphicsScene
- Fix includes
- Add window titles
- Introduce nullptr
- Remove unneeded C-style casts in QCOMPARE
- Replace remaining C-style casts
- Use range-based for
- Fix static invocation
- Fix class structure, add override, use member initialization
- Fix top level widget leaks and add a check
- Silence debug output by using a logging category
- Use Qt 5 connection syntax

Task-number: QTBUG-76497
Change-Id: I77532a517353d04d1da43ce844988ee0ac2ffc7d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-08-24 08:31:19 +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
Friedemann Kleint
a4a1198708 Windows: Fix some widget tests to pass on High DPI screens
For tst_QFrame and tst_QOpenGLWidget, force scaling off
since they do screen captures which would fail with
scaling activated due to different device pixel ratios.

For tst_QGraphicsItem and tst_QHeaderView, force
scaling on for Windows since some tests otherwise fail
due to violation of the minimum size constraints of
framed windows on Windows.

The tests will then pass regardless of any environment
setting of the scaling variables on a developer
machine.

Change-Id: Iefa4e84b433f7e51dce4e416546a9eda8ee6d0f1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-08-23 08:39:16 +02:00
Morten Johan Sørvig
3e5362bfa1 HighDPI: Add “metrics” manual test
This test displays a summary of relevant DPI and scale
factor/devicePixelRatio values:

 - DPI and DPR as seen by the application
 - Input from QPlatformScreen
 - Input from environment variables.

Task-number: QTBUG-53022
Change-Id: I340391624b202e342f22902ffbd7228fe7fbe94b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-08-23 03:40:43 +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
Friedemann Kleint
45f681e818 tst_QStyle: Remove unused baseline images (Windows Vista/macOS)
The test contained outdated baseline images for

1) Windows Vista: They were only used for OS version Vista
   and do not match any more.

2) macOS: They were apparently were not in use any more

Remove the testing and image comparison code.

Task-number: QTBUG-76493
Change-Id: I91cec5113db8d1845b43f97ad2987e63d9f86ac7
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-08-22 22:26:53 +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
Alex Trotsenko
d55712153a tst_NoQtEventLoop: destroy hidden windows
Otherwise, we get a warning:

QWARN  : tst_NoQtEventLoop::consumeSocketEvents() QWindowsContext::windowsProc: No Qt Window found for event 0x2a3 (WM_MOUSELEAVE), hwnd=0x0x9b80646.

in the event loop which is running by another test. So, add missing
'delete' call.

Change-Id: Ib9b24155bdd6e78062a5234c317c9f878906e413
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-08-22 16:34:40 +03: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
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
Friedemann Kleint
b455a863a1 Add screen() accessor to QWidget
Base it on QWidgetPrivate::associatedScreen(), but make a larger
effort to find a screen in case the widget is not shown yet.

Rename QDesktopScreenWidget::screen() to something else to avoid
clashes.

Task-number: QTBUG-62094
Task-number: QTBUG-53022
Change-Id: I36ba5ef5f0645a4ac89da0b38a391f7057b2f49c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-08-21 22:18:52 +02:00
Soroush Rabiei
e71bf9d5c7 Add support for the Jalali (Solar Hijri or Persian) calendar
This has its own locale data, extracted from CLDR.

[ChangeLog][QtCore][QCalendar] Added support for the Jalali (Persian
or Solar Hijri) calendar, controlled by feature jalalicalendar.

Fixes: QTBUG-58404
Change-Id: Id5c56a10db05a4fd612aafc01615273db81ec743
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-21 22:18:48 +02:00
Soroush Rabiei
3e771a8b09 Add support for Julian and Milankovic calendars
These share their locale data with the Gregorian calendar, making them
virtually free to add. Still leave them out of the boot-strap build,
though.

[ChangeLog][QtCore][QCalendar] Added support for Julian and Milankovic
calendars. These are enabled by default, except in bootstrap builds.

Change-Id: I585045ed9e78c1e959957f6772b3e144093b701c
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-21 22:18:45 +02:00
Tor Arne Vestbø
ce73b4db62 Remove dead code from Qt 4 times
The benefit of keeping this code around was to inspire or inform
changes in the areas to take into account possibly missing features
in Qt 5, but at this point that benefit is questionable. We can
always use the history to learn about missing pieces if needed.

Change-Id: I87a02dc451e9027be9b97554427bf8a1c6b2c025
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-20 22:27:46 +00:00
Allan Sandfeld Jensen
2cddaf0071 Fix tst_bench_qimagereader
It couldn't find the test images if not build in sources.

Change-Id: Ieeb5a76694a37d05b3e9a4ed0154885040b0812f
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-08-20 22:47:09 +02:00
Allan Sandfeld Jensen
9e86fdb6e8 Support writing color space profile in JPEG
That way the image formats with color space supports all have both read
and write support.

Change-Id: Ib52ebd56192c4a8a0897a6afc7c4a26020319270
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-08-20 17:10:19 +02:00
Sona Kurazyan
aa6e0e3e30 Remove the usage of deprecated APIs from QSysInfo
Replaced:
 QSysInfo::macVersion() -> QOperatingSystemVersion::current()
 Q_MV_OSX(10, 13) -> QOperatingSystemVersion::MacOSHighSierra

Task-number: QTBUG-76491
Change-Id: Iae4f9c319ff16314fb04bbefaa48935a0f618007
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-20 15:09:11 +00:00
Soroush Rabiei
aa8393c94f Add support for calendars beside Gregorian
Add QCalendarBackend as a base class for calendar implementations and
QCalendar as a facade via which to access it.

QDate's implicit implementation of the Gregorian calendar becomes
QGregorianCalendar and QDate methods now support choice of calendar.

Convert QLocale's CLDR data for month names to a locale-data component
of each supported calendar and relevant QLocale methods now support
choice of calendar. Adapt Python scripts for locale data generation to
extract month name data from CLDR (keeping on version v35.1) into the
new calendar-locale files. The locale data for the Gregorian calendar
is held in a Roman calendar base, for sharing with other calendars.

Add tests for basic uses of the new API.

[ChangeLog][QtCore][QCalendar] Added QCalendar to support diverse
calendars, supported by implementing QCalendarBackend.

[ChangeLog][QtCore][QDate] Allow choice of calendar in various
operations, with Gregorian remaining the default.

Done-with: Lars Knoll <lars.knoll@qt.io>
Done-with: Edward Welbourne <edward.welbourne@qt.io>
Fixes: QTBUG-17110
Fixes: QTBUG-950
Change-Id: I9d6278f394269a183aee8156e990cec4d5198ab8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-20 13:41:21 +02:00
Paul Olav Tvete
2f52e1da0d Merge remote-tracking branch 'qt/5.12' into 5.13
Conflicts:
	src/gui/configure.json
	src/gui/util/qtexturefilereader.cpp
	src/gui/util/util.pri
	tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp

Change-Id: I2bc4f84705b66099e97330cda68e0b816aceb9cc
2019-08-20 10:41:56 +00:00
Tor Arne Vestbø
6d9d4e6817 Rename QWidgetBackingStore to QWidgetRepaintManager
Quoting a blog from 2009, "this class is responsible for figuring out which parts
of the window surface needs to be updated prior to showing it to screen, so it's
really a repaint manager."

https://blog.qt.io/blog/2009/12/16/qt-graphics-and-performance-an-overview/

What better time to do the rename than 10 years later!

Change-Id: Ibf3c3bc8c7df64ac03d72e1f71d296b62d832fee
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-20 11:33:47 +02:00
Timur Pocheptsov
8052755fd7 Add means to configure HTTP/2 protocol handler
Similar to TLS configuration that we can use on QNetworkRequest,
we can configure different options in our HTTP/2 handling by
providing QNetworkAccessManager with h2 configuration. Previously,
it was only possible internally in our auto-test - a hack with
QObject's properties and a private class. Now it's time to provide
a public API for this.

[ChangeLog][QtNetwork][QNetworkRequest] Add an ability to configure HTTP/2 protocol

Change-Id: I80266a74f6dcdfabb7fc05ed1dce17897bcda886
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-08-20 07:19:43 +02:00
Tor Arne Vestbø
f4db381169 Get rid of QWidgetBackingStoreTracker
It was added for Symbian almost 10 years ago (d7057e7c1f1a), for a somewhat
dubious use-case. The Symbian code is since long gone (ae30d7141), so the
remaining pieces are just adding complexity to the already intricate workings
of the QtWidgets backingstore/painting logic.

Task-number: QTBUG-8697
Change-Id: I82af610a8ac26719c588ac63f06b4501f59b400d
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit 2e0b0be2ce)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-19 23:20:27 +02:00
Nils Jeisecke
d8a9bec35f QTextDocument: add css-styling of table cell borders to HTML import/export
Supported style attributes:

<table>
style: supports "border-collapse: collapse" and "border-color".
border: width of the outer border
bordercolor: basic color for all borders

<tr>
style: not supported

<td>/</th>
style: supports the "border", "border-[top|left|bottom|right]]"
       shorthand styles and the "border-width", "border-color"
       and "border-style" (and the top/left/bottom/right variants)
       attributes

<table border=1 style="border-collapse: collapse"> will render
a simple 1px table grid.

Notes:

The QTextDocument table model is much simpler than the HTML table model.
It basically only has <table> and <td> support. So the HTML parser is
forced to map markup and styling to the QTextDocument model which
is not without loss.

In other words: While QTextDocument -> HTML -> QTextDocument should
preserve the QTextDocument structure, HTML -> QTextDocument -> HTML
does not preserve the HTML DOM at all.

So for now the HTML importer and writer only support border styles on
the <td> and <th> nodes. In future updates, the HTML parser might be
enhanced to map <tr> and <table> CSS styles to the cells.

Change-Id: If9e7312fa6cbf270cf8f7b3c72ba1fa094107517
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-08-19 20:59:12 +02:00
Christian Ehrlicher
427995a518 Itemmodel tests: remove foreach usage
Replace foreach with range-based for loop, replace some int values with
the correct Qt flag enum as drive-by.

Change-Id: I41c52f6ae6c537fa9ad4f9e169485533936952d1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-19 19:10:06 +02:00
Daniel Smith
662fec6f0d Update for failures only on dev branch. Use general platform names
This patch was generated with tooling from patchset 31 of
https://codereview.qt-project.org/c/qt/qtqa/+/267034 in interactive
mode. General platform names were chosen if greater than 60% of the
currently active platforms of a given type in COIN recently failed.

Change-Id: Ia4bde7f0ec422bbb727dc9d7151295159094f146
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-08-19 18:22:11 +02:00
Tor Arne Vestbø
2e0b0be2ce Get rid of QWidgetBackingStoreTracker
It was added for Symbian almost 10 years ago (d7057e7c1f1a), for a somewhat
dubious use-case. The Symbian code is since long gone (ae30d7141), so the
remaining pieces are just adding complexity to the already intricate workings
of the QtWidgets backingstore/painting logic.

Task-number: QTBUG-8697
Change-Id: I82af610a8ac26719c588ac63f06b4501f59b400d
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-19 14:40:29 +02:00
Ryan Chu
7a4e5e7433 Make Qt aware of symlinks and shortcuts on Windows
Qt has traditionally considered Windows shortcut files equivalent to
symlinks on Unix file systems. Because of NTFS symlinks, the
interpretation of shotcut files as symlinks is confusing.

In this change, QFileInfo treats shortcut (.lnk) files as regular files
but can follow the pointed object.

In addition, QFileInfo introduces a more comprehensive file type. So
that applications can make well-informed decisions about how to treat a
file system entry.

Based on the implementation of QFileInfo::type(), two inline helper
functions are introduced to QFileInfo.
1. isSymbolicLink, returns true if it points to a symbolic link.
2. isShortcut, returns true if it points to a shortcut.

[ChangeLog][QtCore][QFileInfo] Introduce QFileInfo::type() to replace
the isSymLink method.

Task-number: QTBUG-75869
Change-Id: Icc0dd52f9ad0ea50b0265d77ee0d0a3d25054e39
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-16 23:25:33 +02:00
Qt Forward Merge Bot
56f46ba13d Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: Ia3645f92b9debf3e1fe2d972300c7d0dbd649268
2019-08-16 01:00:33 +02:00
James McDonnell
12d37e70a7 Make the inputRejected test compatible with -no-feature-clipboard
Qt for QNX is, by default, built without the clipboard feature.

Change-Id: Ie8a36ceb0c0f0a695ae7d0fcf6f0bd70d2a43e0c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Rafael Roquetto <rafael@roquetto.com>
2019-08-15 15:00:25 -04:00
Eirik Aavitsland
a547404c12 QTextureFileReader: backport ASTC support
Add support for astc format files as an experimental feature.
To enable, configure with "-feature-texture_format_astc_experimental"

(Backported from commit 5a4db421bd94acd12a4ac1f77031996b95f85dbf)

Change-Id: I9a2f7b1fa20ba344b79637bafb50ff2bd0596747
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-08-15 09:26:11 +02:00
Joerg Bornemann
31e0d171d6 Fix qinstall on Windows for directories containing read-only files
Initial patch by: Vlad Lipskiy <eswcvlad@yahoo.com>

Fixes: QTBUG-77299
Change-Id: I803b809d1f23d844252b701cb070f6e4ba34eca1
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-08-15 09:24:14 +02:00
Milla Pohjanheimo
ee94d9c169 Add binary compatibility files for Qt5.13.0 for QtBase
Binary compatibility files added.

Change-Id: If013647f17ade6a51e9f8678252b373d8f51d010
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit b5677bc6da)
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2019-08-15 04:19:39 +00:00
Qt Forward Merge Bot
425d34b70e Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: Icc80dacbca8613f2996be75553ff15d0ad242b7e
2019-08-15 01:00:51 +02:00
Qt Forward Merge Bot
c5c9380555 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Id7954ada1f8658d3b1da5e8241a09f2d201a7c56
2019-08-15 01:00:30 +02:00
Joerg Bornemann
08192d6097 Add tst_qmake::qinstall
...with a failing test case for QTBUG-77299.

Task-number: QTBUG-77299
Change-Id: I42c4fc4bb96f8660f8ff9bea97e6096ca6cec972
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-14 16:36:48 +02:00
Allan Sandfeld Jensen
8bd48a1c33 Fix crash in optimized solid fills on RGBA64PM
Was expecting destStore64 to be non-null.

Change-Id: I4fc827256630a35e0669d405c04f9b5b7e71580e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-08-14 10:57:13 +02:00
Milla Pohjanheimo
b5677bc6da Add binary compatibility files for Qt5.13.0 for QtBase
Binary compatibility files added.

Change-Id: If013647f17ade6a51e9f8678252b373d8f51d010
Reviewed-by: David Faure <david.faure@kdab.com>
2019-08-14 10:29:38 +03:00
Friedemann Kleint
ecb6327762 QTestLib: Introduce initMain() to run in main before qApp exists
When running Qt autotests on a developer machine with a high
resolution, failures occur due to either some widget becoming too
small, some rounding fuzz appearing when Qt High DPI scaling is active,
or some test taking screenshots failing to deal with device pixel
ratios != 1 in the obtained pixmaps.

It is not feasible to adapt all tests to pass on high resolution
monitors in both modes (Qt High DPI scaling enabled/disabled). It
should be possible to specify the High DPI setting per test.

Previously, it was not possible to set the Qt High DPI scaling
attributes since they must be applied before QApplication
instantiation.

Enable this by checking for the presence of a static void initMain()
function on the test object and invoking it before QApplication
instantiation.

Prototypically use it in tst_qtimer and to turn off High DPI scaling for
tst_QGL.

[ChangeLog][QtTestLib] It is now possible to perform static
initialization before QApplication instantiation by implementing a
initMain() function in the test class.

Change-Id: Idec0134b189710a14c41a451fa8445bc0c5b1cf3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-13 19:07:05 +02:00
Christian Ehrlicher
de26ea6a7f QTree/TableView: allow to reset the sort order to natural sorting
QTreeView allowed to set the sort column to -1 which shows the data in
it's natural order (when the model supports it). This functionality was
removed during the porting away from the deprecated sortByColumn(int)
functionality done in d0f909f8db
Readd the functionality and also allow it for QTableView.

Fixes: QTBUG-77419
Change-Id: I96b0c09ab9da36ca0a9de58fe0f37e2c56b1d51b
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: David Faure <david.faure@kdab.com>
2019-08-13 18:22:14 +02:00
Vitaly Fanaskov
e8c7124768 Introduce QSignalSpy constructor allows to spy on a meta method
This functionality is especially convenient if meta-object system is
heavily used in a test. For example, if you need to test a bunch of
signals based on their names and/or argument types.

Change-Id: I09a4ecbbd3d0859b5fd466d9dde7679804eb7614
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-13 17:26:18 +02:00
Allan Sandfeld Jensen
c29a136804 Fix tst_QImageReader::saveColorSpace
After comparing colorspaces was remove from QImage equality, the test
was no longer testing what it was supposed to.

Change-Id: Ie7ee8ac2f488ea4254086cbb91a2662dc729e80b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-08-13 17:26:15 +02:00
Marc Mutz
19b52e7c1d tst_QFormLayout: use QAutoPointer to simplify test and avoid leak
... in case of a test failure. QAutoPointer is private API, but here we can use it.

Change-Id: I45b734385cd13fdea95d0100f2d8152f969612f9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-08-13 17:26:11 +02:00
Liang Qi
275ad4ce4c Merge "Merge remote-tracking branch 'origin/5.13' into dev" 2019-08-13 10:20:13 +02:00
Liang Qi
1dade1bd8a Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	mkspecs/win32-clang-msvc/qmake.conf
	src/corelib/tools/qlist.h
	src/gui/painting/qcompositionfunctions.cpp
	src/gui/painting/qtriangulator_p.h
	src/gui/text/qfontengine_p.h
	src/network/kernel/qhostinfo_p.h
	src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp

Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io>
Change-Id: Ib8a0308cf77224c4fbdcf56778fdac4a43e37798
2019-08-13 09:46:17 +02:00
Joerg Bornemann
42d32e468a Determine dependencies of Windows resource files
Windows resource files support a subset of C preprocessor directives.
Among others they can have #include directives.

Use QMake's own scanner to retrieve the files that are included by a
Windows resource file and add them to its dependencies.

For the test case the TestCompiler class had to be extended:
runCommand is now public, and commandOutput is less peculiar.

Fixes: QTBUG-3859
Change-Id: I138703352c37c98297c0574a9a440510c1c494b8
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-13 09:38:46 +02:00
Lars Knoll
00076a2695 Don't insert items into the wrong row
This happened to work by chance, as QList::insert() would
gracefully handle out of bounds insertions.

Change-Id: I7ee1e645ed9a538946a509957ce5155641ffea1d
Reviewed-by: David Faure <david.faure@kdab.com>
2019-08-13 07:34:00 +01:00
Thiago Macieira
7922cd5272 QChar: add FormFeed (FF) special character
[ChangeLog][QtCore][QChar] Added FormFeed (FF) special character.

Fixes: QTBUG-77089
Change-Id: I1024ee42da0c4323953afffd15b245a508f545f0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-12 22:06:39 -07:00
Allan Sandfeld Jensen
d45908e242 Support missing white-space:pre-line CSS
A mode that only preserves new lines.

Change-Id: I612347b181c6e6c41dfae0cf60b22a662cba1b7e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-08-12 17:24:05 +01:00
Kyle Edwards
63d9cd17d0 CMake: Add support for auto-importing plugins in CMake
This commit adds transitive dependencies to the plugins, so that a
sane set of default plugins get auto-imported when linking against a
module. It also provides a new function, qt5_import_plugins(), which
allows you to override the set of plugins that get imported. The decision
of whether or not to import a specific plugin is based on several custom
target properties and a very clever generator expression.

Note that this change only imports plugins on static Qt builds. It
does nothing on shared Qt builds, as the shared libraries already have
their own plugin import mechanism.

[ChangeLog][CMake] Added ability to auto-import non-qml plugins on
CMake builds

Task-number: QTBUG-38913
Task-number: QTBUG-76562
Change-Id: I2d6c8908b521cf6ba1ebbbc33a87cb7ddd9935cf
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-12 18:23:58 +02:00
Liang Qi
44c393f9b6 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	config.tests/arch/write_info.pri
		Repair architecture config test for the WASM_OBJECT_FILES=1 build mode
	configure.pri
	tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp

Done-With: Jörg Bornemann <joerg.bornemann@qt.io>
Change-Id: I9e12088356eb5bc65b53211cd7a8e330cccd1bb4
2019-08-12 13:23:11 +02:00
Morten Johan Sørvig
fcc5323a08 Make test less dependent on moving the cursor
The sendMouseMove() function calls QTest::mouseMove(),
which again calls QCursor::setPos() to move the cursor.
It then creates and sends a MouseMove event, using
the constructor which picks up the global position
by calling QCursor::pos().

On macOS 10.14, QCursor::setPos() may silently fail
if the user does not grant the application permission
to move the cursor (via a dialog). As result of this
the mouse move event gets an incorrect global position.

Provide the global position directly when creating
the event to make sure it gets the correct value.

Task-number: QTBUG-75786
Change-Id: I3e8df450fea802783a3d1dbe471753f502b42de3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-08-11 12:01:54 +02:00
Morten Johan Sørvig
9bcbba36c7 QWizard: Account for missing background image on macOS 10.14+
We were loading “Background.png” from the KeyboardSetupAssistant
app bundle. As of macOS 10.14 that image is no longer
there.

Adjust auto tests and document the behavior.

Change-Id: Icb4dd73b3fa88927e87bb86db2bc9f7b4a8094f7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-11 10:01:46 +00:00
Morten Johan Sørvig
5d7f113320 Add nullptr guard to QHighDScaling::scaleAndOrigin(QPlatformScreen *)
Commit b6ded193 added an unconditional dereference
of the platformScreen pointer, for calls where nativePostion
is non-nullptr.

Change-Id: I4a6fbbd0337f91d4fcb76c17b4dc60e1b9ad10ed
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-11 12:01:26 +02:00
Marc Mutz
c58ca4256d Deprecate QStringViewLiteral
As a macro, we can't directly deprecate it, but need to make it call
something deprecated. That is a new ctor with a new enum type
added. The type might be useful for other such ventures, so put it
into qglobal.h

Remove the QT_NO_UNICODE_LITERAL protection, as it's always false
these days, and QT_UNICODE_LITERAL is unconditionally #defined a 20
lines above.

[ChangeLog][QtCore][QStringView] Deprecated the (undocumented)
QStringViewLiteral macro. Just use u"" or QStringView(u"") instead.

Change-Id: I9141320225037e1bc6b7f920bf01a9d0144fdac2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-10 22:13:49 +02:00
Volker Hilsheimer
b7d073e990 Refactor memory allocation for arguments of QMetaCallEvents
There are two cases:

In a BlockingQueuedConnection, QMetaCallEvent doesn't allocate memory
and instead passes already existing pointers through. A QSemaphore
is used to serialize data access between threads. So the constructor
taking a QSemaphore can be simplified to only accept an existing arg
array.

In a QueuedConnection, QMetaCallEvent needs to make deep copies of
the arguments, and memory needs to be allocated based on the number
of arguments. The previous code put the burden of memory allocation
on the code generating the event, while the memory was free'd by
~QMetaCallEvent. Instead, make it QMetaCallEvent's responsibility
to allocate and free the memory as needed, and adjust the code
generating QMetaCallEvents.

We can allocate the memory for types and pointers to arguments in a
single block, starting with the space for the array of void*, followed
by the space for the array of integers to avoid byte alignment issues.
By pre-allocating the space that's needed by three arguments, we can
avoid all mallocs for the majority of QMetaCallEvents.

Until this change has propagated through qt5.git, we need to keep the
old API that is still used by QtDeclarative around. Once QtDeclarative
has migrated to the new API, it can be removed.

Change-Id: Id7359ffc14897237ea9672dabae9ef199a821907
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-10 22:04:11 +02:00
Joerg Bornemann
e75aed1a96 Warn about conflicting DESTDIR/TARGET combination in debug_and_release
If a project has DESTDIR and TARGET set to fixed values, then the
target paths conflict when doing debug_and_release builds.

With this change we're detecting this situation and yield a warning.

Fixes: QTBUG-2736
Change-Id: Ib163db3463322792ab9fa5b997285ac9fc9819ab
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-08-09 10:29:28 +02:00
Joerg Bornemann
38cfd3a8cb tst_qmake: Pass /nologo to jom like we do for nmake
Change-Id: Id9b2ac4dd7d591d471d3e21e8d78d4915620a2c1
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-08-09 10:29:03 +02:00
Nils Jeisecke
9c891bead8 QTextDocument: add manual test for table border logic
This adds a manual test for the QTextTable border logic.

Two HTML files are bundled as resources:

table-border-test.html: Contains various test cases for the border
logic.

table-border-test-header.html: Contains a test case for printing a table
with a repeated header.

The test application allows:
- editing
- previewing
- printing
- opening the HTML in the system browser (via temp. file)

It is possible to edit the HTML with "live preview" so new test cases
can easily be implemented.

Change-Id: Ic88488bc8b7dd74d5c03c3363f55840423462325
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-08-09 07:21:25 +00:00
Thiago Macieira
6ce9404a6e QBitArray: fix fromBits() and actually test it
When I initially added it, it was ony for QCborValue, but I never added
the tests. Turns out there were two bugs:

[ChangeLog][QtCore][QBitArray] Fixed two bugs that caused QBitArrays
created using fromBits() not to compare equal to the equivalent
QBitArray created using other methods if the size was zero or not a
multiple of 4. If the size modulus 8 was 5, 6, or 7, the data was
actually incorrect.

Fixes: QTBUG-77285
Change-Id: Ife213d861bb14c1787e1fffd15b70573d162042c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-08-08 20:27:04 -07:00
Heikki Halmet
c76b86aec6 BLACKLIST contains_QPointF for msvc-2019
Task-number: QTBUG-77312
Change-Id: I5197d160d9b3c70b538c2e5a43c31120e1bed5f0
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2019-08-08 15:20:23 +03:00
Ville Voutilainen
ca20b44959 A GCC 4.8 build fix
Change-Id: Ic128486711118e1124739e8dca30547ab8ba9816
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-08 10:53:53 +03:00
Eskil Abrahamsen Blomfeldt
79e0effead Fix crash in QTextDocument::clearUndoRedoStacks()
When calling QTextDocument::clearUndoRedoStacks() with UndoStack,
there were two bugs: The first was that we were retrieving
the item at "undoState" and deleting this. This is actually the
upper limit of the for loop. If the stack does not contain any
redos, then it would be == undoStack.size() and we would assert.

If there were redos, then we would delete the item at undoState
multiple times (actually undoState times).

In addition, when the loop exited, we first removed the dangling
pointers using remove() and then there was a weird resize() to
the new size minus the old undoState.

This would either assert because we tried to resize to a negative
number, or it would arbitrarily remove items from the stack.

[ChangeLog][QtGui][Text] Fixed a crash bug in
QTextDocument::clearUndoRedoStacks(QTextDocument::UndoStack).

Task-number: QTBUG-69546
Change-Id: I8a93e828ec27970763a2756071fa0b01678d2dcd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2019-08-08 07:07:20 +02:00
Qt Forward Merge Bot
2b38408cbc Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I4c0fd501db974fb8339944b8df845336776d80a9
2019-08-08 01:00:08 +02:00
Marc Mutz
5f1f0fe0b7 QDateTimePrivate: inherit QSharedData and other cleanups
Don't manage the ref-count yourself, as this requires the code to use
the QAtomic copy ctor, which we want to remove going forward. Using
QSharedData, we can let the compiler write the code for us.

Since 'ref' this way moves to the first spot in the list of effective
members, creating a 4B hole between itself and 'msecs', swap 'status'
and 'msecs' to fill the hole:

  offset:   0       8      16      24
            |       |       |       |
  without   v       v       v       v
  adj.mnt: |*R*|   | msecs | S | U | TZ....
  before:  | msecs | S | U |*R*|   | TZ...
  after:   |*R*| S | msecs | U |   | TZ....

This keeps the padding out of the critical first word, which improves
latency. That said, for accessing the members the old layout surely was
optimal. This layout optimizes copies and pessimizes access to 'msecs'
on 32-bit platforms without the Critical Word First optimization.

Requires adjustments to tst_toolsupport and the qhooks version.

Also default members using NSDMI, consequently drop the manual default
ctor.

Change-Id: I3c48e68694ad29b28a13aa47ea0f283fae52edd7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-08-07 20:09:13 +00:00
Marc Mutz
1563c38a4b QPoint/F: add transposed()
For symmetry with QSize and QRect and because there were some users in Qt.

Port those users.

[ChangeLog][QtCore][QPoint/QPointF] Added transposed().

Change-Id: If4f23dbcf7d67983a6b1885e0d1d538115b49e2b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-08-07 23:09:06 +03:00
Marc Mutz
247ab241c7 QVector/QList/QLinkedList/QVarLengthArray/QSet: add missing deduction guides
Amends 2e1763d83a.

The new range ctors need deduction guides, since the compiler can't
deduce the value_type from a pair of iterators.

Change-Id: I3ec1e5f91305b317c443b6a70246be416b55bad9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-08-07 23:09:03 +03:00
Kyle Edwards
bf99c4bf55 CMake: Fix some failing cmake tests
Change-Id: I74f2bf270726feba8367ea222a3c669110c99e08
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-07 22:08:59 +02:00
Timur Pocheptsov
36cc171b93 tst_http2::connectToHost - fix flakiness
some assumptions were incorrect: our test server immediately sends
its SETTINGS frame, as a result we have to reply with client preface +
SETTINGS(ACK). So QVERIFY(!prefaceOK) was wrong from the beginning and
was only passing by pure luck.

Change-Id: Ie43f0d4ac41deb0e5339badaae6149a9b2f9d9b3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-07 18:57:31 +02:00
Ville Voutilainen
4f116f00fc Fix GCC 4.8 build
Change-Id: I4994146b359e8e37f6c0fa1b27f03fb9e800fdd5
Fixes: QTBUG-77218
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-05 15:50:42 +03:00
Sona Kurazyan
19a9d3517b Remove the unused includes for QSignalMapper
Change-Id: I13f19fadc7ad3fed8eb0a6718244cc8880e91be9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-05 10:15:57 +02:00
Liang Qi
f3b28e8021 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	qmake/generators/unix/unixmake2.cpp
	src/plugins/platforms/cocoa/qcocoawindow.mm

Change-Id: Iba7aa7324f35543e0297a3680956420058cd3630
2019-08-05 09:28:48 +02:00
Allan Sandfeld Jensen
05251bca1d Add an easier way to change colorspaces
Adds setters for transfer-functions and primaries.

This allows us to remove use of private QColorSpace API from the PNG
handler.

Change-Id: Ieeff81c813c253649500acd1e53f35247b872325
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-08-02 21:07:54 +02:00
Allan Sandfeld Jensen
76c097c4d7 Improve our color space terminology
Replace our use of 'gamut' with 'primaries'. One is the axes of the
color space, the other the volume of representable values. For the
currently supported color spaces those are mostly equivalent, but when
we later add support for scRgb, this would be misleading as it has the
same primaries as sRGB but a much wider gamut, and we would like to use
the same primaries/"gamut" id for it.

Also few people would know what "the sRGB gamut" is, but
"the sRGB primaries" is easily googable.

Change-Id: I3348ccaae27a071ec77a4356331b9bbbf92e0d19
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-08-02 09:44:55 +02:00
Sona Kurazyan
376715f1a5 Remove usages of deprecated APIs of qtbase/widgets
- Replace the usages of deprecated APIs by corresponding
  alternatives in the library code and documentation.

- Build docs for deprecated APIs conditionally, based on deprecation
  version. Remove the docs of methods deprecated since 5.0.0, these
  methods are not compiled anymore.

- Modify the tests to make them build when deprecated APIs disabled:
    * Make the the parts of the tests testing the deprecated APIs to
      be compiled conditionally, only when the corresponding methods
      are enabled.
    * If the test-case tests only the deprecated API, but not the
      corresponding replacement, add tests for the replacement

Task-number: QTBUG-76491
Task-number: QTBUG-76540
Task-number: QTBUG-76541
Change-Id: I6aaf0a1369c479fb880369a38f2b8e1e86b46934
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-01 17:04:13 +00:00
Sona Kurazyan
bd2c8353b4 Improve the keypadnavigation manual test
- No need to use QSignalMapper here, replace its uses with lambdas.
- Replace index 'for' loop with iterator loop, to simplify the code.

Change-Id: Ide3d2db99a074c0233eb5c2fd7a9b217d804973f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-01 19:03:42 +02:00
Timur Pocheptsov
ec62033bc2 tst_http2::connectToHost - add a fix for SecureTransport backend
One of the tests above was unsetting a variable that enforces
the use of a temporary keychain. We have to set it back, otherwise
the test is failing. What surprises me though - why I had this
problem only locally and not on CI? Apparently, SecureTransport
is not covered by our configurations ...

Change-Id: I0ff1e3e304632869391ed61213c245b949d8c778
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-01 17:37:53 +02:00
Timur Pocheptsov
bd8ef7fe24 Blacklist tst_http2::connectToHost
Test if flakey.

Change-Id: I1f956f47ab4cf0602f3631e4f7908df35f5ce83f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-01 13:18:02 +00:00
Marc Mutz
4726f47b41 Port users of get{Contents,Text}Margins() missed first time around
Done-with: Sona Kurazyan <sona.kurazyan@qt.io>
Change-Id: I5b584cbe468429c53c2d661a0d7957d74e7ad691
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-01 12:55:07 +00:00
Sona Kurazyan
10845315b7 Conditionally disable parts of the tests testing the deprecated APIs
Somehow missed these during my first iteration.

Change-Id: Iaef0ab84d9320a98f49ec071c93cd6f2907d92c3
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2019-08-01 13:51:18 +02:00
Friedemann Kleint
174061f9f3 QHighDPI: Fix broken scaling of QPoint(F)
For some reason, the overload resolution of the
High DPI scale() functions introduced by
b6ded193ee chose the
wrong overloads for QPointF and/or QPoint; it fell
back to the generic template intended for qreal,
QSize, etc, ignoring the origin. Remove the
template and spell out all overloads.

Fixes: QTBUG-77255
Change-Id: I5661f16f7326f65156f646f430f5a0c71d5302d2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-01 13:20:23 +02:00
Sona Kurazyan
d914a5ba4e Remove the remaining usages of deprecated APIs of qtbase
This change removes the leftovers form other cleanup commits.

Task-number: QTBUG-76491
Change-Id: I61440f87c5a280f9666b78e19aac4d8ac603767e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2019-08-01 06:48:27 +02:00
Marc Mutz
a2c18fd10c tst_QMenu: Eradicate Q_FOREACH loops
In two cases, we now detach. ¯\_(ツ)_/¯  This is test code.

Change-Id: I244f5e20dd923281049f38b76366163c16b6498c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-08-01 07:46:36 +03:00
Qt Forward Merge Bot
5ee1c86d10 Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I4505ec6fe17a1aa2c8d1e6576234d06a34eb9f99
2019-08-01 01:00:10 +02:00
Allan Sandfeld Jensen
dcc4d54fc9 Parse color space name from ICC profile
Adds parsing of ICCv2 and ICCv4 description tags.

Change-Id: I8647e1529d4127950624f16c475d8dba610149b6
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-07-31 21:47:17 +02:00
Allan Sandfeld Jensen
a2c1109152 Harden ICC parser
Add missing implicit size checks of tags by passing the already checked
explicitly given size forward.

Also adds my fuzzing test for the ICC parser as it is security critical,
by being used by multiple image formats.

Change-Id: Ieb632ccb78f9b445a276959ffbd66fa04a7a5b45
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-07-31 21:47:04 +02:00
Eirik Aavitsland
697910e5fb Fix assert in QPainterPath after clear()
The newly introduced clear() method left the path in an undefined
state: d_ptr allocated, but no elements. The elements vector is
otherwise never empty, since ensureData() inserts a dummy initial
moveTo element.

Fix by making sure that clear() leaves the path in the same state as
ensureData() (i.e. "empty" but not "null"), except possibly more
capacity allocated in the elements vector.

Fixes: QTBUG-76534
Change-Id: I7ad8b312913f5eb6e22023f5d2fd873e54b1e23c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-07-31 12:05:54 +02:00
Laszlo Agocs
3f201f988f rhi: Fix clear value in offscreen test
Leftover from the migration to QColor as color clear value.

Change-Id: Ibf49d65234a1e14d53035b46249753a5929ca22b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-07-31 09:04:49 +02:00
Laszlo Agocs
493ce2f3d4 rhi: gl: Add support for compute
...and storage buffers and images.

Change-Id: If38a51322e3187088a13cf4e9b88cb40c8af8621
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-07-31 09:04:45 +02:00
Laszlo Agocs
c955426945 rhi: metal: Do not hold on to the drawable when not presenting
The Quick render loops do SkipPresent occasionally, and it all seemed
to work with the threaded one because we lack an autorelease pool on
the SG render thread. (to be corrected separately) The basic one ended
up crashing sometimes, however. Holding on to the drawable is incorrect.

Fixes: QTBUG-76953
Change-Id: I0d0ec6d09aa209d2c848d7a9dbd9b15916fe23ab
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-07-31 09:04:41 +02:00
Liang Qi
4aec85b6bb Merge "Merge remote-tracking branch 'origin/5.13' into dev" 2019-07-30 21:41:23 +02:00
Liang Qi
71ec1d6d79 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	qmake/generators/win32/mingw_make.cpp

Change-Id: I2f790bc8572bd22fea01edf7ca74595b29f063eb
2019-07-30 13:47:36 +02:00
Heikki Halmet
305f2c3aa6 BLACKLIST insert_remove_loop for msvc-2019
Task-number: QTBUG-77239
Change-Id: Ie1a08db0b4c4e1bbcb7981f24bcf12d5e6d33e48
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2019-07-30 14:11:02 +03:00
Simon Hausmann
31ffc7bf2a Fix removal of QJsonObject properties when assigning undefined
Commit 8010e906d3 accidentally ended up
removing the removal-on-undefined-insertion check by calling insertAt
instead of insert, which had it. This patch moves the check back into
setValueAt.

Change-Id: Ic381e284d3da37e31c4eb29f79dfab9c55c2e3e9
Fixes: QTBUG-77204
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-07-30 11:08:24 +02:00
hjk
4fa0b41523 uic: Avoid use of Q_UNUSED in the generated code
Instead, use (void)x; directly.

The current use of Q_UNUSED(x); generates warnings for an
empty statement the expansion of Q_UNUSED contains a semicolon
already.

Emitting Q_UNUSED(x) without the extra semicolon would be
an option, too, but as the future of Q_UNUSED's embedded
semicolon seems unclear right now, avoid its use altogether.

The change affects only generated code that's barely ever
read by a human, so the overall utility of "improved readability"
of Q_UNUSED in that place is questionable anyway.

Change-Id: I332527ed7c202f779bd82290517837e3ecf09a08
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2019-07-30 09:34:36 +02:00
Samuel Gaist
889b1c4b28 test: migrate QSqlDatabase test to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: Id82e103d4076fed63c871385b2b0f21c04735d00
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-07-29 20:01:24 +02:00
David Faure
3e7463411e Fix crash when the focus widget gets a focus proxy after the fact
QApplicationPrivate::focus_widget became a dangling pointer
in the following scenario:

A widget first gets focus and later on gets a focus proxy.
QApplicationPrivate::focus_widget was still pointing to the initial widget.
Upon destruction, QWidget::hasFocus() [which follows to the focus proxy
and then compares with focus_widget] was therefore false for both
widgets. So QWidget::clearFocus() didn't call
QApplicationPrivate::setFocusWidget(0) for either of them. As a
result, focus_widget remained set, and became dangling.

In real life, this happened with a QWebEngineView, which the application
gave focus to upon creation. At that time it doesn't have a focus proxy
yet. That happens later, in QWebEngineViewPrivate::widgetChanged.

https://bugs.kde.org/show_bug.cgi?id=381793

Change-Id: Ifee610bb76a2d4d2797b98ece9bffe5fffe3c6a6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-29 17:15:02 +02:00
Qt Forward Merge Bot
f53fc76060 Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" 2019-07-29 15:33:37 +02:00
Eirik Aavitsland
ac885a34ec Revert "Fix comparisons of image with different color spaces"
QImage comparison has always ignored differences in
metadata. Introducing colorspace comparison can break backwards
compatibility, as not all image formats or handlers have colorspace
capability.

This partially reverts commit
733ca2230c.

Fixes: QTBUG-77205
Change-Id: I1d525a9727e84502624cd118f503eec7be306c99
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-07-29 12:45:16 +00:00
Qt Forward Merge Bot
154155f588 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/corelib/io/qresource.cpp

Change-Id: I54917f72444a621bd08aeaa15f5d17415993144d
2019-07-29 11:56:00 +02:00
Marc Mutz
adab531771 Port from QStringViewLiteral to u""
Now that all our supported compilers know char16_t, we no longer need
QStringViewLiteral, whose only purpose in life was to turn u"" into
L"" for MSVC < 2015.

Change-Id: I25a094fe7992d9d5dbeb4a524d9e99e043dcb8ce
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-29 11:17:28 +03:00
Volker Hilsheimer
fe8cd567dd Add IPv6 data to the reverseLookup test
Passes locally, and there is no reason why it shoulnd't. Use IPv6
addresses for Google and Cloudflare DNS servers, and as with the IPv4
tests, rely on Python and (as a fallback) nslookup to produce the
reference.

Change-Id: I584f8ae9bc89c66a1f59d7b1e7493d0ed8033e8a
Fixes: QTBUG-22287
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-07-29 09:35:30 +02:00
Friedemann Kleint
82d24b4388 QFileSystemModel: Remove model member variable from test
The test instantiated and deleted a model in each test which is
wasteful since not all tests use it. Remove it and introduce per-test
variables instead.

Task-number: QTBUG-76493
Change-Id: I1684ea5b8eac7b52bb99e830f723693c51e8b9a5
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-07-27 10:54:28 +02:00
Qt Forward Merge Bot
f9b8c544e6 Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: Ic6cfe08dbda1dc92b969e67063f805df63ba0fcf
2019-07-27 01:00:37 +02:00
Volker Hilsheimer
e24a4976be QHostInfo: Always post results through the event loop to the receiver
Lookups performed via QHostInfoRunnable must not synchronously call
the user-code's receiver objects, as that would execute user-code in
the wrong thread. Instead, post a metacall event through the event
loop of the receiver object, or the thread that initiated the lookup.

This was done correctly for the trivial cases of empty host name or
cached results, so the code generally existed. By moving it from a
global function into a member function of QHostInfoResult, we can
simply access the required data to construct and post the event.

As we process that posted event, we need to check that the context
object (which is already guarded via QPointer) is still alive, if
we had one in the first place. If we had one, and it's deleted, then
abort.

[ChangeLog][QtNetwork][QHostInfo] Functors used in the lookupHost
overloads are now called correctly in the thread of the context object.
When used without context object, the thread that initiates the lookup
will run the functor, and is required to run an event loop.

Change-Id: I9b38d4f9a23cfc4d9e07bc72de2d2cefe5d0d033
Fixes: QTBUG-76276
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-07-26 17:59:47 +02:00
Friedemann Kleint
84a58e514b QFileSystemModel: Brush up the test
- Use nullptr
- Instantiate test helpers on the stack or use QScopedPointer
- Remove C-style casts of enumerations/flags, use meta types
- Port to Qt 5 connection syntax
- Fix static method invocation
- Use initializer lists for QStringList
- Introduce a logging category for all debug output
- Streamline code
- Refactor cleanup() to operate on QFileInfoList which is faster
  and streamline
- Remove unused variables

Task-number: QTBUG-76493
Change-Id: I3a033af7c9ec4dac3149d2016104daad07797a4f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-07-26 12:01:57 +02:00
Liang Qi
bf08e0bbb2 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/network/access/qhttpthreaddelegate.cpp

Change-Id: Id47b977587e2d713c16ac17e63c5ec80c2f05ee9
2019-07-26 10:13:06 +02:00
Timur Pocheptsov
e4c1feae5c Implement 'preconnect-https' and 'preconnect-http' for H2
QNetworkAccessManager::connectToHostEncrypted()/connectToHost()
creates 'fake' requests with pseudo-schemes 'preconnect-https'/
'preconnect-http'. QHttp2ProtocolHandler should handle this
requests in a special way - reporting them immediately as
finished (so that QNAM emits finished as it does in case of
HTTP/1.1) and not trying to send anything.
We also have to properly cache the connection - 'https' or
'http' scheme is too generic - it allows (unfortunately)
mixing H2/HTTP/1.1 in a single connection in case an attribute
was missing on a request, which is wrong.
h2c is more complicated, since it needs a real request
to negotiate the protocol switch to H2, with the current
QNetworkHttpConnection(Channel)'s design it's not possible
without large changes (aka regressions and new bugs introduced).

Auto-test extended.

Fixes: QTBUG-77082
Change-Id: I03467673a620c89784c2d36521020dc9d08aced7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-07-24 16:03:02 +02:00
Marc Mutz
ca5fc087bd Re-apply 'Skip old benchmark that doesn't build automatically'
This commit re-applies commit f8efe8e0c9,
which was lost in the recent tools → text changes.

Change-Id: I03ce35fcb89840e5607776d67578fb75b66f6eb2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-07-24 07:45:59 +03:00
Allan Sandfeld Jensen
83de6d0ce5 Add support for saving colorspace to PNGs
Also fixes interaction with QImageReader gamma correction

Change-Id: I108f253697f7ff60be6940bca17faa9f9ceb577b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-07-23 23:37:45 +02:00
Allan Sandfeld Jensen
733ca2230c Fix comparisons of image with different color spaces
Take color space into account when comparing images, and fix gamma
comparison that was trying to be too accurate.

Change-Id: I3674653abb21b66aaacb557addc4afb4ee75cfdd
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-07-23 23:37:37 +02:00
Sona Kurazyan
b6f7efba48 Make sql tests build and pass with disabled deprecated APIs
Deprecated APIs of sql lib are used only in tests. This change
makes sure, that the tests build and pass with those deprecated APIs
removed or disabled, by:

- Making the parts of the tests testing the deprecated APIs to be
  compiled conditionally, only when the corresponding methods are
  enabled.

- If the test-case tests only the deprecated API, but not the
  corresponding replacement, added tests for the replacement.

Task-number: QTBUG-76541
Change-Id: I93ed6ff92c7aa7af2c106b1a9d92d3704c7d9105
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2019-07-23 20:48:44 +02:00
Sona Kurazyan
19f72c17c0 Make network tests build and pass with disabled deprecated APIs
Deprecated APIs of network lib are used only in tests. This change
makes sure, that the tests build and pass with those deprecated APIs
removed or disabled, by:

- Making the parts of the tests testing the deprecated APIs to be
  compiled conditionally, only when the corresponding methods are
  enabled.

- If the test-case tests only the deprecated API, but not the
  corresponding replacement, added tests for the replacement.

Task-number: QTBUG-76541
Change-Id: I78c4913155007fd1d0df2c38e1b9a8b80066adeb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-07-23 18:48:17 +00:00
Allan Sandfeld Jensen
181e96cae2 Remove public d_func from QColorSpace
Replaced with getter in private.

Change-Id: I968eb45052a80b45750213cf6a0c08b5973dfc4d
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-07-23 19:07:56 +02:00
Allan Sandfeld Jensen
c21cc647e9 Fix lancebench results oddness
Imports were expanded in the list of commands every time they were
evaluated. This meant any test with imports ran slower and slower the
more iterations it got through.

Fixed by creating a new PaintCommands object every time and living with
initialization of it being part of the benchmark results.

Change-Id: Ib53a3a25f1393437452bc5aede04ccb63e8715a6
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-07-23 11:47:51 +00:00
Liang Qi
261a87f956 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	qmake/generators/makefile.cpp

Change-Id: Ib3715e626f2fd32804c75c16ea9aa06a1216e76d
2019-07-22 06:50:42 +02:00