Commit Graph

24 Commits

Author SHA1 Message Date
Ulf Hermann d270c51f81 Adapt examples to AUTO_RESOURCE_PREFIX
Examples that don't explicitly set NO_RESOURCE_TARGET_PATH get the
AUTO_RESOURCE_PREFIX now.

Task-number: QTBUG-103452
Change-Id: I6b41e96ce5620079f60ca2f967b0a2e611c1f738
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2022-06-24 08:45:43 +02:00
Lucie Gérard 0dc4fd240a Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.

Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-06-11 08:05:15 +02:00
Ulf Hermann 633a85cd39 Install the "shared" example module into macOS bundles
If we build an application bundle we cannot rely on the relative path
between the application's and the shared module's output directories.

This is somewhat ugly, but as we don't have a comprehensive solution for
building application bundles, yet, it's the best we can do right now.

In order for the shared bundle to be loaded from the PlugIns directory,
we need to add the PlugIns directory to the import path on macOS.

Pick-to: 6.2
Change-Id: I5b952420b4bb60af74886a140fa2c6a263d2f730
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-09-03 13:04:55 +02:00
Ulf Hermann cb9cc7ca66 Update views example to use modules
The qmake and qmlproject files are adapted to use the "shared" module,
too.

Pick-to: 6.2
Change-Id: I5fc4895416357ba202528b155581b1b5a880a68d
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-08-30 20:34:49 +02:00
Shawn Rutledge ca89437d00 Use qEnvironmentVariableIntValue() instead of qgetenv().toInt()
The docs tell us that it's faster.

Pick-to: 6.2
Change-Id: Ib828ed9a10bbb617670a61e7525cbbe25704815d
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-08-17 16:14:53 +02:00
Volker Hilsheimer a15840a8df Fix additional warnings from usage of deprecated APIs
Replace QLibaryInfo::location with QLibraryInfo::path, and remove usage of
Qt::AA_EnableHighDpiScaling, which doesn't have any effect anymore.

Change-Id: I347e8a83e0f4c2b4405f2512e569ad3234f05a98
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-16 12:44:59 +02:00
Liang Qi 2570b801c7 Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	.qmake.conf
	src/qml/compiler/qv4codegen.cpp
	src/qml/compiler/qv4compileddata_p.h
	src/qml/debugger/qqmlprofiler_p.h
	src/qml/jsruntime/qv4engine.cpp
	src/qml/memory/qv4mm.cpp
	src/qml/qml/qqmlcomponent.cpp
	src/qml/qml/qqmlobjectcreator.cpp
	src/qml/qml/qqmlobjectcreator_p.h
	src/qml/types/qqmldelegatemodel.cpp
	src/quick/items/qquickitem_p.h
	src/quick/items/qquickwindow.cpp
	tests/auto/quick/touchmouse/BLACKLIST
	tests/benchmarks/qml/holistic/tst_holistic.cpp

Change-Id: I520f349ab4b048dd337d9647113564fc257865c2
2018-01-24 09:34:11 +01:00
Tor Arne Vestbø 7628316e6e Let platform decide what the default show action is
The platform handles this through the ShowIsMaximized and
ShowIsFullScreen platform integration style-hints, as well
as QPlatformIntegration::defaultWindowState(), which was
added specifically so that we wouldn't have to hard-code
the behavior in user code.

Change-Id: Ic019ccc2edd871a78bf94fd5fe572b9659416582
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-12-19 22:16:07 +00:00
Liang Qi 15dd1b7883 Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/qml/qml/qqmlimport.cpp
	src/qml/qml/qqmlimport_p.h
	src/qml/qml/qqmltypenamecache.cpp

