Commit Graph

47611 Commits

Author SHA1 Message Date
Lars Knoll
52bbb19fa4 Reduce some code duplication
The r-value setBinding() overloads can be removed,
as they took a copy internally anyway.

Change-Id: I691265299e5cb336791f614b30788c81467df534
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-09-02 22:44:27 +02:00
Lars Knoll
80745bfffe Generalize some methods taking a QProperty<>
Generalize some methods taking a QProperty<T>,
so that they can work with other types that
implement the QProperty interface as well.

This removes some duplication between QProperty and
QNotifiedProperty. It also makes it possible to
create private property classes that store their
data in a different place.

Change-Id: I4b1ae8589cb9a76be59e63206044dcf2244163c2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-09-02 22:44:26 +02:00
Friedemann Kleint
00e181fdae Vista Style: Fix pixelized arrow of QCommandLinkButton with scaling
Do not unnecessarily downscale the pixmap; QIcon will set the correct
device pixel ratio.

Pick-to: 5.15
Task-number: QTBUG-86344
Change-Id: I04ba93ec3003d3dfd458b032cc5c8fc9cf38e957
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-09-02 20:44:26 +00:00
Friedemann Kleint
85cdc8ebc1 Vista style: Fix pixelized elements after focus/activation
Use a float device pixel ratio in the style animations and default
to the application's device pixel ratio.

Pick-to: 5.15
Task-number: QTBUG-86344
Change-Id: I093bfefc0f544eb488da0993a183f92c9c77a286
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-09-02 22:44:26 +02:00
Friedemann Kleint
1fd5a970f0 Fix include style violation in qline.h
Amends c0d0949448.

Pick-to: 5.12 5.15
Change-Id: Ie220a245ae2000af6e52c000c6836b9830c56de6
Reviewed-by: hjk <hjk@qt.io>
2020-09-02 22:44:26 +02:00
Friedemann Kleint
9d059da344 qnetworkaccessbackend_p.h: Add missing "We mean it comment"
Change-Id: I079ad30c0b96dc3a1c7a89459ad0e1488999bc56
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-02 22:44:26 +02:00
Volker Hilsheimer
7f7b60d8d5 Fix gcc warning about possible call of printf with nullptr
Amends fe4794f70e

Depending on the types, the generic QTest::toString version might be
used, which returns nullptr.

Change-Id: Ic60675057181629d1cf9cb22e7508d57c026a0ad
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-09-02 22:44:26 +02:00
Volker Hilsheimer
e3c08da307 Remove last traces of the PostScript paint engine
Remove enum value, documentation, and another ### Qt 6 comment.

Change-Id: I046d9581625d39c8fc8cf75287e8767501aae0cc
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-09-02 22:44:26 +02:00
Tor Arne Vestbø
233b6534a7 High-DPI: Remove legacy environment variables
QT_DEVICE_PIXEL_RATIO is replaced by QT_SCALE_FACTOR, while
QT_AUTO_SCREEN_SCALE_FACTOR is replaced by QT_ENABLE_HIGHDPI_SCALING.

Since High-DPI is now always enabled, there's no reason to keep the
code path for android.app.auto_screen_scale_factor. Also, based on
the original commit message that introduced this code, the value of
the property should have been true.

Change-Id: Ib34b1deeab46c488c67c4d64f087599b4a54dc55
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-09-02 19:00:18 +02:00
Shawn Rutledge
b200ff685e Fix warning: don't compare Qt::TouchPointReleased and QEventPoint::State
They are actually equivalent, but from different enums.

Change-Id: Ic5f148e2e6bb260c226026b3f89333626a6020ec
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-09-02 14:43:11 +02:00
Volker Hilsheimer
55fe46fd58 Move event-response code into dedicated event handlers
Address ### Qt 6 comments.

Change-Id: I4c90265293ddf539f860630901ab6d9487e2a1b5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-09-02 09:01:56 +02:00
Friedemann Kleint
a494da3b20 Document native interfaces
As the private headers are not included by default in the precompiled
header QDoc builds for QtGui, create a custom module header for
the documentation build and pull in the required headers.

Add dummy declarations for Windows-specific types for building docs
on non-Windows platforms.

Task-number: QTBUG-83252
Change-Id: I225ed08f68cf4f7c1f1d093424070b13ce36aa51
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-02 05:29:44 +02:00
Friedemann Kleint
d23c118fd4 QTextHtmlParserNode: Fix warnings flood about setting negative pixel size
Exclude the default value (-1) from the check.

Amends 0bd770fb87.

Pick-to: 5.12 5.15 5.15.1
Change-Id: Ib98ae166fd5fdab546c5d4212ce78345b5c9b583
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-02 00:13:24 +02:00
Giuseppe D'Angelo
11b8c46d2a QObject: add a single shot connection flag
If one needed to listen to a signal just once, one had to
store the QMetaObject::Connection object returned by connect()
and use it to disconnect the slot after the first signal
activation.

This has led to a proliferation of using wrappers (and enough
TMP); they usually look like this:

