summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup QtWidgets examplesChristian Ehrlicher2019-10-1156-195/+216
| | | | | | | | | | | Cleanup QtWidgets examples: - use nullptr (clang-tidy) - use member-initialization - adjust the style - fix includes Change-Id: Ic5448606aacc525ea60b615a69227017aa2b821a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Make QTextBlockFormat::MarkerType an enum classShawn Rutledge2019-10-101-6/+6
| | | | | | | This came up during API review. Change-Id: I9198e1eb96db0c21e46a226a032919bb62d3ca66 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Widgets flowlayout example: Fix crash on startupChristian Ehrlicher2019-10-031-1/+1
| | | | | | | | | The flowlayout example crashes on startup because the last change removed a c-style cast which converted -1 to ~0U ... Fixes: QTBUG-78861 Change-Id: I0dbed4472b4f68a92b3f92763d00d28baa186f9a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-09-304-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qrandom.cpp src/corelib/io/qfileinfo.cpp src/corelib/kernel/qeventdispatcher_win.cpp src/corelib/kernel/qeventdispatcher_win_p.h src/gui/text/qfontdatabase.cpp src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm src/plugins/platforms/windows/qwindowsglcontext.cpp src/testlib/qtestcase.cpp Done-With: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Done-With: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I4893212471aa24be804c989a581810e2f714545c
| * I18N: Load qtbase_ translation catalogs in examplesLeena Miettinen2019-09-274-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...instead of the qt_ meta catalogs. The qt_ catalogs are needed for backwards compatibility and depend on translations for now deprecated modules, such as qtscript, that might not be installed in the system. This causes loading the translation to fail. Instead of the qt_ catalogs, the examples should use the translation files for the Qt modules used, here qtbase_. Task-number: QTBUG-69203 Change-Id: I13f5a3d6653cef8379a712fbc02ec320eea4e51a Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Cleanup QtWidgets (widgets) examplesChristian Ehrlicher2019-09-1752-197/+330
| | | | | | | | | | | | | | | | | | | | | | | | | | Cleanup QtWidgets widgets examples: - use member-init (clang-tidy) - fix includes/don't include QtWidgets globally - include own header first - use nullptr (clang-tidy) - avoid c-style casts - use QVector instead QList Change-Id: Ib56bb507eb2ef885f1ddc664050d3c7af92adb70 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Cleanup QtWidgets (tools) examplesChristian Ehrlicher2019-09-1160-376/+426
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleanup QtWidgets tools examples: - use member-init (clang-tidy) - fix includes/don't include QtWidgets globally - include own header first - use nullptr (clang-tidy) - avoid c-style casts - use QVector instead QList - use QItemDelegate instead QStyledItemDelegate Change-Id: Ibe9440cdf711e5cc2138c054864edebe1fc95731 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Widgets/GraphicsView examples: cleanupChristian Ehrlicher2019-09-0559-417/+288
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleanup GraphicsView examples with the help of clang-tidy - modernize-use-nullptr - modernize-use-default-member-init - modernize-use-override.IgnoreDestructors - Some QList -> QVector changes - use nullptr - use normalized includes, remove unused includes - fix style Change-Id: I79347e55bfde52f6ae7749cc7093fbd442044020 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | QFileSystemModel: Fix naming of Option enumerationFriedemann Kleint2019-09-021-1/+1
| | | | | | | | | | | | | | | | Fix an API review finding in 5.14, amending 6b9d319b26da2e4b6f939ee92a176f8604c1c539. Change-Id: I6c67ebde91021b87a43a86ff831b724f098019aa Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Merge remote-tracking branch 'origin/dev' into 5.14Liang Qi2019-08-276-11/+12
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/kernel/qwidget.cpp src/widgets/kernel/qwidget_p.h src/widgets/kernel/qwidgetrepaintmanager.cpp src/widgets/kernel/qwidgetwindow.cpp tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp Change-Id: Ifae457d0427be8e2465e474b055722e11b3b1e5c
| * | Remove usages of deprecated APIs of QWheelEventSona Kurazyan2019-08-236-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replaced the usages of deprecated QWheelEvent::delta() and QWheelEvent::orientation() with QWheelEvent::angleDelta(). In most of the examples it is acceptable to use only the vertical component of angle delta. - Made the docs APIs to build conditionally, based on the deprecation version. Task-number: QTBUG-76491 Task-number: QTBUG-76540 Change-Id: Id4230d483f724af49e4b6349b44881c3944de2a2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Remove dead code from Qt 4 timesTor Arne Vestbø2019-08-202-14/+0
|/ / | | | | | | | | | | | | | | | | | | The benefit of keeping this code around was to inspire or inform changes in the areas to take into account possibly missing features in Qt 5, but at this point that benefit is questionable. We can always use the history to learn about missing pieces if needed. Change-Id: I87a02dc451e9027be9b97554427bf8a1c6b2c025 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Cleanup QtWidgets animation examplesChristian Ehrlicher2019-08-1738-291/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | Cleanup the QtWidgets animation examples: - use nullptr - use normalized includes, remove unused includes - fix style - fix crash of sub-attaq when the game ended (error during range-based for loop porting) - don't use keyword 'final' for a variable name Change-Id: Id23be8ff8b1b310da005d13c052fe547f6a0d63a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | QFileSystemModel: Add optionsFriedemann Kleint2019-08-141-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Options flags similar to QFileDialog: - DontWatch: Do not use file system watchers for simple use cases like line edit completion. This brings it closer to QDirModel, which then can be deprecated. - DontResolveSymlinks: Similar to QFileDialog::DontResolveSymlinks. - DontUseCustomDirectoryIcons: matching QFileIconProvider::DontUseCustomDirectoryIcons for convenience. Task-number: QTBUG-76493 Change-Id: I09d3cb73ef902a700e6ebfba427e2d990fce4b4c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Deprecate QStringViewLiteralMarc Mutz2019-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Remove usages of deprecated APIs of qtbase/widgetsSona Kurazyan2019-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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>
* | Remove the remaining usages of deprecated APIs of qtbaseSona Kurazyan2019-08-011-1/+1
| | | | | | | | | | | | | | | | | | 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>
* | QOpenGLWindow example: use std::unique_ptr instead of QScopedPointerMarc Mutz2019-07-252-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | QScopedPointer is scheduled for deprecation, and can't decide whether it wants to be a scoped, or a unique pointer. The use of a unique_ptr members requires that the destructor be out-of-line, since the payload classes are only forward-declared in the header file. Change-Id: Id0dcdde52cb3adc30d3051d2eed1d24c76154921 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-171-4/+5
|\| | | | | | | | | | | | | | | | | | | 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
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-121-4/+5
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure.pri Also required s/solid\.color/solidColor/ in a couple of places in: src/gui/painting/qpaintengine_raster.cpp Change-Id: I29937f63e9779deb6dac7ae77e2948d06ebc0319
| | * Fix the systray example to only show an icon when requestedVolker Hilsheimer2019-07-091-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "None" and "Custom icon" cases where using the same value for icon type, which resulted in both options showing the application icon. Use -1 to indicate the custom option, and treat all other options the same. Task-number: QTBUG-76916 Change-Id: Ib715f5d328175bd6e221b3f507087954fa542838 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | Remove usages of deprecated APIs of qtbase/guiSona Kurazyan2019-07-134-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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>
* | | Remove usages of deprecated APIs of corelibSona Kurazyan2019-07-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-012-7/+8
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/ssl/qsslsocket_openssl.cpp src/platformsupport/vkconvenience/qvkconvenience.cpp Change-Id: I97ce6ed185f7fdad8102cc58d3cfec0119fd7bb4
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-06-282-7/+8
| |\| | | | | | | | | | Change-Id: I912bd8851c390302414d3dfb3c8220df5a0d5630
| | * styles example: Use QImage instead of QPixmap in NorwegianWoodStyleTor Arne Vestbø2019-06-252-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using QImage allows creating the style before the application has been created, and is the more modern API. No changes to the documentation needed. Change-Id: Ifa0e5fa1113802fca18fbd45bb3c0a5ba1dbfeab Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-06-271-6/+32
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/network/ssl/qsslsocket_openssl.cpp Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io> Change-Id: Ibb57a0548b4977797b400637487a56245ac1c024
| * | Example: Move the SQL statementsVenugopal Shivashankar2019-06-211-6/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Used const variables for the SQL statements, so that the code looks similar to its couterpart in Qt for Python. Change-Id: If2a505a404deff77d3d37c5ffad913c8c538d0b3 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-06-201-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/gui/painting/qdrawhelper.cpp src/network/ssl/qsslsocket_openssl.cpp src/widgets/styles/qstylesheetstyle.cpp Change-Id: Ibe1cd40f46a823c9e5edbe0a3cd16be1e1686b17
* | | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-06-251-1/+1
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Doc: Fix typo in briefPaul Wicking2019-06-191-1/+1
| | | | | | | | | | | | | | | | | | Fixes: QTBUG-76512 Change-Id: I8db4288b22416c6af9aaaa72c5005b81d79bf620 Reviewed-by: Martin Smith <martin.smith@qt.io>
* | | Convert uses of QTime as a timer to QElapsedTimerEdward Welbourne2019-06-149-21/+19
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I2297f61efa5adf9ea5194c7f3ff68574cbcf452c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Use QSaveFile in MainWindow examplesFriedemann Kleint2019-06-124-35/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QSaveFile should preferably be used by editor applications to catch write errors. Task-number: QTBUG-60635 Change-Id: Ia609435871b56b45714c3dd3d32bbc85b5cb4dd5 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | SecureUDPServer example: use std::unique_ptr instead of QSharedPointerMarc Mutz2019-05-152-16/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only reason the code used QSharedPointer is that it used QVector to hold a collection of them, and QVector infamously cannot hold move-only types such as std::unique_ptr. Fix by using std::vector<std::unique_ptr> instead. Also, pass the objeccts into non-sink functions by raw pointer instead of shared_ptr. As a drive-by, replace clear-following-iterate by the for-exchanged pattern. Change-Id: I605fbb98af840c1b93eab9e65c07defd6e7b39e1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | RelationalTableModel example: use std::unique_ptr instead of QScopedPointerMarc Mutz2019-05-151-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's talk that QScopedPointer may be deprecated. Don't use it in examples anymore. Change-Id: I3c4647a569b72cd3a628c9b92ef34c87fd588342 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | HTTP example: use std::unique_ptr instead of QScopedPointerMarc Mutz2019-05-152-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows the QFile factory there to actually return the payload in a unique_ptr instead of falling back to a raw pointer. The use of a unique_ptr member requires that the destructor be out-of-line, since QFile is only forward-declared in the header file. This is good hygiene, so do it for ProgressDialog, too. Change-Id: Idb6ed327f9592526bb7d0d5b2cfbffe9f08f3eea Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | ThreadedOpenGL example: use std::unique_ptr instead of QScopedPointerMarc Mutz2019-05-151-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's talk that QScopedPointer may be deprecated. Don't use it in examples anymore. Change-Id: I05a486c2a86fcc7015a9c21ed0ce9682b0c24034 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | Torrent example: Replace the last Java-style iterator with STL onesMarc Mutz2019-05-231-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scope a previous iterator variable better so we can re-use 'it' as the iterator name. Change-Id: I46d239ad2d3646168408d1ef29ed74fd07bc663f Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Icons example: use std::unique_ptr instead of QScopedPointerMarc Mutz2019-05-151-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's talk that QScopedPointer may be deprecated. Don't use it in examples anymore. Change-Id: Ia50ef66de84dae2885f71a9dd83c5909bfa253f0 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | Composition example: use std::unique_ptr instead of QScopedPointerMarc Mutz2019-05-152-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The use of a unique_ptr member requires that the destructor be out-of-line, since the payload is only forward-declared in the header file. This is good hygiene, so do it for CompositionWidget, too. Add 'explicit' and missing = nullptr to both constructors as a drive-by. Change-Id: Ied1c89864f90d3f2c13fb4e9a8bbbe2e6fd6f1d7 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | Torrent example: replace a QMultiMap with a sorted vectorMarc Mutz2019-05-251-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This came about trying to remove the Java-style iterator. It was used to iterate in reverse order, something QMap can't do, easily, due to lack of rbegin()/rend(). Instead of writing ugly loops, use a vector of pairs, fill it, sort it, then iterate over that one in reverse. Change-Id: I09c8a2732a0699fff4c497778745523e20d348a1 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Torrent example: add missing qAsConst()Marc Mutz2019-05-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function is const, but the d-pointer doesn't propagate it (raw pointer), so we need the qAsConst() even here. Change-Id: I9d2e1f7715abb3dc67a87cdadaa7ded971b15848 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Torrent example: rewrite some very convoluted codeMarc Mutz2019-05-241-17/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code iterated over the peer list, inserting active peers into a QSet, curiously not stopping to search for clients if it had already determined the peer to be active. It then iterated over the peers again, storing the indexes of the peers it had determined to be active in the first loop, in a QList. It _then_ iterated over the index list, in reverse, calling removeAt() on the peers list. <sean parent>That's a remove_if!</sean parent> The twist is, that only some maximum number of inactive peers should be removed, just enough to bring the number of peers below a predefined number. To solve, use a lambda that keeps track of the number of times it has returned true, returning false once the count drops to zero. We can't use a mutable lambda here, since the STL algorithms are allowed to copy the predicate as many times as they wish, and, indeed, remove_if is commonly implemented by calling find_if. But the standard guarantees exactly one application of the predicate per element, so we can assume that we're not called again on the same element, and therefore keep a reference to an external count. With this, what was a horrible mess becomes a single call to remove_if. Also change a while(--n) c.removeFirst() loop to a single call of range-erase. Change-Id: I6c6a54a1805e5b376800e1116e7aec643e95e4e1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Torrent example: replace Java-style iteration with STL iteratorsMarc Mutz2019-05-231-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Java-iterators are going to be deprecated. Change-Id: I2e6353f3fd9e2ddaf0767e7f6cea713249d9591e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Remove usages of Q_OS_WINCEJoerg Bornemann2019-05-231-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This platform is history. Change-Id: Iddfab008a509f4828c321730414c8204055cf7af Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | | Fix memory leak with arthur styleSimon Hausmann2019-05-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ASAN reports a leak here, so let's delete the style after the widgets using them have been destroyed. Change-Id: I0e8603fc5d2d0c13deca35a1c0020646c65eaf49 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Fix qdoc warnings for Qt 5.14Friedemann Kleint2019-05-211-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/corelib/tools/qstring.cpp:9505:clang found diagnostics parsing \fn int QLatin1String::indexOf(QLatin1String l1, int from Qt::CaseSensitivity cs) const error: expected ')' error: out-of-line definition of 'indexOf' does not match any declaration in 'QLatin1String' src/corelib/tools/qstringview.cpp:723:clang found diagnostics parsing \fn qsizetype QStringView::indexOf(QLatin1String l1, qsizetype from Qt::CaseSensitivity cs) const error: expected ')' error: out-of-line definition of 'indexOf' does not match any declaration in 'QStringView' src/corelib/tools/qstringview.cpp:822:Unknown command '\t' src/corelib/tools/qstringview.cpp:825:Unknown command '\t' src/corelib/tools/qstringview.cpp:826:Unknown command '\t' src/corelib/tools/qstringview.cpp:831:Unknown command '\t' src/corelib/global/qnamespace.qdoc:2448:Undocumented enum item 'MarkdownText' in Qt::TextFormat src/corelib/tools/qstringmatcher.cpp:183:No such parameter 'pattern' in QStringMatcher::QStringMatcher() src/network/ssl/qsslerror.cpp:58:Undocumented enum item 'CertificateStatusUnknown' in QSslError::SslError src/gui/kernel/qevent.cpp:5321:Undocumented parameter 'screenOrientation' in QScreenOrientationChangeEvent::QScreenOrientationChangeEvent() src/gui/kernel/qevent.cpp:5321:Undocumented parameter 'screen' in QScreenOrientationChangeEvent::QScreenOrientationChangeEvent() src/gui/kernel/qevent.cpp:5321:No such parameter 'orientation' in QScreenOrientationChangeEvent::QScreenOrientationChangeEvent() src/gui/text/qtextformat.cpp:532:Undocumented enum item 'BlockCodeLanguage' in QTextFormat::Property src/gui/text/qtextformat.cpp:532:Undocumented enum item 'BlockQuoteLevel' in QTextFormat::Property src/gui/text/qtextformat.cpp:532:Undocumented enum item 'BlockMarker' in QTextFormat::Property src/gui/text/qtextdocument.cpp:3294:Undocumented parameter 'features' in QTextDocument::toMarkdown() src/gui/painting/qcolorspace.cpp:659:Undocumented parameter 'colorSpace1' in QColorSpace::operator!=() src/gui/painting/qcolorspace.cpp:659:Undocumented parameter 'colorSpace2' in QColorSpace::operator!=() src/gui/painting/qcolorspace.cpp:659:No such parameter 'colorspace1' in QColorSpace::operator!=() src/gui/painting/qcolorspace.cpp:659:No such parameter 'colorspace2' in QColorSpace::operator!=() examples/widgets/doc/src/icons.qdoc:269:Command '\snippet (//! [43])' failed at end of file 'widgets/icons/iconpreviewarea.cpp' src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogRetryButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogYesToAllButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogIgnoreButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogNoToAllButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogAbortButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_RestoreDefaultsButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogSaveAllButton' in QStyle::StandardPixmap src/testlib/qtestcase.qdoc:439:Undocumented parameter 'TestClass' in QTest::QTEST_HIGHDPI_SCALING_MAIN src/testlib/qtestcase.qdoc:452:Undocumented parameter 'TestClass' in QTest::QTEST_NO_HIGHDPI_SCALING_MAIN Change-Id: Ib0e9bf81c5caaa6b1fc644ac92085af47c600e0e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | examples: port away from Java-style iteratorsMarc Mutz2019-05-234-19/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no reason to use them here, the Mutable is misleading in a few instances, ranged-for is much simpler, and more future-proof. Change-Id: Ifd5eaae95bbaa0b4cf0f435e6cfee6d778817b44 Reviewed-by: David Faure <david.faure@kdab.com>
* | | QFileDialog: mark obsolete enum DontUseSheet as deprecatedChristian Ehrlicher2019-05-171-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFileDialog::DontUseSheet is obsolete since 4.5 and not used anywhere inside the Qt code base. Mark it as deprecated and remove the last usage in the examples. Change-Id: If3d23fd5906314e6ebc7080efa79da14a2aa2720 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | QtCore: mark obsolete enumerations as deprecatedChristian Ehrlicher2019-05-172-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following enumerations were obsolete for a log time but not marked as deprecated: - WA_NoBackground - WA_MacNoClickThrough - WA_MacBrushedMetal - WA_MacMetalStyle - WA_MSWindowsUseDirect3D - WA_MacFrameworkScaled - AA_MSWindowsUseDirect3DByDefault - AA_X11InitThreads - ImMicroFocus mark them as deprecated and remove the usage inside QtBase so they can be removed with Qt6 Change-Id: Ia087a7e1d0ff1945286895be6425a6cceaa483fb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>