summaryrefslogtreecommitdiffstats
path: root/examples/widgets/tutorials
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Regenerate examples to set the WIN32_EXECUTABLE propertyAlexandru Croitor2020-10-2725-0/+100
| | | | | | | | | As well as the MACOSX_BUNDLE properties as necessary. Task-number: QTBUG-87664 Task-number: QTBUG-86827 Change-Id: I7677449a26d51fa853bd67bab6b3b61afbd2b12f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Regenerate examples to use qt_add_executableAlexandru Croitor2020-10-1925-25/+25
| | | | | | Task-number: QTBUG-87661 Change-Id: I0dacfdc97a3fb7d88da85b67800f2c1b084d869b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Regenerate examplesAlexandru Croitor2020-07-0925-25/+125
| | | | | | Change-Id: I1c51b10af4e2b26f54740f257164c56a0e2a03ce Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Use | to OR some related flagsGiuseppe D'Angelo2020-06-191-1/+1
| | | | | | | | | | | And not +. Guess what, this was "accidentally" working around a number of bugs, most importantly QTBUG-75172 (which is caused by QTBUG-74639 and probably others). Change-Id: If13810d9408f2be7b87f0d259737bff8cacc6f7b Pick-to: 5.15 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: David Faure <david.faure@kdab.com>
* 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 remote-tracking branch 'origin/5.15' into devSimon Hausmann2020-03-161-0/+2
|\ | | | | | | | | | | | | Conflicts: src/corelib/kernel/qmetatype.cpp Change-Id: I88eb0d3e9c9a38abf7241a51e370c655ae74e38a
| * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-03-111-0/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | 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-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-031-1/+1
|\| | | | | | | | | | | Change-Id: If36d96c0fef3de5ab6503977501c55c62a2ecc97
| * | Docs: Use Qt::SplitBehavior in preference to QString::SplitBehaviorEdward Welbourne2020-02-281-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.15' into devLiang Qi2020-02-131-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/widgets/graphicsview/boxes/scene.h src/corelib/Qt5CoreMacros.cmake src/corelib/Qt6CoreMacros.cmake src/network/ssl/qsslsocket.cpp src/network/ssl/qsslsocket.h src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp src/testlib/CMakeLists.txt src/testlib/.prev_CMakeLists.txt tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp Disabled building manual tests with CMake for now, because qmake doesn't do it, and it confuses people. Done-With: Alexandru Croitor <alexandru.croitor@qt.io> Done-With: Volker Hilsheimer <volker.hilsheimer@qt.io> Change-Id: I865ae347bd01f4e59f16d007b66d175a52f1f152
| * Examples: fix compile without printsupportChristian Ehrlicher2020-01-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | Checking for QT_CONFIG(printdialog) is not enough when printsupport is completely disabled since then the macro will throw an error. Therefore add an additional check 'defined(QT_PRINTSUPPORT_LIB)' before using the QT_CONFIG macro. Fixes: QTBUG-81626 Change-Id: Ie9898f057cdd6bf9daf4ba9135987cb6e901e7bf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Regenerate examplesAlexandru Croitor2020-02-0425-74/+214
| | | | | | | | | | | | Change-Id: I04b2adbe370ffea81d7787ad90e4ae69d2c165cb Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-10-1413-13/+13
|\| | | | | | | Change-Id: I4a78428a8ea273b6960792e3b8043f816fa37fcf
| * Cleanup QtWidgets examplesChristian Ehrlicher2019-10-1113-13/+13
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-06-1424-25/+25
|\| | | | | | | | | | | | | | | | | | | This changes many different CMake places to mention Qt6 instead of Qt5. Note that some old qt5 cmake config files in corelib are probably not needed anymore, but I still renamed and kept them for now. Change-Id: Ie69e81540386a5af153f76c0242e18d48211bec4
* | Fix compiling of examples on AndroidSimon Hausmann2019-06-1224-24/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-1224-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0524-350/+545
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Rerun pro2cmake on projects that use .ui filesAlexandru Croitor2019-05-222-3/+54
| | | | | | | | | | | | | | Task-number: QTBUG-75875 Change-Id: I95109b07fc4a6e09fe7911a21fc5f27f2c895d77 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* | Merge commit 'dev' into 'wip/cmake-merge'Tobias Hunger2019-04-1640-260/+308
|\| | | | | | | Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
| * Cleanup Widgets examples - foreachChristian Ehrlicher2019-01-071-17/+18
| | | | | | | | | | | | | | | | | | | | Cleanup the Widget examples - replace foreach with range-based for loop in subdirectory tools, touch and tutorials Change-Id: I008d23b5993a18a3332fe9f5e5bca68cb0561066 Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * Cleanup Widgets examples - new signal/slot syntaxChristian Ehrlicher2019-01-0313-61/+116
| | | | | | | | | | | | | | | | | | Cleanup the Widget examples - use the new signal/slot syntax where possible - tutorials subdirectory Change-Id: I741589f6616578412ad74f8371e0e3c87df783a2 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
| * Itemviews: Cleanup examplesChristian Ehrlicher2018-11-1223-139/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleanup some minor issues in the chart example: - remove unused members - use initializer list for members - pass a proper role to dataChanged() - honor roles parameter in PieView::dataChanged() - use nullptr instead 0 - use new-style connect - fix indentation and other whitespaces Change-Id: Idb212b07c006fe3ae31bee9cd9b1ba4d03043b5e Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * Notepad example: Get rid of auto-connection slotsAlexander Volkov2018-11-013-43/+60
| | | | | | | | | | | | | | | | Their correctness is not checked at compile time and even object renames can break code. Change-Id: I99273a28743a79a76c00e6db0ed4cd6d7eba8bf2 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | CMake: Add widgets examplesTobias Hunger2019-03-2630-0/+494
|/ | | | | Change-Id: Ib6142b93df066e3658eb189b50ca74c455fe7e56 Reviewed-by: Alexandru Croitor <alexandru.croitor@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: Add missing full stops in briefsPaul Wicking2018-06-211-1/+1
| | | | | | Task-number: QTBUG-68933 Change-Id: I3f2a9f8c562f9a44bb32bddd31d75abbfe6de04d Reviewed-by: Topi Reiniö <topi.reinio@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>
* Examples: Fix unused variable warnings by ClangFriedemann Kleint2018-05-021-4/+0
| | | | | | | | | | | | | mainwindow.cpp(59,11): warning: unused variable 'ROWS' [-Wunused-const-variable] const int ROWS = 2; mainwindow.cpp(60,11): warning: unused variable 'COLUMNS' [-Wunused-const-variable] const int COLUMNS = 3; mainwindow.cpp(76,19): warning: unused variable 'message' [-Wunused-const-variable] Task-number: QTBUG-60635 Change-Id: I97c31462ffa826da9baa32c33c0ff0140bf46dfc Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* examples: Fix notepad example for configurations without printsupportOliver Wolff2018-01-222-1/+12
| | | | | | Task-number: QTBUG-65735 Change-Id: I7e0d19de4ac92603f2fd033007343f20a408618a Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
* qtlite: Skip building examples when configured with no-feature-itemviewsRainer Keller2018-01-1212-1/+12
| | | | | | | | | 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>
* Doc: move notepad example to qtbase and improve itNico Vertriest2017-12-1823-1/+1152
| | | | | | | | | | | | | | | - Edited gettingstartedqt.qdoc - update .pro files - replaced snippet statements by \quotefromfile - removed second version of notepad.h and notepad.cpp that were made only for quoting snippets (\quotefromfile reads from the program code) - show current filename in header of window - added checking routine on filename in Save method Task-number: QTBUG-63984 Change-Id: I5298d761763a4dfeb705a1d9b77354be853ada88 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Tutorial: migrate addressbook tutorial to use QRegularExpressionSamuel Gaist2017-01-241-1/+1
| | | | | | | | Update the addressbook tutorial to use the new QRegularExpression class in place of the deprecated QRegExp. Change-Id: Ibea9252ab8fe1d12e6fc862fa70229ca6efe0804 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
* Examples: Replace 'Q_DECL_OVERRIDE' by 'override'hjk2016-06-155-18/+18
| | | | | | | | Examples should demonstrate best practice, and we can use the keyword directly nowadays. Change-Id: I1f122e5caceca17290757ffbaf3d660e7daa9ae4 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* Unify license header usage.Jani Heikkinen2016-03-2959-177/+767
| | | | | | | | | 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>
* Examples/Doc snippets: Fix single-character string literals.Friedemann Kleint2015-10-132-9/+9
| | | | | | | Use character literals where applicable. Change-Id: I79fa5018f05735201ae35ee94ba0d356fcad1056 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-07-011-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qglobal.h src/corelib/global/qsysinfo.h src/corelib/global/qsystemdetection.h src/corelib/kernel/qobjectdefs.h src/plugins/plugins.pro tests/auto/widgets/itemviews/qlistview/qlistview.pro Change-Id: Ib55aa79d707c4c1453fb9d697f6cf92211ed665c
| * Doc: rearrange tables with overflowNico Vertriest2015-06-261-1/+2
| | | | | | | | | | | | Task-number: QTBUG-46475 Change-Id: Id599b2eb0dee0c003475c094ad61700150e37e65 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
* | Remove bogus call and comment from addressbookHolger Hans Peter Freyther2015-06-081-1/+0
|/ | | | | | | | | | | | QMap::empty() does not empty the list but is the STL version to ask if the map is empty. Remove the comment and code as operator>> of QDataStream will clear the map. Fixes Coverity CID#89073 Change-Id: I259e518b44afd42b698368b42aedcc3b84240aca Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Updated BSD licensed file headersJani Heikkinen2015-02-1559-177/+177
| | | | | Change-Id: I6441ff931dbd33b698d762e6f6784898f3f60fe7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-1159-295/+295
| | | | | | | | | | | | | | | | | | 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-155-18/+18
| | | | | | | | | | | | | | | | | | 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>
* Update AddressBook ExampleSteven Ceuppens2014-04-283-3/+3
| | | | | | | | | | Adding parent to QDialog As proposed on qt-project.org forum: http://qt-project.org/forums/viewthread/41686/ Change-Id: Ib66d24e4afd0be803a1080c37bc6c0a189844786 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* expand tabs and related whitespace fixes in *.{cpp,h,qdoc}Oswald Buddenhagen2014-01-131-6/+6
| | | | | | | | the diff -w for this commit is empty. Started-by: Thiago Macieira <thiago.macieira@intel.com> Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Clean up threading examplesSze Howe Koh2013-11-0520-943/+1
| | | | | | | | | | | | | | | | | | | | | | | | | - Example 3 (Clock) is a collection of anti-patterns. - It implements a slot in a QThread subclass and then forces the new thread to use Qt::DirectConnection to invoke the slot in the "wrong" thread. - It talks about getting away with non-thread-safe usage - It uses a thread as a timer and then admits that it's an over- complicated approach. - Example 4 (Permanent Thread) is over-complicated yet incomplete. A better one exists in the QThread class ref. - Example 1 (Thread Pool) is covered by the QThreadPool class ref. - Example 2 (QtConcurrent::run()) is covered in the "Threading and Concurrent Programming Examples" page and the "QtConcurrentRun" page. - The undocumented "Hello Thread" example is covered in the QThread class ref. - These examples cannot be accessed from Qt Creator's Examples tool. - These examples are neither widget-related nor tutorials, contrary to their source paths. Task-number: QTBUG-33360 Change-Id: Ic79cb764ee925ddbcbeafee8e1d01db7fe0f6cfe Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Remove warnings about examples not running in the Qt SimulatorTor Arne Vestbø2013-10-0918-36/+0
| | | | | | | The Qt Simulator is no longer supported with Qt 5. Change-Id: I0f98351d482dd0554ea0754746d56f94ee6bf22f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Doc: Remove section about how to start threadsSze Howe Koh2013-09-143-8/+2
| | | | | | | | | | | | | | - Incomplete: It doesn't talk about how to use a raw QThread, or QRunnable, or Qt Concurrent. - Redundant: Its contents are already presented in QThread's class ref, and the line before this section links to the "Multithreading Technologies in Qt" overview page which provides a more complete intro Also remove snippet markers that are no longer used. Change-Id: I89b7bd72f10c8ffdfd9b7772e2493050aafc9c88 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Remove addressbook-frhjk2013-08-2337-3490/+1
| | | | | | | | | Documentation is generally not translated, this one sticks out. Task-number: QTBUG-28535 Change-Id: Ib2cdbc8c94a6354af3369ff2dcf4df69cde4c381 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Geir Vattekar <geir.vattekar@digia.com>
* Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-1627-166/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove all trailing whitespace from the following list of files: *.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README excluding 3rdparty, test-data and auto generated code. Note A): the only non 3rdparty c++-files that still have trailing whitespace after this change are: * src/corelib/codecs/cp949codetbl_p.h * src/corelib/codecs/qjpunicode.cpp * src/corelib/codecs/qbig5codec.cpp * src/corelib/xml/qxmlstream_p.h * src/tools/qdoc/qmlparser/qqmljsgrammar.cpp * src/tools/uic/ui4.cpp * tests/auto/other/qtokenautomaton/tokenizers/* * tests/benchmarks/corelib/tools/qstring/data.cpp * util/lexgen/tokenizer.cpp Note B): in about 30 files some overlapping 'leading tab' and 'TAB character in non-leading whitespace' issues have been fixed to make the sanity bot happy. Plus some general ws-fixes here and there as asked for during review. Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>