summaryrefslogtreecommitdiffstats
path: root/examples/network
Commit message (Collapse)AuthorAgeFilesLines
* secureudpclient - a speculative fix for non-reproducible crashTimur Pocheptsov2020-12-111-0/+5
| | | | | | | | | | | | Not much information in a bug report: QByteArray is protected from negative sizes and QUdpSocket too. FWIW - add one more check, similar to what the server counterpart already had. Fixes: QTBUG-83457 Change-Id: I585fa90e0a258d2257e4fed2f24c52b47548bcbb Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit b283ce1e836ab08e602a11ea255ee3d8e537902e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update the HTTP exampleMårten Nordheim2020-10-283-69/+120
| | | | | | | | | | | | | | | | | | | - Extended the documentation talking about it - Initialize members in the header rather than in the ctor - Some formatting changes - Prefer connect-ing to QNetworkReply rather than QNAM for sslErrors - Because we didn't use the QNetworkReply* argument - Put the QNetworkReply pointer in a managed pointer - Removed the code explicitly handling a redirect (it's the new default) - Edited HttpWindow::httpFinished so that there're less places to reset the reply pointer - Updated some ifdefs I didn't update when I was revamping this example 3 years ago Task-number: QTBUG-87306 Change-Id: I10a6f756c09908f199ac9c61e28b49625af10105 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* CMake: Regenerate examples to set the WIN32_EXECUTABLE propertyAlexandru Croitor2020-10-2722-0/+88
| | | | | | | | | 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-1922-22/+22
| | | | | | Task-number: QTBUG-87661 Change-Id: I0dacfdc97a3fb7d88da85b67800f2c1b084d869b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QAbstractSocket: Resolve remaining Qt6 TODOsMårten Nordheim2020-08-242-6/+6
| | | | | Change-Id: Id257f0721c1cd5fcbafa9297bae0251a2d68e366 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Port the QXmlStream API from QStringRef to QStringViewKarsten Heimrich2020-08-191-2/+2
| | | | | | | | | | | | | | This gives some source incompatibilities, most of them can be handled by using auto instead of QStringRef explicitly. [ChangeLog][Important API changes] QXmlStream now uses QStringView insteead of QStringRef in it's API. Using auto forvariables returning a QStringRef in Qt 5 should lead to code that can be used against both Qt versions. Fixes: QTBUG-84317 Change-Id: I6df3a9507276f5d16d044a6bdbe0e4810cf99440 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* CMake: Regenerate examplesAlexandru Croitor2020-07-0924-48/+168
| | | | | | Change-Id: I1c51b10af4e2b26f54740f257164c56a0e2a03ce Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Use qsizetype in QListLars Knoll2020-07-063-10/+10
| | | | | | | | | | | | | | | | | | | | The change creates a slight source incompatibility. The main things to take care of are * code using printf statements on list.size(). Using qsizetype in printf statements will always require a cast to work on both 32 and 64 bit. * A few places where overloads now get ambiguous. One example is QRandomGenerator::bounded() that has overloads for int, uint and double, but not int64. * Streaming list.size() to a QDataStream will change the format depending on the architecture. [ChangeLog][QtCore][QList] QList now uses qsizetype to index into elements. Change-Id: Iaff562a4d072b97f458417b670f95971bd47cbc6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QList instead of QVector in examplesJarek Kobus2020-06-239-16/+16
| | | | | | Task-number: QTBUG-84469 Change-Id: Id14119168bb1bf11f99bda7ef6ee9cf51bcfab2e Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Torrent example: fix crashGiuseppe D'Angelo2020-05-111-2/+2
| | | | | | | | | | | | | | | | | | | | | Yet Another Side Effect of not keeping iterator stability. Although not idiomatic, the pattern while (i != e) { auto cur = i++; if (cond) erase(cur); } was actually correct. Move to the idiomatic erase pattern instead (it = cont.erase(it)). The example still has memory problems all over the place on shutdown. At least now it doesn't crash when running. Change-Id: I30bd2c4e2b3fa7fe4e28d4426ff3d894b9bae103 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* torrent example: fix premature pessimisationMarc Mutz2020-05-051-1/+1
| | | | | | | | | | | Use case-insensitive endsWith() instead of lowering a QString and then comparing case-sensitively. As a drive-by, replace ascii string literal with char16_t one. Change-Id: Id4d8e5b197baba7aa3ae4c2ae57414c1242b3827 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-05-041-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/text/qlocale.cpp src/network/access/qnetworkaccessmanager.cpp Regenerated tests/auto/testlib/selftests/float/CMakeLists.txt Change-Id: I5a8ae42511380ca49a38b13c6fa8a3c5df8bed01
| * torrent example: fix stripping of file extensionMarc Mutz2020-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | Due to QChar being convertible from almost any integral type, the old code actually called QString::remove(QChar). Fix by using QString::chop() instead. Change-Id: I345b018aa137ecff608a130e69ade5d37ef0805c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-231-0/+1
|\| | | | | | | Change-Id: Iaa439ba7dff19a17e3716b3d30f49f60fa6e38f8
| * SslSocketClient - fix example not to crashTimur Pocheptsov2020-04-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the bug related to the 'new syntax' signal/slot connections, it's unfortunately possible to have a connection not deleted properly by the moment children objects get deleted. Then, as a result, in e.g. QSslSocket's destructor the socket will change its state, triggering the (now deleted) UI elements' access. Note - the original bug was reported, the patch (only possible?) was not accepted. Fixes: QTBUG-83659 Change-Id: I2965532485bcd46f93f8449e4d0a30da92b572c5 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | QApplication: remove obsolete globalStrut functionalityVolker Hilsheimer2020-04-101-2/+1
| | | | | | | | | | | | Change-Id: If56873f86f5291264cac720f8db7dbd4db756f49 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-083-4/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/opengl/doc/src/cube.qdoc src/corelib/global/qlibraryinfo.cpp src/corelib/text/qbytearray_p.h src/corelib/text/qlocale_data_p.h src/corelib/time/qhijricalendar_data_p.h src/corelib/time/qjalalicalendar_data_p.h src/corelib/time/qromancalendar_data_p.h src/network/ssl/qsslcertificate.h src/widgets/doc/src/graphicsview.qdoc src/widgets/widgets/qcombobox.cpp src/widgets/widgets/qcombobox.h tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro tests/manual/diaglib/debugproxystyle.cpp tests/manual/diaglib/qwidgetdump.cpp tests/manual/diaglib/qwindowdump.cpp tests/manual/diaglib/textdump.cpp util/locale_database/cldr2qlocalexml.py util/locale_database/qlocalexml.py util/locale_database/qlocalexml2cpp.py Resolution of util/locale_database/ are based on: https://codereview.qt-project.org/c/qt/qtbase/+/294250 and src/corelib/{text,time}/*_data_p.h were then regenerated by running those scripts. Updated CMakeLists.txt in each of tests/auto/corelib/serialization/qcborstreamreader/ tests/auto/corelib/serialization/qcborvalue/ tests/auto/gui/kernel/ and generated new ones in each of tests/auto/gui/kernel/qaddpostroutine/ tests/auto/gui/kernel/qhighdpiscaling/ tests/libfuzzer/corelib/text/qregularexpression/optimize/ tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/ tests/libfuzzer/gui/text/qtextdocument/sethtml/ tests/libfuzzer/gui/text/qtextdocument/setmarkdown/ tests/libfuzzer/gui/text/qtextlayout/beginlayout/ by running util/cmake/pro2cmake.py on their changed .pro files. Changed target name in tests/auto/gui/kernel/qaction/qaction.pro tests/auto/gui/kernel/qaction/qactiongroup.pro tests/auto/gui/kernel/qshortcut/qshortcut.pro to ensure unique target names for CMake Changed tst_QComboBox::currentIndex to not test the currentIndexChanged(QString), as that one does not exist in Qt 6 anymore. Change-Id: I9a85705484855ae1dc874a81f49d27a50b0dcff7
| * macOS: Remove all use of deprecated Q_OS_OSX defineTor Arne Vestbø2020-04-031-1/+1
| | | | | | | | | | Change-Id: I49c285604694c93d37c9d1c7cd6d3b1509858319 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * More qOverload cleanups in qtbaseTimur Pocheptsov2020-03-241-2/+1
| | | | | | | | | | | | Task-number: QTBUG-82605 Change-Id: I1c3c14ed82911ed5483258c11e76f5dd7744fa12 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * QAbstractSocket: Fix usage of deprecated error signal in exampleMårten Nordheim2020-03-241-1/+1
| | | | | | | | | | | | Task-number: QTBUG-82605 Change-Id: I83a8777d32302607d48dd670b6c787ac05db88d2 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devLars Knoll2020-03-041-1/+5
|\| | | | | | | Change-Id: I99ee6f8b4bdc372437ee60d1feab931487fe55c4
| * Examples: use QDialog::showMaximaized() for AndroidAssam Boudjelthia2020-03-031-1/+5
| | | | | | | | | | | | | | | | | | Examples that use QDialog as main window should be maximized on Android to avoid a black view on most of the screen. Task-number: QTBUG-80717 Change-Id: I933c1a01d95d53da009c190c37fa32f27be5af5e Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* | Merge remote-tracking branch 'origin/5.15' into devLars Knoll2020-02-2817-24/+55
|\| | | | | | | Change-Id: I469b0501cc65fc5ce4d797a69ae89405cc69c7f8
| * Revert "QNetworkReply: deprecate the 'error' getter"Alexander Akulich2020-02-285-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit ccb2cb84f535b0bfce19a95d7f3a36803480cae8 and commit 0f568d0a671e9f0667a1b47ffa6fbb9f7a10d9f5. The patches fix ambiguity between a getter and a signal by changing the getter name, but we still have to rename the signal to follow the signals naming convention. Revert the commits to keep the getter as is and change the signal name instead. Change-Id: Iddbab7c33eea03826ae7c114a01857ed45bde6db Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * QAbstractSocket: deprecate 'error' signal, use 'errorOccurred' insteadAlexander Akulich2020-02-277-13/+11
| | | | | | | | | | | | | | [ChangeLog][Deprecation Notice] QAbstractSocket::error() (the signal) is deprecated; superseded by errorOccurred() Change-Id: I11e9c774d7c6096d1e9b37c451cf0b99188b6aad Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Examples: request Android storage permissions when using QStandardPathsAssam Boudjelthia2020-02-262-1/+24
| | | | | | | | | | | | | | | | | | http example uses QStandardPaths, on Android permissions might need to be explicitly requested to write the downloaded file. Task-number: QTBUG-80717 Change-Id: Icd377254ad77cac661c5ae37e9081e0463493d8b Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * Revert "QAbstractSocket: deprecate 'error' member-function"Alexander Akulich2020-02-263-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 94b3dd77f29a00ebbd1efdc66d75f57e1c75b152. The patch fixes ambiguity between a getter and a signal by changing the getter name, but we still have to rename the signal to follow the signals naming convention. Revert the commit to keep the getter as is and change the signal name instead. Change-Id: I0dd60cf1ae9d1bd95beeb8ad58661ca4b1fb63b9 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-02-2617-2195/+9
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/bearermonitor/CMakeLists.txt examples/network/CMakeLists.txt src/corelib/tools/qlinkedlist.h src/sql/kernel/qsqldriver_p.h src/sql/kernel/qsqlresult_p.h src/widgets/kernel/qwidget.cpp src/widgets/kernel/qwidget_p.h tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp tests/auto/tools/moc/allmocs_baseline_in.json Change-Id: I21a3c34570ae79ea9d30107fae71759d7eac17d9
| * Remove bearer management from remaining network examplesMårten Nordheim2020-02-196-139/+9
| | | | | | | | | | | | | | | | Because bearer management is going away Change-Id: I60439c1714e0350b0f2bbef6afc8d2015886135f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * Remove the bearermonitor exampleMårten Nordheim2020-02-1910-2012/+0
| | | | | | | | | | | | | | | | Because bearer management is going away Change-Id: I64311895c347b3e63df75d10db1673bcfe54f52d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | QComboBox: remove currentIndexChanged(const QString&)Vitaly Fanaskov2020-02-191-1/+1
| | | | | | | | | | | | | | Fixes: QTBUG-81913 Task-number: QTBUG-81845 Change-Id: I8f24b858ce4e35b495440001d7734cc8f169cd5f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge "Merge remote-tracking branch 'origin/wip/cmake' into dev"Alexandru Croitor2020-02-1123-26/+159
|\ \
| * | Regenerate examplesAlexandru Croitor2020-02-0423-26/+159
| | | | | | | | | | | | | | | | | | Change-Id: I04b2adbe370ffea81d7787ad90e4ae69d2c165cb Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | QSpinBox: remove deprecated signal valueChanged(const QString &)Vitaly Fanaskov2020-02-101-1/+1
|/ / | | | | | | | | | | Task-number: QTBUG-81845 Change-Id: I91148cac553f63b44968337ccc121e7376ee4465 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-01-291-1/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/Qt5CoreConfigExtras.cmake.in src/corelib/Qt5CoreMacros.cmake src/dbus/Qt5DBusConfigExtras.cmake.in src/widgets/Qt5WidgetsConfigExtras.cmake.in Change-Id: Ib782f3b177c38b2cce83beebe15be9c0baa578f7
| * Replace most use of QVariant::type and occurrences of QVariant::TypeOlivier Goffart2020-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I made a clazy automated check that replaced the use of QVariant::Type by the equivalent in QMetaType. This has been deprecated since Qt 5.0, but many uses were not yet removed. In addition, there was some manual changes to fix the compilation errors. Adapted the Private API of QDateTimeParser and QMimeDataPrivate and adjust QDateTimeEdit and QSpinBox. QVariant(QVariant::Invalid) in qstylesheet made no sense. But note that in QVariant::save, we actually wanted to use the non-user type. In the SQL module, many changes were actually reverted because the API still expects QVarient::Type. Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/dev' into merge-devLeander Beernaert2020-01-2449-329/+337
|\| | | | | | | Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
| * Build the securesocketclient example for other SSL backendsMårten Nordheim2020-01-141-1/+1
| | | | | | | | | | Change-Id: I06b8361c116d2ae2aa2a64f63ac90b6ff1982008 Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
| * QNetworkReply: deprecate the 'error' getterTimur Pocheptsov2020-01-135-6/+6
| | | | | | | | | | | | | | | | | | | | To disambiguate &QNetworkReply::error expression. [ChangeLog][Deprecation Notice] QNetworkReply::error() (the getter) was deprecated; superseded by networkError(). Task-number: QTBUG-80369 Change-Id: I545f963788bce0800c9e0f0c94d5f1029946effe Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * QAbstractSocket: deprecate 'error' member-functionTimur Pocheptsov2020-01-103-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | The one that is a getter for the last error found. This is to disambiguate the expression '&QAbstractSocket::error'. Introduce a new member-function socketError as a replacement. [ChangeLog][Deprecation Notice] QAbstractSocket::error() (the getter) is deprecated; superseded by socketError(). Task-number: QTBUG-80369 Change-Id: Ia2e3d108657aaa7929ab0810babe2ede309740ba Reviewed-by: Mårten Nordheim <marten.nordheim@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/dev' into wip/cmakeSimon Hausmann2019-10-171-2/+2
|\| | | | | | | Change-Id: Ia1da879a7bd8f71a649661a1844144dd67d60b3a
| * Prepare for deprecating the QDesktopWidgetSona Kurazyan2019-10-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/wip/qt6' into wip/cmakeAlexandru Croitor2019-07-116-23/+22
|\| | | | | | | Change-Id: I715b1d743d5f11560e7b3fbeb8fd64a5e5ddb277
| * Convert uses of QTime as a timer to QElapsedTimerEdward Welbourne2019-06-144-7/+7
| | | | | | | | | | | | | | | | Change-Id: I2297f61efa5adf9ea5194c7f3ff68574cbcf452c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@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>
* | Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-06-1423-48/+48
|\| | | | | | | | | | | | | | | | | | | 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-1223-19/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-1219-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0523-415/+616
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>