Commit Graph

1389 Commits

Author SHA1 Message Date
Timur Pocheptsov
6c45b1817f SslSocketClient - fix example not to crash
Due to the bug related to the 'new syntax' signal/slot connections,
it's unfortunately possible to have a connection not deleted properly
by the moment children objects get deleted. Then, as a result,
in e.g. QSslSocket's destructor the socket will change its state,
triggering the (now deleted) UI elements' access.
Note - the original  bug was reported, the patch (only possible?) was
not accepted.

Fixes: QTBUG-83659
Change-Id: I2965532485bcd46f93f8449e4d0a30da92b572c5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-22 13:03:45 +02:00
Shawn Rutledge
1ec350e35f Stop using obsolete TouchPoint rect accessors in tests and examples
Followup to cf4a8b12fa
68916fede4 and
3c159957f8.

Task-number: QTBUG-83403
Change-Id: Ieaf418860c565dbe883384e7f296a829fbfa1e33
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-10 13:54:43 +00:00
Tor Arne Vestbø
ab4c22d47d macOS: Remove all use of deprecated Q_OS_OSX define
Change-Id: I49c285604694c93d37c9d1c7cd6d3b1509858319
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-03 13:44:37 +02:00
Timur Pocheptsov
4561370661 More qOverload cleanups in qtbase
Task-number: QTBUG-82605
Change-Id: I1c3c14ed82911ed5483258c11e76f5dd7744fa12
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-03-24 20:58:13 +01:00
Mårten Nordheim
fc1b5eac1a QAbstractSocket: Fix usage of deprecated error signal in example
Task-number: QTBUG-82605
Change-Id: I83a8777d32302607d48dd670b6c787ac05db88d2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-03-24 17:40:40 +01:00
Christian Ehrlicher
bd75c87e0e Doc: replace deprecated references to QGLWidget
Remove references to the deprecated QGLWidget and replace it with
QOpenGLWidget.

Change-Id: Ia31df42ab61c25e9ce46f4491267d2c64910f55c
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-20 22:27:29 +01:00
Friedemann Kleint
a719c630f1 Mandelbrot Example: Use High DPI scaling
Create the pixmap with a device pixel ratio set.

Change-Id: I7f7e90aec4d117304852f050be70e14a0c6bf69d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-03-12 08:24:09 +01:00
Qt Forward Merge Bot
116d68f105 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/corelib/plugin/qlibrary.cpp
	src/corelib/plugin/qlibrary_unix.cpp
	src/corelib/plugin/qpluginloader.cpp

Change-Id: I866feaaa2a4936ee5389679724c8471a5b4b583d
2020-03-11 11:27:49 +01:00
Friedemann Kleint
9aa2932701 Polish the Mandelbrot Example
Fix warnings about float constants and comparison.
Use member or constructor initialization.
Introduce some const for clarity.
Use Qt_CONFIG.

Task-number: QTBUG-81254
Change-Id: I71a6ebfba397c0f8e1dd2e61167233c8e5c137af
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-10 08:15:15 +01:00
Jarek Kobus
50d2acdc93 Add default arguments to QPainterPath methods using transform
Fixes: QTBUG-82602
Change-Id: Id82f145ffb33e6d4ef9b81282ad14657b1c8fbd0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-06 21:09:48 +01:00
Paul Wicking
a2446c0eed Doc: Let SQL Drill Down example show correct use of qgraphicsitem_cast
For qgraphicsitem_cast to work correctly with custom items, one must
reimplement the type() function for each custom QGraphicsItem subclass.
Do that in the example code.

Fixes: QTBUG-7357
Change-Id: Ibf221817908355f0347cddfc46747b6955958f5f
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-03-06 08:12:52 +01:00
Oliver Wolff
7c7bd44669 examples: Fix build for configurations that do not have printsupport
printsupport features are only available if the module is available for
the configuration. Every printer feature check has to be coupled with a
check for the module itself.

