summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Tablet example: add a menu item to clear the canvasShawn Rutledge2018-08-234-4/+22
| | | | | | | | It's annoying to have to kill the app and start over when it gets too cluttered. Change-Id: Ic72e372e5742de4e7c6bb818a3150283498a517b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-08-171-0/+0
|\ | | | | | | Change-Id: I8bb8227f9da982e7d5ebe5324fc27abd9ac0d4fc
| * Doc: Update out-of-date screenshots in example docsPaul Wicking2018-08-161-0/+0
| | | | | | | | | | | | Task-number: QTBUG-63248 Change-Id: I4cd47977ae020b43ca92b1781ac8b038e6ef851c Reviewed-by: Martin Smith <martin.smith@qt.io>
* | DTLS server - use the proper TLS configurationTimur Pocheptsov2018-08-101-0/+1
| | | | | | | | | | | | | | | | | | The one we had before was invalid and we ended up with defaultDtlsConfiguration which has peerVerifyMode == AutoVerify. Change-Id: I5b9ceb027e90189325c1d8fd0db37d1b212ebbc8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Document DTLS examplesTimur Pocheptsov2018-08-0913-27/+255
| | | | | | | | | | | | | | | | Task-number: QTBUG-68070 Change-Id: I2b08322049005b02f1ed680bee21992ade16813a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Document the DTLS APITimur Pocheptsov2018-08-092-0/+73
| | | | | | | | | | | | | | Task-number: QTBUG-68070 Change-Id: Ifd08ecb7c2c1a6dc352952a10ad56259bd1ecf10 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-08-071-3/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/corelib/doc/src/objectmodel/signalsandslots.qdoc src/plugins/platforms/cocoa/qcocoamenuloader.mm src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp tests/auto/gui/image/qimage/tst_qimage.cpp Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Change-Id: I9bd24ee9b00d4f26c8f344ce3970aa6e93935ff5
| * Doc: Synchronize documentation with code snippetPaul Wicking2018-08-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | * The plugin IID with version number was removed in transition to new plugin system, see efde205586a70320d0525e941e5a1cd9657bdd30. * This change re-adds the version number, so that we deliver on the best practices as mentioned in the documentation for the example. Task-number: QTBUG-59487 Change-Id: I88596e71cf18be88d0b1d28d56b6d3bb72fe756b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge "Merge branch '5.11' into dev" into refs/staging/devEdward Welbourne2018-07-311-10/+21
|\ \
| * | Merge branch '5.11' into devEdward Welbourne2018-07-311-10/+21
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/library/qmakebuiltins.cpp src/plugins/platforms/windows/qwindowstabletsupport.h src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/widgets/styles/qstylesheetstyle.cpp tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp Done-With: Gatis Paeglis <gatis.paeglis@qt.io> Change-Id: I000b0eb3cea2a5c7a99b95732bfdd41507cf916e
| | * Doc: Update Tetrix examplePaul Wicking2018-07-191-10/+21
| | | | | | | | | | | | | | | | | | | | | | | | Use new connect syntax throughout the example. Task-number: QTBUG-69503 Change-Id: I5ab1453318e60586a9655ecb58263778c02aba4f Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* | | Examples: Revamp LoopbackAndre Hartmann2018-07-303-41/+45
|/ / | | | | | | | | | | | | | | | | | | | | | | | | * order and sort includes * use functor connect * use nullptr * use member init * added sanity check for nextPendingConnection() * small cleanup here and there Change-Id: I72c6758b5fedea0937a1f2cb9031cb7203f5d955 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | QDtls - use conventional namesTimur Pocheptsov2018-07-272-7/+7
| | | | | | | | | | | | | | | | More Qt-style and more natural, also, shorter names. Change-Id: I97bd68a8614126d518a3853027661435dc4e080d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | QDtls - refactorTimur Pocheptsov2018-07-262-7/+7
| | | | | | | | | | | | | | | | | | This patch renames rather awkward 'remote' into more conventional 'peer' (similar to what we have in QAbstractSocket). Change-Id: Ifc45e538b8adf9cc076bd7aee693277829fd94dc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Add demo of the new QGradient presets to the gradients exampleEirik Aavitsland2018-07-244-4/+74
| | | | | | | | | | | | | | | | In the gradients example, allow the user to select and show QGradient's named presets. Change-Id: I40bc6cbe3a0316ce49d67d63511881b6f6112574 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | cbordump: Fix build with linux-clang-libc++Jüri Valdmann2018-07-121-0/+1
| | | | | | | | | | | | | | | | | | ../cbordump/main.cpp:716:15: error: use of undeclared identifier 'LC_ALL' setlocale(LC_ALL, "C"); ^ Change-Id: Ibff2345ffa99894cdcd48323f8c365d01ebd6300 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | DTLS client - improve the exampleTimur Pocheptsov2018-07-102-13/+26
| | | | | | | | | | | | | | | | | | | | | | | | - Remove redundant pingTimer.start() call (timer is not a single shot timer and already started before this point in code). - Use connected UDP sockets to show that it can work with QDtls. - Replace (translated) string concatenations with formatted strings and 'arg' where needed. Change-Id: I8dba54f43464a718062cd897d24f89b75b99f2a4 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Metatype: make the Qt CBOR value-like types built-in meta typesThiago Macieira2018-07-041-3/+0
| | | | | | | | | | | | | | | | This change only adds them to the registry and reserves the IDs. The next commit will handle conversions. Change-Id: I56b444f9d6274221a3b7fffd150d2d49f40940c2 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | CBOR: Add QDebug operators for the Qt CBOR value-like typesThiago Macieira2018-07-041-10/+0
| | | | | | | | | | | | | | | | | | | | I added a function that returns the string identifiers for QCborKnownTags and QCborSimpleType, in order to facilitate writing a QTest::toString for those types, as neither enum is part of a Q_OBJECT or Q_GADGET class. Change-Id: I56b444f9d6274221a3b7fffd150d2d26a1925c19 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Examples: add an example that converts between different file formatsThiago Macieira2018-07-0416-0/+2494
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This example converts to and from: - Binary JSON - CBOR - CBOR Diagnostic notation (output only) - JSON - Null (output only) - QDataStream - QVariant dump (output only) - Text - XML Change-Id: Ibab69e0efefb40bdbf94fffd150b59f8c0da3174 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-07-0256-100/+213
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/cocoa/qnsview_dragging.mm src/plugins/platforms/ios/qiosinputcontext.mm src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/tools/androiddeployqt/main.cpp Was moved from qttools into qtbase in 5.11. So re-apply 32398e4d here. tests/auto/corelib/global/qlogging/test/test.pro tests/auto/corelib/global/qlogging/tst_qlogging.cpp tests/auto/corelib/io/qfile/tst_qfile.cpp tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp tests/auto/corelib/thread/qthreadstorage/test/test.pro tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp tests/auto/widgets/kernel/qapplication/test/test.pro Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Done-with: Mårten Nordheim <marten.nordheim@qt.io> Done-with: Oliver Wolff <oliver.wolff@qt.io> Change-Id: Id970486c5315a1718c540f00deb2633533e8fc7b
| * Doc: Add references to QDBusAbstractAdaptor implementation examplePaul Wicking2018-06-291-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | Adding references where applicable, as removed by 023a818738d64da01ebecc5d4a26356055ba0021 when removing stale example. Add example run snippet to the example landing page. Remove stale example qdoc file that is superceded by current example. Task-number: QTBUG-69191 Change-Id: I62dc66edc86da5efb4c79fd124edb2fa619aeb6b Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
| * Doc: Add Hello GLES3 examplePaul Wicking2018-06-264-1/+48
| | | | | | | | | | | | Task-number: QTBUG-67109 Change-Id: I55135264a63b78502b300de723a25b3f363af58b Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
| * Notepad example: Wrap clipboard functions with QT_CONFIG(clipboard)Topi Reinio2018-06-221-0/+17
| | | | | | | | | | | | | | | | And disable menu actions for functionality that's not available. Task-number: QTBUG-68168 Change-Id: I153487860e8dda8271ae04e9cd2ad8b26a4b130f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Doc: Fix typo in Scribble examplePaul Wicking2018-06-211-1/+1
| | | | | | | | | | | | Task-number: QTBUG-68549 Change-Id: Ib83d3297e2ebefe6f42799a14dde35411a8ec120 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
| * Doc: Add missing full stops in briefsPaul Wicking2018-06-2143-43/+43
| | | | | | | | | | | | Task-number: QTBUG-68933 Change-Id: I3f2a9f8c562f9a44bb32bddd31d75abbfe6de04d Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
| * Doc: Add menu bar to Books examplePaul Wicking2018-06-213-1/+32
| | | | | | | | | | | | | | | | | | | | Add menu bar with Help->About that contains a short description of the example application. Remove redundant title string between menu and application content. Task-number: QTBUG-68652 Change-Id: I31fb386ab9c01eff86b8ed3ef274ba8cfdb0148b Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
| * Doc: Update Extension exampleNico Vertriest2018-06-131-47/+53
| | | | | | | | | | | | | | | | | | | | -language review -rewrite some paragraphs Task-number: QTBUG-60635 Change-Id: I96154cd5d78b9517409ac67ec416c53031dcb909 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * Doc: Sql example Books lock rating column widthPaul Wicking2018-06-081-0/+5
| | | | | | | | | | | | | | | | | | | | Lock the width of the rating column to prohibit the contents to escape the bounds of the column upon resize. Task-number: QTBUG-68652 Change-Id: I5c744833b19a8e5bcf88ef1b9ab657ac81f5aa50 Reviewed-by: Nico Vertriest <nico.vertriest@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
| * Doc: Update Factorial ExampleNico Vertriest2018-06-071-1/+1
| | | | | | | | | | | | | | | | | | Updated connect syntax Task-number: QTBUG-60635 Change-Id: Ib5280326c158221129c1817a4853bfd79bbcd895 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * Doc: Update Elided Label exampleNico Vertriest2018-06-071-6/+5
| | | | | | | | | | | | | | | | | | Updated connect syntax Task-number: QTBUG-60635 Change-Id: I8d770f62557d5056375d72d778c4e2079511b848 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | Add a secure UDP client exampleTimur Pocheptsov2018-06-2211-1/+1173
| | | | | | | | | | | | | | | | | | | | | | | | A simple application that establishes DTLS connection(s) and sends/receives datagrams. Class DtlsAssociation is essentially a QUdpSocket|QDtls pair: it initiates a handshake, handles timeouts and errors. After establishing an encrypted connection it sends messages to the server and processes responses. Task-number: QTBUG-67596 Change-Id: I92d481b7dfd2459e6a93c754b338a2e897a7feaf Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Add a secure UDP server exampleTimur Pocheptsov2018-06-2111-1/+1212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a simple DTLS server, implemented with QUdpSocket, QDtlsClientVerifier and QDtls. The server is configured to use PSK only (it has no certificate/key). The server uses a single QUdpSocket socket and de-multiplexes UDP datagrams internally (thus it can work with several clients simultaneously). Future update will probably add more options (like configuring with certificate/key, etc). For now - it's as minimalistic and simple as possible. Task-number: QTBUG-67596 Change-Id: Ic7d18dbab6dbcc9ed44c82e69a2b364df24aa256 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Spice up QOpenGLWindow exampleTor Arne Vestbø2018-06-151-10/+5
| | | | | | | | | | | | | | | | | | | | By drawing the same gradient for the triangle as in the rasterwindow example. We also set a default geometry and show the window without forcing it to become maximized. Change-Id: I05f9138d08f9c5d3e30eec362a3a1cd63d72753e Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix typo in contextinfo exampleMichal Klocek2018-06-151-1/+1
| | | | | | | | | | Change-Id: I4d788c9880ca4d52aab58a5abc13b8b91838b66e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-06-0724-237/+425
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/corelib/kernel/qeventdispatcher_cf.mm src/gui/kernel/qguiapplication_p.h src/gui/kernel/qwindowsysteminterface.cpp src/gui/kernel/qwindowsysteminterface.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/cocoa/qnswindowdelegate.mm src/plugins/platforms/ios/qioseventdispatcher.mm src/plugins/platforms/windows/qwindowsdrag.h src/plugins/platforms/windows/qwindowsinternalmimedata.h src/plugins/platforms/windows/qwindowsmime.cpp src/plugins/platforms/winrt/qwinrtscreen.cpp Change-Id: Ic817f265c2386e83839d2bb9ef7419cb29705246
| * Examples: Cleanup and modernize Plug&PaintAndre Hartmann2018-06-069-99/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use C++11 member init * Use auto where appropriate * Replace foreach with range-for * Replace last Qt4-style connects * Sort includes to common style * Fix some Clang warnings Task-number: QTBUG-60635 Change-Id: I61c98b34b954e416dd175b56ca589125217083de Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * Doc: Clean up SQL Example: Books - whitespace editionPaul Wicking2018-06-061-1/+1
| | | | | | | | | | | | | | | | Remove whitespace for consistency. Task-number: QTBUG-68652 Change-Id: I1ca1f449db2352cb96c88535936f2c44392693cf Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * Doc: Clean up SQL example: Books (part 2)Paul Wicking2018-06-061-1/+2
| | | | | | | | | | | | | | | | Improve readability, enforce consistent code formatting. Task-number: QTBUG-68652 Change-Id: I7bbe0b2baa6273e0133df84d7c3cc2aa6a0b6ff2 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * Doc: Clean up and modernize SQL example: BooksPaul Wicking2018-06-063-93/+126
| | | | | | | | | | | | | | | | | | | | | | * Replace Qt4-style connects. * Reformat code to adhere to 80 column width. * Touch comments to make location and style consistent. * Rename a label in the UI form. Task-number: QTBUG-68652 Change-Id: Icc592f7b5a013d1806bc36c45057b35472b6efbb Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
| * Doc: Update connect syntax Plugandpaint ExampleNico Vertriest2018-06-053-16/+18
| | | | | | | | | | | | | | | | Task-number: QTBUG-60635 Change-Id: I354a0886b22c63be57bd927308163abd3246be77 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * Doc: Add formatting features to Notepad exampleNico Vertriest2018-06-017-22/+182
| | | | | | | | | | | | | | | | - bold, italic, underline - About button Change-Id: I8ece7d2bfca0b148b681a2fccb4a439ce179848a Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * Make sure we can build with -no-feature-draganddropJoerg Bornemann2018-05-294-6/+6
| | | | | | | | | | | | | | | | | | We move QInternalMimeData to a separate file, because this class is used, even if draganddrop is disabled. From now on, include qinternalmimedata_p.h instead of qdnd_p.h for QInternalMimeData. Change-Id: I594e08e2e90d574dc445119091686b4b69e4731b Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | Examples: use CBOR in the network-chat broadcast messageThiago Macieira2018-06-023-19/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of sending one @-separated message, send one CBOR message. The message structure is, using the CBOR Data Definition Language: broadcast = [ username: tstr, port: 0..65535 ] Change-Id: Ic38ec929fc3f4bb795dafffd150ac2614d18c6bf Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Examples: change the main network-chat protocol to CBORThiago Macieira2018-06-023-146/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This complements the previous commit, which changed the broadcast datagram to CBOR. This commit changes the TCP protocol too. The protocol is an infinite array of commands, each of which is a map from an integer (the DataType enum) to either a string or null. The entire state machine for the connection is rewritten, relying on QCborStreamReader's ability to deal with incomplete data. Change-Id: Ic38ec929fc3f4bb795dafffd150ac674c32fac87 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | glextensions.h: simplify #if-ery to avoid conflictEdward Welbourne2018-05-311-12/+4
| | | | | | | | | | | | | | | | The prior #if-ery was needlessly confusing; and most of it was redundant anyway. Change-Id: I82da1b38c08b93b9dc2220dd7b15ecb7dcc002af Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Provide presets for QGradientTor Arne Vestbø2018-05-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Similar to Qt::GlobalColor, the presets allow the user to create brushes based on predefined gradients, quickly getting pretty pixels on screen. The presets are based on the linear gradients from WebGradients, a free collection of gradients, hosted at https://webgradients.com/. The few radial and blended gradient presets have been excluded. Change-Id: I1ce8f2210a6045c9edb8829ab3eddcc313549127 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-05-292-3/+5
|\| | | | | | | Change-Id: I8d8b03ea46c537b091b72dc7b68aa6aa3a627ba6
| * Doc: Update Echoplugin ExampleNico Vertriest2018-05-281-0/+0
| | | | | | | | | | | | | | | | | | | | - screenshot - connect syntax Task-number: QTBUG-60635 Change-Id: I18c3e1fef5c623565bbf6cf33bf88e9d8135d8be Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * Doc: Update Fetchmore exampleNico Vertriest2018-05-281-3/+5
| | | | | | | | | | | | | | | | | | | | - minor edit - updated screenshot Task-number: QTBUG-60635 Change-Id: I988ad28723131127eee0a93671b0562d8f446139 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>