1) create a shared_ptr<QMO::Connection>, allocating its payload;
2) create a lambda, capturing the shared_ptr by value;
3) in the lambda, disconnect the connection (through the shared_ptr),
   and call the actual slot;
4) connect the signal to the lambda, storing the returned
   QMO::Connection into the shared_ptr.

This is expensive, error prone for newcomers, and tricky to
support as a general facility inside one's projects.
We can do better, just support single shot connections right
in QObject.

[ChangeLog][QtCore][QObject] Added the Qt::SingleShotConnection
flag. When a connection is established with this flag set,
the slot is going to be activated at most once; when the signal
is emitted, the connection gets automatically broken by Qt.

Change-Id: I5f5feeae7f76c9c3d6323d841efba81c8f98ce7e
Fixes: QTBUG-44219
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-09-01 17:59:36 +02:00
Shawn Rutledge
3e7c63955e Remove remaining ### Qt 6 comment in qcoreevent.h
QEvent::Pointer will probably end up unused in Qt 6, but removing it
right now would break qtdeclarative; this might continue for a little
while longer.

Change-Id: I02c4901068be710ffd31261b306e1b8ec1988c63
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-01 17:59:36 +02:00
Andreas Hartmetz
77d63db06f Doc fix: functions may actually have fewer arguments than the signal
See tst_QObject::connectFunctorArgDifference()

Change-Id: I8b027fd3095ff7f90e5087be94978b05db79b120
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-09-01 13:35:39 +02:00
Andreas Hartmetz
7406949858 Doc fix: disconnect with receiver also works for context objects
One could guess it by assuming that disconnecting for a destroyed
receiver and disconnect() with given receiver use the same
implementation, but without closely knowing the implementation a
reader of the documentation can't know for sure.

Also add a test to prove that what the new documentation says is
really true.

Also remove an unnecessary negation in the preceding sentence.

Change-Id: I9d24442bb1a4646b89f969bad1a4d0e1eafa7534
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-09-01 13:35:39 +02:00
Alessandro Portale
7451453154 Android: Fix warning: unused variable 'm_statusBarShowing'
Change-Id: I612c2239f1626abb1841100745d17f54f60e806b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-09-01 13:35:39 +02:00
Ulf Hermann
4fbb2f66d6 Add a QMetaSequence interface
This is in line with QMetaType and will be used to implement a mutable
QSequentialIterable. Later on, a QMetaAssociation will be added as
well, to implement a mutable QAssociativeIterable.

The code here represents the minimal set of functionality needed to have
a practical sequential container. The functionality is not completely
orthogonal. In particular, the index based operations could be
implemented in terms of iterator-based operations.

Task-number: QTBUG-81716
Change-Id: Ibd41eb7db248a774673c701549d9a03cbf2e48b6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-09-01 13:35:39 +02:00
Jarek Kobus
83ad54c124 Mention QPromise on QtConcurrent page
Change-Id: I82d3ddd4a9129694d6dedcc742165cb2af135527
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-09-01 13:35:39 +02:00
Joerg Bornemann
e3c6e19ad0 CMake: Fix call to qt_apply_rpaths in qt_internal_add_app
We never passed a valid target name to qt_apply_rpaths.
This amends fde98f7794.

Task-number: QTBUG-85399
Change-Id: I1c023ce30a3a8b5ec43d020373960d19fe20f59a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-09-01 11:35:39 +00:00
Joerg Bornemann
5c092c2b40 CMake: Implement configure -trace
Task-number: QTBUG-85373
Change-Id: Ib9ac35ec98dd5b6c272f58f8a61a124d1d262ec0
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-09-01 13:35:39 +02:00
Andreas Hartmetz
7f878c6217 Remove "fallback session management"
With the Qt6 compatibility break, it can finally be removed.
Closing windows (which might quit the application with
quitOnLastWindowClosed() true, the default) acted contrary to the
documentation of the commitDataRequest() signal, which could have
been a hint.

This removes the workaround API from the fix for QTBUG-49667 and
also removes the problematic feature that it worked around.

