The drawing is antialiased and with rounded caps and joins.
Rotation stylus acts like a felt marker.
Airbrush sprays a radial gradient of color, and its alpha can
depend on the tangential pressure if so chosen.
Task-number: QTBUG-46694
Change-Id: I4fb16eb621707e3c56a75aa302dd0d3bf418a745
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
The existing recentfiles example was basically a clone of the SDI
example with a "Recent" menu added. Assuming it is better to have
it all in one place, the functionality is merged into the existing
SDI/MDI examples.
- Implement recently opened files handling using a submenu and a
QSettings array in the SDI/MDI examples.
- Remove recentfiles example.
Change-Id: Id5a1ab9fa1c2e6b9ec81309cfe74cf86f450392a
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Add some extra rotations and offsets, to show off the power of
what you can do with a single draw call. Also use QGLWindow instead
of QGLWidget. This improves performance from 23 FPS to 30 FPS on a
4k monitor with integrated Intel graphics.
Change-Id: Iedac1c14cc6057959aa15faaacdf29da91f36ab1
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Using the approach we already do for some GLES 3.0 functions we can provide a cross-platform,
cross-GL-GLES wrapper for ES 3.0 and 3.1 functions too.
Applications only have to take extra care about the version requests (context version
and version directives in shader code), the rest of their code can stay the same across
desktop/mobile/embedded, even when ES 3 functions are used.
The new functions are placed to a new subclass which is placed between QOpenGLFunctions
and the internal QOpenGLExtensions. This is necessary because, unlike with QOpenGLFunctions,
there is no guarantee that these functions are always available in all configurations.
When running on desktop OpenGL, we resolve as usual. If the OpenGL version contains the
function in question, either in core or as an extension, it will all just work. This is
handy because it does not rely on 4.x extensions like GL_ARB_ESx_compatibility, and so
ES 3.0 functions will be functional on OpenGL 3.x systems too by just setting a 3.x version
number in the QSurfaceFormat.
We will no longer qFatal on broken systems where the driver returns a 3.0 or 3.1 context without
the corresponding functions present. Instead, we show a warning and gracefully fall back to
resolving as usual, via eglGetProcAddress or similar. For functions that are available in ES2 as
an extension this may just work fine.
Added also an example that runs identically both with OpenGL and OpenGL ES 3 and utilizes some
ES 3.0 features like instanced drawing.
[ChangeLog] Added QOpenGLExtraFunctions providing OpenGL ES 3.0 and 3.1 function wrappers in
a cross-platform manner.
Task-number: QTBUG-46161
Change-Id: I9f929eb61946c35c415b178c4d6ab2c1c958684e
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
- Introduce Qt 5 signals & slot syntax and remove the QSignalMapper
used to map the triggered() signals of the per-MDI-child actions
of the window menu to the activation slot by a functor to demonstrate
the flexibility of the new connection syntax (the functor can
in turn be replaced by a lambda expression once we have C++ 11).
- Merge MainWindow::createMenus()/createQToolBars()
into MainWindow::createActions(), removing the need
to store the actions as member variables.
Use QMenu::addAction() for brevity.
- Use QIcon::fromTheme() to obtain system icons and use
resource icons as fallback.
- Rewrite settings code to use
QWidget::saveGeometry(), Widget::restoreGeometry() since
saving size and position does not work well with multiple
screens. Query the available size when determining
the initial size instead of using hard-coded values
for High-DPI screens.
- Fix minor issues in code, use multi-argument version
of QString::arg(), QDir::toNativeSeparators() to
present file paths to the user and static method invocation.
Change-Id: I3d5078ddbe3cb4eba65e188430ba3580cecb2c79
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
- Introduce Qt 5 signals & slot syntax.
- Use QIcon::fromTheme() to obtain system icons and use
resource icons as fallback.
- Fix minor issues in code, use multi-argument version
of QString::arg(), QDir::toNativeSeparators() to
present file paths to the user, static method
invocations.
- Use QMimeDatabase for file dialog.
Change-Id: Ib7f947aaaa0c8034f0853b1c740ebf195821dae0
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
I show this code during trainings and this explicit template type
just makes the line of code more complex than it has to be.
Change-Id: I294c65f48967e54c67d9c3b8e1de96c3c2495a5b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
- Introduce Qt 5 signals & slot syntax.
- Replace QSignalMapper used for the corner/area
actions by a by a functor.
- Improve command line parsing.
- Reorder class declarations.
- Remove commented-out code.
- Use QDialogButtonBox in dialogs.
- Fix minor issues in code, use multi-argument version
of QString::arg(), QDir::toNativeSeparators() to
present file paths to the user, static method
invocations.
Change-Id: I865c56639c74135b59740797e9a9dfbfca2e72b6
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
- Introduce Qt 5 signals & slot syntax.
- Use QCommandLineParser to obtain file arguments, factor
out positioning into tile() function to be able to
use it from command line and open/new slots.
- Merge MainWindow::createMenus()/createQToolBars()
into MainWindow::createActions(), removing the need
to store the actions as member variables.
Use QMenu::addAction() for brevity.
- Use QIcon::fromTheme() to obtain system icons and use
resource icons as fallback.
- Rewrite settings code to use
QWidget::saveGeometry(), Widget::restoreGeometry() since
saving size and position does not work well with multiple
screens. Query the available size when determining
the initial size instead of using hard-coded values
for High-DPI screens.
- Fix minor issues in code, use multi-argument version
of QString::arg(), QDir::toNativeSeparators() to
present file paths to the user and and static method invocation.
- Fix snippet references accordingly.
Change-Id: I3ea0372bc7ff82247192f54620289352fb68d60f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
- Introduce Qt 5 signals & slot syntax
- Use QCommandLineParser to obtain file arguments
- Merge MainWindow::createMenus()/createQToolBars()
into MainWindow::createActions(), removing the need
to store the actions as member variables.
Use QMenu::addAction() for brevity.
- Use QIcon::fromTheme() to obtain system icons and use
resource icons as fallback.
- Rewrite settings code to use
QWidget::saveGeometry(), Widget::restoreGeometry() since
saving size and position does not work well with multiple
screens. Query the available size when determining
the initial size instead of using hard-coded values
for High-DPI screens.
- Fix minor issues in code, use multi-argument version
of QString::arg(), QDir::toNativeSeparators() to
present file paths to the user.
- Fix snippet references accordingly.
Change-Id: I1bc49a8913aa6d669e0e666f04be3f1f42eaba10
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
The Hello GL2 Example was using the older Signal/Slot syntax that made
use of the macros `SIGNAL()` and `SLOT()`. I changed it to the newer
one.
Change-Id: I8e55015383847a04b07f751fe9fc94b81956a896
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
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>
The DEPLOYMENT variable has been deprecated.
Change-Id: I1c7c07b36a2e665ae302e4f43f7f2dc752f3c1f4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Use the last path from QSP to hint that we want to
load photos from the global photo library. This
should currently only make a difference on iOS.
Change-Id: I7a6217dbbbc2e247b69bf406c02001458c757211
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Introduce support for the widgets' clipRect(). Right now render-to-texture widgets
in scroll areas placed close to each other result in broken (non-existent) clipping.
Similarly, stack-on-top widgets fail to clip when placed inside a scroll area.
This is now corrected and the qopenglwidget example is enhanced to utilize a scroll
area.
Task-number: QTBUG-45860
Change-Id: I859a63d61a50d64ba9e87244f83c5969dce12337
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
The Qt TestLib examples are just tutorials so updated
the qdocconf to use the default thumbnail in the
Qt Creator welcome screen.
Task-number: QTBUG-41996
Change-Id: Ia04a42a92e414c97a426b6095a62621a348e7de0
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
The result doesn't look good when you paint with the MinimumDiameter (3 px).
Also don't paint released touch points, because we can't get neither the
touch rect not the pressure for them.
Change-Id: I8d17c4884ae41545b2cd3f208afa73262133456c
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Add dynamic GL and remove warning about ANGLE since that
package no longer exists.
Task-number: QTBUG-46103
Change-Id: Icf93d1105434395a3c9ad61bb8c921fcedfc7137
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Fix Library not loaded/image not found error on application
startup.
With @rpath enabled (commit 6e18f57a) qmake now requires
a correct target.path in order to emit correct -rpath @loader_path
linker directives.
Change-Id: Ia32b038ad2d64819477be5cd9d1ed36768e2251b
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
If this setting is enabled, the entire group of docked tabs will
be draggable by the title bar of the group and and individual dock
can be dragged by dragging the tab.
When tabs are detached, the docks that are contained are reparented to
a QDockWidgetGroupWindow.
[ChangeLog][QtWidgets][QMainWindow] Added GroupedDragging as a DockOption
which allow users to drag all the tabs together when dragging the
title of a QDockWidget which is tabbed with others.
Change-Id: I5285685b129770498eb3e4fd5f4556e41225a595
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
The QWindow tends to get mouse releases on Windows when
maximizing the window for example. This is likely a problem
in the platform, but the example should be improved too to
be more robust and ignore such unwanted events.
Task-number: QTBUG-42842
Change-Id: Iecf916a2f753ed1b37d644721ee212ca7c728c49
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This makes the behavior much more clear. You can get a tristate checkbox
just by setting the CheckStateRole to PartiallyChecked, no tristate flag needed.
The flag, on the other hand, enables the automatic-tristate behavior in
QTreeViews (and only there), hence the new name for it.
Change-Id: I18d292a8b8294c863eab806f3874d15dfb72556c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
Currently only the QRegExp based regexp tool is available to help build
regular expression. This patch aims to add the equivalent that use the
new QRegularExpression class.
Change-Id: Ie5f711640b32a6d10ce44d2c7795062c1aacce3f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
The Google Suggest API doesn't return the 'num_queries'
anymore. Had to remove code related to 'num_queries' entry
so that the suggestion list shows up.
Task-number: QTBUG-42817
Change-Id: Ic918d1c86840fa4c1e18f32a984f5a9dd911261d
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Add a command line parser so that the directory can be specified.
Resize depending on screen size and make first (name) column larger.
Change-Id: Ied5823b4e8f50345aae792628fb610b8604e37d3
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
The swipe handler is simple, and also doesn't currently work on every
platform. But the pinch handler is the one that needs explanation,
because the difference between incremental and absolute values of the
rotation and scale properties is tricky.
Change-Id: Ie3c7f4941d4a17734c9a920a8dd978f86fb03c4b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
QPinchGesture::scaleFactor is relative to the previous zoom factor,
so either we need to multiply the total zoom by scaleFactor,
or set it based on totalScaleFactor, which is simpler. Pinch-zoom is
now working in this example.
There's also no reason to use getProperty() when the accessors are
directly accessible in QPinchGesture.
Task-number: QTBUG-6010
Change-Id: I150dc0b18b4b871a08ec55c0f77463509ab26afe
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Including math.h can pollute the default namespace, and break
some compilers if cmath versions of the method are declared as using.
Switching to C++ math functions also greatly simplifies handling of
float qreal as C++ automatically chooses the right method.
[ChangeLog][QtCore][QtMath] qmath.h no longer includes math.h, so any
sources depending on that indirect inclusion may fail to build.
Change-Id: I4d0e331dafba354ec05dc5052e61ef4ff8d387fe
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>