Done-with: Ulf Hermann<ulf.hermann@qt.io>
Change-Id: I41ba7a592b2659ddf53da6952ea3b456a7bba319
2017-10-24 11:13:09 +02:00
Kai Koehne ea6cd0de3c Fix outdated BSD license header
Change-Id: Icc08925454445fc9497fb3bfd2c26efe90605983
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2017-10-17 11:18:11 +00:00
Laszlo Agocs c9023c2876 Add QQuickPathItem and its backend infra
The generic backend uses the triangulator from QtGui, but is in
fact OpenGL-only for now due to materials.

The NVPR backend uses GL_NV_path_rendering on NVIDIA hardware with
OpenGL 4.3+ or OpenGL ES 3.1+.

The software backend simply uses QPainter.

With the generic backend each PathItem is backed by a non-visual root node
and 0, 1 or 2 child geometry nodes, depending on the presence of visible
stroking and filling. The potentially expensive triangulation happens on
updatePolish(), on the gui thread. This is proven to provide much smoother
results when compared to doing the geometry generation on the render thread
in updatePaintNode(), in particular on power-limited embedded devices.

The NVPR backend uses a QSGRenderNode in DepthAware mode so that the batch
renderer can continue to rely on the depth buffer and use opaque batches.
Due to not relying on slow CPU-side triangulation, this backend uses 5-10
times less CPU, even when properties of the path or its elements are
animated.

The path itself is specified with the PathView's Path, PathLine, PathArc,
PathQuad, etc. types. This allows for consistency with PathView and the
2D Canvas and avoids a naming mess in the API. However, there won't be a
100% symmetry: backends like NVPR will not rely on QPainterPath but process
the path elements on their own (as QPainterPath is essentially useless with
these APIs), which can lead to differences in the supported path elements.

The supported common set is currently Move, Line, Quad, Cubic, Arc.

The patch introduces PathMove, which is essentially PathLine but maps to
moveTo instead of lineTo. More types may get added later (e.g. NVPR can do
a wide variety of optimized rounded rects, but this requires directly
specifying a GL_ROUNDED_RECTx_NV command, thus neededing a dedicated Path
type on our side too)

For filling with gradients only linear gradients are supported at the
moment.

In addition to the declarative API, a more lightweight, QObject-less
JS-callable API should be considered as well for the future.

Change-Id: I335ad64b425ee279505d60e3e57ac6841e1cbd24
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-12-19 17:03:46 +00:00
Venugopal Shivashankar 1372abd309 Example: Enable auto scaling on HighDPI screens
Task-number: QTBUG-56425
Change-Id: I2246245216fb8cd0d4dc4b15a0687edfc64ccad1
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2016-10-28 11:25:10 +00:00
Friedemann Kleint 34f39c8f0d Fix shared example header.
Use new connection syntax and return -1 on load failures, which
avoids hanging processes and empty windows in case some module is not
installed.

Change-Id: I4966c9657b752eee8612fa893a0489bc8a64ccfc
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2015-08-03 08:49:15 +00:00
Jani Heikkinen 20c207815a Fixed license headers
Change-Id: I4d5640ff95e1361ec7e65fb3e87d7726d8185ff5
Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
2015-02-17 13:33:18 +00:00
Jani Heikkinen c5796292ad Update copyright headers
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.

Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9
Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
2015-02-12 10:28:11 +00:00
Shawn Rutledge 6622b87482 Tools and examples: consistently use organization name QtProject
This affects the location of the QSettings files or registry entries.
Other parts of Qt are using this organization name so it's good to
have all the settings in the same place.

[ChangeLog][QtQuick] tools and examples consistently use the
QtProject organization name

Change-Id: I1fae4eaed0248411fe95dda9572d38006648b162
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2014-07-02 09:08:06 +02:00
Sean Harmer 3afffa47fe Adapt Qt Quick 2 renderer to work with OpenGL Core Profile
The basic approach is to have the batched renderer create and bind a
vertex array object if it detects we are using an OpenGL Core profile
context. The VAO is bound for the duration of the QQ2 renderer's
work cycle and unbound at the end so as to not interfere with any
other VAO's a user may wish to use.