Change-Id: Id2ca84e71d5d74463d0ff35e8b18b252a779a883
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-03-05 15:11:36 +01:00
Assam Boudjelthia
b711ee2555 Examples: add scrollbar to allow viewing all options on Android
This fix is most relevant for Android for affine and gradients examples.
Currently, if the screen size is small the settings will show cramped
and not usable. Thus, adding a scrollbar to fix that.

Task-number: QTBUG-80717
Change-Id: Ic25460e5ce37a5c53bbcae48e11b6b787c45e999
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-03-03 19:35:46 +02:00
Assam Boudjelthia
e5f4e14059 Examples: enable HighDPI scaling for examples on Android
These examples show very tiny UI elements on Android devices,
thus enabling HighDPI.

Task-number: QTBUG-80717
Change-Id: I813801d5249dc1fcfc6f61a8d146f60dd19901f6
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-03-03 19:35:11 +02:00
Mårten Nordheim
8f8eb99991 QNetworkReply: Deprecate 'error' signal, use 'errorOccurred' instead
[ChangeLog][Deprecation Notice] QNetworkReply::error() (the signal) is deprecated; superseded by errorOccurred()

Change-Id: I4f1ef410fd22d34ddf87e89cc5709cc60703af95
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-03-03 18:25:57 +01:00
Assam Boudjelthia
873eba3f8b Examples: use QDialog::showMaximaized() for Android
Examples that use QDialog as main window should be maximized on Android
to avoid a black view on most of the screen.

Task-number: QTBUG-80717
Change-Id: I933c1a01d95d53da009c190c37fa32f27be5af5e
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-03-03 12:39:56 +02:00
Edward Welbourne
c158f881b3 Docs: Use Qt::SplitBehavior in preference to QString::SplitBehavior
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.

Applied suitable wrapping round various char and string literals,
since docs are meant to show best practice.

Change-Id: Ie061905fad26f9b4dda3eedba4612704f0a19126
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-28 15:37:11 +01:00
Alexander Akulich
4c86e667d2 Revert "QNetworkReply: deprecate the 'error' getter"
This reverts commit ccb2cb84f5 and
commit 0f568d0a67.

The patches fix ambiguity between a getter and a signal by changing the
getter name, but we still have to rename the signal to follow the signals
naming convention.

Revert the commits to keep the getter as is and change the signal name instead.

Change-Id: Iddbab7c33eea03826ae7c114a01857ed45bde6db
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-02-28 07:21:14 +03:00
Alexander Akulich
cb26a4da69 QAbstractSocket: deprecate 'error' signal, use 'errorOccurred' instead
[ChangeLog][Deprecation Notice] QAbstractSocket::error() (the signal) is deprecated; superseded by errorOccurred()

Change-Id: I11e9c774d7c6096d1e9b37c451cf0b99188b6aad
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-02-27 13:56:45 +01:00
Assam Boudjelthia
86f7d44089 Examples: request Android storage permissions when using QStandardPaths
http example uses QStandardPaths, on Android permissions might need to
be explicitly requested to write the downloaded file.

Task-number: QTBUG-80717
Change-Id: Icd377254ad77cac661c5ae37e9081e0463493d8b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-02-26 23:07:48 +02:00
Alexander Akulich
6d18e4a2b8 Revert "QAbstractSocket: deprecate 'error' member-function"
This reverts commit 94b3dd77f2.

The patch fixes ambiguity between a getter and a signal by changing the
getter name, but we still have to rename the signal to follow the signals
naming convention.

Revert the commit to keep the getter as is and change the signal name instead.

Change-Id: I0dd60cf1ae9d1bd95beeb8ad58661ca4b1fb63b9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-02-26 23:07:52 +03:00
Mårten Nordheim
3742c67041 Remove bearer management from remaining network examples
Because bearer management is going away

Change-Id: I60439c1714e0350b0f2bbef6afc8d2015886135f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-02-19 13:28:00 +01:00
Mårten Nordheim
22c585f0f9 Remove the bearermonitor example
Because bearer management is going away

