Commit Graph

10058 Commits

Author SHA1 Message Date
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
Mat Sutcliffe
0652bdcf5e QJsonObject: add QLatin1String overloads of non-const methods
Also optimized the existing QL1S overload of non-const operator[](), and
applied Extract Method refactoring to the other existing QL1S overloads.

[ChangeLog][QtCore][QJsonObject] Added insert(), remove(), and take()
overloads taking QLatin1String.

Change-Id: I5e737cf2d7d9ffb325d6981db1e4a6a9f093657b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
2019-07-20 12:04:48 +01:00
Mat Sutcliffe
7f8e3aab2d JSON: add some QStringView overloads
[ChangeLog][QtCore][JSON] Added overloads of functions taking key
strings as QStringView; in QJsonObject, QJsonValue and QJsonDocument.

Change-Id: I78b40aba8200003acfae257ff06f5f15737005e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
2019-07-20 12:04:31 +01:00
Qt Forward Merge Bot
124b5b8108 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ic34021fbb87d689ee23a5d1b3f50617ada9ec9b9
2019-07-20 01:00:13 +02:00
Thiago Macieira
65f9646583 Fix QCborStreamReader not flushing QIODevices due to internal buffering
When successfully finishing a parse, it's reasonable to expect that the
QIODevice was advanced to the end of the input data.

[ChangeLog][QtCore][QCborStreamReader] Fixed a bug that caused the
QIODevice that the data was being read from not to show the entire CBOR
message as consumed. This allows the user to consume data that may
follow the CBOR payload.

Fixes: QTBUG-77076
Change-Id: I1024ee42da0c4323953afffd15b23f5d8fcc6f50
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-07-19 12:31:42 -07:00
Qt Forward Merge Bot
8f0790dd90 Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I999ba23a27cd897017d15c6ffe41ea8cd008ffb9
2019-07-19 01:00:41 +02:00
Eirik Aavitsland
82aabafada Fix loading of image files with wrong, but known, file name extension
If QImageReader recognized the suffix of a file, it would by default
not check if the file contents matched the claimed format. Hence, a
valid but misnamed image file would fail to load.
Fix by adding contents check for suffix-recognized files.

[ChangeLog][QtGui][Image] Loading of image files having a file name
suffix for a different image file type has been fixed. QImageReader
will now ask the suffix format handler to confirm the file contents
(canRead()), and fall back to normal file content recognition on
failure. This implies a slight behavior change in
QImageReader::loopCount(), ::imageCount() and ::nextImageDelay(): For
an unreadable file with a recognized suffix, they would earlier return
0, while they now will return -1, i.e. error as per the documentation.

Fixes: QTBUG-42540
Fixes: QTBUG-68787
Change-Id: I205e83f29ed7190cbcae95dab960232544d012f6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-07-18 16:05:57 +02:00
Mårten Nordheim
d35aedc125 tst_qnetworkreply: Use object.connect() to get rid of warning
warning C4573: the usage of 'tst_QNetworkReply::connect' requires the
compiler to capture 'this' but the current default capture mode does not
allow it

Change-Id: Ic9fd526fedf7c52e53e2b1136834c10bf4cd0ea9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-07-18 12:30:02 +02:00
Mårten Nordheim
e0ea987994 tst_qnetworkreply: skip ssl session sharing tests with schannel
It's not implemented

Change-Id: I56abb0a5fe0e6d5c2f5f678adadafed395456902
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-07-18 12:28:12 +02:00
Timur Pocheptsov
334f09b585 tst_http2 - make the test less rough in general
1. Use per-case QNAM objects
2. In a slots (connected to QNetworkReplies) - if an error detected - stop
   the event loop (no reason to continue waiting) and then do normal
   QVERIFY/QCOMPARE things.
3. In tests, check QTest::currentTestFailed after the event loop returned -
   if an error was detected by a slot, no need to continue with QCOMPARE/QVERIFY
   in the test itself.

Task-number: QTBUG-77053
Change-Id: I3827a629a2749becd3dc6eee7fd6994d96441e65
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-07-18 06:18:40 +02:00
Qt Forward Merge Bot
7576250b1c Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I685000c4f33fb3707b2102fae0b58092107dc8f0
2019-07-18 01:00:08 +02:00
Volker Hilsheimer
3966b571ff QDir: strip Windows' long-path markers when converting from native
Applications might receive paths with Windows' '\\?\' markers, which
indicates a long path to Win32 APIs, when the application is opened by
explorer via file association. Qt not ignoring those markers will fail
to open such files.

By stripping the marker in QDir::fromNativeSeparators, QFile, QFileInfo
etc automatically are able to handle such paths. QDir::cleanPath is
also documented to normalize separators, so it needs to be done there
as well.

[ChangeLog][QtCore][QDir] Remove Windows specific long path markers
when handling file paths with native separators.

Change-Id: I526a890614edee8c85b39fc12c98e7ddb6e0d793
Fixes: QTBUG-75117
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-07-17 20:07:15 +02:00
Qt Forward Merge Bot
eb9c5fd4f9 Merge "Merge remote-tracking branch 'origin/5.13' into dev" 2019-07-17 11:47:20 +02:00
Qt Forward Merge Bot
64df0eda36 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/corelib/global/qlogging.cpp
	src/gui/painting/qtextureglyphcache_p.h
	src/gui/text/qfontengine.cpp
	src/widgets/widgets/qlineedit.cpp

Change-Id: Ic8798538df466b7141caa8bbf1fb7605eb56be37
2019-07-17 10:44:21 +02:00
Thiago Macieira
d80bd2f548 QResource: deprecate isCompressed()
Current codebases assume isCompressed() implies ZlibCompression, since
there was no compressionAlgorithm() getter. In order to force codebases
to change, deprecate isCompressed() and force handling of the algorithm.

The replacement API is being introduced in 5.14, which is why the
warning is being emitted in 5.15 only.

Change-Id: Ief874765cd7b43798de3fffd15a9f5d978951ea5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-07-16 22:36:27 -03:00
Thiago Macieira
9b8493314d Qt6: Fix uninitialized meta objects on Windows
Windows has a problem relating to cross-DLL variable relocations: they
are not supported. Since QMetaObject's link to the parent class is done
via a pointer, every QMetaObject in a DLL or in the EXE that derives
from a class from another DLL (such as QObject) will be dynamically
initialized.