All shaders have been copied and ported to be compliant with the
GLSL 150 core specification which is the minimum for a Core profile
context (OpenGL 3.2 Core). We are not using any newer features as
yet so this will work anywhere we can get a Core profile context.

The QSGShaderSourceBuilder class has been extended to resolve any
requests for shaders to the same basefilename with "_core"
appended prior to any file extension. This could be extended in
the future to allow version, or GPU or platform specific shaders.

The QSGShaderSourceBuilder has also been extended to allow it to
insert #define definitions in the prologue of a shader. Any such
definition is inserted:

* After the last #extension directive (if any are found)
* Otherwise after the #version directive (if found)
* Otherwise at the start of the shader source

This is required by the custom particle shaders which make
extensive use of such #defines.

In addition the mechanism used by the distance field glyph cache to
extend the cache with new glyphs has been modified to work (and
work more efficiently) when using a Core profile context.

Rather than using a shader program and a buffer filling quad to
blit the old texture into the new cache texture, we instead use
the technique of framebuffer blitting. The existing fallback
implementation using glTexSubImage2D() is still available if
needed.

The DECLARATIVE_EXAMPLE_MAIN macro has been extended to allow easy
testing of any of the QtDeclarative examples with a core profile
context. Just run the example with

QT_QUICK_CORE_PROFILE=1 ./text

for e.g. The only ones that may not work out of the box are those
that provide GLSL shader source e.g. the customparticles or
shader effect examples. These work fine if the shader source is
adapted to GLSL 150 core.

In the future it may be a good idea to expose some context property
to QML that the user can use to determine what shader source
variation to provide to Qt Quick. Along these lines it would also
be very nice to allow the provision of shader source to
ShaderEffect or CustomParticle from a separate source file just as
we now do within Qt Quick.

Task-number: QTBUG-32050
Change-Id: Ia6e9f06dbb8508af9ae03c6b60fb418b4cc9e41f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-11-13 23:42:13 +01:00
Alan Alpert 87f90a43f4 Polish up QQmlFileSelector
Incorporate beta feedback, and hide QQmlAbstractUrlInterceptor as the
implementation (instead of making that "the API").

Change-Id: Ib7b14afeb9205fb8a87ed16a6d38b1f468b2aaaa
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-11-13 09:32:27 +01:00
Alan Alpert 67ee1cd27b Apply file selectors to QQmlApplicationEngine apps
You can also manually apply them to a QQmlEngine using
setUrlInterceptor(new QQmlFileSelector(parent)), or using
your own QQmlAbstractUrlInterceptor subclass.

Change-Id: I0c0ff8b080c138686b3c03e0bc3b9f25bcd11a85
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-20 01:08:53 +02:00
Shawn Rutledge d9956871a3 examples: set application name and organization for QSettings
With the Qt.labs.settings module available, it makes sense for each
example to have its own settings file.

Change-Id: I8257f04ec13c7caf9995e03626e5453c653cfb92
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-08-15 14:12:42 +02:00
Shawn Rutledge 4348452855 Package dialogs examples into a single executable
Introduced tabs and added the C++ boilerplate launcher.

Change-Id: Ibb49a182e3928aba5dced097d5307eb7d1f4b42d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-05-28 10:08:51 +02:00
Sergio Ahumada 83deab8d1b Update copyright year in Digia's license headers
Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76
Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-01-10 19:52:37 +01:00
Kai Koehne a0fb0a5dd3 Use resource files for most examples
Make examples shadow-build-friendly by using resource
files instead of trying to derive the qml path from
applicationDirPath().

Change-Id: I669424554c772d9b261249b366247190f5fbd8b1
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2012-12-12 10:32:50 +01:00
Oswald Buddenhagen a6065d60f1 centralize and fixup example sources install targets
follow respective change in qtbase

Change-Id: I27502eb7ebea973e19ec5f7c3ec0e2338556f6e0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
2012-12-10 18:16:48 +01:00