Change-Id: I672be58864ef062df7fb7f2a81658b92c4feedd2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-09-01 10:16:15 +02:00
Paul Wicking
98f41552e4 Doc: compile transform snippets
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Fixes: QTBUG-81486
Change-Id: Ie35d22469e7f8d9c244b70665af30b39e265766a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:22 +02:00
Paul Wicking
614ca8ec4a Doc: compile separations snippets
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Change-Id: I62294cedd4a0f96ebc2513b5b4179d451bb4b375
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:20 +02:00
Paul Wicking
7e571c3927 Doc: compile scribe-overview snippet
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Change-Id: If760744aba49361d8d9ed51c4a2641b743c35c25
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:20 +02:00
Paul Wicking
ad654870cb Doc: compile textobjectinterface snippet
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Change-Id: Ibad1ef95b85d5484ee7e9cceee8019d026c10cb9
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:19 +02:00
Paul Wicking
319e22cb4a Doc: compile qstatustipevent snippet
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Change-Id: I44c7b31e0a99009f51f81e2c8d0e736e6eafd535
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:18 +02:00
Paul Wicking
5ee39fc7c9 Doc: compile qimagewriter snippet
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Change-Id: Ibb4087d7035c3061b2980b317ab4280fa38aab50
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:18 +02:00
Paul Wicking
45211e947a Doc: compile qfileopenevent snippet
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Change-Id: I28d7e9749b7a8feacd6b82abebcea462010caeba
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:17 +02:00
Paul Wicking
87eb059ed3 Doc: compile polygon snippets
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Change-Id: I29caf1818154df3b0f2b599ac19c966e826f6287
Taks-number: QTBUG-81486
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:17 +02:00
Paul Wicking
47e0309ea8 Doc: compile plaintextlayout snippet
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Change-Id: I2bac37fd41703cc4cfb7de3946b31412c4af37b9
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:16 +02:00
Paul Wicking
d46eed31a0 Doc: compile picture snippets
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Change-Id: I9daf8ed8c7d9620cd59feb40677795cbac30c97c
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:15 +02:00
Paul Wicking
91ab585147 Doc: Remove obsolete snippet file
QMatrix is gone, remove the snippet file as the content is
not referenced anywhere.

Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Change-Id: I57040bce50cc51f7a3580af65cc56713567330f9
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:15 +02:00
Paul Wicking
fd8132b8ae Doc: compile image snippets
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: 81486
Change-Id: I9860217a80cf94d27542d7e7836fe60fcd60897e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:14 +02:00
Paul Wicking
65fb72d302 Doc: compile droprectangle snippets
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Change-Id: I0087f7cc0746168bc2223972074fed468c3fba46
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:13 +02:00
Paul Wicking
4dd53a40aa Doc: Compile dropevents snippets
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Change-Id: I8d2eebcd82f47c500a215e310b5828f9b7e303c6
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:12 +02:00
Paul Wicking
88e3bdb6e6 Doc: Remove unused snippet files
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Change-Id: I7bf5794ffc9f96ca0cb85cc6f58b4400468df439
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:12 +02:00
Nico Vertriest
e1915cd83e Doc: Make snippets Qt Gui compilable - textblock-fragments
Task-number: QTBUG-81486
Change-Id: I3a6ee6ef744abb694d1cc7ef409f8bb584854395
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:11 +02:00
Paul Wicking
37fbffee81 Doc: Remove unused files from snippet
These files aren't referenced from anywhere and duplicates
other snippet content. Remove them.

Task-number: QTBUG-81486
Change-Id: I48976dae3c095ae38ced682147527f2809a8fef6
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:11 +02:00
Nico Vertriest
b6043dc34e Doc: Make snippets Qt Gui compilable - textblock-formats
Task-number: QTGUI-81486
Change-Id: I06dd6ce04b4d37c49df07d4b1b47c3ef029ee419
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:10 +02:00
Paul Wicking
03887ab8a3 Doc: Compile droparea snippet
droparea.h has been removed. Remove all code that depends on that header
except the one snippet that is still used. Add minimal code to allow
the snippet to be compiled.

Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Change-Id: I58c80d3527c82389ccff97567f4c75c33aec0f5e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:09 +02:00
Nico Vertriest
e596f15a45 Doc: Make Qt Gui snippets compilable - textdocument-texttable
Task-number: QTBUG-81486
Change-Id: If77873649aa10552047e0f89a7fccf55597e73f5
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:09 +02:00
Paul Wicking
b16b7d8879 Doc: Compile textdocument-tables snippets
Minor code cleanup in passing.

Task-number: QTBUG-81486
Change-Id: I23f8b3a22f627050582c69c81e5e0b85b5e45768
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:08 +02:00
Nico Vertriest
e81383eb09 Doc: Make Qt Gui snippets compilable - textdocument-selections
Task-number: QTBUG-81486
Change-Id: I467ca4d5ecd33f84e44b456a9559748ffd6cc53c
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:07 +02:00
Nico Vertriest
b5a1e7ac5c Doc: Make Qt Gui snippets compilable - textdocument-resources
Task-number: QTBUG-81486
Change-Id: Ifd3b8d79617532bf16f33f0935f370b956048130
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:07 +02:00
Nico Vertriest
69b622cb3d Doc: Make Qt Gui snippets compilable - textdocument-printing
Task-number: QTBUG-81486
Change-Id: If811ac26eebbd6b3f9fd20e2b3fb29d3be24d1cb
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:06 +02:00
Nico Vertriest
fcea9d4b72 Doc: Make Qt Gui snippets compilable - textdocument-lists
Task-number: QTBUG-81486
Change-Id: I5f8017c7dc7fc735af83279ac340e3dfde68af89
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:06 +02:00
Nico Vertriest
fec48857e8 Doc: Make Qt Gui snippets compilable - textdocument-listitemstyles
Task-number: QTBUG-81486
Change-Id: Ie718f4ae3de3f9ae12702264f5455f23d38bf1fe
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:05 +02:00
Nico Vertriest
29949cc0f7 Doc: Make Qt Gui snippets compilable - textdocument-listitems
Task-number: QTBUG-81486
Change-Id: I7bbecd3cbf086243ea3a03fb7822064bde85201c
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:05 +02:00