This commit changes the meta object pointers in QMetaObject::d from raw
pointers to a wrapper class SuperData, which is almost entirely source-
compatible with the pointer itself. On all systems except for Windows
with Qt 6, it's binary compatible with the current implementation.

But for Windows with Qt 6, this commit will store both the raw pointer
and a pointer to a function that returns the QMetaObject, with one of
them non-null only. For all meta objects constructed by moc, we store
the function pointer, which allows the staticMetaObject to be statically
intialized. For dynamic meta objects (QMetaObjectBuilder, QtDBus, QtQml,
ActiveQt), we'll store the actual raw pointer.

[ChangeLog][QtCore][QMetaObject] Some internal members of the
QMetaObject class have changed types. Those members are not public API
and thus should not cause source incompatibilities.

The macro QT_NO_DATA_RELOCATION existed in Qt 4 but was called
Q_NO_DATA_RELOCATION and only applied to Symbian. It was removed in
commit 24a72c4efa ("qglobal: Remove
symbian specific features").

Task-number: QTBUG-38876
Fixes: QTBUG-69963
Change-Id: Id92f4a61915b49ddaee6fffd14ae1cf615525e92
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-16 18:34:41 -07:00
Thiago Macieira
8abbbb4c48 Fix regression causing QVector::fill w/ same size to not detach
Caused by commit 01301b0b34, which made
vector.resize(vector.size()) not to detach, which was used by fill() and
assumed that detaching happened. The test does not test the resize()
behavior, only that fill() is not broken anymore.

[ChangeLog][QtCore][QVector] Fixed a regression that caused fill() not
to detach, corrupting shared copies.

Fixes: QTBUG-77058
Change-Id: I6aed4df6a12e43c3ac8efffd15b1b527a8007bf3
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-07-16 18:09:51 -07:00
Timur Pocheptsov
7a61cb46e6 tst_http2::flowControlServerSide
fix the bloody test for good - the idea to have a shared QNAM (shared
by test cases in this test) was somewhat wrong to start with.

Fixes: QTBUG-77053
Change-Id: I5755e96ec988e2dd546f527f3f902fc43914b0b7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-07-15 16:17:16 +02:00
Marc Mutz
a7383b4b6d QNetworkRequest: make the default ctor implicit
As in QVarLengthArray (c34242c679), this will
probably bite someone someday, so fix it before there's a bug report.

Use ctor delegation to keep code size increase small.

There's also the benefit that default-constructing a QNetworkRequest now
no longer creates an expensive QUrl object just to destroy it unused again.

Add an auto-test.

Change-Id: I5ceb5402ca3946048d695244d1b1c36564a1e80a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-07-15 13:07:10 +02:00
Marc Mutz
205824103e QVarLengthArray: optimize pop_back()
Don't call realloc() with all its machinery when we know exactly what
to do: destroy the last element and decrease the size by one.

Extend the test, removing the unused Foo class for a new Tracker one.

Change-Id: I568eef4f6335669689fb16fd23af92cb4d6464bd
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2019-07-14 15:44:22 +00:00
Sona Kurazyan
2f33e030b8 Remove usages of deprecated APIs of qtbase/gui
- Replaced the usages of deprecated APIs by corresponding
  alternatives in the library code and documentation.

- Modified the tests to make them build when deprecated APIs disabled:
    * Made 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, added tests for the replacement.

Change-Id: Ic38245015377fc0c8127eb5458c184ffd4b450f1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-13 10:43:15 +02:00
Qt Forward Merge Bot
a3d1fee81b Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I5d2a4fa33b4aa22da39ac045e6b85ab940b8720b
2019-07-13 01:00:21 +02:00
Tor Arne Vestbø
7d3a55cbd2 Remove unused arguments from QWidgetPrivate::create_sys
The public QWidget::create still has them, but we don't need to
propagate them on - that just makes debugging the window creation
flow harder.

The window argument to QWidget::create is technically used to
guard an early exit in the function, but to keep behavior the
same we leave it for now.

Change-Id: Ic0287575aa25f1272e216adc1b75e34d6f55f6d9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-12 14:54:13 +00:00
Shawn Rutledge
2d2e16d3ef Fix a couple more uses of QWheelEvent constructors in tests
Change-Id: I0c9f08a243a823aff0bf21dfc14f78680e95d80f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-07-12 15:13:23 +02:00
Shawn Rutledge
7d29807296 Finish deprecating obsolete members of QWheelEvent
In Qt 5.0, delta() and orientation() were already marked obsolete,
but Widgets and tests have kept on depending on them all this time.
We now start using alternative API so they can really be deprecated.
All constructors except the newest one are also deprecated.
The plan is for all events from pointing devices to have
QPointF position() and globalPosition(), so we deprecate
the other position accessors.

[ChangeLog][QtGui] Obsolete constructors and accessors in QWheelEvent
now have proper deprecation macros.  What is left is intended to be
compatible with planned changes in Qt 6.

Change-Id: I26250dc90922b60a6ed20d7f65f38019da3e139e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-07-12 15:13:01 +02:00
Marc Mutz
0a724ac74c Introduce QT_NO_LINKED_LIST and mark QtBase (almost) free of it
QLinkedList is still used in several tests. Add exceptions for
these subdirs.

Change-Id: I50ccd2a0892129d4a47aa4e2400211690da9a82d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-12 14:26:30 +02:00
Qt Forward Merge Bot
77d126ccb5 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	configure.pri

Also required s/solid\.color/solidColor/ in a couple of places in:
	src/gui/painting/qpaintengine_raster.cpp

Change-Id: I29937f63e9779deb6dac7ae77e2948d06ebc0319
2019-07-12 12:23:29 +02:00
Marc Mutz
e936c2a9a2 tst_QObbject: Fix very annoying -Wdeprecated-copy warnings
There's like three pages of this when compiling the test :)

Change-Id: I923f2c4f5eff7c709977026666cc5b2a2cbfaa72
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-12 06:55:45 +02:00
Qt Forward Merge Bot
fd2d9de51e Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: Icaabf08f9af539ddf844d96bc9c3a2d09408ba8a
2019-07-12 01:00:42 +02:00
Friedemann Kleint
54684f10e9 QSaveFile: Fix changing the file name after hitting on readonly file
The call to QFileDevice::unsetError() in QSaveFile::open() does
not clear QSaveFilePrivate::writeError. Clear it in addition.

Fixes: QTBUG-77007
Change-Id: I5e5009750f1726d1c74c1b4eb1c33f3a5393fe4f
Reviewed-by: David Faure <david.faure@kdab.com>
2019-07-11 22:00:10 +02:00
Robert Loehning
3bee5a470a Fix typos in readme
Change-Id: Ifecb1bac475512241de9bcf195955409bb3adaff
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-07-11 14:17:08 +02:00
Volker Hilsheimer
cc32226e64 Windows: handle errors correctly when connecting to unreachable host
The previous code handled only some error codes, in a very inefficient
way, for some code paths. This change standardizes error handling using
a helper function that maps winsock WSAE* codes to Qt error codes.

The test for connecting to unreachable hosts or ports is now more
generic, and enabled on Windows, where it passes in local tests,
but dependency on network configuration still makes it fragile,
so ignoring some failures without completely skipping the test.

[ChangeLog][Network][Windows] Correctly emit errors when trying to
reach unreachable hosts or services

Change-Id: Icaca3e6fef88621d683f6d6fa3016212847de4ea
Fixes: QTBUG-42567
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-07-11 10:46:23 +02:00
Edward Welbourne
a9aa206b7b Move text-related code out of corelib/tools/ to corelib/text/
This includes byte array, string, char, unicode, locale, collation and
regular expressions.

Change-Id: I8b125fa52c8c513eb57a0f1298b91910e5a0d786
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-10 17:05:30 +02:00
Mårten Nordheim
16158e1132 Win: qdiriterator bench: fix missing null-terminator issues
It's not done by toWCharArray. This caused some issues as we were using
API requiring a null-terminator. wcslen for instance was measuring the
string as being millions of characters long, causing fairly quick
crashes when appending.

Change-Id: Iedaaf9f195be22a610543ab649da92a87cb71973
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-07-10 07:18:05 +00:00
Volker Hilsheimer
b426cff1e0 Make tst_QGraphicsItem painting tests most robust
Counting absolute paint events is fragile, as there are no guarantees
that a single call to QApp::processEvents only delivers a single paint
event to a widget. As of QTBUG-76566, we see that the items occasionally
receive three calls to paint, which can be simulated by activating other
windows while the test is running and waiting for events to be
processed.

Instead, verify that we do receive any paint events as the first test,
and then verify increments when we expect updates.

This also reverts change 24b9424adc.

Change-Id: Ib51853e918f31acd3aea10d4109c95f34012a29f
Fixes: QTBUG-76566
Reviewed-by: Dimitrios Apostolou <dimitrios.apostolou@qt.io>
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2019-07-10 06:17:09 +02:00
Volker Hilsheimer
59b29d03b2 Further stabilization of QGraphicsItem::cursor test
The QTest::mouseMove calls are not reliable, and seem to produce
flakiness, at least on WinRT. Removing them, and only depending on
handling of the synchronously delivered QMouseEVent for simulated
mouse moves.

Also, initialize the expected cursor shape from an empty scene;
this avoids that showing the view with the cursor accidentially
on an item results in the wrong default shape. Remove hard
coded coordinates, just test what we know.

Fixes: QTBUG-73545
Change-Id: I6f81d6b16bb613ec77aaa776d6a80aac739aeb58
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-10 06:16:52 +02:00
Friedemann Kleint
9c8d1ca18b QTestlib: Check compared images for device pixel ratio
When accidentally running a test doing screen-grabbing
with High DPI scaling active, sizes of the obtained pixmaps
can differ due to the device pixel ratio. Add a check to make that
clearer.

[ChangeLog][QtTestLib] Comparison of QImage, QPixmap now checks for the
device pixel ratio.

Change-Id: Id8d5187e99c565c44a7bfb8b9cfb09737815fb15
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-07-09 20:15:34 +02:00
Ryan Chu
d72ea9cbd3 Revert "QFtp: Skip the flaky QTestEventLoop::timeout in Coin network"
This reverts commit 33d2715dd3.

Reason for revert: <QTBUG-76367>

Change-Id: I134514e729d7066ab5f67a0536e653868bf15ed7
Reviewed-by: Dimitrios Apostolou <dimitrios.apostolou@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-07-09 17:40:50 +00:00
Volker Hilsheimer
d8688d4484 Don't set the mouse cursor for items that are disabled
As with widgets, items that are disabled should not receive any input
events.

Similar to QGraphicsScene, which ignores disabled items when handling
mouse presses, the view should also ignore them when handling mouse
moves to update the cursor.

Since QGraphicsView only adjusts the cursors on mouse moves, reenabling
an item that is currently under the mouse will not change the cursor.
This is consistent with other changes of item attributes that would
position the item under the mouse (such as moving it). The overhead of
hit-testing items for every such attribute change would be too large,
and applications can generate a mouse move event if they really need
to adjust the cursor in all situations.

[ChangeLog][QtWidgets][QGraphicsView] Ignore disabled items when setting
the mouse cursor.

Fixes: QTBUG-76765
Change-Id: Ifcd31fc0581e8421e58eeb436a55b031909eed7e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-07-08 20:51:22 +02:00
Volker Hilsheimer
307403f8b4 Stabilize QGraphicsItem::cursor and select_multi tests
The tests send QEvent::MouseMove events to the view, but don't fully
construct the event with both local and global position. Consequently,
QMouseEvent will use QCursor::pos as the global position, which is
unreliable, as QTest::mouseMove can not guarantee that the mouse really
moves - when running the tests locally on e.g macOS, it never does.

So instead construct the QMouseEvent with the trivially calculated
global position.

Change-Id: Ic4c914e3af7f15751545080d4743b06d3887cce8
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2019-07-08 20:51:19 +02:00
Daniel Smith
6c136973fd unblacklist passing tests
These tests have not failed on the removed platforms for at least 60 days

Task-number: QTBUG-76608
Change-Id: If7a9f4db907124e3cd54e3f4b0ad3e20717d1912
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-08 11:01:42 +00:00
Mårten Nordheim
8436fa30af Add manual test for QNetwork{Connection|Status}Monitor
Simplistic console application with one test for each of the two
classes. Simply tests that we receive the signal when the connection
is disrupted in some way.

This patch also exports the classes for tests/developer builds
so that we can actually link with them.

Change-Id: I8066312274350984110c3f3ad3e94854adca7c2a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-07-08 12:12:57 +02:00
Mårten Nordheim
682e4795fe QNetworkReply: Skip a test when QNetworkStatusMonitor is enabled
QNetworkSession has a concept of UsagePolicy which can disable
background* transfers to conserve battery or bandwidth. However, it is
only possible to change the policy through
QNetworkSessionPrivate::setUsagePolicy which currently doesn't have any
callers outside of our auto tests.

*background = transfers not initiated directly by the user, but needs
to be marked as such by the application developer.

Change-Id: I92c4abccaca040612b4795abe7c52d68a2d21749
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-07-08 12:12:39 +02:00
Shawn Rutledge
07553d0353 QTextBrowser: assume Markdown is UTF-8
That's how CommonMark specifies it.  The HTML codec-guessing algorithm
was making it fall back to Latin1 in practice, which was screwing up
any Unicode characters found in the markdown source.

Change-Id: I4021adc4a68591ecfd56ef24971af53ce3e9c96d
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-07-08 07:25:35 +02:00
Giuseppe D'Angelo
3a1f9dec7c Q_ARRAY_LITERAL: protect the check for literal types
Some compilers (hello, MSVC) do not produce literal types in Qt
because their constexpr support has been blacklisted.
Therefore, amend the check for literal types in Q_ARRAY_LITERAL:
only do the check if the compiler supports constexpr.

Change-Id: I7cffe00dde447d975aa6a7d02248df9c351508ff
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-07-06 19:07:04 +00:00
Marc Mutz
cd113d0dcb Port some trivial cases from QMutex to QRecursiveMutex
In all of these cases, the effect of the change is local to one file.

Change-Id: I3bda3aadee3b42e7797183c2330183390b92d1f2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-07-06 11:22:37 +02:00
Marc Mutz
95310aac6d Short live QRecursiveMutex!
Move the recursive mutex use case out of QMutex into a separate class,
unsurprisingly called QRecursiveMutex. As an immediate benefit, 90% of
the QMutex users now enjoy a constexpr QMutex ctor.

This change prepares for a real split in Qt 6, so that both use-cases
are no longer bundled up in one class.

[ChangeLog][QtCore][QMutex] Added QRecursiveMutex as a replacement of
QMutex(QMutex::Recursive).

Change-Id: I79b8724e8a8ee65e4bd0f06acd76103fe4197b8c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-06 11:22:16 +02:00
Liang Qi
9bc92cdcfd Merge "Merge remote-tracking branch 'origin/5.13' into dev" 2019-07-05 19:36:41 +02:00
Liang Qi
deee7b7ece Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	.qmake.conf
	qmake/generators/makefile.cpp

Change-Id: Ifb2633a69d0bf8cdf12d799c6259beefc279c49e
2019-07-05 15:37:50 +02:00
Mårten Nordheim
4cb0749250 tst_QTcpSocket::hostNotFound Only expect failure for the http proxy
When I added the QEXPECT_FAIL the http proxy was the only one.
That's no longer true after fixing the SOCKS proxy, so let's make the
condition more specific.

Change-Id: I1eaa5117d5d0219e04cbd091ec54e522fe7b5509
Reviewed-by: Dimitrios Apostolou <dimitrios.apostolou@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-07-05 11:27:02 +02:00
Sona Kurazyan
b0cd007335 Remove usages of QSysInfo's deprecated APIs
- Replaced QOperatingSystemVersion::WindowsVersion,
  QSysInfo::windowsVersion(), QSysInfo::macVersion(),
  QSysInfo::MacintoshVersion with QOperatingSystemVersion::current().

- Added QOperatingSystemVersion::WindowsVista for convenience, as it
  is used in lots of places.

Change-Id: If9c4ac496005b2e70b5c70be160747afa74b98c1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-07-05 09:26:17 +00:00
Sona Kurazyan
9b3e8b32f2 Remove usages of deprecated APIs of corelib
- Replaced the usages of deprecated APIs of corelib by corresponding
  alternatives in the library code and documentation.

- Modified the tests to make them build when deprecated APIs disabled:
    * Made 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, added tests for the replacement.

Task-number: QTBUG-76491
Task-number: QTBUG-76539
Task-number: QTBUG-76541
Change-Id: I62ed4a5b530a965ec3f6502c6480808f938921aa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-05 11:25:46 +02:00
Qt Forward Merge Bot
e72e60b107 Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" 2019-07-03 15:19:38 +02:00
Qt Forward Merge Bot
a2b221e595 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	.qmake.conf

Change-Id: I936be3c0df2b9845ff6a85eb3d4442cdabe63d37
2019-07-03 15:19:26 +02:00
Marc Mutz
f70905448f Add QT_NO_JAVA_STYLE_ITERATORS and mark QtBase free of it
... except for tests, which manually undefine the macro.

Like QT_NO_FOREACH, this is a technical way to keep JSI-free
modules JSI-free going forward.

Change-Id: Icf1342da00a700f42f9e32a253d1cdb94c38dd7e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-03 14:48:37 +02:00
Allan Sandfeld Jensen
6ff0614b61 Handle multiple font-families in <font> face attribute
This seems to be a common use case, and to be expected from pastes
of MSWord documents.

Change-Id: I5849d7f51408e76f15a0b03c2118649f118af1d6
Fixes: QTBUG-66794
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-03 13:21:14 +02:00
Mårten Nordheim
1f451da9d7 Revert "Temporarily skip tst_QSslSocket::resume"
This reverts commit 9a25d27b9d58316dee5d2305135d2d74ad5d51e7.

The QSKIP is no longer needed as the imap server's certificate
was updated

Task-number: QTBUG-76610
Change-Id: I1007ce50d6f7f6258fdeb8894c66678a660b03ca
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-07-03 13:04:54 +02:00
Thiago Macieira
2021b36ebd QPluginLoader: fix failing test comparing the Qt version
We stopped storing the patch release number of Qt in the plugin metadata
in commit 7bd79b3cff (5.13), to make it
simpler to parse the validity of plugins before decoding the CBOR
payload.

Fixes: QTBUG-76855
Change-Id: I6aed4df6a12e43c3ac8efffd15adbbf83e928866
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-07-03 05:59:16 -03:00
Christian Ehrlicher
1e4e006c3f QPainter: mark obsolete RenderHints as deprecated
RenderHint::HighQualityAntialiasing and NonCosmeticDefaultPen are
obsolete since Qt5 but not marked as such. Therefore add
Q_DECL_ENUMERATOR_DEPRECATED_X now so those two enumerations can be
removed with Qt6.

[ChangeLog][QtGui][QPainter] HighQualityAntialiasing and
NonCosmeticDefaultPen are marked as deprecated and don't have an effect
anymore

Change-Id: Ib0c966a078a1d23d492d0255288e2066c50e87b6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-07-03 06:53:34 +02:00
Friedemann Kleint
e5ab131c18 tst_QShortcut: Remove test widget and other member variables
Remove the mainW, edit widget member variables from the test and use
widgets instantiated on the stack in the tests.

For the data-driven tests, use a static QScopedPointer, which is
reset by a newly introduced TestEnd action.

The book-keeping logic maintaining a list of shortcuts can then be
removed.

The setupShortcut() helpers are simplified and the special case
TestWidget::SendKeyEvent is replaced by a lambda in
keypressConsumption().

Task-number: QTBUG-76493
Change-Id: I15dfa86dfa0666ed8288b7190e37cdb862c261c8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-07-02 22:39:50 +02:00
Dimitrios Apostolou
24b9424adc Skip flaky test on MacOS_10_12
This is the most flaky-pass test currently.
It fails the first time it is run on MacOS_10_12, but
succeeds all the following times.
This happens extremely often, so disable it until the issue
is resolved.

Task-number: QTBUG-76566
Change-Id: I94359eceb91c3b958930424e6c8b5957fb3f1252
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-02 16:38:21 +02:00
Volker Hilsheimer
555661b625 Update visible window's alpha when toggling WA_TranslucentBackground
QWidgetPrivate::updateIsTranslucent sets the surface format of the
window with the alpha based on the translucency attribute, so we need
to call this function when the attribute value changes. The test can
confirm that the window's requested surface format has changed, we
can't rely on what is actually set, and don't have to rely on
hard-coded values like 8bit alpha.

While WA_NoSystemBackground needs to be set for WA_TranslucentBackground
to have an effect, we can't clear the attribute when clearing
translucency (as it might have been set explicitly).

Change-Id: I238d6930b7e0488397467a4e035b5f530566a1ff
Fixes: QTBUG-60822
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-07-02 16:35:18 +02:00
Mårten Nordheim
1eeab2d27f QSocks5SocketEngine: account for in-transit signal when waiting for read
When calling waitFor{ReadyRead,Disconnected} it will wait for data but
if the data is already received and the read notification has been
queued (and there's no more data coming in) it will return false.

By checking if a read notification has been queued and then handling
this we can easily take care of this scenario.

Fixes some flaky tests which missed the read data in waitForDisconnect
and similar.

Fixes: QTBUG-38385
Change-Id: Ic05d59883c1175783e56ff1822b6636c35aec874
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-02 16:05:15 +02:00
Friedemann Kleint
6df8a30333 tst_QShortcut: Brush up the code, preparing the extraction of a base class to QtGui
- Use nullptr
- Fix static method invocations
- Use QString() instead of QString("")
- Use override
- Use member initialization
- Remove unimplemented code related to status bars
- Use Qt 5 connection syntax
- Fix apparent oversights in ambiguousItems() and
  unicodeCompare(),where the 2nd shortcut was assigned to the wrong button
- Use Q_ENUM for the enumerations which will output the value in
  QCOMPARE and automatically declare them to be a metatype
- Use enums in helper function signature for clarity

Task-number: QTBUG-76493
Change-Id: I0ed6ee7ee8dc2dbb48160a8383e6ed29164c3449
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-07-02 11:05:02 +02:00
Sona Kurazyan
8c8eae279d Remove usages of deprecated APIs from QDateTime
- Replaced the usages of:
  * QDateTime::toTime_t() -> QDateTime::toSecsSinceEpoch().
  * QDateTime::fromTime_t() -> QDateTime::fromSecsSinceEpoch().
  * QDate::shortDayName() -> QLocale::system().dayName().
  * QTime by QElapsedTimer, where the deprecated methods of QTime
    were used.

- Modified the tests for the deprecated methods to be enabled only
  when the corresponding methods are enabled: when the deprecated
  APIs are disabled, the tests will be also disabled, and the
  compilation won't be broken.

Task-number: QTBUG-76491
Change-Id: I4d565db2329e580c567aae511696eb1efe120843
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-02 09:49:36 +02:00
Ulf Hermann
c34242c679 Make the default ctor of QVarLengthArray implicit
Otherwise "QVarLengthArray<Foo> x = {};" gives a warning. Also, some
compilers get confused about "QVarLengthArray()" this way.

Task-number: QTBUG-76199
Change-Id: I4296586c0181d3e6e82ca8b7b79aeb9a21645d1f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-07-02 09:39:33 +02:00
Friedemann Kleint
fdef9c8039 uic: Implement form window setting to disable QObject::connectSlotsByName()
Task-number: QTBUG-76375
Change-Id: I16ad147366aa7d52b7a0e17ae240127d8ac34b3c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2019-07-02 09:15:47 +02:00
Liang Qi
57fccd6f21 Merge "Merge remote-tracking branch 'origin/5.13' into dev" 2019-07-01 19:20:20 +02:00
Edward Welbourne
a4f5f25eb0 Move YearRange to QDateTime from its Private
As planned when adding YearRange: now that it's merged up to dev, move
it to QDateTime, since we can add to the API at 5.14.0.

This follows up on commit 82ad4be4a2.

Change-Id: I81b6c2331121a71e2592514781c02c5756e70c52
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-07-01 17:49:09 +02:00
Laszlo Agocs
058c52fc2a rhi: Improve base vertex/instance support
Have feature flags as appropriate. OpenGL is causing a mess here
but let's support what we can since some of this will become relevant
in more sophisticated mesh drawing cases with 3D in particular.

Change-Id: Idfa7b4642ec87147978e03d78d6233efbd151491
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-01 17:34:47 +02:00
Laszlo Agocs
9452c963c8 rhi: Add a test for instancing
Draws 1024 cubes at random x,y positions with varying color with
a single instanced draw call.

Change-Id: I8737503acf23866ad4734b1d88753415a3b93445
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-01 17:34:40 +02:00
Laszlo Agocs
854ddb0301 rhi: Enhance line width and point size support
...but this will vary between backends, or in some cases
even between implementations of the same API.

Point size is settable only via the vertex shader (gl_PointSize).
It is silently ignored with D3D and HLSL.

Line widths other than 1 are supported only on OpenGL and Vulkan.
(but this is in fact deprecated with GL and optional with Vulkan)

Add QRhi::Feature values for both.

The line width is now settable on QRhiGraphicsPipeline. It is not a
dynamic state since the static, per-pipeline width is good enough for
most cases. (and the feature is not supported on half of the backends
anyways so it will get limited use in practice).

Change-Id: I6d3a32269527c452b794b2cb8b0f03101eab40b2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-01 17:34:29 +02:00
Liang Qi
d25c322729 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/network/ssl/qsslsocket_openssl.cpp
	src/platformsupport/vkconvenience/qvkconvenience.cpp

Change-Id: I97ce6ed185f7fdad8102cc58d3cfec0119fd7bb4
2019-07-01 10:21:37 +02:00
Mat Sutcliffe
2a99f60cfb QStringList: add QStringView overloads of join, filter, replaceInStrings
[ChangeLog][QtCore][QStringList] Added QStringView overloads of join(),
filter(), and replaceInStrings().

Change-Id: I9636e21e2e43ed46cce0aa7fa23ab0710aa641ba
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-06-30 23:16:11 +00:00
Ryan Chu
57055ffafd Share the common configurations among different modules
This change is used to generalize a template docker-compose file for all
modules. Ideally, the leaf module only need to keep a docker compose
file for all platforms (docker-compose.yml).

NOTE:
The version of docker-compose file downgrades from 3.4 to 2.1 because
the 'extends' keyword is not supported in Compose version 3.x.

Change-Id: I2e36fd9236eda86cb5fcf940d787ccefe9200696
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2019-07-01 01:09:42 +02:00
Sona Kurazyan
ff2b2032a0 Remove usages of deprecated APIs from QtAlgorithms
Task-number: QTBUG-76491
Change-Id: I9dab736a0cbd2e86588919640c26e8ce6b3674d0
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-06-29 21:58:36 +02:00
Marc Mutz
a27e7e8151 QObject: deprecate the undocumented userData() feature
... and schedule it for removal in Qt 6.

This appears to have come to some fame on the internet, so better add
a deprecation warning before we remove it in Qt 6.

Change-Id: I42d91d933f47dfd2d8d54c92358e9e46ced6bf21
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-06-29 16:10:01 +02:00
Marvin Scholz
a03270f891 rcc: Add -d option to output a Makefile-syntax depfile
The -d option makes rcc output a dependency file with the specified
file name.

The resulting dependency file is useful for make or ninja based build
systems.

[ChangeLog][Tools][rcc] Added -d option to generate a dependency file.

Fixes: QTBUG-45460
Change-Id: I495ade50f8d9865d4c00dce9373b2b6d1a6c8f2f
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-06-29 02:26:23 +02:00
Giuseppe D'Angelo
f66c1db16c Introduce Q_NAMESPACE_EXPORT
A recurring problem with the Q_NAMESPACE macro is that it declares
an object (staticMetaObject) in the surrounding namespace. That
object lacks any export/import qualification to make it usable
with shared libraries.

Introduce therefore another macro to work around this issue, allowing
the user to prefix the object with an exporting macro, f.i. like this:

Q_NAMESPACE_EXPORT(Q_CORE_EXPORT)

The old macro can simply then be rewritten in terms of this new one,
supplying an empty export macro.

Note that NOT passing an argument to a macro expecting one is well
defined behavior in C99 -- the macro will expand an empty token.
Of course, MSVC doesn't like this and emits warnings. As a
workaround, use a variadic macro.

[ChangeLog][QtCore] Added the new Q_NAMESPACE_EXPORT macro. It
can be used just like Q_NAMESPACE to add meta-object information
to a namespace; however it also supports exporting of such
information from shared libraries.

[ChangeLog][Potentially Source-Incompatible Changes] Prefixing
Q_NAMESPACE with an export macro may no longer work. Use the new
Q_NAMESPACE_EXPORT macro for that use case.

Fixes: QTBUG-68014
Change-Id: Ib044a555ace1f77ae8e0244d824ec473550f3d8e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-06-28 06:47:29 +02:00
Qt Forward Merge Bot
7265fb0597 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I912bd8851c390302414d3dfb3c8220df5a0d5630
2019-06-28 01:00:23 +02:00
Friedemann Kleint
8f0e3ad518 Corelib tests: Fix out of bounds string access
Fix warnings:
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.

introduced by qtbase/c2d2757bccc68e1b981df059786c2e76f2969530 (5.14).

Change-Id: Ie6f0e2e3bb198a95dd40e7416adc8ffb29f3b2ba
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
 
 
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-28 00:24:54 +02:00
Friedemann Kleint
4b63288a60 tst_QAction(Group): Brush up the tests
- Use nullptr
- Use Qt 5 connection syntax
- Remove C-Style casts

Task-number: QTBUG-69478
Change-Id: Icf8faf3433ff3bff667db050e79b560b221867b0
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-06-28 00:24:40 +02:00
Friedemann Kleint
c2b00f8d57 tst_QThread: Add output for all elapsed tests
Obtain diagnostics.

Task-number: QTBUG-76707
Change-Id: I051fb43802a9736cb9542f4adaaf5880b52a407e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-06-28 00:24:17 +02:00
Liang Qi
25eb97d2d4 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	.qmake.conf
	src/network/ssl/qsslsocket_openssl.cpp

Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: Ibb57a0548b4977797b400637487a56245ac1c024
2019-06-27 14:38:03 +02:00
Friedemann Kleint
ee8dfcaf67 tst_QThread: Blacklist sleep() for Windows
Task-number: QTBUG-76707
Change-Id: Iddce10fb3c8259b829d76596ffc9829f8d013bf3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-06-26 12:31:52 +02:00
Volker Hilsheimer
7f69c13fd9 Skip tests if the required plugins were not deployed
This is usually the case on Android, where running this test would
require deployment of files to the emulator. This doesn't give us any
further testing that we don't already do by running this test on regular
Linux, so skipping the test instead if the preconditions aren't met.

Change-Id: I3722796634871213ba51c89ae7f40b19f954f2cb
Fixes: QTBUG-73566
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-06-19 17:03:53 +02:00
Allan Sandfeld Jensen
64033c3592 Output all font families in HTML output
Fix our generation of font-family CSS so it contains the full list of
families.

Change-Id: I37d5efa64faeb4b6aeb7e2c5d6a54ff07febe9cc
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-06-21 13:31:38 +02:00
Liang Qi
aedc59b1c3 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/corelib/io/qstorageinfo_unix.cpp
	src/network/ssl/qsslsocket_openssl.cpp

Change-Id: Ibc9ce799bef62d60d616beaa9fbde8ebeadfbc20
2019-06-25 15:47:42 +02:00
Friedemann Kleint
530c6903a4 Brush up Diaglib
Fix most clang warnings about override, nullptr, range-based for loops.

Change-Id: Id47e57adb63a38e2f397a31511b788a2432c97cf
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-06-24 08:56:00 +02:00
Volker Hilsheimer
0f3f143f6d Fix window shortcuts when a completer popup has focus
The completer popup has focus, making QShortcut direct to it's window
rather than to the window the completer belongs to. As QShortcut handles
the case for Tool windows that have a parent, but doens't do the same
for popups. And they shouldn't be treated the same way, as a context
menu popup for a e.g. text edit should in fact block the text edit's
shortcuts while open.

However, the completer popup is special, in that it explicitly makes the
widget completes for its focusProxy, which is what we can use to fix
this issue.

Change-Id: Ie7177d39668b3af14a1d9e0ee5d93eca9c67c8af
Fixes: QTBUG-4485
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-06-25 00:04:15 +02:00
Eirik Aavitsland
2ce4a9f487 Fix crash in QPainterPath::reserve()
Function did not handle default-constructed (null d_ptr) path correctly.

Fixes: QTBUG-76516
Change-Id: I2925d4306f7fce34ece6739b18a8e275e7970837
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-06-19 16:47:19 +02:00
Liang Qi
bd9959bde2 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	.qmake.conf
	src/gui/painting/qdrawhelper.cpp
	src/network/ssl/qsslsocket_openssl.cpp
	src/widgets/styles/qstylesheetstyle.cpp

Change-Id: Ibe1cd40f46a823c9e5edbe0a3cd16be1e1686b17
2019-06-20 07:50:44 +02:00
Volker Hilsheimer
b877285694 Android: don't run test function for fd leakage, make test pass
It is sufficient to run this test on systems where we don't need to
set up dependencies and satisfy other assumptions the test makes. It is
safe to assume that if this test passes on regular Unix, then
QTemporaryFile will behave as expected on Android as well.

Change-Id: Iaf9a67d7c12b3acfd0992bab591c3f906b073d9e
Fixes: QTBUG-73564
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-19 00:04:29 +02:00
Laszlo Agocs
6f4aa54131 rhi: Add compute api and implement for Vulkan and Metal
D3D11 and GL (4.3+, ES 3.1+) will come separately at a
later time.

Change-Id: If30f2f3d062fa27e57e9912674669225b82a7b93
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-06-17 10:32:57 +02:00
Liang Qi
ef37ab9970 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	.qmake.conf
	src/gui/painting/qdrawhelper.cpp
	src/gui/text/qdistancefield.cpp
	src/gui/text/qdistancefield_p.h
	src/network/ssl/qsslsocket_openssl.cpp
	src/plugins/platforms/android/qandroidinputcontext.cpp
	src/widgets/styles/qstylesheetstyle.cpp

Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: Ia7daad21f077ea889898f17734ec46303e71fe6b
2019-06-25 13:04:27 +02:00
Giuseppe D'Angelo
5e86aa93fc QByteArray autotest: code tidies
Suppress a few warnings raised by GCC 9.

Change-Id: Ic52dc9c85e447ee0f54ef8310a7fcd41d6e09304
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-23 15:52:41 +02:00
Christian Ehrlicher
a7cbb8c639 QWidget: fix setTabOrder for compound widgets
81e298a51d fixed a case where the focus
chain was screwed up when the order was already correct. This worked
correctly in most cases but not when the next focus widget of the first
one had Qt::NoFocus.
The optimization check if lastFocusChildOfFirst is the same as second is
thrown away since it now does not longer screw up the focus chain and
the save would only be four pointer assignments.

Fixes: QTBUG-75388
Task-number: QTBUG-10907
Task-number: QTBUG-68393
Task-number: QTBUG-69619
Change-Id: I581ed532156c34ea970123afd063194aab016304
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-06-10 13:44:42 +02:00
Mårten Nordheim
a489e11b97 Temporarily skip tst_QSslSocket::resume
Will be reverted once ready

Change-Id: Id03df7dea1dd65579ec83606fddf2a73a45a0d64
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-06-24 15:18:48 +02:00
Mårten Nordheim
42f3b18ec9 SSL: Update an about-to-expire certificate
Change-Id: I9e29baf529b74ae33fa0ee7250e5af6b1873e86f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-06-24 15:18:47 +02:00
Timur Pocheptsov
a22a6c01f8 Revert "tst_qnetworkreply - QSKIP/disable tests that deadlock on Windows"
QSslSocket (OpenSSL backend) does not use mutex/locks during
a handshake, so we re-enable previously skipped tests.
This reverts commit 8c87a1402c.

Change-Id: I994b085f016f0eb18b3ba439a7041ea08cd3577b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-06-21 09:54:09 +02:00
Frederik Gladhorn
73a19a3a10 Stabilize tst_qsplitter
This is the worst fix ever, adding one more qWait. The test has been
updated in the 5.13 branch, so there a different fix will be needed. For
now this is in line with the rest of the code.
This test is currently one of the worst offenders when it comes to flaky
tests.

Task-number: QTBUG-64639
Change-Id: Ia1e71cc948997408b9658839013c9ad098111033
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-06-19 18:32:19 +02:00
Tor Arne Vestbø
7940791f47 Report correct state change when destroying QAbstractAnimation
Change-Id: Ibe5310e20268d1baa5b329a4d02a3dc38d875008
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-06-20 12:46:30 +02:00
Marc Mutz
35431062bd QString: towards QStringView::arg() pt.3: Long live QStringView/QLatin1String::arg()
This version of arg(), unlike its QString counterpart, transparently accepts
views without conversion to QString, and is also extensible to further argument
types, say a future QFormattedNumber.

[ChangeLog][QtCore][QStringView/QLatin1String] Added arg(), taking arbitrarily
many strings.

Change-Id: If40ef3c445f63383e32573f3f515fdda84c7fe3a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-20 19:36:37 +02:00
Shawn Rutledge
b149f5d77a Overload QTextBrowser::setSource() to add optional type argument
Now that it's trying to guess whether the type is markdown based on
the file extension, there needs to be a way to override it. For example
it might be arranged that directory listings will be generated in
markdown format instead of HTML; then when loading a source URL that
is a directory, the application may override the type. The type for
the single-argument setSource(url) is UnknownResource to preserve
the existing behavior, but the user can override the guessing by
setting a specific type.

Change-Id: Id111efd24de7d8fd18c47b16a2d58f5b09d77891
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-06-20 20:29:15 +02:00
Eskil Abrahamsen Blomfeldt
6492541df3 Support copy-pasting foreground images within same document
When using a texture for foreground color in text and copy-pasting
the text inside the same QTextEdit, the formatting would disappear.

Fixing this in a general way would require implementing some
other carrier format in the mime data than HTML, such as e.g ODF,
but it can quite easily be fixed for the case where the data
is pasted in the same document, or even different documents
as long as they have a reference to the image in the formats.

[ChangeLog][QtWidgets][QTextEdit] Added support for copy-pasting
foreground brushes with textures within same document.

Task-number: QTBUG-75931
Change-Id: I8b39dce289c64eea39e25cb8eb207e2534bcd2eb
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-06-21 11:48:10 +02:00
Giuseppe D'Angelo
34fe9232db Port from QAtomic::load() to loadRelaxed()
Semi-automated, just needed ~20 manual fixes:

$ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} +
$ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} +

