summaryrefslogtreecommitdiffstats
path: root/examples/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets')
-rw-r--r--examples/widgets/doc/images/imagegestures-example.jpgbin0 -> 38962 bytes
-rw-r--r--examples/widgets/doc/src/plugandpaint.qdoc9
-rw-r--r--examples/widgets/gestures/imagegestures/doc/src/imagegestures.qdoc3
-rw-r--r--examples/widgets/graphicsview/boxes/boxes.pro6
-rw-r--r--examples/widgets/widgets/imageviewer/imageviewer.cpp2
-rw-r--r--examples/widgets/windowcontainer/windowcontainer.cpp18
6 files changed, 23 insertions, 15 deletions
diff --git a/examples/widgets/doc/images/imagegestures-example.jpg b/examples/widgets/doc/images/imagegestures-example.jpg
new file mode 100644
index 0000000000..c8484b4a71
--- /dev/null
+++ b/examples/widgets/doc/images/imagegestures-example.jpg
Binary files differ
diff --git a/examples/widgets/doc/src/plugandpaint.qdoc b/examples/widgets/doc/src/plugandpaint.qdoc
index 7a8a2cf2fc..a1e26272bc 100644
--- a/examples/widgets/doc/src/plugandpaint.qdoc
+++ b/examples/widgets/doc/src/plugandpaint.qdoc
@@ -30,8 +30,7 @@
\title Plug & Paint Example
\ingroup examples-widgets-tools
- \brief The Plug & Paint example demonstrates how to write Qt
- applications that can be extended through plugins.
+ \brief Demonstrates how to extend Qt applications using plugins.
\image plugandpaint.png Screenshot of the Plug & Paint example
@@ -314,6 +313,9 @@
/*!
\example tools/plugandpaintplugins/basictools
\title Plug & Paint Basic Tools Example
+ \brief A plugin providing the basic tools for painting functionality.
+
+ \image plugandpaint.png Screenshot of the Plug & Paint example
The Basic Tools example is a static plugin for the
\l{tools/plugandpaint}{Plug & Paint} example. It provides a set
@@ -499,6 +501,9 @@
/*!
\example tools/plugandpaintplugins/extrafilters
\title Plug & Paint Extra Filters Example
+ \brief A plugin providing the extra filters.
+
+ \image plugandpaint.png Screenshot of the Plug & Paint example
The Extra Filters example is a plugin for the
\l{tools/plugandpaint}{Plug & Paint} example. It provides a set
diff --git a/examples/widgets/gestures/imagegestures/doc/src/imagegestures.qdoc b/examples/widgets/gestures/imagegestures/doc/src/imagegestures.qdoc
index 07acef6b4d..2751c64e76 100644
--- a/examples/widgets/gestures/imagegestures/doc/src/imagegestures.qdoc
+++ b/examples/widgets/gestures/imagegestures/doc/src/imagegestures.qdoc
@@ -28,10 +28,13 @@
/*!
\example gestures/imagegestures
\title Image Gestures Example
+ \brief Demonstrates the use of simple gestures in a widget
This example shows how to enable gestures for a widget and use gesture input
to perform actions.
+ \image imagegestures-example.jpg
+
We use two classes to create the user interface for the application: \c MainWidget
and \c ImageWidget. The \c MainWidget class is simply used as a container for the
\c ImageWidget class, which we will configure to accept gesture input. Since we
diff --git a/examples/widgets/graphicsview/boxes/boxes.pro b/examples/widgets/graphicsview/boxes/boxes.pro
index e608b1c845..15d26f02f0 100644
--- a/examples/widgets/graphicsview/boxes/boxes.pro
+++ b/examples/widgets/graphicsview/boxes/boxes.pro
@@ -1,10 +1,6 @@
QT += opengl widgets
-contains(QT_CONFIG, opengles.) {
- contains(QT_CONFIG, angle): \
- warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c")
- error("This example requires Qt to be configured with -opengl desktop")
-}
+contains(QT_CONFIG, opengles.|angle|dynamicgl):error("This example requires Qt to be configured with -opengl desktop")
HEADERS += 3rdparty/fbm.h \
glbuffers.h \
diff --git a/examples/widgets/widgets/imageviewer/imageviewer.cpp b/examples/widgets/widgets/imageviewer/imageviewer.cpp
index c32f21e7f3..0b8513f090 100644
--- a/examples/widgets/widgets/imageviewer/imageviewer.cpp
+++ b/examples/widgets/widgets/imageviewer/imageviewer.cpp
@@ -107,7 +107,7 @@ void ImageViewer::open()
mimeTypeFilters.sort();
const QStringList picturesLocations = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation);
QFileDialog dialog(this, tr("Open File"),
- picturesLocations.isEmpty() ? QDir::currentPath() : picturesLocations.first());
+ picturesLocations.isEmpty() ? QDir::currentPath() : picturesLocations.last());
dialog.setAcceptMode(QFileDialog::AcceptOpen);
dialog.setMimeTypeFilters(mimeTypeFilters);
dialog.selectMimeTypeFilter("image/jpeg");
diff --git a/examples/widgets/windowcontainer/windowcontainer.cpp b/examples/widgets/windowcontainer/windowcontainer.cpp
index 022b6dafc4..a38a10e6f6 100644
--- a/examples/widgets/windowcontainer/windowcontainer.cpp
+++ b/examples/widgets/windowcontainer/windowcontainer.cpp
@@ -92,10 +92,12 @@ public:
}
void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE {
- m_mouseDown = true;
- m_polygon.clear();
- m_polygon.append(e->pos());
- renderLater();
+ if (!m_mouseDown) {
+ m_mouseDown = true;
+ m_polygon.clear();
+ m_polygon.append(e->pos());
+ renderLater();
+ }
}
void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE {
@@ -106,9 +108,11 @@ public:
}
void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE {
- m_mouseDown = false;
- m_polygon.append(e->pos());
- renderLater();
+ if (m_mouseDown) {
+ m_mouseDown = false;
+ m_polygon.append(e->pos());
+ renderLater();
+ }
}
void focusInEvent(QFocusEvent *) Q_DECL_OVERRIDE {