summaryrefslogtreecommitdiffstats
path: root/examples/widgets/widgets/tablet
Commit message (Collapse)AuthorAgeFilesLines
* Fix compiling of examples on AndroidSimon Hausmann2019-06-121-1/+2
| | | | | | | | | | | | | | | | | | | * Simplify add_qt_gui_executable() to not require WIN32/MACOSX_BUNDLE but provide it implicitly. It's redundant :) * When on Android, build a module (shared library), just like qmake. This requires an additional library destination in the install() call, but that's ignored on other platforms. * Fix typos in the android deployment generation settings function * Use the correct cache variable to determine whether we're inside a Qt build or not. Right now this only works inside Qt builds anyway as QtPlatformAndroid.cmake is not publically accessible. Change-Id: If1c763c31a7a83d0e0d854362ba7901657f63eb5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Fix linking of examplesSimon Hausmann2019-06-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Provide add_qt_gui_executable() as function in our public API that takes care of automaticWinMain linkage. We can use this in the future to encapsulate similarplatform-specific behavior and adjustments, such as module generation onAndroid. In order for the examples to see the function in Qt5CoreMacros, three more additional fixes were required: * Do the build_repo_end() call _before_ attempting to build the examples, as we need the build_repo_end() to include QtPostProcess and complete the creation of all the target config files. Otherwise the find_package() calls in the examples see something incomplete. * Add more QT_NO_CREATE_TARGET guards * Always call find_dependency on the dependencies, regardless of the target creation mode. This way a find_package(Qt5 COMPONENTS Widgets) will still load Qt5CoreMacros. Change-Id: I03ce856e2f4312a050fe8043b8331cbe8a6c93e6 Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Allow to build examples as standalone projectKevin Funk2019-06-051-21/+25
| | | | | | | | | | | | | | | | Create CMake config files which can be used from the very same CMake project. These CMake config files simply do not create any targets, controlled via the QT_NO_CREATE_TARGETS. This patch also allows to build qtbase.git:examples as a standalone project, against an already-built Qt. Ran this: ag -s "QT " examples -l -0 | xargs -0 -n 1 .../util/cmake/pro2cmake.py --is-example Task-number: QTBUG-74713 Change-Id: I44cce5a4048618b30f890c5b789592c227a8b47d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge commit 'dev' into 'wip/cmake-merge'Tobias Hunger2019-04-163-6/+5
|\ | | | | | | Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
| * Cleanup Widgets examples - includesChristian Ehrlicher2019-01-281-2/+2
| | | | | | | | | | | | | | | | | | Cleanup the Widgets examples - adjust includes to Qt coding style and remove unused includes and formward declarations Change-Id: I9f2e513284ad631337ff52ec9c0b98645055dcca Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * Cleanup Widgets examples - nullptrChristian Ehrlicher2019-01-231-3/+2
| | | | | | | | | | | | | | | | | | Cleanup the widgets examples - replace 0 with nullptr Change-Id: Id4bf119b9a41f6d10117f3a613a6e604128fa196 Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * Tablet example: Fix warning about switch/fallthroughFriedemann Kleint2018-11-011-1/+1
| | | | | | | | | | | | | | | | Add Q_FALLTHROUGH(), fixing: tabletcanvas.cpp:222:55: warning: this statement may fall through [-Wimplicit-fallthrough=] Change-Id: I573f4add56774218e28a7c5f1dac09c5402333c0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | CMake: Add widgets examplesTobias Hunger2019-03-261-0/+26
|/ | | | | Change-Id: Ib6142b93df066e3658eb189b50ca74c455fe7e56 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Tablet example: paint only the changed areas of the canvasShawn Rutledge2018-08-301-2/+4
| | | | | | | This improves performance significantly. Change-Id: I9a8782148ce03a2bc85759c4e8c1eecb37467cf6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* 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>
* Rename the tablet example to avoid triggering a bug in tablet driversAndre de la Rocha2018-05-091-0/+5
| | | | | | | | | | | | | | | | | | | | It seems there is a subtle bug in the Wacom tablet drivers for Windows that is triggered in the very particular case where the running executable is named "tablet.exe", regardless of its installation path. It causes WM_POINTER* messages not to be delivered to the application, initially, but only after the application's window is reselected, after another application's window had been selected. It happens at least on Windows 10 systems with Wacom Bamboo tablets and drivers, and was reproduced with non-Qt-based applications also. It looks like a bad compatibility setting that makes "tablet" a cursed target name for applications using tablet functionality. It seems older versions of the drivers used to contain an executable with this name, although it seems to be absent in newer versions. Unfortunately, the Qt tablet example uses this name, which breaks it when used with upcoming WM_POINTER* messages support. Change-Id: I931cc725b9117b4604267f7b0172110ae61700de Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-201-0/+1
|\ | | | | | | | | | | | | Conflicts: tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: If089d5010d15c33b3c1f13912d4386207456c1a9
| * qtlite: Skip building examples when configured with no-feature-itemviewsRainer Keller2018-01-121-0/+1
| | | | | | | | | | | | | | | | | | Compiling the default examples should be possible without compile errors. Task-number: QTBUG-53141 Change-Id: I73d8787241291ae6230861a89b38e91d900fede0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-302-0/+11
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/thread/qsemaphore.cpp tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: Id35b535e88df63fdfe4007ea92ed4a39c4b6d707
| * Demonstrate the new AA_CompressTabletEvents in the tablet exampleShawn Rutledge2017-11-242-0/+11
| | | | | | | | | | | | Change-Id: I1972da2ead51274771ff24b4c506c2b581ee6abe Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Replace Q_NULLPTR with nullptr where possibleKevin Funk2017-09-192-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Tablet example: update only the drawn areas of the canvasShawn Rutledge2017-09-152-2/+7
|/ | | | | | | | This makes an enormous difference in responsiveness on the iPad Pro: it actually feels like real-time drawing with hardly any lag. Change-Id: I17c3b948e818d4ee46b4d24934c929ab9b386e69 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-07-041-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess_unix.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/widgets/util/util.pri tests/auto/corelib/thread/qthread/qthread.pro tests/auto/corelib/thread/qthread/tst_qthread.cpp Change-Id: I5c45ab54d46d3c75a5c6c116777ebf5bc47a871b
| * Convert features.statustip to QT_CONFIGStephan Binner2017-06-291-2/+2
| | | | | | | | | | Change-Id: Ic719ab93ed1802fcc713885ad0421cb44c7a998b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | tablet example: don't update the cursor image on iOSShawn Rutledge2017-06-021-0/+2
| | | | | | | | | | | | | | | | There is no visible cursor on iOS, so updating the image is a waste of time. Removing this does in fact speed up rendering of the strokes. Change-Id: If958fabeefd4273644707277d4a084855d415bb1 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | tablet example: enable high-DPI renderingShawn Rutledge2017-05-151-13/+15
| | | | | | | | | | | | Change-Id: Ie03867208902fdc9cf794de16d7249c8994351f4 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | tablet example: use stylus rotation property correctlyShawn Rutledge2017-05-081-5/+5
| | | | | | | | | | | | | | | | | | It was backwards from the expected value, consistently on iOS and xcb. It was already that way in 5.6, and we don't document which way is clockwise. So it seems to be just the example which is wrong. Change-Id: Ibbdadc2ae240017abc87439a2694fb5fbd3d07f8 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | tablet example: make smoother strokes with the rotation stylusShawn Rutledge2017-05-082-2/+12
|/ | | | | | | | | | Each stroke is a polygon (quadrilateral) connecting the previous tablet event point to the current one. Previously we used the same width for both ends of the stroke, so rapid changes in pressure caused steps in the stroke width. Now it is tapered from one end to the other. Change-Id: I909a2e85334a1a6e20fd28ee4babf6825da36612 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* make TabletMove hover events conditional on QWidget::tabletTrackingShawn Rutledge2017-02-231-0/+1
| | | | | | | | | | | | | | | | | | This adds the tabletTracking property in the same way that mouseTracking already existed: there is a WA_TabletTracking attribute, and a TabletTrackingChange event to notify when it changes. So for widget applications it's an opt-in feature. QtQuick applications don't yet make use of tablet events, but when they do in the future, we don't yet have a mechanism to turn the move events off; it remains to be seen whether that will be necessary. [ChangeLog][QtWidget] QWidget now has a tabletTracking property, analogous to mouseTracking, which will enable TabletMove events while the stylus is hovering, even if no button is pressed. This allows applications to show feedback based on the other tablet event properties such as rotation and tilt. Task-number: QTBUG-26116 Change-Id: Ie96e8acad882b167e967796cdd17f1ad747a2771 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Examples: Replace 'Q_DECL_OVERRIDE' by 'override'hjk2016-06-152-4/+4
| | | | | | | | Examples should demonstrate best practice, and we can use the keyword directly nowadays. Change-Id: I1f122e5caceca17290757ffbaf3d660e7daa9ae4 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* add cross-platform tablet->mouse event synth; enable on AndroidShawn Rutledge2016-04-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's urgent to fix the issue that on Android, it became impossible to interact with any widget or MouseArea which handles only mouse events but not tablet events, using the stylus, because stylus events are sent only as QTabletEvents. Before 5.6 (change 01d78ba86a631386a4d47b7c12d2a359da28f517) they were sent as touch events, and mouse events were synthesized from those. Whereas on other platforms, every QTabletEvent is followed by a synthesized QMouseEvent. This fix proceeds in the direction that event synthesis should be done in cross-platform code so that platform plugins don't have to repeat it, following the same pattern as for touch->mouse synthesis. Just as in that case, the application can disable it, and the platform plugin can also report that it's unnecessary for Qt to do the synthesis because the platform already does. So QTBUG-51618 is fixed, but QTBUG-47007 requires us to remove the tablet->mouse synthesis from all platform plugins, because the plugin does not know whether the tablet event was accepted or not, so it does not have enough information to decide whether to synthesize a mouse event. Synthesis has been unconditional until now, which contradicts what the documentation says: the mouse event should be sent only if the tablet event is NOT accepted. We can now gradually make this promise come true. [ChangeLog][QtCore][Tablet support] A synthetic mouse event will no longer be sent after every QTabletEvent, only after those which are not accepted (as documented). Task-number: QTBUG-47007 Task-number: QTBUG-51618 Change-Id: I99404e0c2b39bbca4377be6fd48e0c6b20338466 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Unify license header usage.Jani Heikkinen2016-03-297-21/+91
| | | | | | | | | Update files using old header.LGPL3 to header.LGPL Update files using old FDL template to use new one Update files using old BSD template to use new one Change-Id: I36a78272516f9953d02956522f285b40adfc8915 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Polish the Tablet exampleShawn Rutledge2016-01-286-278/+174
| | | | | | | | | | | | | | | | | | | | | - Introduce Qt 5 signal-slot connection syntax. - Merge MainWindow::createMenus()/createActions() into MainWindow::createMenus(), removing the need to store the actions as member variables. Use QMenu::addAction() for brevity. - For actions in QActionGroups, carry the Valuator enum in QAction::data so that the slot to handle the selection does not need to compare the QAction pointer itself. - Use a non-modal QColorDialog, so that the user can change colors more easily while drawing. - Choose saner shortcut keys: control-Q should not override the default usage for quitting the application, and using shortcuts for About dialogs is anyway dubious. - Improve the example documentation. Change-Id: I57aaf5f5b885c13a953482dbcc41275dd3d6bff4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* Tablet example: update the cursor according to the toolShawn Rutledge2015-07-319-11/+62
| | | | | Change-Id: Ibbe530856bb833e465dd9fa1da5425c018fecc21 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Tablet example: smoother, rotation stylus, better airbrushShawn Rutledge2015-07-314-59/+68
| | | | | | | | | | | | The drawing is antialiased and with rounded caps and joins. Rotation stylus acts like a felt marker. Airbrush sprays a radial gradient of color, and its alpha can depend on the tangential pressure if so chosen. Task-number: QTBUG-46694 Change-Id: I4fb16eb621707e3c56a75aa302dd0d3bf418a745 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Updated BSD licensed file headersJani Heikkinen2015-02-157-21/+21
| | | | | Change-Id: I6441ff931dbd33b698d762e6f6784898f3f60fe7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-117-35/+35
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Examples: Add Q_DECL_OVERRIDE to overridden functionsOlivier Goffart2014-07-152-4/+4
| | | | | | | | | | | | | | | | | | Q_DECL_OVERRIDE (which expands to 'override' for supported compiler) helps to declare the intent (that it is an overridden function) and force compilation error when there is no such virtual function in the base class. The examples should show the best practice of having it, as it may save the programmer quite some time in case of change of API or typo in the function name or arguments. This change was done automatically with clang-modernize -add-override -override-macros And fixed MSVC compilation by removing inline for TorrentViewDelegate::paint Change-Id: Ice66ae93fae571266f908703d5b8892b2c1ebb1a Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Remove warnings about examples not running in the Qt SimulatorTor Arne Vestbø2013-10-091-2/+0
| | | | | | | The Qt Simulator is no longer supported with Qt 5. Change-Id: I0f98351d482dd0554ea0754746d56f94ee6bf22f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-187-7/+7
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* clean up example project files, mostly wrt QT+=widgetsOswald Buddenhagen2012-12-171-2/+2
| | | | | | | | | move QT+=widgets (and printsupport) statements before the install statements, and de-duplicate some cases. also move some TARGET assignments to a more conventional place. Change-Id: I6140d8611680f66c24490e5894e4eb90cae95635 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* centralize and fixup example sources install targetsOswald Buddenhagen2012-11-291-3/+1
| | | | | | | | | | | | | it's confusing for the users if the examples' project files contain code to install their own sources. also, this constitutes an enormous code duplication, and lots of mistakes. consequently, automate it. more or less as a side effect, this also removes the entirely meaningless target installs in subdirs projects. Task-number: QTBUG-28184 Change-Id: I9fc1367a06db9e2c46aeb67d68729a4f67163ef9 Reviewed-by: hjk <qthjk@ovi.com>
* delete .desktop files of examplesOswald Buddenhagen2012-11-281-11/+0
| | | | | | | | | they were added without an explanation, and they can't be particularly useful (because they contain hard-coded paths and refer to non-existing icons). Change-Id: I27e2c35375e28645b0c03449ddc7ac7017da5943 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Examples: Install to $$[QT_INSTALL_EXAMPLES]/$submodule/$examplehjk2012-11-261-2/+2
| | | | | | | | This makes the structure of the examples after an 'make install' similar to the one in a 'developer build'. Change-Id: I9120bd741fab332e64e30adc01cefe87e5633454 Reviewed-by: Martin Smith <martin.smith@digia.com>
* Fix building of examples.Friedemann Kleint2012-11-211-2/+2
| | | | | | | | | | | - Correct install path of widget examples to contain widgets directory in target tree. - Add missing resources. Task-number: QTBUG-27977 Change-Id: If4cb117998892b0b165d7678367553d3a7553b91 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-227-42/+42
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Moving .qdoc files under examples/widgets/docGabriel de Dietrich2012-08-209-0/+985
Updated those .qdoc files to refer to the new relative examples emplacement. Images and snippets to be moved later. Also grouped all widgets related examples under widgets. Change-Id: Ib29696e2d8948524537f53e8dda88f9ee26a597f Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>