Change-Id: I64311895c347b3e63df75d10db1673bcfe54f52d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-02-19 13:28:00 +01:00
Mårten Nordheim
57a6c60fb9 Remove usage of bearer management from lightmaps example
Because bearer management is going away

Change-Id: I82f2e67a052fdcdf0dde337f9f69b414681511c4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-02-19 13:28:00 +01:00
Liang Qi
b9585277e7 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/corelib/tools/qlinkedlist.h
	src/plugins/platforms/wasm/qwasmintegration.cpp
	src/plugins/platforms/wasm/qwasmscreen.cpp

Change-Id: Iefca7f9f4966bdc20e7052aca736874861055738
2020-02-18 09:26:53 +01:00
Shawn Rutledge
882f340f62 Deprecate QTabletEvent::device() in favor of deviceType()
The idea is to reserve device() to return a pointer to a QInputDevice
in the future, which is in sync with QQuickPointerEvent::device()
and with QTouchEvent::device().

Change-Id: Ifda6e8aea72d5121955b31bdcbd91bf1bfa4cec4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-02-17 21:39:59 +01:00
Paul Wicking
b26b40f7e1 Doc: remove link to Qt Quarterly in example
Qt Quarterly 31 was the last edition of Qt Quarterly to be
published exclusively as a PDF. We cannot fix the typo in the
PDF. As the content is >10 years old an in an unmaintained
archive section, remove the reference to it from this example.

Fixes: QTBUG-81972
Change-Id: I41a82487ff89dbe8ea5701c02c51e7f7c79bf73d
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-02-14 13:59:17 +01:00
Jan Arve Sæther
5e83a2eed2 Deprecate one overload of QInputDialog::getDouble() for 5.15
...and merge the two overloads of getDouble() in Qt6

Change-Id: I55faa2ff222b41e48889a0ef14dd00a6da691c36
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-02-12 16:10:24 +01:00
Alexander Akulich
c08b0cec2f QLocalSocket: Deprecate 'error' signal, use 'errorOccurred' instead
[ChangeLog][Deprecation Notice] QLocalSocket::error() (the signal) is deprecated; superseded by errorOccurred()

Change-Id: I579c07564f5c470cf2867864755e0a26e6afce3b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-02-11 16:54:59 +03:00
Jan Arve Sæther
f415c5ad23 Remove unused variable
Change-Id: I774b1647eff5fcfa0de5bcc50ca2638644b03613
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-02-10 15:04:39 +01:00
Qt Forward Merge Bot
97417e8f28 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	.qmake.conf
	examples/widgets/widgets/imageviewer/imageviewer.cpp
	src/corelib/text/qchar.cpp
	src/corelib/time/qdatetime.cpp

Change-Id: I9762f5c4ff650799219729d6aee79ac07ce9024a
2020-02-04 10:44:00 +01:00
Giuseppe D'Angelo
c29fac453f Markdown importer: use Unicode decoding
Given we feed UTF-8 data into the importer, it must be able to cope
with Unicode. Build md4c with UTF-8 support, advertise it at
usage site, and change a couple of broken decodings.

Driveby: the textedit example used the wrong codec to decode
a Markdown file. While the Markdown spec doesn't deal with encodings,
using the default one for HTML is certainly wrong. Port the loading
of both markdown and plaintext to UTF-8, as that what _saving_
via QTextDocumentWriter would use by default.

Change-Id: I51c6214cfe45ebfc5a67a7366f7866a5328366ec
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-02-03 14:58:00 +01:00
Sze Howe Koh
b90eaa3bb5 Examples: Replace deprecated QLabel API
Task-number: QTBUG-48701
Change-Id: I6fc875a35dfc3bf4d906d0f0e495c18ef566d1e1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-02-01 07:31:01 +08:00
Christian Ehrlicher
c7f59cad19 Examples: fix compile without printsupport
Checking for QT_CONFIG(printdialog) is not enough when printsupport is
completely disabled since then the macro will throw an error. Therefore
add an additional check 'defined(QT_PRINTSUPPORT_LIB)' before using the
QT_CONFIG macro.

