summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.15' into devLiang Qi2020-01-0415-20/+46
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qvector.h Make QVector(DataPointer dd) public to be able to properly merge 5b4b437b30b320e2cd7c9a566999a39772e5d431 from 5.15 into dev. src/widgets/kernel/qapplication.cpp tests/auto/tools/moc/allmocs_baseline_in.json Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de> Change-Id: I929ba7c036d570382d0454c2c75f6f0d96ddbc01
| * Fix some qdoc warningsFriedemann Kleint2020-01-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/corelib/serialization/qjsonvalue.cpp:174: (qdoc) warning: No such parameter 'n' in QJsonValue::QJsonValue() ... examples/widgets/doc/src/icons.qdoc:584: (qdoc) warning: Command '\snippet (//! [24])' failed at end of file 'widgets/icons/mainwindow.cpp' src/corelib/text/qbytearray.cpp:5177: (qdoc) warning: clang found diagnostics parsing \fn QByteArray::FromBase64Result::operator QByteArray() const error: out-of-line definition of 'operator QByteArray' does not match any declaration in 'QByteArray::FromBase64Result' src/corelib/serialization/qjsonarray.cpp:178: (qdoc) warning: Overrides a previous doc src/corelib/serialization/qjsonarray.cpp:140: (qdoc) warning: (The previous doc is here) src/corelib/serialization/qjsonobject.cpp:1016: (qdoc) warning: clang found diagnostics parsing \fn QJsonValueRef QJsonObject::iterator::operator[](int j) const error: out-of-line definition of 'operator[]' does not match any declaration in 'QJsonObject::iterator' src/corelib/serialization/qjsonobject.cpp:1267: (qdoc) warning: clang found diagnostics parsing \fn QJsonValue QJsonObject::const_iterator::operator[](int j) const error: out-of-line definition of 'operator[]' does not match any declaration in 'QJsonObject::const_iterator' src/corelib/tools/qhash.cpp:2641: (qdoc) warning: Overrides a previous doc src/corelib/tools/qhash.cpp:1492: (qdoc) warning: (The previous doc is here) src/corelib/tools/qhash.cpp:2659: (qdoc) warning: Can't link to 'unit()' src/corelib/text/qchar.cpp:274: (qdoc) warning: Undocumented enum item 'Script_Sundanese' in QChar::Script src/corelib/text/qchar.cpp:274: (qdoc) warning: No such enum item 'Script_Sundaneseo' in QChar::Script src/network/ssl/qsslsocket.cpp:1514: (qdoc) warning: Can't link to 'QSslConfiguration::addDefaultCaCertificate()' src/widgets/widgets/qtabwidget.cpp:581: (qdoc) warning: Undocumented parameter 'visible' in QTabWidget::setTabVisible() Change-Id: I05c2a4884873850b684fa94036cd90db1a6e7726 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2019-12-164-4/+30
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/ssl/qsslsocket.cpp src/widgets/kernel/qapplication.cpp Change-Id: Ib7421cc2df59d0969f89b3fbd65a17ea76ffef3b
| | * styles example: Set default style up front, and react to style changesTor Arne Vestbø2019-12-124-4/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | Allows running the example with -style foo or QT_STYLE_OVERRIDE. No changes to documentation needed. Change-Id: Id7cef450f13faabd118badde51afb7273439c9fc Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | Replace usages of QVariant::value by qvariant_castOlivier Goffart2019-12-1510-15/+15
| | | | | | | | | | | | | | | | | | | | | This is done automatically with a clazy check Change-Id: I3b59511d3d36d416c8eda74858ead611d327b116 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Move QOpenGLWidget from QtWidgets to QtOpenGLJohan Klokkhammer Helsing2019-12-126-6/+6
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-74409 Change-Id: I98a4f8a9e1d439bfdc24eb2910385273cedecd29 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | Merge "Merge remote-tracking branch 'origin/5.15' into dev"Qt Forward Merge Bot2019-12-112-18/+41
|\| |
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2019-12-102-18/+41
| |\| | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/network/kernel/qnetworkinterface/BLACKLIST Change-Id: I1e8866c63b54bcd95fc2a044276ee15b7f60e79a
| | * Modernize shapedclock exampleEirik Aavitsland2019-12-102-18/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Relying on the hard clipping of QRegion widget masks to create non-rectangular windows is a solution from a bygone era. The result looks horrible with today's eyes, particularly on a high-dpi screen. Update the example to create smooth anti-aliased edges using translucent window bacground. Task-number: QTBUG-64229 Change-Id: I8859d61177d2a2dc446632c23f27f42050e0d7c7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | | Remove deprecated QGL* classesJohan Klokkhammer Helsing2019-12-1145-4841/+0
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes QGL paths in sub-attaq and chip examples. The boxes example depended on QGL and has been removed. The corresponding module and test directories for the opengl module are now empty, but has been left there so we can move the QOpenGL* classes there. [ChangeLog][QtOpenGL] The deprecated QGL* classes have been removed. Fixes: QTBUG-74408 Change-Id: I52f56409af8f6901359462a7ba162103d051fe3d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Ulf Hermann2019-12-032-3/+12
|\| | | | | | | | | | | | | Conflicts: src/corelib/serialization/qcborvalue.cpp Change-Id: I675a3029955c96e81a33ed9d98b72b55b6784b52
| * Styles example: Use system style per DefaultFriedemann Kleint2019-11-251-3/+11
| | | | | | | | | | | | | | | | The example is useful as a gallery for widgets in which case the custom Norwegian Wood style is not primarily interesting. Change-Id: I96e304f97edeb43da6e8f572e01a768b1317722c Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
| * Show the styles example under 'gallery' on Qt Creator's example screenFriedemann Kleint2019-11-231-0/+1
| | | | | | | | | | | | | | | | Add meta tag 'gallery'. Change-Id: I8d670d6eb7641bdc82944a85b7335eee26bcc573 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
| * Sub-Attaq: Fix compilation with -no-openglFriedemann Kleint2019-11-181-0/+1
| | | | | | | | | | | | | | | | Add missing include removed by 13426aff248c25b44ac377f37dc3e3a54ea0ea86. Fixes: QTBUG-80163 Change-Id: I6b81f399a3abf637a2023700baac09b631d652d5 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* | Deprecate constructing QFlags from a pointerAllan Sandfeld Jensen2019-11-206-6/+6
| | | | | | | | | | | | | | | | | | This was used to support QFlags f = 0 initialization, but with 0 used as a pointer literal now considered bad form, it had been changed many places to QFlags f = nullptr, which is meaningless and confusing. Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-151-0/+1
|\| | | | | | | | | | | | | | | Conflicts: src/gui/rhi/qshader.cpp tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp Change-Id: I1c4ae718eb3592a0a0a90af9d11553f3ab68cad5
| * Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-11-131-0/+1
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/widgets/widgets/scribble/mainwindow.cpp This amends cb54c16584cf3be746a1a536c1e37cb3022a2f1b. Change-Id: Iaae60a893330524b2973917e23b31f9d51f8bd38
* | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-081-3/+3
|\| | | | | | | | | | | Change-Id: I963b5f48b5d6f3500ca379fbd7f1a4290b570175
| * | Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-11-061-3/+3
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf mkspecs/features/mac/default_post.prf src/corelib/tools/qsimd_p.h src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm util/qfloat16-tables/gen_qfloat16_tables.cpp Change-Id: If48fa8a3bc3c983706b609a6d3822cb67c1352a4
| | * Fix computegles31 example crashing on Pi4Paolo Angelelli2019-10-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Due to work group size configured for desktop GL. Change-Id: Id62cf297e280e04aecba748cf41b62c64ed9a0b2 Done-with: Andrey Yaromenok <ayaromenok@gmail.com> Fixes: QTBUG-79374 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | Fix build of the sub-attaq exampleVolker Hilsheimer2019-11-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QMenuBar is only forward declared in QMainWindow. I don't think this is a recent change or breakage, just noticed then when running a complete build of the 5.15 branch. Change-Id: Ia1a072044bd26c5f3f51ec5f5b0f72f065a0576f Reviewed-by: Johanna Äijälä <johanna.aijala@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Cleanup network examplesChristian Ehrlicher2019-11-0645-318/+326
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleanup network examples: - use nullptr - use member-init - adjust includes - use new-style connects Change-Id: I80aa230168e5aec88a1bc93bbf49a471bfc30e7b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-051-4/+4
|\| | | | | | | | | | | Change-Id: Icd98de8592828c60cfea3d69f9c7ae2711b9f059
| * | Docs: Fix a typo in the documentationKavindra Palaraja2019-11-011-4/+4
| | | | | | | | | | | | | | | | | | | | | Change-Id: Ice4d0842883e32f62abd27be826b1caf1c78d3b6 Fixes: QTBUG-55503 Reviewed-by: Frederik Schwarzer <schwarzer@kde.org> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | | Widget examples: replace QItemDelegate with QStyledItemDelegateChristian Ehrlicher2019-11-021-23/+15
| | | | | | | | | | | | | | | | | | | | | | | | The documentation was forgotten in 5d4b5dab7fec0f2a511145209daea9a85e741cc7 Change-Id: I4e0f8f507199601910a174a080936b9a619048a4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-015-39/+8
|\| | | | | | | | | | | Change-Id: Ic13ef00d76c81295076bb2432576db70ec84fe29
| * | examples: Fix -Wdeprecated-copy warningsAlbert Astals Cid2019-10-305-39/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | examples/corelib/tools/customtypesending/window.cpp: In member function ‘void Window::sendMessage()’: examples/corelib/tools/customtypesending/window.cpp:79:71: warning: implicitly-declared ‘Message& Message::operator=(const Message&)’ is deprecated [-Wdeprecated-copy] 79 | thisMessage = Message(editor->toPlainText(), thisMessage.headers()); | ^ In file included from examples/corelib/tools/customtypesending/window.h:55, from examples/corelib/tools/customtypesending/window.cpp:52: examples/corelib/tools/customtypesending/message.h:62:5: note: because ‘Message’ has user-provided ‘Message::Message(const Message&)’ 62 | Message(const Message &other); | ^~~~~~~ examples/corelib/tools/customtypesending/window.cpp: In member function ‘void Window::setMessage(const Message&)’: examples/corelib/tools/customtypesending/window.cpp:87:19: warning: implicitly-declared ‘Message& Message::operator=(const Message&)’ is deprecated [-Wdeprecated-copy] 87 | thisMessage = message; | ^~~~~~~ In file included from examples/corelib/tools/customtypesending/window.h:55, from examples/corelib/tools/customtypesending/window.cpp:52: examples/corelib/tools/customtypesending/message.h:62:5: note: because ‘Message’ has user-provided ‘Message::Message(const Message&)’ 62 | Message(const Message &other); | ^~~~~~~ Change-Id: I563d53f7dd1e0e0dc5fd4db06299b2d0a70c62ff Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Widget examples: replace QItemDelegate with QStyledItemDelegateChristian Ehrlicher2019-10-285-28/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | Replace QItemDelegate with QStyledItemDelegate in the examples since QItemDelegate is deprecated. Also fix up some unused documentation snippet references. Change-Id: I42b8780ad0c317b9a253cc722d0b471695ed253f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-181-0/+1
|\| | | | | | | | | | | Change-Id: I4fbbf100b673ab100997dbf2f42bf195dc3c050f
| * | Examples: fix compiling tablet example on qnxChristian Ehrlicher2019-10-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | std::abs(int) is defined in cstdlib which is not included on QNX. Fixes: QTBUG-78763 Change-Id: I14d087069369db7ab4e5db9d4f816a3fbffe95f6 Reviewed-by: Johanna Äijälä <johanna.aijala@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-1620-34/+36
|\| | | | | | | | | | | Change-Id: Ifd83db69416230175ddc3161f640b612755018fc
| * | Prepare for deprecating the QDesktopWidgetSona Kurazyan2019-10-1520-34/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDesktopWidget is marked as obsolete in docs, but it is not yet completely deprecated, some of its methods are still in use. Replace uses of the following methods marked as obsolete: - QDesktopWidget::screenNumber(QWidget*) -> QWidget::screen() - QDesktopWidget::screenGeometry(QWidget*) -> QWidget::screen()->geometry() - QDesktopWidget::availableGeometry(QWidget*) -> QWidget::screen()->availableGeometry() Task-number: QTBUG-76491 Change-Id: I2cca30f2b4caa6e6848e8190e09f959d2c272f33 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-1357-201/+222
|\| | | | | | | | | | | Change-Id: I9953c1ca16862184c2373027e946c482ce8e6f0e
| * | 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>
* | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-041-1/+1
|\| | | | | | | | | | | Change-Id: I43393cf47675fd6c14972df1221986335c6f493c
| * | 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>
* | | Examples/OpenGLWindow: do not use hardcoded indicesChristian Ehrlicher2019-10-021-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use the hardcoded indices 0 and 1 but the ones returned from QOpenGLShaderProgram::attributeLocation(). Also change them from GLuint to GLint. Fixes: QTBUG-43566 Change-Id: I582bcf899f20d90f4ec1cd61326a177aabb69992 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Qt Forward Merge Bot2019-10-014-4/+4
|\ \ \
| * | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-014-4/+4
| |\| | | | | | | | | | | | | | Change-Id: I77ba01f09b3dbcaf13cb265a70d9da661c32a61f
| | * | 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 QtOpenGL examplesChristian Ehrlicher2019-09-3026-225/+132
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleanup the OpenGL examples - use nullptr (clang-tidy) - use member-initialization - avoid redundant checks for != nullptr when deleting a pointer Change-Id: I3e4702690ed79e71c3e952d51ceef83b907b45b7 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | Port two examples from QTime to QElapsedTimerAlbert Astals Cid2019-09-272-9/+9
| | | | | | | | | | | | | | | Change-Id: I23d13bf1e909801797a8fc2785c46f341ef5ee77 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-09-1952-197/+330
|\| | | | | | | | | | | Change-Id: I46ec05ade1c84e61f7f45562a218aa9ff55e2975
| * | 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>
* | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-09-1660-376/+426
|\| | | | | | | | | | | Change-Id: Ie24be82ee70bf103c2664de1a42741979262b10c
| * | 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>
* | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-09-0959-417/+288
|\| | | | | | | | | | | Change-Id: If8e9d88771243fd9e221b49f53d7d8b111a8ce2a
| * | 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>