summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* torrent example: fix premature pessimisationMarc Mutz2020-05-051-1/+1
| | | | | | | | | | | Use case-insensitive endsWith() instead of lowering a QString and then comparing case-sensitively. As a drive-by, replace ascii string literal with char16_t one. Change-Id: Id4d8e5b197baba7aa3ae4c2ae57414c1242b3827 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-05-041-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/text/qlocale.cpp src/network/access/qnetworkaccessmanager.cpp Regenerated tests/auto/testlib/selftests/float/CMakeLists.txt Change-Id: I5a8ae42511380ca49a38b13c6fa8a3c5df8bed01
| * torrent example: fix stripping of file extensionMarc Mutz2020-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | Due to QChar being convertible from almost any integral type, the old code actually called QString::remove(QChar). Fix by using QString::chop() instead. Change-Id: I345b018aa137ecff608a130e69ade5d37ef0805c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Remove a couple of QTextStream usagesLars Knoll2020-05-011-3/+3
| | | | | | | | | | | | | | | | | | | | Don't use QTextStream to write a QString to a file in UTF-8. This can be done more easily, by directly converting the QString to utf-8 and calling write on the io device. Change-Id: I4b617b342ab339affb396ed49c5a920985d1ddfd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | CMake: Regenerate examples/widgets/ projectsSona Kurazyan2020-04-2916-29/+163
| | | | | | | | | | | | | | | | Also add the missing examples/widgets/gallery project. Change-Id: Iec3d61881065cf93d90f9fd3da928ffcd4f0c0aa Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Mark widget gallery example as "gallery"Friedemann Kleint2020-04-291-0/+1
| | | | | | | | | | | | | | | | | | Add a metatag. Amends 4e93e3b574390829c4c3c87716e0a9bb5ed579e4. Pick-to: 5.15 Task-number: PYSIDE-1112 Change-Id: I5003f958559438cc83eb98e5eedfcefb21a243b7 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | examples: avoid int -> QChar conversionsMarc Mutz2020-04-293-3/+3
| | | | | | | | | | | | | | They're being made explicit/deprecated/removed. Change-Id: I61d8c40dc86035813b85724beb21a65b6f8dffef Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Do not mention Qt XML's SAX API anymore in examples/xml/READMEKai Koehne2020-04-241-5/+3
| | | | | | | | | | | | | | | | | | The SAX API in in Qt XML got deprecated, and examples using it removed in commit 82d02b7b95908. Pick-to: 5.15 Change-Id: I39b71378c0f797e82431c8a0e12255626ed145ed Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-231-0/+1
|\| | | | | | | Change-Id: Iaa439ba7dff19a17e3716b3d30f49f60fa6e38f8
| * SslSocketClient - fix example not to crashTimur Pocheptsov2020-04-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | CMake: Add qt6_add_plugin public APILeander Beernaert2020-04-225-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a publicly callable qt6_add_plugin() API to create plugins. This API is meant to cover cases such as the plugandpaint example. This patch also renames qt_add_plugin to qt_internal_add_plugin in order to avoid clashes with the public API. To avoid breaking the existing projects, a compatibility wrapper function is enabled by default unless QT_DISABLE_QT_ADD_PLUGIN_COMPATIBILITY is specified. Fixes: QTBUG-82961 Change-Id: If5b564a8406c90434f1bdad0b8df76d3e6626b5f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Remove deprecated QStyle enum valuesVolker Hilsheimer2020-04-161-2/+2
| | | | | | | | | | Change-Id: I7eba336017844c06b2976df53d440e167abd7894 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Port example over to QRegularExpressionLars Knoll2020-04-155-26/+44
| | | | | | | | | | Change-Id: I1e15bfa0a2973aabcad78f3eba4bb4903f8f3f6f Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Convert the example to use QRegularExpressionLars Knoll2020-04-152-17/+32
| | | | | | | | | | | | Change-Id: I7a4259ac43e59a8f50ee1c5072a3da5b977d8bfe Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* | Fix example documentation to not mention QRegExp anymoreLars Knoll2020-04-132-5/+2
| | | | | | | | | | Change-Id: I2761d8efef31a3b890de9cab78589f1d6c03f62d Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-111-5/+7
|\| | | | | | | | | | | | | Conflicts: tests/auto/network/socket/platformsocketengine/platformsocketengine.pri Change-Id: I22daf269a8f28f80630b5f521b91637531156404
| * Stop using obsolete TouchPoint rect accessors in tests and examplesShawn Rutledge2020-04-101-5/+7
| | | | | | | | | | | | | | | | | | | | Followup to cf4a8b12fa277c2ea218f022607934f60fed1a06 68916fede41d1eca5d07eb6b1db518d41a007616 and 3c159957f863cf8d367a9261e7016e52cd0348c1. Task-number: QTBUG-83403 Change-Id: Ieaf418860c565dbe883384e7f296a829fbfa1e33 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | QApplication: remove obsolete globalStrut functionalityVolker Hilsheimer2020-04-101-2/+1
| | | | | | | | | | | | Change-Id: If56873f86f5291264cac720f8db7dbd4db756f49 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Change qHash() to work with size_t instead of uintLars Knoll2020-04-092-2/+2
| | | | | | | | | | | | | | | | | | | | | | This is required, so that QHash and QSet can hold more than 2^32 items on 64 bit platforms. The actual hashing functions for strings are still 32bit, this will be changed in a follow-up commit. Change-Id: I4372125252486075ff3a0b45ecfa818359fe103b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-088-11/+10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/opengl/doc/src/cube.qdoc src/corelib/global/qlibraryinfo.cpp src/corelib/text/qbytearray_p.h src/corelib/text/qlocale_data_p.h src/corelib/time/qhijricalendar_data_p.h src/corelib/time/qjalalicalendar_data_p.h src/corelib/time/qromancalendar_data_p.h src/network/ssl/qsslcertificate.h src/widgets/doc/src/graphicsview.qdoc src/widgets/widgets/qcombobox.cpp src/widgets/widgets/qcombobox.h tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro tests/manual/diaglib/debugproxystyle.cpp tests/manual/diaglib/qwidgetdump.cpp tests/manual/diaglib/qwindowdump.cpp tests/manual/diaglib/textdump.cpp util/locale_database/cldr2qlocalexml.py util/locale_database/qlocalexml.py util/locale_database/qlocalexml2cpp.py Resolution of util/locale_database/ are based on: https://codereview.qt-project.org/c/qt/qtbase/+/294250 and src/corelib/{text,time}/*_data_p.h were then regenerated by running those scripts. Updated CMakeLists.txt in each of tests/auto/corelib/serialization/qcborstreamreader/ tests/auto/corelib/serialization/qcborvalue/ tests/auto/gui/kernel/ and generated new ones in each of tests/auto/gui/kernel/qaddpostroutine/ tests/auto/gui/kernel/qhighdpiscaling/ tests/libfuzzer/corelib/text/qregularexpression/optimize/ tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/ tests/libfuzzer/gui/text/qtextdocument/sethtml/ tests/libfuzzer/gui/text/qtextdocument/setmarkdown/ tests/libfuzzer/gui/text/qtextlayout/beginlayout/ by running util/cmake/pro2cmake.py on their changed .pro files. Changed target name in tests/auto/gui/kernel/qaction/qaction.pro tests/auto/gui/kernel/qaction/qactiongroup.pro tests/auto/gui/kernel/qshortcut/qshortcut.pro to ensure unique target names for CMake Changed tst_QComboBox::currentIndex to not test the currentIndexChanged(QString), as that one does not exist in Qt 6 anymore. Change-Id: I9a85705484855ae1dc874a81f49d27a50b0dcff7
| * macOS: Remove all use of deprecated Q_OS_OSX defineTor Arne Vestbø2020-04-035-7/+7
| | | | | | | | | | Change-Id: I49c285604694c93d37c9d1c7cd6d3b1509858319 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * More qOverload cleanups in qtbaseTimur Pocheptsov2020-03-241-2/+1
| | | | | | | | | | | | Task-number: QTBUG-82605 Change-Id: I1c3c14ed82911ed5483258c11e76f5dd7744fa12 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * QAbstractSocket: Fix usage of deprecated error signal in exampleMårten Nordheim2020-03-241-1/+1
| | | | | | | | | | | | Task-number: QTBUG-82605 Change-Id: I83a8777d32302607d48dd670b6c787ac05db88d2 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Doc: replace deprecated references to QGLWidgetChristian Ehrlicher2020-03-203-13/+13
| | | | | | | | | | | | | | | | Remove references to the deprecated QGLWidget and replace it with QOpenGLWidget. Change-Id: Ia31df42ab61c25e9ce46f4491267d2c64910f55c Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | QRegularExpression: rename AnchoredMatchOption to AnchorAtOffsetMatchOptionGiuseppe D'Angelo2020-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The name of the option may cause confusion due to the fact that it's not _fully_ anchoring the match, only anchoring it at the offset passed to match() -- in other words, it's a "left" anchoring. Deprecate the old name and introduce a new one that should explain the situation better. [ChangeLog][QtCore][QRegularExpression] The AnchoredMatchOption match option has been deprecated in favor of AnchorAtOffsetMatchOption, which should better describe that the match is only anchored at the offset. Change-Id: Ib751e5e488f2d0309a2da6496378247dfa4648de Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* | Remove the regexp exampleLars Knoll2020-03-319-436/+18
| | | | | | | | | | Change-Id: I113a8f4c8ba401443aab2347211b3782e99c9cf4 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* | Move undo framework out of Qt WidgetsMitch Curtis2020-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Moves QUndo* classes (except QUndoView) from src/widgets/utils to src/gui/utils - Moves related auto tests from widgets to gui - Replaces QUndoAction with lambdas that do text prefixing [ChangeLog][Undo Framework] QUndo* classes (except QUndoView) were moved from Qt Widgets to Qt GUI. Done-with: volker.hilsheimer@qt.io Fixes: QTBUG-40040 Change-Id: I3bd8d4d32c64f8dee548f62159a1df2126da89d8 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | High-DPI: Remove usages of Qt::AA_UseHighDpiPixmapsMorten Johan Sørvig2020-03-3011-29/+0
| | | | | | | | | | | | | | | | | | | | Remove usages of Qt::AA_UseHighDpiPixmaps from examples/. This flag is now on by default, and can't be disabled. Task-number: QTBUG-83092 Change-Id: Ie28622f816da2fe28d4ab272d45ea20bd051d5f3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Remove QGuiAction again and split QAction implementation up insteadVolker Hilsheimer2020-03-296-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Duplicating the number of classes is a high price to pay to be able to have some QAction functionality behave differently, or be only available in widgets applications. Instead, declare the entire API in QtGui in QAction* classes, and delegate the implementation of QtWidgets specific functionality to the private. The creation of the private is then delegated to the Q(Gui)ApplicationPrivate instance through a virtual factory function. Change some public APIs that are primarily useful for specialized tools such as Designer to operate on QObject* rather than QWidget*. APIs that depend on QtWidgets types have been turned into inline template functions, so that they are instantiated only at the caller side, where we can expect the respective types to be fully defined. This way, we only need to forward declare a few classes in the header, and don't need to generate any additional code for e.g. language bindings. Change-Id: Id0b27f9187652ec531a2e8b1b9837e82dc81625c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Re-generate various CMake projects and configure after mergeSimon Hausmann2020-03-162-0/+4
| | | | | | | | | | Change-Id: I02f5926c6664aab518c5c81e0c33dca0818a1871 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.15' into dev"Simon Hausmann2020-03-1611-38/+77
|\ \
| * | Merge remote-tracking branch 'origin/5.15' into devSimon Hausmann2020-03-1611-38/+77
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qmetatype.cpp Change-Id: I88eb0d3e9c9a38abf7241a51e370c655ae74e38a
| | * Mandelbrot Example: Use High DPI scalingFriedemann Kleint2020-03-125-21/+47
| | | | | | | | | | | | | | | | | | | | | Create the pixmap with a device pixel ratio set. Change-Id: I7f7e90aec4d117304852f050be70e14a0c6bf69d Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-03-116-17/+30
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/plugin/qlibrary.cpp src/corelib/plugin/qlibrary_unix.cpp src/corelib/plugin/qpluginloader.cpp Change-Id: I866feaaa2a4936ee5389679724c8471a5b4b583d
| | | * examples: Fix build for configurations that do not have printsupportOliver Wolff2020-03-056-17/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | cmake: Remove APPLE prefix from platform namesTor Arne Vestbø2020-03-162-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | None of the other platforms have it. Change-Id: Ib448c2c03ba03f711b507ef391977c0e6aa7c192 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | | cmake: Fix naming when referring to Apple macOSTor Arne Vestbø2020-03-162-2/+2
|/ / / | | | | | | | | | | | | Change-Id: Iafb5e448d0d65d42f788464fc600594a5666f9af Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | Merge "Merge remote-tracking branch 'origin/5.15' into dev"Qt Forward Merge Bot2020-03-1110-33/+40
|\ \ \
| * | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-1110-33/+40
| |\| | | | | | | | | | | | | | Change-Id: Ibee5acec72a1a1769d4bc5f23f56c7dc8d4cf3cb
| | * | Polish the Mandelbrot ExampleFriedemann Kleint2020-03-103-33/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * | Add default arguments to QPainterPath methods using transformJarek Kobus2020-03-065-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * | Doc: Let SQL Drill Down example show correct use of qgraphicsitem_castPaul Wicking2020-03-062-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | QtConcurrent::run: accept more then five function's argumentsVitaly Fanaskov2020-03-111-2/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][Potentially Source-Incompatible Changes] QtConcurrent::run has the following signatures: run(Function &&f, Args &&...args) and run(QThreadPool *pool, Function &&f, Args &&...args). If f is a member pointer, the first argument of args should be an object for which that member is defined (or a reference, or a pointer to it). See the documentation for more details. Fixes: QTBUG-82383 Change-Id: I18f7fcfb2adbdd9f75b29c346bd3516304e32d31 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devLars Knoll2020-03-0422-15/+97
|\| | | | | | | | | | | Change-Id: I99ee6f8b4bdc372437ee60d1feab931487fe55c4
| * | Examples: add scrollbar to allow viewing all options on AndroidAssam Boudjelthia2020-03-032-12/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Examples: enable HighDPI scaling for examples on AndroidAssam Boudjelthia2020-03-0316-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | QNetworkReply: Deprecate 'error' signal, use 'errorOccurred' insteadMårten Nordheim2020-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | [ChangeLog][Deprecation Notice] QNetworkReply::error() (the signal) is deprecated; superseded by errorOccurred() Change-Id: I4f1ef410fd22d34ddf87e89cc5709cc60703af95 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * | Examples: use QDialog::showMaximaized() for AndroidAssam Boudjelthia2020-03-033-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-039-10/+12
|\| | | | | | | | | | | Change-Id: If36d96c0fef3de5ab6503977501c55c62a2ecc97
| * | Docs: Use Qt::SplitBehavior in preference to QString::SplitBehaviorEdward Welbourne2020-02-289-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>