Fixes: QTBUG-81626
Change-Id: Ie9898f057cdd6bf9daf4ba9135987cb6e901e7bf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-01-31 06:23:58 +01:00
Edward Welbourne
2130d282b1 Change examples and snippets to pass QDate and QTime by value
They're value types, so we should show them being used as such.

Change-Id: If9f0c366fac66306b7861f04e2f047540d444acc
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2020-01-30 13:32:57 +01:00
Topi Reinio
5d82cbcfc3 Doc: Specify install path for Vulkan examples
Vulkan examples, although part of the Qt GUI documentation project,
live under their own directory under /examples. Mark the correct
install path for these using the \meta command.

Fixes: QTBUG-81360
Change-Id: I0b98a19bf56d5b1953dbd90c0d5103be9041689a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-01-30 10:42:57 +00:00
Christian Ehrlicher
fb7c9dfc06 QButtonGroup: deprecate overloaded signals
Deprecate the overloaded signals
buttonClicked/buttonPressed/buttonReleased/buttonToggled taking an int
to avoid to need to use QOverload<> when connecting the signal. The id
of a button in a button group can be easily fetched with
QButtonGroup::id().

Task-number: QTBUG-80906
Change-Id: Idaaab54bbcb25cba543fc99f305b9f4743ee3ed8
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-01-28 06:24:25 +01:00
Jarek Kobus
4bb897a384 Deprecate all methods that use QMatrix
Don't use QMatrix in implementation classes anymore.

Task-number: QTBUG-46653
Fixes: QTBUG-81627
Change-Id: I4806c1302e42645dc6a608062c8d9c336ae8629b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-01-28 04:12:25 +01:00
Sze Howe Koh
582311d122 Doc: Replace some usages of 0/zero/null with \nullptr
Change-Id: Ibe7de11fc6fc41477c35e7d653c6a911855deabb
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-01-27 21:31:08 +08:00
Friedemann Kleint
3939640965 Fix some qdoc-warnings
src/corelib/tools/qmap.cpp:1199: (qdoc) warning: Can't link to 'QMultiMap::unite()'
src/gui/kernel/qevent.cpp:949: (qdoc) warning: Unknown command '\see'
src/gui/painting/qpaintengine_raster.cpp:344: (qdoc) warning: clang found diagnostics parsing \fn Type QRasterPaintEngine::type() const
    error: unknown type name 'Type'
src/gui/doc/src/qtgui.qdoc:45: (qdoc) warning: Can't link to 'Build with CMake'
examples/widgets/doc/src/gallery.qdoc:28: (qdoc) warning: Cannot find file 'widgets/gallery/gallery.pro' or 'widgets/gallery/gallery.pyproject'
src/widgets/kernel/qwidget.cpp:5950: (qdoc) warning: Can't link to 'setFilePath'
src/widgets/kernel/qshortcut.cpp:542: (qdoc) warning: No such parameter 'context' in QShortcut::QShortcut()

Change-Id: I2395af854efebef719d4762da466f69f7c5aab9e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-01-24 08:13:03 +01:00
Olivier Goffart
73d1476fb1 Replace most use of QVariant::type and occurrences of QVariant::Type
I made a clazy automated check that replaced the use of QVariant::Type
by the equivalent in QMetaType.
This has been deprecated since Qt 5.0, but many uses were not yet removed.

In addition, there was some manual changes to fix the compilation errors.

Adapted the Private API of QDateTimeParser and QMimeDataPrivate
and adjust QDateTimeEdit and QSpinBox.

QVariant(QVariant::Invalid) in qstylesheet made no sense.

But note that in QVariant::save, we actually wanted to use the non-user type.

In the SQL module, many changes were actually reverted because the API
still expects QVarient::Type.

Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-01-23 16:46:51 +01:00
Qt Forward Merge Bot
3e9f8b5249 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I12148e7b20bcdb72d9b328035d528c99633b1e92
2020-01-18 01:00:08 +01:00
Topi Reinio
e05511a364 Pad Navigator example: Remove duplicated property animations
The example created two QPropertyAnimation instances that controlled
the same property; this caused a clash for some transitions.