It can be easily improved (e.g. for store check that there are no commas
after the opening parens). The most common offender is QLibrary::load,
and some code using std::atomic directly.

Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-06-20 20:48:59 +02:00
Edward Welbourne
84e89c1e9e Convert uses of QTime as a timer to QElapsedTimer
Change-Id: I2297f61efa5adf9ea5194c7f3ff68574cbcf452c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-06-14 10:42:33 +02:00
Samuel Gaist
1e21867baf test: migrate ModelsToTest to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: Ifea720470541000481fbacc510b4cb589c9990d9
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
 
 
 
 
 
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
2019-06-10 08:42:17 +02:00
Samuel Gaist
16cc3ea585 test: migrate QNetworkReply test to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: Ibdd3f63d9069c3f01dfe8431bcc64bde4f2aa569
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-06-10 16:49:19 +02:00
Samuel Gaist
605dc42a0f test: migrate QXmlSimpleReader to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: Ifa62ad002689a0be6ed1a88ad4ac0e92082ef616
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-10 21:37:56 +00:00
Samuel Gaist
6ff2e0e718 test: migrate QFontComboBox test to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: I2e1b42c09db88da64ec62aee7906f4c368e5bcbb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-06-10 09:35:45 +02:00
Samuel Gaist
5398ce2432 test: migrate QAbstractItemModelTester to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: I23bc9693fb9f553fd63d10687d51322394717ed7
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
2019-06-10 09:32:36 +02:00
Samuel Gaist
5174c8abae test: migrate QPrinterInfo test to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: I949479066e114af0af85b6e62d90fd56b9c80077
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-06-11 09:08:11 +02:00
Samuel Gaist
2d72bf6019 Remove unused QRegExp include
There's no use of QRegExp here therefore remove the include

