Examples are usually a good way to get to know a new codebase, do not
teach developers who are new to Qt about the 3-arg connect() to begin
with.
Drive-by changes:
- `this` can't be implicitly captured with [=] in a lambda, instead
capture by reference
- Update docs related to the sqlbrowser example; the overloaded signal
it mentions has been removed in Qt6
- In the sqlbrowser example, rename addConnection() (no-arg) overload to
openNewConnectionDialog, suggested in code review
Change-Id: I30c9f35bda4ac2f460d767ab7f84422ae3ed09f7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This is what we promote also in the documentation.
Change-Id: If91aebafe861b0c934acbb2c69afd182abc3345d
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.
Existing copyright statements remain intact
Task-number: QTBUG-88621
Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Examples are intended to show how to build against an installed Qt.
Building them as part of the main build means the way the Qt targets
are defined and created are not representative of an end user's build.
By building them as separate projects using ExternalProject, we can
more closely replicate the intended audience's environment. This
should allow us to catch more problems earlier.
Having examples built as part of the main build also creates problems
with some static builds where a tool built by the main build is needed
during configure time. This happens with other repos like qtdeclarative
but not (currently) with qtbase. Converting the examples in qtbase to
be built using ExternalProject is intended as a demonstrator for how
other repos can do similar. Until other repos are converted, they will
continue to work as they did before, with examples as part of the main
build for non-static builds only.
The new build-externally behavior is only supported for non-prefix
builds with this change. Prefix builds will continue to use the old
non-external method. Support for building examples externally in
prefix builds will be a separate change.
Task-number: QTBUG-90820
Fixes: QTBUG-91068
Change-Id: I2304329940568dbdb7da18d54d5595ea7d8668bc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Added qt_examples_begin() and qt_examples_end() macros to setup the
example list so it can be re-used in other projects.
When cross-compiling, we also need to set
CMAKE_FIND_ROOT_PATH_MODE_PACKAGE to BOTH in order for find_package()
to work correctly.
Removed support for building the whole qtbase/examples folder as a
standalone project. Building examples is only supported when building
the whole of qtbase (qtbase + examples together) or each individual
example is built separately against an installed Qt version.
Change-Id: I9d26b94b48b95af230b76ab618becb21d2d45581
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
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>