Remove the smoothFlipXRotation and smoothFlipYRotation animations;
they are not needed as equivalent animations are already set as
defaults for the state machine.

Fixes: QTBUG-28081
Change-Id: Ifa7a09d48cd4905df720e3327914320ed74ebae6
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-01-16 10:24:06 +01:00
Qt Forward Merge Bot
c3123c757a Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I8dbcf23835d52d3aa7d018ed250814d60c68aa83
2020-01-15 01:00:39 +01:00
Friedemann Kleint
4e93e3b574 Add documentation for the widget gallery
Task-number: PYSIDE-1112
Change-Id: I35fe85d8ac9c2dab9f1260d3736c7f65e8e45d8e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-01-14 14:52:09 +01:00
Mårten Nordheim
f494e8b58d Build the securesocketclient example for other SSL backends
Change-Id: I06b8361c116d2ae2aa2a64f63ac90b6ff1982008
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
2020-01-14 09:44:28 +01:00
Tor Arne Vestbø
0a93db4d82 Unify application palette handling between QGuiApplication and QApplication
The logic is now mostly handled in QGuiApplication, with QApplication
only dealing with the widget-specific palettes and interaction between
the style and the palette.

The application now picks up changes to the platform theme and will
re-resolve the current application palette appropriately. This also
works even if an explicit application palette has been set, in which
case any missing roles are filled in by the theme.

The palette can now also be reset back to the default application
palette that's fully based on the theme, by passing in the default
constructed palette (or any palette that doesn't have any roles set).
This is also correctly reflected in the Qt::AA_SetPalette attribute.

Conceptually this means QGuiApplication and QApplication follow the
same behavior as QWidget, where the palette falls back to a base or
inherited palette for roles that are not set, in this case the theme.

Behavior-wise this means that the default application palette of the
application does not have any roles set, but clients should not have
relied on this, nor does QWidget rely on that internally.

It also means that setting a palette on the application and then
getting it back again will not produce the same palette as set,
since the palette was resolved against the theme in the meantime.
This is the same behavior as for QWidget, and although it's a
behavior change it's one towards a more sane behavior, so we
accept it.

[ChangeLog] Application palettes are now resolved against the platform's
theme palette, the same way widget palettes are resolved against their
parents, and the application palette. This means the application palette
reflected through QGuiApplication::palette() may not be exactly the same
palette as set via QGuiApplication::setPalette().

Change-Id: I76b99fcd27285e564899548349aa2a5713e5965d
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-01-13 16:53:05 +01:00
Timur Pocheptsov
ccb2cb84f5 QNetworkReply: deprecate the 'error' getter
To disambiguate &QNetworkReply::error expression.

[ChangeLog][Deprecation Notice] QNetworkReply::error() (the getter) was deprecated; superseded by networkError().

Task-number: QTBUG-80369
Change-Id: I545f963788bce0800c9e0f0c94d5f1029946effe
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-01-13 15:50:47 +01:00
Friedemann Kleint
caab0ad357 Fix Mandelbrot Example documentation with regards to qRegisterMetaType()
The call to qRegisterMetaType() has been removed since the type
is registered as a meta type in Qt 5. Assert on the meta type id instead.
Adapt the documentation accordingly.

Fixes: QTBUG-81254
Change-Id: I0cb459d0dda7a82fc37871605ff634004af0f9f9
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-01-13 12:50:03 +01:00
Timur Pocheptsov
94b3dd77f2 QAbstractSocket: deprecate 'error' member-function
The one that is a getter for the last error found. This is to disambiguate
the expression '&QAbstractSocket::error'. Introduce a new member-function
socketError as a replacement.

[ChangeLog][Deprecation Notice] QAbstractSocket::error() (the getter) is deprecated; superseded by socketError().

Task-number: QTBUG-80369
Change-Id: Ia2e3d108657aaa7929ab0810babe2ede309740ba
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-01-10 12:54:53 +01:00