summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/opengl/legacy/framebufferobject2/framebufferobject2.pro8
-rw-r--r--examples/opengl/legacy/grabber/grabber.pro8
-rw-r--r--examples/opengl/legacy/hellogl/glwidget.cpp4
-rw-r--r--examples/opengl/legacy/hellogl/glwidget.h3
-rw-r--r--examples/opengl/legacy/hellogl/hellogl.pro8
-rw-r--r--examples/opengl/legacy/overpainting/glwidget.cpp4
-rw-r--r--examples/opengl/legacy/overpainting/glwidget.h3
-rw-r--r--examples/opengl/legacy/overpainting/overpainting.pro8
-rw-r--r--examples/opengl/legacy/pbuffers/pbuffers.pro8
-rw-r--r--examples/opengl/legacy/pbuffers2/pbuffers2.pro8
-rw-r--r--examples/opengl/legacy/samplebuffers/samplebuffers.pro8
-rw-r--r--examples/opengl/legacy/shared/qtlogo.cpp37
-rw-r--r--examples/opengl/legacy/shared/qtlogo.h3
-rw-r--r--examples/opengl/qopenglwidget/glwidget.cpp6
-rw-r--r--examples/opengl/qopenglwidget/mainwindow.cpp20
-rw-r--r--examples/opengl/qopenglwidget/mainwindow.h2
-rw-r--r--examples/sql/books/books.pro2
-rw-r--r--examples/touch/fingerpaint/scribblearea.cpp5
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/anim_accord.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/anim_gallery.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/anim_panel.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/anim_skew.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/css3_backgrounds.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/css3_border-img.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/css3_grad-radial.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/css3_mask-grad.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/css3_mask-img.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/css3_text-overflow.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/form_tapper.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/mob_condjs.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/mobile.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/storage.js0
-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/draganddrop/puzzle/puzzle.pro2
-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/mainwindows/mainwindow/colorswatch.cpp8
-rw-r--r--examples/widgets/mainwindows/mainwindow/colorswatch.h4
-rw-r--r--examples/widgets/mainwindows/mainwindow/mainwindow.cpp7
-rw-r--r--examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro2
-rw-r--r--examples/widgets/tutorials/addressbook/part7/addressbook.cpp1
-rw-r--r--examples/widgets/widgets/icons/icons.pro2
-rw-r--r--examples/widgets/widgets/imageviewer/imageviewer.cpp2
-rw-r--r--examples/widgets/widgets/movie/movie.pro2
-rw-r--r--examples/widgets/windowcontainer/windowcontainer.cpp18
-rw-r--r--examples/xml/dombookmarks/dombookmarks.pro2
-rw-r--r--examples/xml/htmlinfo/htmlinfo.pro2
-rw-r--r--examples/xml/saxbookmarks/saxbookmarks.pro2
49 files changed, 112 insertions, 105 deletions
diff --git a/examples/opengl/legacy/framebufferobject2/framebufferobject2.pro b/examples/opengl/legacy/framebufferobject2/framebufferobject2.pro
index e0067cf27f..78fc6b1a63 100644
--- a/examples/opengl/legacy/framebufferobject2/framebufferobject2.pro
+++ b/examples/opengl/legacy/framebufferobject2/framebufferobject2.pro
@@ -5,11 +5,7 @@ RESOURCES += framebufferobject2.qrc
QT += opengl widgets
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/framebufferobject2
+target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/framebufferobject2
INSTALLS += target
-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")
diff --git a/examples/opengl/legacy/grabber/grabber.pro b/examples/opengl/legacy/grabber/grabber.pro
index b8567580f0..1db0e23156 100644
--- a/examples/opengl/legacy/grabber/grabber.pro
+++ b/examples/opengl/legacy/grabber/grabber.pro
@@ -6,11 +6,7 @@ SOURCES = glwidget.cpp \
QT += opengl widgets
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/grabber
+target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/grabber
INSTALLS += target
-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")
diff --git a/examples/opengl/legacy/hellogl/glwidget.cpp b/examples/opengl/legacy/hellogl/glwidget.cpp
index 02501cd99e..122f7ddfe1 100644
--- a/examples/opengl/legacy/hellogl/glwidget.cpp
+++ b/examples/opengl/legacy/hellogl/glwidget.cpp
@@ -128,6 +128,8 @@ void GLWidget::setZRotation(int angle)
//! [6]
void GLWidget::initializeGL()
{
+ initializeOpenGLFunctions();
+
qglClearColor(qtPurple.dark());
logo = new QtLogo(this, 64);
@@ -153,7 +155,7 @@ void GLWidget::paintGL()
glRotatef(xRot / 16.0, 1.0, 0.0, 0.0);
glRotatef(yRot / 16.0, 0.0, 1.0, 0.0);
glRotatef(zRot / 16.0, 0.0, 0.0, 1.0);
- logo->draw();
+ logo->draw(static_cast<QOpenGLFunctions_1_1 *>(this));
}
//! [7]
diff --git a/examples/opengl/legacy/hellogl/glwidget.h b/examples/opengl/legacy/hellogl/glwidget.h
index 994e38e13d..9aca4451df 100644
--- a/examples/opengl/legacy/hellogl/glwidget.h
+++ b/examples/opengl/legacy/hellogl/glwidget.h
@@ -42,11 +42,12 @@
#define GLWIDGET_H
#include <QGLWidget>
+#include <QOpenGLFunctions_1_1>
class QtLogo;
//! [0]
-class GLWidget : public QGLWidget
+class GLWidget : public QGLWidget, public QOpenGLFunctions_1_1
{
Q_OBJECT
diff --git a/examples/opengl/legacy/hellogl/hellogl.pro b/examples/opengl/legacy/hellogl/hellogl.pro
index 500bd85b3c..c211242fd2 100644
--- a/examples/opengl/legacy/hellogl/hellogl.pro
+++ b/examples/opengl/legacy/hellogl/hellogl.pro
@@ -11,11 +11,7 @@ SOURCES = glwidget.cpp \
QT += opengl widgets
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl
+target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/hellogl
INSTALLS += target
-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):error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/overpainting/glwidget.cpp b/examples/opengl/legacy/overpainting/glwidget.cpp
index b41bc31126..52b6c35801 100644
--- a/examples/opengl/legacy/overpainting/glwidget.cpp
+++ b/examples/opengl/legacy/overpainting/glwidget.cpp
@@ -115,6 +115,8 @@ void GLWidget::setZRotation(int angle)
//! [2]
void GLWidget::initializeGL()
{
+ initializeOpenGLFunctions();
+
glEnable(GL_MULTISAMPLE);
logo = new QtLogo(this);
@@ -173,7 +175,7 @@ void GLWidget::paintEvent(QPaintEvent *event)
glRotatef(yRot / 16.0, 0.0, 1.0, 0.0);
glRotatef(zRot / 16.0, 0.0, 0.0, 1.0);
- logo->draw();
+ logo->draw(static_cast<QOpenGLFunctions_1_1 *>(this));
//! [7]
//! [8]
diff --git a/examples/opengl/legacy/overpainting/glwidget.h b/examples/opengl/legacy/overpainting/glwidget.h
index dd5c0ba9ff..7e62a00170 100644
--- a/examples/opengl/legacy/overpainting/glwidget.h
+++ b/examples/opengl/legacy/overpainting/glwidget.h
@@ -42,13 +42,14 @@
#define GLWIDGET_H
#include <QGLWidget>
+#include <QOpenGLFunctions_1_1>
#include <QTimer>
class Bubble;
class QtLogo;
//! [0]
-class GLWidget : public QGLWidget
+class GLWidget : public QGLWidget, public QOpenGLFunctions_1_1
{
Q_OBJECT
diff --git a/examples/opengl/legacy/overpainting/overpainting.pro b/examples/opengl/legacy/overpainting/overpainting.pro
index c1bda7853d..cc46f18889 100644
--- a/examples/opengl/legacy/overpainting/overpainting.pro
+++ b/examples/opengl/legacy/overpainting/overpainting.pro
@@ -13,11 +13,7 @@ SOURCES = bubble.cpp \
qtlogo.cpp
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/overpainting
+target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/overpainting
INSTALLS += target
-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):error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/pbuffers/pbuffers.pro b/examples/opengl/legacy/pbuffers/pbuffers.pro
index a349e39f68..d779a2a2dc 100644
--- a/examples/opengl/legacy/pbuffers/pbuffers.pro
+++ b/examples/opengl/legacy/pbuffers/pbuffers.pro
@@ -7,11 +7,7 @@ RESOURCES += pbuffers.qrc
QT += opengl widgets
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers
+target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/pbuffers
INSTALLS += target
-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")
diff --git a/examples/opengl/legacy/pbuffers2/pbuffers2.pro b/examples/opengl/legacy/pbuffers2/pbuffers2.pro
index f9dd269eea..2ba40a6f74 100644
--- a/examples/opengl/legacy/pbuffers2/pbuffers2.pro
+++ b/examples/opengl/legacy/pbuffers2/pbuffers2.pro
@@ -5,11 +5,7 @@ SOURCES += glwidget.cpp main.cpp
RESOURCES += pbuffers2.qrc
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers2
+target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/pbuffers2
INSTALLS += target
-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")
diff --git a/examples/opengl/legacy/samplebuffers/samplebuffers.pro b/examples/opengl/legacy/samplebuffers/samplebuffers.pro
index b57599aae4..3719f5039d 100644
--- a/examples/opengl/legacy/samplebuffers/samplebuffers.pro
+++ b/examples/opengl/legacy/samplebuffers/samplebuffers.pro
@@ -4,11 +4,7 @@ SOURCES += glwidget.cpp main.cpp
QT += opengl widgets
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/samplebuffers
+target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/samplebuffers
INSTALLS += target
-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")
diff --git a/examples/opengl/legacy/shared/qtlogo.cpp b/examples/opengl/legacy/shared/qtlogo.cpp
index efe3fb0201..0d960dd4b6 100644
--- a/examples/opengl/legacy/shared/qtlogo.cpp
+++ b/examples/opengl/legacy/shared/qtlogo.cpp
@@ -43,6 +43,7 @@
#include <QGLWidget>
#include <QMatrix4x4>
#include <QVector3D>
+#include <QOpenGLFunctions_1_1>
#include <qmath.h>
@@ -60,7 +61,7 @@ struct Geometry
void appendSmooth(const QVector3D &a, const QVector3D &n, int from);
void appendFaceted(const QVector3D &a, const QVector3D &n);
void finalize();
- void loadArrays() const;
+ void loadArrays(QOpenGLFunctions_1_1 *functions) const;
};
//! [0]
@@ -73,7 +74,7 @@ public:
void setSmoothing(Smoothing s) { sm = s; }
void translate(const QVector3D &t);
void rotate(qreal deg, QVector3D axis);
- void draw() const;
+ void draw(QOpenGLFunctions_1_1 *functions) const;
void addTri(const QVector3D &a, const QVector3D &b, const QVector3D &c, const QVector3D &n);
void addQuad(const QVector3D &a, const QVector3D &b, const QVector3D &c, const QVector3D &d);
@@ -96,10 +97,10 @@ static inline void qSetColor(float colorVec[], QColor c)
colorVec[3] = c.alphaF();
}
-void Geometry::loadArrays() const
+void Geometry::loadArrays(QOpenGLFunctions_1_1 *functions) const
{
- glVertexPointer(3, GL_FLOAT, 0, vertices.constData());
- glNormalPointer(GL_FLOAT, 0, normals.constData());
+ functions->glVertexPointer(3, GL_FLOAT, 0, vertices.constData());
+ functions->glNormalPointer(GL_FLOAT, 0, normals.constData());
}
void Geometry::finalize()
@@ -170,15 +171,15 @@ void Patch::translate(const QVector3D &t)
}
//! [2]
-void Patch::draw() const
+void Patch::draw(QOpenGLFunctions_1_1 *functions) const
{
- glPushMatrix();
- glMultMatrixf(mat.constData());
- glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, faceColor);
+ functions->glPushMatrix();
+ functions->glMultMatrixf(mat.constData());
+ functions->glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, faceColor);
const GLushort *indices = geom->faces.constData();
- glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, indices + start);
- glPopMatrix();
+ functions->glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, indices + start);
+ functions->glPopMatrix();
}
//! [2]
@@ -371,17 +372,17 @@ void QtLogo::buildGeometry(int divisions, qreal scale)
//! [3]
//! [4]
-void QtLogo::draw() const
+void QtLogo::draw(QOpenGLFunctions_1_1 *functions) const
{
- geom->loadArrays();
+ geom->loadArrays(functions);
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
+ functions->glEnableClientState(GL_VERTEX_ARRAY);
+ functions->glEnableClientState(GL_NORMAL_ARRAY);
for (int i = 0; i < parts.count(); ++i)
- parts[i]->draw();
+ parts[i]->draw(functions);
- glDisableClientState(GL_VERTEX_ARRAY);
- glDisableClientState(GL_NORMAL_ARRAY);
+ functions->glDisableClientState(GL_VERTEX_ARRAY);
+ functions->glDisableClientState(GL_NORMAL_ARRAY);
}
//! [4]
diff --git a/examples/opengl/legacy/shared/qtlogo.h b/examples/opengl/legacy/shared/qtlogo.h
index 562435daed..9bd15a1431 100644
--- a/examples/opengl/legacy/shared/qtlogo.h
+++ b/examples/opengl/legacy/shared/qtlogo.h
@@ -44,6 +44,7 @@
#include <QObject>
#include <QColor>
+class QOpenGLFunctions_1_1;
class Patch;
struct Geometry;
@@ -54,7 +55,7 @@ public:
explicit QtLogo(QObject *parent, int d = 64, qreal s = 1.0);
~QtLogo();
void setColor(QColor c);
- void draw() const;
+ void draw(QOpenGLFunctions_1_1 *functions) const;
private:
void buildGeometry(int d, qreal s);
diff --git a/examples/opengl/qopenglwidget/glwidget.cpp b/examples/opengl/qopenglwidget/glwidget.cpp
index f93e667615..df52e3efbf 100644
--- a/examples/opengl/qopenglwidget/glwidget.cpp
+++ b/examples/opengl/qopenglwidget/glwidget.cpp
@@ -537,14 +537,14 @@ void GLWidget::setTransparent(bool transparent)
window()->update();
}
-void GLWidget::resizeGL(int w, int h)
+void GLWidget::resizeGL(int, int)
{
if (m_hasButton) {
if (!m_btn) {
- m_btn = new QPushButton("A widget on top.\nPress me!", this);
+ m_btn = new QPushButton("A widget on top.\nPress for more widgets.", this);
connect(m_btn, &QPushButton::clicked, this, &GLWidget::handleButtonPress);
}
- m_btn->move(w / 2, h / 2);
+ m_btn->move(20, 80);
}
}
diff --git a/examples/opengl/qopenglwidget/mainwindow.cpp b/examples/opengl/qopenglwidget/mainwindow.cpp
index 6cf1d5d6e2..22111afdcb 100644
--- a/examples/opengl/qopenglwidget/mainwindow.cpp
+++ b/examples/opengl/qopenglwidget/mainwindow.cpp
@@ -47,6 +47,7 @@
#include <QLabel>
#include <QCheckBox>
#include <QSpinBox>
+#include <QScrollArea>
#include "glwidget.h"
@@ -69,7 +70,7 @@ MainWindow::MainWindow()
"and therefore an interval < 16 ms will likely lead to a 60 FPS update rate.");
QGroupBox *updateGroupBox = new QGroupBox(this);
QCheckBox *timerBased = new QCheckBox("Use timer", this);
- timerBased->setChecked(true);
+ timerBased->setChecked(false);
timerBased->setToolTip("Toggles using a timer to trigger update().\n"
"When not set, each paintGL() schedules the next update immediately,\n"
"expecting the blocking swap to throttle the thread.\n"
@@ -87,7 +88,7 @@ MainWindow::MainWindow()
slider->setRange(0, 50);
slider->setSliderPosition(30);
m_timer->setInterval(10);
- label->setText("A QOpenGLWidget");
+ label->setText("A scrollable QOpenGLWidget");
label->setAlignment(Qt::AlignHCenter);
QGroupBox * groupBox = new QGroupBox(this);
@@ -96,7 +97,10 @@ MainWindow::MainWindow()
m_layout = new QGridLayout(groupBox);
- m_layout->addWidget(glwidget,1,0,8,1);
+ QScrollArea *scrollArea = new QScrollArea;
+ scrollArea->setWidget(glwidget);
+
+ m_layout->addWidget(scrollArea,1,0,8,1);
m_layout->addWidget(label,9,0,1,1);
m_layout->addWidget(updateGroupBox, 10, 0, 1, 1);
m_layout->addWidget(slider, 11,0,1,1);
@@ -134,7 +138,10 @@ MainWindow::MainWindow()
connect(timerBased, &QCheckBox::toggled, this, &MainWindow::timerUsageChanged);
connect(timerBased, &QCheckBox::toggled, updateInterval, &QWidget::setEnabled);
- m_timer->start();
+ if (timerBased->isChecked())
+ m_timer->start();
+ else
+ updateInterval->setEnabled(false);
}
void MainWindow::updateIntervalChanged(int value)
@@ -170,3 +177,8 @@ void MainWindow::timerUsageChanged(bool enabled)
w->update();
}
}
+
+void MainWindow::resizeEvent(QResizeEvent *)
+{
+ m_glWidgets[0]->setMinimumSize(size() + QSize(128, 128));
+}
diff --git a/examples/opengl/qopenglwidget/mainwindow.h b/examples/opengl/qopenglwidget/mainwindow.h
index f1b2c51e53..9ad8a01339 100644
--- a/examples/opengl/qopenglwidget/mainwindow.h
+++ b/examples/opengl/qopenglwidget/mainwindow.h
@@ -56,6 +56,8 @@ public:
void addNew();
bool timerEnabled() const { return m_timer->isActive(); }
+ void resizeEvent(QResizeEvent *);
+
private slots:
void updateIntervalChanged(int value);
void timerUsageChanged(bool enabled);
diff --git a/examples/sql/books/books.pro b/examples/sql/books/books.pro
index 31c47ba04f..1cdcaff870 100644
--- a/examples/sql/books/books.pro
+++ b/examples/sql/books/books.pro
@@ -16,5 +16,5 @@ wince*: {
CONFIG(debug, debug|release):sqlPlugins.files = $$QT_BUILD_TREE/plugins/sqldrivers/*d4.dll
CONFIG(release, debug|release):sqlPlugins.files = $$QT_BUILD_TREE/plugins/sqldrivers/*[^d]4.dll
sqlPlugins.path = sqldrivers
- DEPLOYMENT += sqlPlugins
+ INSTALLS += sqlPlugins
}
diff --git a/examples/touch/fingerpaint/scribblearea.cpp b/examples/touch/fingerpaint/scribblearea.cpp
index 469c6b1a70..05598c134c 100644
--- a/examples/touch/fingerpaint/scribblearea.cpp
+++ b/examples/touch/fingerpaint/scribblearea.cpp
@@ -187,13 +187,14 @@ bool ScribbleArea::event(QEvent *event)
foreach (const QTouchEvent::TouchPoint &touchPoint, touchPoints) {
switch (touchPoint.state()) {
case Qt::TouchPointStationary:
- // don't do anything if this touch point hasn't moved
+ case Qt::TouchPointReleased:
+ // don't do anything if this touch point hasn't moved or has been released
continue;
default:
{
QRectF rect = touchPoint.rect();
if (rect.isEmpty()) {
- qreal diameter = MinimumDiameter;
+ qreal diameter = MaximumDiameter;
if (touch->device()->capabilities() & QTouchDevice::Pressure)
diameter = MinimumDiameter + (MaximumDiameter - MinimumDiameter) * touchPoint.pressure();
rect.setSize(QSizeF(diameter, diameter));
diff --git a/examples/webkit/webkit-guide/js/anim_accord.js b/examples/webkit/webkit-guide/js/anim_accord.js
index cc95b7f7c9..cc95b7f7c9 100755..100644
--- a/examples/webkit/webkit-guide/js/anim_accord.js
+++ b/examples/webkit/webkit-guide/js/anim_accord.js
diff --git a/examples/webkit/webkit-guide/js/anim_gallery.js b/examples/webkit/webkit-guide/js/anim_gallery.js
index 050f113bb4..050f113bb4 100755..100644
--- a/examples/webkit/webkit-guide/js/anim_gallery.js
+++ b/examples/webkit/webkit-guide/js/anim_gallery.js
diff --git a/examples/webkit/webkit-guide/js/anim_panel.js b/examples/webkit/webkit-guide/js/anim_panel.js
index e6cc5e6d8f..e6cc5e6d8f 100755..100644
--- a/examples/webkit/webkit-guide/js/anim_panel.js
+++ b/examples/webkit/webkit-guide/js/anim_panel.js
diff --git a/examples/webkit/webkit-guide/js/anim_skew.js b/examples/webkit/webkit-guide/js/anim_skew.js
index 8b1300fd1f..8b1300fd1f 100755..100644
--- a/examples/webkit/webkit-guide/js/anim_skew.js
+++ b/examples/webkit/webkit-guide/js/anim_skew.js
diff --git a/examples/webkit/webkit-guide/js/css3_backgrounds.js b/examples/webkit/webkit-guide/js/css3_backgrounds.js
index 29004c7b53..29004c7b53 100755..100644
--- a/examples/webkit/webkit-guide/js/css3_backgrounds.js
+++ b/examples/webkit/webkit-guide/js/css3_backgrounds.js
diff --git a/examples/webkit/webkit-guide/js/css3_border-img.js b/examples/webkit/webkit-guide/js/css3_border-img.js
index a8bfd9132d..a8bfd9132d 100755..100644
--- a/examples/webkit/webkit-guide/js/css3_border-img.js
+++ b/examples/webkit/webkit-guide/js/css3_border-img.js
diff --git a/examples/webkit/webkit-guide/js/css3_grad-radial.js b/examples/webkit/webkit-guide/js/css3_grad-radial.js
index f194ddaa6c..f194ddaa6c 100755..100644
--- a/examples/webkit/webkit-guide/js/css3_grad-radial.js
+++ b/examples/webkit/webkit-guide/js/css3_grad-radial.js
diff --git a/examples/webkit/webkit-guide/js/css3_mask-grad.js b/examples/webkit/webkit-guide/js/css3_mask-grad.js
index 911212dcf4..911212dcf4 100755..100644
--- a/examples/webkit/webkit-guide/js/css3_mask-grad.js
+++ b/examples/webkit/webkit-guide/js/css3_mask-grad.js
diff --git a/examples/webkit/webkit-guide/js/css3_mask-img.js b/examples/webkit/webkit-guide/js/css3_mask-img.js
index a8bfd9132d..a8bfd9132d 100755..100644
--- a/examples/webkit/webkit-guide/js/css3_mask-img.js
+++ b/examples/webkit/webkit-guide/js/css3_mask-img.js
diff --git a/examples/webkit/webkit-guide/js/css3_text-overflow.js b/examples/webkit/webkit-guide/js/css3_text-overflow.js
index 58af80d6d1..58af80d6d1 100755..100644
--- a/examples/webkit/webkit-guide/js/css3_text-overflow.js
+++ b/examples/webkit/webkit-guide/js/css3_text-overflow.js
diff --git a/examples/webkit/webkit-guide/js/form_tapper.js b/examples/webkit/webkit-guide/js/form_tapper.js
index d4d87a2c1a..d4d87a2c1a 100755..100644
--- a/examples/webkit/webkit-guide/js/form_tapper.js
+++ b/examples/webkit/webkit-guide/js/form_tapper.js
diff --git a/examples/webkit/webkit-guide/js/mob_condjs.js b/examples/webkit/webkit-guide/js/mob_condjs.js
index 32bf550d20..32bf550d20 100755..100644
--- a/examples/webkit/webkit-guide/js/mob_condjs.js
+++ b/examples/webkit/webkit-guide/js/mob_condjs.js
diff --git a/examples/webkit/webkit-guide/js/mobile.js b/examples/webkit/webkit-guide/js/mobile.js
index 51c94d4080..51c94d4080 100755..100644
--- a/examples/webkit/webkit-guide/js/mobile.js
+++ b/examples/webkit/webkit-guide/js/mobile.js
diff --git a/examples/webkit/webkit-guide/js/storage.js b/examples/webkit/webkit-guide/js/storage.js
index b5a374f39d..b5a374f39d 100755..100644
--- a/examples/webkit/webkit-guide/js/storage.js
+++ b/examples/webkit/webkit-guide/js/storage.js
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/draganddrop/puzzle/puzzle.pro b/examples/widgets/draganddrop/puzzle/puzzle.pro
index 95008fc29b..b310f1f776 100644
--- a/examples/widgets/draganddrop/puzzle/puzzle.pro
+++ b/examples/widgets/draganddrop/puzzle/puzzle.pro
@@ -18,5 +18,5 @@ INSTALLS += target
wince*: {
addFile.files = example.jpg
addFile.path = .
- DEPLOYMENT += addFile
+ INSTALLS += addFile
}
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/mainwindows/mainwindow/colorswatch.cpp b/examples/widgets/mainwindows/mainwindow/colorswatch.cpp
index 408f6c4b0f..7499389dc3 100644
--- a/examples/widgets/mainwindows/mainwindow/colorswatch.cpp
+++ b/examples/widgets/mainwindows/mainwindow/colorswatch.cpp
@@ -248,8 +248,8 @@ void ColorDock::setCustomSizeHint(const QSize &size)
updateGeometry();
}
-ColorSwatch::ColorSwatch(const QString &colorName, QWidget *parent, Qt::WindowFlags flags)
- : QDockWidget(parent, flags)
+ColorSwatch::ColorSwatch(const QString &colorName, QMainWindow *parent, Qt::WindowFlags flags)
+ : QDockWidget(parent, flags), mainWindow(parent)
{
setObjectName(colorName + QLatin1String(" Dock Widget"));
setWindowTitle(objectName() + QLatin1String(" [*]"));
@@ -390,7 +390,6 @@ ColorSwatch::ColorSwatch(const QString &colorName, QWidget *parent, Qt::WindowFl
void ColorSwatch::updateContextMenu()
{
- QMainWindow *mainWindow = qobject_cast<QMainWindow *>(parentWidget());
const Qt::DockWidgetArea area = mainWindow->dockWidgetArea(this);
const Qt::DockWidgetAreas areas = allowedAreas();
@@ -458,7 +457,6 @@ void ColorSwatch::updateContextMenu()
void ColorSwatch::splitInto(QAction *action)
{
- QMainWindow *mainWindow = qobject_cast<QMainWindow *>(parentWidget());
QList<ColorSwatch*> dock_list = mainWindow->findChildren<ColorSwatch*>();
ColorSwatch *target = 0;
foreach (ColorSwatch *dock, dock_list) {
@@ -477,7 +475,6 @@ void ColorSwatch::splitInto(QAction *action)
void ColorSwatch::tabInto(QAction *action)
{
- QMainWindow *mainWindow = qobject_cast<QMainWindow *>(parentWidget());
QList<ColorSwatch*> dock_list = mainWindow->findChildren<ColorSwatch*>();
ColorSwatch *target = 0;
foreach (ColorSwatch *dock, dock_list) {
@@ -525,7 +522,6 @@ void ColorSwatch::place(Qt::DockWidgetArea area, bool p)
{
if (!p) return;
- QMainWindow *mainWindow = qobject_cast<QMainWindow *>(parentWidget());
mainWindow->addDockWidget(area, this);
if (allowedAreasActions->isEnabled()) {
diff --git a/examples/widgets/mainwindows/mainwindow/colorswatch.h b/examples/widgets/mainwindows/mainwindow/colorswatch.h
index 6d02592b22..78f267c320 100644
--- a/examples/widgets/mainwindows/mainwindow/colorswatch.h
+++ b/examples/widgets/mainwindows/mainwindow/colorswatch.h
@@ -70,8 +70,10 @@ class ColorSwatch : public QDockWidget
QAction *windowModifiedAction;
+ QMainWindow *mainWindow;
+
public:
- explicit ColorSwatch(const QString &colorName, QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ explicit ColorSwatch(const QString &colorName, QMainWindow *parent = 0, Qt::WindowFlags flags = 0);
QMenu *menu;
void setCustomSizeHint(const QSize &size);
diff --git a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
index 70a8644b47..ea557c7aa9 100644
--- a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
+++ b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
@@ -156,6 +156,11 @@ void MainWindow::setupMenuBar()
action->setChecked(dockOptions() & VerticalTabs);
connect(action, SIGNAL(toggled(bool)), this, SLOT(setDockOptions()));
+ action = mainWindowMenu->addAction(tr("Grouped dragging"));
+ action->setCheckable(true);
+ action->setChecked(dockOptions() & GroupedDragging);
+ connect(action, SIGNAL(toggled(bool)), this, SLOT(setDockOptions()));
+
QMenu *toolBarMenu = menuBar()->addMenu(tr("Tool bars"));
for (int i = 0; i < toolBars.count(); ++i)
toolBarMenu->addMenu(toolBars.at(i)->menu);
@@ -187,6 +192,8 @@ void MainWindow::setDockOptions()
opts |= ForceTabbedDocks;
if (actions.at(4)->isChecked())
opts |= VerticalTabs;
+ if (actions.at(5)->isChecked())
+ opts |= GroupedDragging;
QMainWindow::setDockOptions(opts);
}
diff --git a/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro b/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro
index 640f36f9b8..809667b2ad 100644
--- a/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro
+++ b/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro
@@ -14,5 +14,5 @@ INSTALLS += target
wince*: {
addFiles.files = main.cpp mainwindow.cpp
addFiles.path = .
- DEPLOYMENT += addFiles
+ INSTALLS += addFiles
}
diff --git a/examples/widgets/tutorials/addressbook/part7/addressbook.cpp b/examples/widgets/tutorials/addressbook/part7/addressbook.cpp
index 45ded876a7..6764423d71 100644
--- a/examples/widgets/tutorials/addressbook/part7/addressbook.cpp
+++ b/examples/widgets/tutorials/addressbook/part7/addressbook.cpp
@@ -370,7 +370,6 @@ void AddressBook::loadFromFile()
QDataStream in(&file);
in.setVersion(QDataStream::Qt_4_3);
- contacts.empty(); // empty existing contacts
in >> contacts;
QMap<QString, QString>::iterator i = contacts.begin();
diff --git a/examples/widgets/widgets/icons/icons.pro b/examples/widgets/widgets/icons/icons.pro
index 51d8b79ba9..58e6c2137c 100644
--- a/examples/widgets/widgets/icons/icons.pro
+++ b/examples/widgets/widgets/icons/icons.pro
@@ -24,5 +24,5 @@ wince*: {
} else {
imageFiles.path = images
}
- DEPLOYMENT += imageFiles
+ INSTALLS += imageFiles
}
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/widgets/movie/movie.pro b/examples/widgets/widgets/movie/movie.pro
index 6d333edfa8..58925c98a0 100644
--- a/examples/widgets/widgets/movie/movie.pro
+++ b/examples/widgets/widgets/movie/movie.pro
@@ -14,5 +14,5 @@ INSTALLS += target
wince*: {
addFiles.files += *.gif
addFiles.path = .
- DEPLOYMENT += addFiles
+ INSTALLS += addFiles
}
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 {
diff --git a/examples/xml/dombookmarks/dombookmarks.pro b/examples/xml/dombookmarks/dombookmarks.pro
index 93a5fb9ac9..a16cdadcfa 100644
--- a/examples/xml/dombookmarks/dombookmarks.pro
+++ b/examples/xml/dombookmarks/dombookmarks.pro
@@ -14,6 +14,6 @@ INSTALLS += target
wince*: {
addFiles.files = frank.xbel jennifer.xbel
addFiles.path = "\\My Documents"
- DEPLOYMENT += addFiles
+ INSTALLS += addFiles
}
diff --git a/examples/xml/htmlinfo/htmlinfo.pro b/examples/xml/htmlinfo/htmlinfo.pro
index 9e58973db6..4ad40213fe 100644
--- a/examples/xml/htmlinfo/htmlinfo.pro
+++ b/examples/xml/htmlinfo/htmlinfo.pro
@@ -9,7 +9,7 @@ win32: CONFIG += console
wince*:{
htmlfiles.files = *.html
htmlfiles.path = .
- DEPLOYMENT += htmlfiles
+ INSTALLS += htmlfiles
}
# install
diff --git a/examples/xml/saxbookmarks/saxbookmarks.pro b/examples/xml/saxbookmarks/saxbookmarks.pro
index 6723b0c6fc..aa84ee4f3e 100644
--- a/examples/xml/saxbookmarks/saxbookmarks.pro
+++ b/examples/xml/saxbookmarks/saxbookmarks.pro
@@ -16,5 +16,5 @@ INSTALLS += target
wince*: {
addFiles.files = frank.xbel jennifer.xbel
addFiles.path = "\\My Documents"
- DEPLOYMENT += addFiles
+ INSTALLS += addFiles
}