Task-number: QTBUG-72587
Change-Id: If281c34d202c9fae4e548c8293443cc0dc283de0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-10 19:25:12 +00:00
Samuel Gaist
928c3e4a68 test: migrate QTextDocumentFragment test to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: I18fb17dd2f5f7c70b5c6564b876fc2138c430176
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-06-10 09:20:55 +02:00
Samuel Gaist
94495c814f test: migrate collections test to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: Iff9d4be685bf360ad921e29a82cb878ae5c46180
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-10 19:24:05 +00:00
Samuel Gaist
4aec51e39f test: migrate QStateMachine test to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: If5d5a9d1c3f094d554110ada3b259f4d863e7121
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-10 19:23:42 +00:00
Samuel Gaist
fd58792ef8 test: migrate QLibrary test to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: I60ffa6df83aaf520730cfbb1dd3f18a2d2e19977
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-10 19:22:55 +00:00
Samuel Gaist
c0f0e94db5 test: Fix QRegularExpression feature config check
The check to disable the test was the one for QRegExp. This patch fixes
that.

Change-Id: I8783f582998cdd6ffe5dc5dafb3d53d56cd91213
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
 
 
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-10 19:29:19 +00:00
Samuel Gaist
826b262fa6 test: migrate QItemSelectionModel test to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: Ibbd161700bf9e75736652b99dfa1ffd47e584249
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-06-10 19:29:44 +00:00
Samuel Gaist
0389a459bb test: migrate QStandardPaths tests to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: Ie89641601763ff41eee5356a4b5ddee7ef810fbc
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-06-10 21:34:38 +02:00
Samuel Gaist
cc843c36ea test: add missing QRegularExpression specific QDataStream tests
This patch adds the missing tests for the QRegularExpression class to
the QDataStream tests. Only QRegExp was tested until now.

Task-number: QTBUG-72587
Change-Id: I68ad1500ecbb041bbc6fbdff04b99171530cc0fd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-10 19:22:20 +00:00
Samuel Gaist
20c6242c52 test: migrate highdpi manual test to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: I0bb1d1409cb0c8f38b7582bb5ce6bbc2b047b6fc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-06-10 10:16:52 +02:00
Volker Hilsheimer
e6f7cc96fa Use C++11 alignof as reference for Q_ALIGNOF, and fix test on Android
Not removing QT_EMULATED_ALIGNOF logic from qglobal.h at this point, as
it might be used elsewhere.

Change-Id: Ie78922bb604a54aed03ab5b88e31a7f29a3a4de0
Fixes: QTBUG-73561
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-17 17:13:22 +02:00
Volker Hilsheimer
eed85dc3e7 Turn on C++11 and 14 correctly
Without this, a local build of this test on macOS fails.

Change-Id: Ie03fa47ff0a54db752af47f223fbe5724cd9c976
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-17 17:13:21 +02:00