qt5base-lts/examples
Tor Arne Vestbø 6ff79478a4 Introduce platform API abstraction for QOpenGLContext
The API is available by including qopenglcontext.h as usual,
but scoped in the QPlatformInterface namespace. The namespace
exposes platform specific type-safe interfaces that provide:

 a) Factory functions for adopting native contexts, e.g.

    QCocoaGLContext::fromNative(nsContext, shareContext);

 b) Access to underlying native handles, e.g.

    openGLContext->platformInterface<QCocoaGLContext>->nativeContext()

 c) Platform specific functionality, e.g.

    static QWGLContext::openGLModuleHandle()

    openGLContext->platformInterface<QEGLContext>->doSomething();

The platform interfaces live close to the classes they extend,
removing the need for complex indirection and plumbing, and
avoids kitchen-sink modules and APIs such as the extras modules,
QPlatformFunctions, or QPlatformNativeInterface.

In the case of QOpenGLContext these platform APIs are backed
by the platform plugin, so dynamic_cast is used to ensure the
platform plugin supports the requested interface, but this is
and implementation detail. The interface APIs are agnostic
to where the implementation lives, while still being available
to the user as part of the APIs they extend/augment.

The documentation will be restored when the dust settles.

Task-number: QTBUG-80233
Change-Id: Iac612403383991c4b24064332542a6e4bcbb3293
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-07-02 10:27:50 +02:00
..
aggregate install a sane top-level examples.pro file 2012-12-11 13:37:57 +01:00
corelib Use QList instead of QVector in examples 2020-06-23 14:01:11 +02:00
dbus Regenerate examples 2020-02-04 18:50:39 +00:00
embedded CMake: Fix lightmaps example to build in a namespaced Qt 2020-06-12 19:30:29 +02:00
gui Regenerate examples 2020-02-04 18:50:39 +00:00
network Use QList instead of QVector in examples 2020-06-23 14:01:11 +02:00
opengl Introduce platform API abstraction for QOpenGLContext 2020-07-02 10:27:50 +02:00
qmake Add cmdline feature to qmake 2019-02-18 07:12:14 +00:00
qpa Replace calls to deprecated QEvent accessor functions 2020-06-08 19:11:51 +02:00
qtconcurrent Fix warnings in QtConcurrent image scaling example 2020-07-01 14:57:43 +02:00
qtestlib Regenerate examples 2020-02-04 18:50:39 +00:00
sql Replace calls to deprecated QEvent accessor functions 2020-06-08 19:11:51 +02:00
vulkan Use QList instead of QVector in examples 2020-06-23 14:01:11 +02:00
widgets macOS: Remove examples for deprecated QMac(NativeWidget|CocoaViewContainer) 2020-06-26 15:10:26 +02:00
xml examples: avoid int -> QChar conversions 2020-04-29 10:10:36 +02:00
CMakeLists.txt cmake: add examples/opengl 2019-10-07 07:22:17 +00:00
examples.pro Doc: Move touch examples around so they get included in docs 2018-09-14 03:56:22 +00:00
README Remove more references to demos. 2011-07-08 15:36:26 +02:00

Qt is supplied with a number of example applications that have been
written to provide developers with examples of the Qt API in use,
highlight good programming practice, and showcase features found in each of
Qt's core technologies.


Documentation for examples can be found in the Examples section
of the Qt documentation.