summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/corelib/ipc/ipc.pro2
-rw-r--r--examples/corelib/threads/mandelbrot/mandelbrotwidget.h14
-rw-r--r--examples/corelib/threads/mandelbrot/renderthread.h2
-rw-r--r--examples/corelib/threads/semaphores/semaphores.cpp4
-rw-r--r--examples/corelib/threads/waitconditions/waitconditions.cpp4
-rw-r--r--examples/corelib/tools/contiguouscache/randomlistmodel.h4
-rw-r--r--examples/dbus/dbus.pro5
-rw-r--r--examples/examples.pro2
-rw-r--r--examples/gui/analogclock/main.cpp4
-rw-r--r--examples/gui/doc/src/openglwindow.qdoc12
-rw-r--r--examples/gui/doc/src/rasterwindow.qdoc15
-rw-r--r--examples/gui/gui.pro4
-rw-r--r--examples/gui/openglwindow/main.cpp4
-rw-r--r--examples/gui/openglwindow/openglwindow.cpp7
-rw-r--r--examples/gui/openglwindow/openglwindow.h5
-rw-r--r--examples/gui/rasterwindow/rasterwindow.cpp10
-rw-r--r--examples/gui/rasterwindow/rasterwindow.h7
-rw-r--r--examples/network/bearermonitor/bearermonitor.pro3
-rw-r--r--examples/network/bearermonitor/sessionwidget.h2
-rw-r--r--examples/network/blockingfortuneclient/fortunethread.h2
-rw-r--r--examples/network/googlesuggest/googlesuggest.h2
-rw-r--r--examples/network/multistreamclient/chatconsumer.cpp93
-rw-r--r--examples/network/multistreamclient/chatconsumer.h79
-rw-r--r--examples/network/multistreamclient/client.cpp219
-rw-r--r--examples/network/multistreamclient/client.h92
-rw-r--r--examples/network/multistreamclient/consumer.h75
-rw-r--r--examples/network/multistreamclient/main.cpp60
-rw-r--r--examples/network/multistreamclient/movieconsumer.cpp83
-rw-r--r--examples/network/multistreamclient/movieconsumer.h74
-rw-r--r--examples/network/multistreamclient/multistreamclient.pro16
-rw-r--r--examples/network/multistreamclient/timeconsumer.cpp94
-rw-r--r--examples/network/multistreamclient/timeconsumer.h79
-rw-r--r--examples/network/multistreamserver/animation.gifbin0 -> 42629 bytes
-rw-r--r--examples/network/multistreamserver/chatprovider.cpp77
-rw-r--r--examples/network/multistreamserver/chatprovider.h67
-rw-r--r--examples/network/multistreamserver/main.cpp61
-rw-r--r--examples/network/multistreamserver/movieprovider.cpp73
-rw-r--r--examples/network/multistreamserver/movieprovider.h73
-rw-r--r--examples/network/multistreamserver/multistreamserver.pro24
-rw-r--r--examples/network/multistreamserver/provider.h76
-rw-r--r--examples/network/multistreamserver/server.cpp171
-rw-r--r--examples/network/multistreamserver/server.h91
-rw-r--r--examples/network/multistreamserver/timeprovider.cpp79
-rw-r--r--examples/network/multistreamserver/timeprovider.h65
-rw-r--r--examples/network/network-chat/connection.h2
-rw-r--r--examples/network/network-chat/server.h2
-rw-r--r--examples/network/network.pro13
-rw-r--r--examples/network/shared/sctpchannels.h62
-rw-r--r--examples/network/threadedfortuneserver/fortuneserver.h2
-rw-r--r--examples/network/threadedfortuneserver/fortunethread.h2
-rw-r--r--examples/network/torrent/connectionmanager.cpp2
-rw-r--r--examples/network/torrent/filemanager.h2
-rw-r--r--examples/network/torrent/mainwindow.cpp6
-rw-r--r--examples/network/torrent/mainwindow.h4
-rw-r--r--examples/network/torrent/metainfo.cpp2
-rw-r--r--examples/network/torrent/peerwireclient.h14
-rw-r--r--examples/network/torrent/torrentclient.cpp4
-rw-r--r--examples/network/torrent/torrentclient.h2
-rw-r--r--examples/network/torrent/torrentserver.h2
-rw-r--r--examples/network/torrent/trackerclient.h2
-rw-r--r--examples/opengl/2dpainting/glwidget.h2
-rw-r--r--examples/opengl/2dpainting/widget.h2
-rw-r--r--examples/opengl/contextinfo/renderwindow.h2
-rw-r--r--examples/opengl/cube/mainwidget.h12
-rw-r--r--examples/opengl/hellogl2/glwidget.h14
-rw-r--r--examples/opengl/hellogl2/window.h2
-rw-r--r--examples/opengl/hellowindow/hellowindow.h4
-rw-r--r--examples/opengl/legacy/framebufferobject2/framebufferobject2.pro2
-rw-r--r--examples/opengl/legacy/framebufferobject2/glwidget.h12
-rw-r--r--examples/opengl/legacy/grabber/glwidget.h10
-rw-r--r--examples/opengl/legacy/grabber/grabber.pro2
-rw-r--r--examples/opengl/legacy/hellogl/glwidget.h14
-rw-r--r--examples/opengl/legacy/hellogl/hellogl.pro2
-rw-r--r--examples/opengl/legacy/hellogl/window.h2
-rw-r--r--examples/opengl/legacy/legacy.pro2
-rw-r--r--examples/opengl/legacy/overpainting/glwidget.h14
-rw-r--r--examples/opengl/legacy/overpainting/overpainting.pro2
-rw-r--r--examples/opengl/legacy/pbuffers/glwidget.h10
-rw-r--r--examples/opengl/legacy/pbuffers/pbuffers.pro2
-rw-r--r--examples/opengl/legacy/pbuffers2/pbuffers2.pro2
-rw-r--r--examples/opengl/legacy/samplebuffers/glwidget.h8
-rw-r--r--examples/opengl/legacy/samplebuffers/samplebuffers.pro2
-rw-r--r--examples/opengl/paintedwindow/paintedwindow.h4
-rw-r--r--examples/opengl/qopenglwidget/glwidget.h6
-rw-r--r--examples/opengl/qopenglwindow/main.cpp6
-rw-r--r--examples/opengl/textures/glwidget.h16
-rw-r--r--examples/opengl/threadedqopenglwidget/glwidget.h2
-rw-r--r--examples/qpa/windows/window.h14
-rw-r--r--examples/sql/books/bookdelegate.h8
-rw-r--r--examples/sql/drilldown/imageitem.h4
-rw-r--r--examples/sql/drilldown/view.h2
-rw-r--r--examples/sql/querymodel/customsqlmodel.h2
-rw-r--r--examples/sql/querymodel/editablesqlmodel.h4
-rw-r--r--examples/sql/sqlbrowser/browser.h2
-rw-r--r--examples/touch/fingerpaint/mainwindow.h2
-rw-r--r--examples/touch/fingerpaint/scribblearea.h6
-rw-r--r--examples/touch/knobs/knob.h2
-rw-r--r--examples/touch/pinchzoom/graphicsview.h2
-rw-r--r--examples/touch/pinchzoom/mouse.h8
-rw-r--r--examples/widgets/animation/animatedtiles/main.cpp12
-rw-r--r--examples/widgets/animation/appchooser/main.cpp8
-rw-r--r--examples/widgets/animation/easing/animation.h2
-rw-r--r--examples/widgets/animation/moveblocks/main.cpp12
-rw-r--r--examples/widgets/animation/states/main.cpp6
-rw-r--r--examples/widgets/animation/stickman/graphicsview.h4
-rw-r--r--examples/widgets/animation/stickman/lifecycle.cpp6
-rw-r--r--examples/widgets/animation/stickman/node.h12
-rw-r--r--examples/widgets/animation/stickman/rectbutton.h6
-rw-r--r--examples/widgets/animation/stickman/stickman.h6
-rw-r--r--examples/widgets/animation/sub-attaq/boat.h2
-rw-r--r--examples/widgets/animation/sub-attaq/boat_p.h18
-rw-r--r--examples/widgets/animation/sub-attaq/pixmapitem.h4
-rw-r--r--examples/widgets/animation/sub-attaq/qanimationstate.h6
-rw-r--r--examples/widgets/animation/sub-attaq/states.h22
-rw-r--r--examples/widgets/animation/sub-attaq/submarine.h2
-rw-r--r--examples/widgets/animation/sub-attaq/submarine_p.h6
-rw-r--r--examples/widgets/desktop/screenshot/screenshot.h2
-rw-r--r--examples/widgets/desktop/systray/window.h4
-rw-r--r--examples/widgets/dialogs/classwizard/classwizard.h8
-rw-r--r--examples/widgets/dialogs/licensewizard/licensewizard.h14
-rw-r--r--examples/widgets/draganddrop/draganddrop.pro2
-rw-r--r--examples/widgets/draganddrop/draggableicons/dragwidget.h8
-rw-r--r--examples/widgets/draganddrop/draggabletext/dragwidget.h6
-rw-r--r--examples/widgets/draganddrop/dropsite/droparea.h8
-rw-r--r--examples/widgets/draganddrop/fridgemagnets/dragwidget.h8
-rw-r--r--examples/widgets/draganddrop/puzzle/pieceslist.h8
-rw-r--r--examples/widgets/draganddrop/puzzle/puzzle.pro6
-rw-r--r--examples/widgets/draganddrop/puzzle/puzzlewidget.h12
-rw-r--r--examples/widgets/effects/blurpicker/blureffect.h2
-rw-r--r--examples/widgets/effects/blurpicker/blurpicker.h6
-rw-r--r--examples/widgets/effects/lighting/lighting.h2
-rw-r--r--examples/widgets/gestures/imagegestures/imagewidget.h8
-rw-r--r--examples/widgets/graphicsview/basicgraphicslayouts/layoutitem.h8
-rw-r--r--examples/widgets/graphicsview/boxes/boxes.pro6
-rw-r--r--examples/widgets/graphicsview/boxes/glbuffers.h14
-rw-r--r--examples/widgets/graphicsview/boxes/main.cpp2
-rw-r--r--examples/widgets/graphicsview/boxes/qtbox.h32
-rw-r--r--examples/widgets/graphicsview/boxes/scene.h26
-rw-r--r--examples/widgets/graphicsview/chip/chip.h12
-rw-r--r--examples/widgets/graphicsview/chip/view.h2
-rw-r--r--examples/widgets/graphicsview/collidingmice/mouse.h8
-rw-r--r--examples/widgets/graphicsview/diagramscene/arrow.h8
-rw-r--r--examples/widgets/graphicsview/diagramscene/diagramitem.h6
-rw-r--r--examples/widgets/graphicsview/diagramscene/diagramscene.h6
-rw-r--r--examples/widgets/graphicsview/diagramscene/diagramtextitem.h8
-rw-r--r--examples/widgets/graphicsview/dragdroprobot/coloritem.h10
-rw-r--r--examples/widgets/graphicsview/dragdroprobot/main.cpp2
-rw-r--r--examples/widgets/graphicsview/dragdroprobot/robot.h26
-rw-r--r--examples/widgets/graphicsview/elasticnodes/edge.h6
-rw-r--r--examples/widgets/graphicsview/elasticnodes/graphwidget.h8
-rw-r--r--examples/widgets/graphicsview/elasticnodes/node.h14
-rw-r--r--examples/widgets/graphicsview/embeddeddialogs/customproxy.h12
-rw-r--r--examples/widgets/graphicsview/embeddeddialogs/main.cpp4
-rw-r--r--examples/widgets/graphicsview/flowlayout/flowlayout.h10
-rw-r--r--examples/widgets/graphicsview/graphicsview.pro2
-rw-r--r--examples/widgets/graphicsview/padnavigator/padnavigator.h2
-rw-r--r--examples/widgets/graphicsview/padnavigator/roundrectitem.h4
-rw-r--r--examples/widgets/graphicsview/padnavigator/splashitem.h4
-rw-r--r--examples/widgets/graphicsview/simpleanchorlayout/main.cpp2
-rw-r--r--examples/widgets/graphicsview/weatheranchorlayout/main.cpp12
-rw-r--r--examples/widgets/itemviews/addressbook/tablemodel.h16
-rw-r--r--examples/widgets/itemviews/chart/pieview.h40
-rw-r--r--examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.h4
-rw-r--r--examples/widgets/itemviews/editabletreemodel/treemodel.h26
-rw-r--r--examples/widgets/itemviews/fetchmore/filelistmodel.h8
-rw-r--r--examples/widgets/itemviews/frozencolumn/freezetablewidget.h6
-rw-r--r--examples/widgets/itemviews/interview/model.h16
-rw-r--r--examples/widgets/itemviews/pixelator/imagemodel.h8
-rw-r--r--examples/widgets/itemviews/pixelator/pixeldelegate.h4
-rw-r--r--examples/widgets/itemviews/puzzle/piecesmodel.h16
-rw-r--r--examples/widgets/itemviews/puzzle/puzzle.pro5
-rw-r--r--examples/widgets/itemviews/puzzle/puzzlewidget.h12
-rw-r--r--examples/widgets/itemviews/simpledommodel/dommodel.h14
-rw-r--r--examples/widgets/itemviews/simpletreemodel/treemodel.h14
-rw-r--r--examples/widgets/itemviews/spinboxdelegate/delegate.h8
-rw-r--r--examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.h6
-rw-r--r--examples/widgets/itemviews/spreadsheet/spreadsheetitem.h6
-rw-r--r--examples/widgets/itemviews/stardelegate/stardelegate.h10
-rw-r--r--examples/widgets/itemviews/stardelegate/stareditor.h8
-rw-r--r--examples/widgets/layouts/borderlayout/borderlayout.h18
-rw-r--r--examples/widgets/layouts/flowlayout/flowlayout.h20
-rw-r--r--examples/widgets/mainwindows/application/mainwindow.h2
-rw-r--r--examples/widgets/mainwindows/mainwindow/colorswatch.cpp6
-rw-r--r--examples/widgets/mainwindows/mainwindow/colorswatch.h12
-rw-r--r--examples/widgets/mainwindows/mdi/mainwindow.h2
-rw-r--r--examples/widgets/mainwindows/mdi/mdichild.h2
-rw-r--r--examples/widgets/mainwindows/menus/mainwindow.h2
-rw-r--r--examples/widgets/mainwindows/sdi/mainwindow.h2
-rw-r--r--examples/widgets/painting/affine/affine.pro4
-rw-r--r--examples/widgets/painting/affine/xform.h12
-rw-r--r--examples/widgets/painting/basicdrawing/renderarea.h6
-rw-r--r--examples/widgets/painting/composition/composition.cpp2
-rw-r--r--examples/widgets/painting/composition/composition.h12
-rw-r--r--examples/widgets/painting/composition/composition.pro6
-rw-r--r--examples/widgets/painting/concentriccircles/circlewidget.h6
-rw-r--r--examples/widgets/painting/deform/pathdeform.h12
-rw-r--r--examples/widgets/painting/gradients/gradients.h10
-rw-r--r--examples/widgets/painting/painterpaths/renderarea.h6
-rw-r--r--examples/widgets/painting/pathstroke/pathstroke.h16
-rw-r--r--examples/widgets/painting/shared/arthurstyle.h20
-rw-r--r--examples/widgets/painting/shared/arthurwidgets.h8
-rw-r--r--examples/widgets/painting/shared/hoverpoints.h2
-rw-r--r--examples/widgets/painting/shared/shared.pri2
-rw-r--r--examples/widgets/painting/transformations/renderarea.h6
-rw-r--r--examples/widgets/richtext/syntaxhighlighter/highlighter.h2
-rw-r--r--examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro7
-rw-r--r--examples/widgets/richtext/textedit/textedit.h2
-rw-r--r--examples/widgets/scroller/graphicsview/main.cpp18
-rw-r--r--examples/widgets/statemachine/factorial/main.cpp8
-rw-r--r--examples/widgets/statemachine/pingpong/main.cpp10
-rw-r--r--examples/widgets/statemachine/rogue/movementtransition.h4
-rw-r--r--examples/widgets/statemachine/rogue/window.h4
-rw-r--r--examples/widgets/statemachine/trafficlight/main.cpp2
-rw-r--r--examples/widgets/tools/completer/fsmodel.h2
-rw-r--r--examples/widgets/tools/customcompleter/textedit.h4
-rw-r--r--examples/widgets/tools/echoplugin/plugin/echoplugin.h2
-rw-r--r--examples/widgets/tools/i18n/languagechooser.h4
-rw-r--r--examples/widgets/tools/plugandpaint/app/app.pro13
-rw-r--r--examples/widgets/tools/plugandpaint/app/paintarea.h10
-rw-r--r--examples/widgets/tools/plugandpaint/plugins/basictools/basictools.pro1
-rw-r--r--examples/widgets/tools/plugandpaint/plugins/basictools/basictoolsplugin.h16
-rw-r--r--examples/widgets/tools/plugandpaint/plugins/extrafilters/extrafilters.pro1
-rw-r--r--examples/widgets/tools/plugandpaint/plugins/extrafilters/extrafiltersplugin.h4
-rw-r--r--examples/widgets/tools/settingseditor/settingstree.h4
-rw-r--r--examples/widgets/tools/settingseditor/variantdelegate.h8
-rw-r--r--examples/widgets/tools/styleplugin/plugin/simplestyle.h2
-rw-r--r--examples/widgets/tools/styleplugin/plugin/simplestyleplugin.h2
-rw-r--r--examples/widgets/tools/tools.pro3
-rw-r--r--examples/widgets/tools/treemodelcompleter/treemodelcompleter.h4
-rw-r--r--examples/widgets/tools/undo/commands.h24
-rw-r--r--examples/widgets/tools/undo/document.h8
-rw-r--r--examples/widgets/tools/undoframework/commands.h16
-rw-r--r--examples/widgets/tools/undoframework/diagramitem.h2
-rw-r--r--examples/widgets/tools/undoframework/diagramscene.h4
-rw-r--r--examples/widgets/tutorials/modelview/1_readonly/mymodel.h6
-rw-r--r--examples/widgets/tutorials/modelview/2_formatting/mymodel.h6
-rw-r--r--examples/widgets/tutorials/modelview/3_changingmodel/mymodel.h6
-rw-r--r--examples/widgets/tutorials/modelview/4_headers/mymodel.h8
-rw-r--r--examples/widgets/tutorials/modelview/5_edit/mymodel.h10
-rw-r--r--examples/widgets/widgets.pro4
-rw-r--r--examples/widgets/widgets/analogclock/analogclock.h2
-rw-r--r--examples/widgets/widgets/calculator/button.h2
-rw-r--r--examples/widgets/widgets/charactermap/characterwidget.h8
-rw-r--r--examples/widgets/widgets/codeeditor/codeeditor.h6
-rw-r--r--examples/widgets/widgets/elidedlabel/elidedlabel.h2
-rw-r--r--examples/widgets/widgets/elidedlabel/testwidget.h2
-rw-r--r--examples/widgets/widgets/icons/icons.pro11
-rw-r--r--examples/widgets/widgets/icons/iconsizespinbox.h4
-rw-r--r--examples/widgets/widgets/icons/imagedelegate.h6
-rw-r--r--examples/widgets/widgets/imageviewer/imageviewer.pro5
-rw-r--r--examples/widgets/widgets/mousebuttons/buttontester.h8
-rw-r--r--examples/widgets/widgets/movie/movie.pro7
-rw-r--r--examples/widgets/widgets/scribble/mainwindow.h2
-rw-r--r--examples/widgets/widgets/scribble/scribblearea.h10
-rw-r--r--examples/widgets/widgets/shapedclock/shapedclock.h10
-rw-r--r--examples/widgets/widgets/styles/norwegianwoodstyle.h14
-rw-r--r--examples/widgets/widgets/tablet/tabletapplication.h2
-rw-r--r--examples/widgets/widgets/tablet/tabletcanvas.h6
-rw-r--r--examples/widgets/widgets/tetrix/tetrixboard.h10
-rw-r--r--examples/widgets/widgets/tooltips/sortingbox.h12
-rw-r--r--examples/widgets/widgets/wiggly/wigglywidget.h4
-rw-r--r--examples/widgets/windowcontainer/windowcontainer.cpp16
-rw-r--r--examples/xml/saxbookmarks/xbelhandler.h10
263 files changed, 2699 insertions, 880 deletions
diff --git a/examples/corelib/ipc/ipc.pro b/examples/corelib/ipc/ipc.pro
index 65ee98a2cf..4cc5f3be56 100644
--- a/examples/corelib/ipc/ipc.pro
+++ b/examples/corelib/ipc/ipc.pro
@@ -3,4 +3,4 @@ requires(qtHaveModule(widgets))
TEMPLATE = subdirs
# no QSharedMemory
!vxworks:!integrity: SUBDIRS = sharedmemory
-!wince:qtHaveModule(network): SUBDIRS += localfortuneserver localfortuneclient
+qtHaveModule(network): SUBDIRS += localfortuneserver localfortuneclient
diff --git a/examples/corelib/threads/mandelbrot/mandelbrotwidget.h b/examples/corelib/threads/mandelbrot/mandelbrotwidget.h
index 14946b44fb..cbacc2cdd0 100644
--- a/examples/corelib/threads/mandelbrot/mandelbrotwidget.h
+++ b/examples/corelib/threads/mandelbrot/mandelbrotwidget.h
@@ -65,15 +65,15 @@ public:
MandelbrotWidget(QWidget *parent = 0);
protected:
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
- void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
+ void resizeEvent(QResizeEvent *event) override;
+ void keyPressEvent(QKeyEvent *event) override;
#ifndef QT_NO_WHEELEVENT
- void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
+ void wheelEvent(QWheelEvent *event) override;
#endif
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
private slots:
void updatePixmap(const QImage &image, double scaleFactor);
diff --git a/examples/corelib/threads/mandelbrot/renderthread.h b/examples/corelib/threads/mandelbrot/renderthread.h
index b9b59ba4cf..b5e9226fb8 100644
--- a/examples/corelib/threads/mandelbrot/renderthread.h
+++ b/examples/corelib/threads/mandelbrot/renderthread.h
@@ -75,7 +75,7 @@ signals:
void renderedImage(const QImage &image, double scaleFactor);
protected:
- void run() Q_DECL_OVERRIDE;
+ void run() override;
private:
uint rgbFromWaveLength(double wave);
diff --git a/examples/corelib/threads/semaphores/semaphores.cpp b/examples/corelib/threads/semaphores/semaphores.cpp
index f44f709d72..37dd4cda20 100644
--- a/examples/corelib/threads/semaphores/semaphores.cpp
+++ b/examples/corelib/threads/semaphores/semaphores.cpp
@@ -68,7 +68,7 @@ class Producer : public QThread
//! [1] //! [2]
{
public:
- void run() Q_DECL_OVERRIDE
+ void run() override
{
qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
for (int i = 0; i < DataSize; ++i) {
@@ -86,7 +86,7 @@ class Consumer : public QThread
{
Q_OBJECT
public:
- void run() Q_DECL_OVERRIDE
+ void run() override
{
for (int i = 0; i < DataSize; ++i) {
usedBytes.acquire();
diff --git a/examples/corelib/threads/waitconditions/waitconditions.cpp b/examples/corelib/threads/waitconditions/waitconditions.cpp
index 7040246937..9eab28f94c 100644
--- a/examples/corelib/threads/waitconditions/waitconditions.cpp
+++ b/examples/corelib/threads/waitconditions/waitconditions.cpp
@@ -74,7 +74,7 @@ public:
{
}
- void run() Q_DECL_OVERRIDE
+ void run() override
{
qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
@@ -105,7 +105,7 @@ public:
{
}
- void run() Q_DECL_OVERRIDE
+ void run() override
{
for (int i = 0; i < DataSize; ++i) {
mutex.lock();
diff --git a/examples/corelib/tools/contiguouscache/randomlistmodel.h b/examples/corelib/tools/contiguouscache/randomlistmodel.h
index f1f9bd247e..e6192b434f 100644
--- a/examples/corelib/tools/contiguouscache/randomlistmodel.h
+++ b/examples/corelib/tools/contiguouscache/randomlistmodel.h
@@ -62,8 +62,8 @@ public:
RandomListModel(QObject *parent = 0);
~RandomListModel();
- int rowCount(const QModelIndex & = QModelIndex()) const Q_DECL_OVERRIDE;
- QVariant data(const QModelIndex &, int) const Q_DECL_OVERRIDE;
+ int rowCount(const QModelIndex & = QModelIndex()) const override;
+ QVariant data(const QModelIndex &, int) const override;
private:
void cacheRows(int, int) const;
diff --git a/examples/dbus/dbus.pro b/examples/dbus/dbus.pro
index 083e442dfb..afeb1de0d5 100644
--- a/examples/dbus/dbus.pro
+++ b/examples/dbus/dbus.pro
@@ -2,8 +2,9 @@ requires(qtHaveModule(dbus))
TEMPLATE = subdirs
SUBDIRS = listnames \
- pingpong \
- complexpingpong
+ pingpong
+
+!uikit: SUBDIRS += complexpingpong
qtHaveModule(widgets) {
SUBDIRS += chat \
diff --git a/examples/examples.pro b/examples/examples.pro
index bcc13704dc..f66c5cbf22 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -15,7 +15,7 @@ SUBDIRS = \
widgets \
xml
-contains(QT_CONFIG, opengl): SUBDIRS += opengl
+qtHaveModule(gui):qtConfig(opengl): SUBDIRS += opengl
aggregate.files = aggregate/examples.pro
aggregate.path = $$[QT_INSTALL_EXAMPLES]
diff --git a/examples/gui/analogclock/main.cpp b/examples/gui/analogclock/main.cpp
index 29b21410e3..053ccb54b5 100644
--- a/examples/gui/analogclock/main.cpp
+++ b/examples/gui/analogclock/main.cpp
@@ -59,8 +59,8 @@ public:
AnalogClockWindow();
protected:
- void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
- void render(QPainter *p) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *) override;
+ void render(QPainter *p) override;
private:
int m_timerId;
diff --git a/examples/gui/doc/src/openglwindow.qdoc b/examples/gui/doc/src/openglwindow.qdoc
index e93451c9a5..f283c7cfc0 100644
--- a/examples/gui/doc/src/openglwindow.qdoc
+++ b/examples/gui/doc/src/openglwindow.qdoc
@@ -34,6 +34,9 @@
\image openglwindow-example.png Screenshot of the OpenGLWindow example
+ \note This is a low level example of how to use QWindow with OpenGL.
+ In practice you should consider using the higher level QOpenGLWindow class.
+
\section1 OpenGLWindow Super Class
Our OpenGLWindow class acts as an API which is then subclassed to do the
@@ -70,9 +73,8 @@
\snippet openglwindow/openglwindow.cpp 2
- The renderLater() function simply puts an update request event on
- the event loop, which leads to renderNow() being called once the event
- gets processed.
+ The renderLater() function simply calls QWindow::requestUpdate() to schedule
+ an update for when the system is ready to repaint.
We also call renderNow() when we get an expose event. The exposeEvent() is
the notification to the window that its exposure, meaning visibility, on
@@ -109,11 +111,11 @@
\l {http://www.khronos.org/registry/gles/}{Khronos OpenGL ES API Registry}.
If animation has been enabled with OpenGLWindow::setAnimating(true), we
- call renderLater() to put another update request on the event loop.
+ call renderLater() to schedule another update request.
\snippet openglwindow/openglwindow.cpp 4
- Enabling animation also triggers an update request as shown in the
+ Enabling animation also schedules an update request as shown in the
following code snippet.
\snippet openglwindow/openglwindow.cpp 5
diff --git a/examples/gui/doc/src/rasterwindow.qdoc b/examples/gui/doc/src/rasterwindow.qdoc
index 963d09971d..d276925059 100644
--- a/examples/gui/doc/src/rasterwindow.qdoc
+++ b/examples/gui/doc/src/rasterwindow.qdoc
@@ -143,19 +143,16 @@
\snippet rasterwindow/rasterwindow.cpp 6
We went through a few places where the window needed to repainted
- immediately. There are some cases where this is not desierable,
+ immediately. There are some cases where this is not desirable,
but rather let the application return to the event loop and
- later. We acheive this by posting an even to ourself which will
- then be delivered when the application returns to the \l
- QGuiApplication event loop. To avoid posting new requests when one
- is already pending, we store this state in the \c m_update_pending
- variable.
+ schedule the repaint for later. We achieve this by requesting
+ an update, using QWindow::requestUpdate(), which will then be
+ delivered when the system is ready to repaint.
\snippet rasterwindow/rasterwindow.cpp 7
We reimplement the virtual \l QObject::event() function to handle
- the update event we posted to ourselves. When the event comes in
- we reset the pending update flag and call renderNow() to render
- the window right away.
+ the update event. When the event comes in we call renderNow() to
+ render the window right away.
*/
diff --git a/examples/gui/gui.pro b/examples/gui/gui.pro
index 3a63ffb5eb..a4d960d3f5 100644
--- a/examples/gui/gui.pro
+++ b/examples/gui/gui.pro
@@ -1,10 +1,10 @@
requires(qtHaveModule(gui))
TEMPLATE = subdirs
+QT_FOR_CONFIG += gui
CONFIG += no_docs_target
SUBDIRS += analogclock
SUBDIRS += rasterwindow
-contains(QT_CONFIG, opengl(es2)?) {
+qtConfig(opengl): \
SUBDIRS += openglwindow
-}
diff --git a/examples/gui/openglwindow/main.cpp b/examples/gui/openglwindow/main.cpp
index ba56ba39f5..90c93f0d37 100644
--- a/examples/gui/openglwindow/main.cpp
+++ b/examples/gui/openglwindow/main.cpp
@@ -63,8 +63,8 @@ class TriangleWindow : public OpenGLWindow
public:
TriangleWindow();
- void initialize() Q_DECL_OVERRIDE;
- void render() Q_DECL_OVERRIDE;
+ void initialize() override;
+ void render() override;
private:
GLuint m_posAttr;
diff --git a/examples/gui/openglwindow/openglwindow.cpp b/examples/gui/openglwindow/openglwindow.cpp
index d36614f6a0..57a996a876 100644
--- a/examples/gui/openglwindow/openglwindow.cpp
+++ b/examples/gui/openglwindow/openglwindow.cpp
@@ -59,7 +59,6 @@
//! [1]
OpenGLWindow::OpenGLWindow(QWindow *parent)
: QWindow(parent)
- , m_update_pending(false)
, m_animating(false)
, m_context(0)
, m_device(0)
@@ -99,17 +98,13 @@ void OpenGLWindow::render()
//! [3]
void OpenGLWindow::renderLater()
{
- if (!m_update_pending) {
- m_update_pending = true;
- QCoreApplication::postEvent(this, new QEvent(QEvent::UpdateRequest));
- }
+ requestUpdate();
}
bool OpenGLWindow::event(QEvent *event)
{
switch (event->type()) {
case QEvent::UpdateRequest:
- m_update_pending = false;
renderNow();
return true;
default:
diff --git a/examples/gui/openglwindow/openglwindow.h b/examples/gui/openglwindow/openglwindow.h
index 820eaf1b8f..6e6c1d7449 100644
--- a/examples/gui/openglwindow/openglwindow.h
+++ b/examples/gui/openglwindow/openglwindow.h
@@ -77,12 +77,11 @@ public slots:
void renderNow();
protected:
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
- void exposeEvent(QExposeEvent *event) Q_DECL_OVERRIDE;
+ void exposeEvent(QExposeEvent *event) override;
private:
- bool m_update_pending;
bool m_animating;
QOpenGLContext *m_context;
diff --git a/examples/gui/rasterwindow/rasterwindow.cpp b/examples/gui/rasterwindow/rasterwindow.cpp
index eb34bec252..fb717a4c8a 100644
--- a/examples/gui/rasterwindow/rasterwindow.cpp
+++ b/examples/gui/rasterwindow/rasterwindow.cpp
@@ -53,7 +53,6 @@
//! [1]
RasterWindow::RasterWindow(QWindow *parent)
: QWindow(parent)
- , m_update_pending(false)
{
create();
m_backingStore = new QBackingStore(this);
@@ -68,7 +67,6 @@ RasterWindow::RasterWindow(QWindow *parent)
bool RasterWindow::event(QEvent *event)
{
if (event->type() == QEvent::UpdateRequest) {
- m_update_pending = false;
renderNow();
return true;
}
@@ -79,10 +77,7 @@ bool RasterWindow::event(QEvent *event)
//! [6]
void RasterWindow::renderLater()
{
- if (!m_update_pending) {
- m_update_pending = true;
- QCoreApplication::postEvent(this, new QEvent(QEvent::UpdateRequest));
- }
+ requestUpdate();
}
//! [6]
@@ -99,9 +94,8 @@ void RasterWindow::resizeEvent(QResizeEvent *resizeEvent)
//! [2]
void RasterWindow::exposeEvent(QExposeEvent *)
{
- if (isExposed()) {
+ if (isExposed())
renderNow();
- }
}
//! [2]
diff --git a/examples/gui/rasterwindow/rasterwindow.h b/examples/gui/rasterwindow/rasterwindow.h
index f03975a808..2ccecbf704 100644
--- a/examples/gui/rasterwindow/rasterwindow.h
+++ b/examples/gui/rasterwindow/rasterwindow.h
@@ -67,14 +67,13 @@ public slots:
void renderNow();
protected:
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
- void exposeEvent(QExposeEvent *event) Q_DECL_OVERRIDE;
+ void resizeEvent(QResizeEvent *event) override;
+ void exposeEvent(QExposeEvent *event) override;
private:
QBackingStore *m_backingStore;
- bool m_update_pending;
};
//! [1]
#endif // RASTERWINDOW_H
diff --git a/examples/network/bearermonitor/bearermonitor.pro b/examples/network/bearermonitor/bearermonitor.pro
index f364fabf2d..d75e021834 100644
--- a/examples/network/bearermonitor/bearermonitor.pro
+++ b/examples/network/bearermonitor/bearermonitor.pro
@@ -12,8 +12,7 @@ FORMS = bearermonitor_240_320.ui \
bearermonitor_640_480.ui \
sessionwidget.ui
-win32:!wince: LIBS += -lws2_32
-wince: LIBS += -lws2
+win32:LIBS += -lws2_32
CONFIG += console
diff --git a/examples/network/bearermonitor/sessionwidget.h b/examples/network/bearermonitor/sessionwidget.h
index 6bc0aef7c1..ba352eefee 100644
--- a/examples/network/bearermonitor/sessionwidget.h
+++ b/examples/network/bearermonitor/sessionwidget.h
@@ -65,7 +65,7 @@ public:
explicit SessionWidget(const QNetworkConfiguration &config, QWidget *parent = 0);
~SessionWidget();
- void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *) override;
private:
void updateSessionState(QNetworkSession::State state);
diff --git a/examples/network/blockingfortuneclient/fortunethread.h b/examples/network/blockingfortuneclient/fortunethread.h
index 2ab1adb921..0cbc3961fc 100644
--- a/examples/network/blockingfortuneclient/fortunethread.h
+++ b/examples/network/blockingfortuneclient/fortunethread.h
@@ -65,7 +65,7 @@ public:
~FortuneThread();
void requestNewFortune(const QString &hostName, quint16 port);
- void run() Q_DECL_OVERRIDE;
+ void run() override;
signals:
void newFortune(const QString &fortune);
diff --git a/examples/network/googlesuggest/googlesuggest.h b/examples/network/googlesuggest/googlesuggest.h
index 561d94efde..1d42f31571 100644
--- a/examples/network/googlesuggest/googlesuggest.h
+++ b/examples/network/googlesuggest/googlesuggest.h
@@ -70,7 +70,7 @@ class GSuggestCompletion : public QObject
public:
GSuggestCompletion(QLineEdit *parent = 0);
~GSuggestCompletion();
- bool eventFilter(QObject *obj, QEvent *ev) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *obj, QEvent *ev) override;
void showCompletion(const QStringList &choices);
public slots:
diff --git a/examples/network/multistreamclient/chatconsumer.cpp b/examples/network/multistreamclient/chatconsumer.cpp
new file mode 100644
index 0000000000..723ecfaa23
--- /dev/null
+++ b/examples/network/multistreamclient/chatconsumer.cpp
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "chatconsumer.h"
+#include <QWidget>
+#include <QTextEdit>
+#include <QLineEdit>
+#include <QVBoxLayout>
+#include <QString>
+
+ChatConsumer::ChatConsumer(QObject *parent)
+ : Consumer(parent)
+{
+ frameWidget = new QWidget;
+ frameWidget->setFocusPolicy(Qt::TabFocus);
+
+ textEdit = new QTextEdit;
+ textEdit->setFocusPolicy(Qt::NoFocus);
+ textEdit->setReadOnly(true);
+
+ lineEdit = new QLineEdit;
+ frameWidget->setFocusProxy(lineEdit);
+
+ connect(lineEdit, &QLineEdit::returnPressed, this, &ChatConsumer::returnPressed);
+
+ QVBoxLayout *layout = new QVBoxLayout(frameWidget);
+ layout->setContentsMargins( 0, 0, 0, 0);
+ layout->addWidget(textEdit);
+ layout->addWidget(lineEdit);
+}
+
+QWidget *ChatConsumer::widget()
+{
+ return frameWidget;
+}
+
+void ChatConsumer::readDatagram(const QByteArray &ba)
+{
+ textEdit->append(QString::fromUtf8(ba));
+}
+
+void ChatConsumer::returnPressed()
+{
+ emit writeDatagram(lineEdit->text().toUtf8());
+ lineEdit->clear();
+}
diff --git a/examples/network/multistreamclient/chatconsumer.h b/examples/network/multistreamclient/chatconsumer.h
new file mode 100644
index 0000000000..9e12f99359
--- /dev/null
+++ b/examples/network/multistreamclient/chatconsumer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CHATCONSUMER_H
+#define CHATCONSUMER_H
+
+#include "consumer.h"
+
+QT_BEGIN_NAMESPACE
+class QTextEdit;
+class QLineEdit;
+QT_END_NAMESPACE
+
+class ChatConsumer : public Consumer
+{
+ Q_OBJECT
+public:
+ explicit ChatConsumer(QObject *parent = nullptr);
+
+ QWidget *widget() Q_DECL_OVERRIDE;
+ void readDatagram(const QByteArray &ba) Q_DECL_OVERRIDE;
+
+private slots:
+ void returnPressed();
+
+private:
+ QWidget *frameWidget;
+ QTextEdit *textEdit;
+ QLineEdit *lineEdit;
+};
+
+#endif
diff --git a/examples/network/multistreamclient/client.cpp b/examples/network/multistreamclient/client.cpp
new file mode 100644
index 0000000000..112fb2e1a0
--- /dev/null
+++ b/examples/network/multistreamclient/client.cpp
@@ -0,0 +1,219 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtWidgets>
+#include <QtNetwork>
+
+#include "client.h"
+#include "movieconsumer.h"
+#include "timeconsumer.h"
+#include "chatconsumer.h"
+
+#include "../shared/sctpchannels.h"
+
+Client::Client(QWidget *parent)
+ : QDialog(parent)
+ , consumers(SctpChannels::NumberOfChannels)
+{
+ setWindowTitle(tr("Multi-stream Client"));
+
+ sctpSocket = new QSctpSocket(this);
+
+ QLabel *hostLabel = new QLabel(tr("&Server name:"));
+ QLabel *portLabel = new QLabel(tr("S&erver port:"));
+
+ hostCombo = new QComboBox;
+ hostCombo->setEditable(true);
+ // find out name of this machine
+ QString name = QHostInfo::localHostName();
+ if (!name.isEmpty()) {
+ hostCombo->addItem(name);
+ QString domain = QHostInfo::localDomainName();
+ if (!domain.isEmpty())
+ hostCombo->addItem(name + QChar('.') + domain);
+ }
+ if (name != QString("localhost"))
+ hostCombo->addItem(QString("localhost"));
+ // find out IP addresses of this machine
+ QList<QHostAddress> ipAddressesList = QNetworkInterface::allAddresses();
+ // add non-localhost addresses
+ for (int i = 0; i < ipAddressesList.size(); ++i) {
+ if (!ipAddressesList.at(i).isLoopback())
+ hostCombo->addItem(ipAddressesList.at(i).toString());
+ }
+ // add localhost addresses
+ for (int i = 0; i < ipAddressesList.size(); ++i) {
+ if (ipAddressesList.at(i).isLoopback())
+ hostCombo->addItem(ipAddressesList.at(i).toString());
+ }
+
+ portLineEdit = new QLineEdit;
+ portLineEdit->setValidator(new QIntValidator(1, 65535, this));
+
+ hostLabel->setBuddy(hostCombo);
+ portLabel->setBuddy(portLineEdit);
+
+ connectButton = new QPushButton(tr("Connect"));
+ connectButton->setDefault(true);
+ connectButton->setEnabled(false);
+
+ QPushButton *quitButton = new QPushButton(tr("Quit"));
+ quitButton->setAutoDefault(false);
+
+ QDialogButtonBox *buttonBox = new QDialogButtonBox;
+ buttonBox->addButton(connectButton, QDialogButtonBox::ActionRole);
+ buttonBox->addButton(quitButton, QDialogButtonBox::AcceptRole);
+
+ QLabel *movieLabel = new QLabel(tr("Movie stream:"));
+ consumers[SctpChannels::Movie] = new MovieConsumer(this);
+ QLabel *timeLabel = new QLabel(tr("Time stream:"));
+ consumers[SctpChannels::Time] = new TimeConsumer(this);
+ QLabel *chatLabel = new QLabel(tr("&Chat:"));
+ consumers[SctpChannels::Chat] = new ChatConsumer(this);
+ chatLabel->setBuddy(consumers[SctpChannels::Chat]->widget());
+
+ connect(hostCombo, &QComboBox::editTextChanged, this, &Client::enableConnectButton);
+ connect(portLineEdit, &QLineEdit::textChanged, this, &Client::enableConnectButton);
+ connect(connectButton, &QPushButton::clicked, this, &Client::requestConnect);
+ connect(buttonBox, &QDialogButtonBox::accepted, this, &Client::accept);
+ connect(sctpSocket, &QSctpSocket::connected, this, &Client::connected);
+ connect(sctpSocket, &QSctpSocket::disconnected, this, &Client::disconnected);
+ connect(sctpSocket, &QSctpSocket::channelReadyRead, this, &Client::readDatagram);
+ connect(sctpSocket, SIGNAL(error(QAbstractSocket::SocketError)),
+ this, SLOT(displayError(QAbstractSocket::SocketError)));
+ connect(consumers[SctpChannels::Time], &Consumer::writeDatagram, this, &Client::writeDatagram);
+ connect(consumers[SctpChannels::Chat], &Consumer::writeDatagram, this, &Client::writeDatagram);
+
+ QGridLayout *mainLayout = new QGridLayout;
+ mainLayout->addWidget(hostLabel, 0, 0);
+ mainLayout->addWidget(hostCombo, 0, 1);
+ mainLayout->addWidget(portLabel, 1, 0);
+ mainLayout->addWidget(portLineEdit, 1, 1);
+ mainLayout->addWidget(buttonBox, 2, 0, 1, 2);
+ mainLayout->addWidget(movieLabel, 3, 0);
+ mainLayout->addWidget(timeLabel, 3, 1);
+ mainLayout->addWidget(consumers[SctpChannels::Movie]->widget(), 4, 0);
+ mainLayout->addWidget(consumers[SctpChannels::Time]->widget(), 4, 1);
+ mainLayout->addWidget(chatLabel, 5, 0);
+ mainLayout->addWidget(consumers[SctpChannels::Chat]->widget(), 6, 0, 1, 2);
+ setLayout(mainLayout);
+
+ portLineEdit->setFocus();
+}
+
+Client::~Client()
+{
+ delete sctpSocket;
+}
+
+void Client::connected()
+{
+ consumers[SctpChannels::Chat]->widget()->setFocus();
+}
+
+void Client::disconnected()
+{
+ for (Consumer *consumer : consumers)
+ consumer->serverDisconnected();
+
+ sctpSocket->close();
+}
+
+void Client::requestConnect()
+{
+ connectButton->setEnabled(false);
+ sctpSocket->abort();
+ sctpSocket->connectToHost(hostCombo->currentText(),
+ portLineEdit->text().toInt());
+}
+
+void Client::readDatagram(int channel)
+{
+ sctpSocket->setCurrentReadChannel(channel);
+ consumers[channel]->readDatagram(sctpSocket->readDatagram().data());
+}
+
+void Client::displayError(QAbstractSocket::SocketError socketError)
+{
+ switch (socketError) {
+ case QAbstractSocket::HostNotFoundError:
+ QMessageBox::information(this, tr("Multi-stream Client"),
+ tr("The host was not found. Please check the "
+ "host name and port settings."));
+ break;
+ case QAbstractSocket::ConnectionRefusedError:
+ QMessageBox::information(this, tr("Multi-stream Client"),
+ tr("The connection was refused by the peer. "
+ "Make sure the multi-stream server is running, "
+ "and check that the host name and port "
+ "settings are correct."));
+ break;
+ default:
+ QMessageBox::information(this, tr("Multi-stream Client"),
+ tr("The following error occurred: %1.")
+ .arg(sctpSocket->errorString()));
+ }
+
+ enableConnectButton();
+}
+
+void Client::enableConnectButton()
+{
+ connectButton->setEnabled(!hostCombo->currentText().isEmpty() &&
+ !portLineEdit->text().isEmpty());
+}
+
+void Client::writeDatagram(const QByteArray &ba)
+{
+ if (sctpSocket->isValid() && sctpSocket->state() == QAbstractSocket::ConnectedState) {
+ sctpSocket->setCurrentWriteChannel(consumers.indexOf(static_cast<Consumer *>(sender())));
+ sctpSocket->writeDatagram(ba);
+ }
+}
diff --git a/examples/network/multistreamclient/client.h b/examples/network/multistreamclient/client.h
new file mode 100644
index 0000000000..c22a245eba
--- /dev/null
+++ b/examples/network/multistreamclient/client.h
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CLIENT_H
+#define CLIENT_H
+
+#include <QDialog>
+#include <QVector>
+#include <QSctpSocket>
+
+QT_BEGIN_NAMESPACE
+class QComboBox;
+class QLineEdit;
+class QPushButton;
+class QByteArray;
+QT_END_NAMESPACE
+
+class Consumer;
+
+class Client : public QDialog
+{
+ Q_OBJECT
+public:
+ explicit Client(QWidget *parent = nullptr);
+ virtual ~Client();
+
+private slots:
+ void connected();
+ void disconnected();
+ void requestConnect();
+ void readDatagram(int channel);
+ void displayError(QAbstractSocket::SocketError socketError);
+ void enableConnectButton();
+ void writeDatagram(const QByteArray &ba);
+
+private:
+ QVector<Consumer *> consumers;
+ QSctpSocket *sctpSocket;
+
+ QComboBox *hostCombo;
+ QLineEdit *portLineEdit;
+ QPushButton *connectButton;
+};
+
+#endif
diff --git a/examples/network/multistreamclient/consumer.h b/examples/network/multistreamclient/consumer.h
new file mode 100644
index 0000000000..d70f8d67bf
--- /dev/null
+++ b/examples/network/multistreamclient/consumer.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CONSUMER_H
+#define CONSUMER_H
+
+#include <QObject>
+#include <QByteArray>
+
+QT_BEGIN_NAMESPACE
+class QWidget;
+QT_END_NAMESPACE
+
+class Consumer : public QObject
+{
+ Q_OBJECT
+public:
+ explicit inline Consumer(QObject *parent = nullptr) : QObject(parent) { }
+
+ virtual QWidget *widget() = 0;
+ virtual void readDatagram(const QByteArray &ba) = 0;
+ virtual void serverDisconnected() { }
+
+signals:
+ void writeDatagram(const QByteArray &ba);
+};
+
+#endif
diff --git a/examples/network/multistreamclient/main.cpp b/examples/network/multistreamclient/main.cpp
new file mode 100644
index 0000000000..b903214710
--- /dev/null
+++ b/examples/network/multistreamclient/main.cpp
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include "client.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ Client client;
+
+ return (client.exec() == QDialog::Accepted) ? 0 : -1;
+}
diff --git a/examples/network/multistreamclient/movieconsumer.cpp b/examples/network/multistreamclient/movieconsumer.cpp
new file mode 100644
index 0000000000..ff5610a0b9
--- /dev/null
+++ b/examples/network/multistreamclient/movieconsumer.cpp
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "movieconsumer.h"
+#include <QLabel>
+#include <QDataStream>
+#include <QImage>
+#include <QPixmap>
+
+MovieConsumer::MovieConsumer(QObject *parent)
+ : Consumer(parent)
+{
+ label = new QLabel;
+ label->setFrameStyle(QFrame::Box | QFrame::Raised);
+ label->setFixedSize(128 + label->frameWidth() * 2,
+ 64 + label->frameWidth() * 2);
+}
+
+QWidget *MovieConsumer::widget()
+{
+ return label;
+}
+
+void MovieConsumer::readDatagram(const QByteArray &ba)
+{
+ QDataStream ds(ba);
+ QImage image;
+
+ ds >> image;
+ label->setPixmap(QPixmap::fromImage(image));
+}
+
+void MovieConsumer::serverDisconnected()
+{
+ label->setPixmap(QPixmap());
+}
diff --git a/examples/network/multistreamclient/movieconsumer.h b/examples/network/multistreamclient/movieconsumer.h
new file mode 100644
index 0000000000..74321a8505
--- /dev/null
+++ b/examples/network/multistreamclient/movieconsumer.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MOVIECONSUMER_H
+#define MOVIECONSUMER_H
+
+#include "consumer.h"
+
+QT_BEGIN_NAMESPACE
+class QLabel;
+QT_END_NAMESPACE
+
+class MovieConsumer : public Consumer
+{
+ Q_OBJECT
+public:
+ explicit MovieConsumer(QObject *parent = nullptr);
+
+ QWidget *widget() Q_DECL_OVERRIDE;
+ void readDatagram(const QByteArray &ba) Q_DECL_OVERRIDE;
+ void serverDisconnected() Q_DECL_OVERRIDE;
+
+private:
+ QLabel *label;
+};
+
+#endif
diff --git a/examples/network/multistreamclient/multistreamclient.pro b/examples/network/multistreamclient/multistreamclient.pro
new file mode 100644
index 0000000000..ed887ab53e
--- /dev/null
+++ b/examples/network/multistreamclient/multistreamclient.pro
@@ -0,0 +1,16 @@
+QT += network widgets
+
+HEADERS = client.h \
+ consumer.h \
+ movieconsumer.h \
+ timeconsumer.h \
+ chatconsumer.h
+SOURCES = client.cpp \
+ movieconsumer.cpp \
+ timeconsumer.cpp \
+ chatconsumer.cpp \
+ main.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/network/multistreamclient
+INSTALLS += target
diff --git a/examples/network/multistreamclient/timeconsumer.cpp b/examples/network/multistreamclient/timeconsumer.cpp
new file mode 100644
index 0000000000..6543e53cfc
--- /dev/null
+++ b/examples/network/multistreamclient/timeconsumer.cpp
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "timeconsumer.h"
+#include <QLCDNumber>
+#include <QString>
+#include <QDataStream>
+#include <QTimer>
+
+TimeConsumer::TimeConsumer(QObject *parent)
+ : Consumer(parent)
+{
+ lcdNumber = new QLCDNumber(8);
+
+ QTimer *timer = new QTimer(this);
+ connect(timer, &QTimer::timeout, this, &TimeConsumer::timerTick);
+ timer->start(100);
+
+ serverDisconnected();
+}
+
+QWidget *TimeConsumer::widget()
+{
+ return lcdNumber;
+}
+
+void TimeConsumer::readDatagram(const QByteArray &ba)
+{
+ QDataStream ds(ba);
+
+ ds >> lastTime;
+ lcdNumber->display(lastTime.toString("hh:mm:ss"));
+}
+
+void TimeConsumer::timerTick()
+{
+ QByteArray buf;
+ QDataStream ds(&buf, QIODevice::WriteOnly);
+
+ ds << lastTime;
+ emit writeDatagram(buf);
+}
+
+void TimeConsumer::serverDisconnected()
+{
+ lcdNumber->display(QLatin1String("--:--:--"));
+}
diff --git a/examples/network/multistreamclient/timeconsumer.h b/examples/network/multistreamclient/timeconsumer.h
new file mode 100644
index 0000000000..3faa4a6b1a
--- /dev/null
+++ b/examples/network/multistreamclient/timeconsumer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef TIMECONSUMER_H
+#define TIMECONSUMER_H
+
+#include "consumer.h"
+#include <QTime>
+
+QT_BEGIN_NAMESPACE
+class QLCDNumber;
+QT_END_NAMESPACE
+
+class TimeConsumer : public Consumer
+{
+ Q_OBJECT
+public:
+ explicit TimeConsumer(QObject *parent = nullptr);
+
+ QWidget *widget() Q_DECL_OVERRIDE;
+ void readDatagram(const QByteArray &ba) Q_DECL_OVERRIDE;
+ void serverDisconnected() Q_DECL_OVERRIDE;
+
+private slots:
+ void timerTick();
+
+private:
+ QTime lastTime;
+ QLCDNumber *lcdNumber;
+};
+
+#endif
diff --git a/examples/network/multistreamserver/animation.gif b/examples/network/multistreamserver/animation.gif
new file mode 100644
index 0000000000..f674369efc
--- /dev/null
+++ b/examples/network/multistreamserver/animation.gif
Binary files differ
diff --git a/examples/network/multistreamserver/chatprovider.cpp b/examples/network/multistreamserver/chatprovider.cpp
new file mode 100644
index 0000000000..a6ba9c6a27
--- /dev/null
+++ b/examples/network/multistreamserver/chatprovider.cpp
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "chatprovider.h"
+#include <QString>
+#include <QSctpSocket>
+#include <QHostAddress>
+
+ChatProvider::ChatProvider(QObject *parent)
+ : Provider(parent)
+{
+}
+
+void ChatProvider::readDatagram(QSctpSocket &from, const QByteArray &ba)
+{
+ emit writeDatagram(0, QString(QLatin1String("<%1:%2> %3"))
+ .arg(from.peerAddress().toString())
+ .arg(QString::number(from.peerPort()))
+ .arg(QString::fromUtf8(ba)).toUtf8());
+}
+
+void ChatProvider::newConnection(QSctpSocket &client)
+{
+ readDatagram(client, QString(tr("has joined")).toUtf8());
+}
+
+void ChatProvider::clientDisconnected(QSctpSocket &client)
+{
+ readDatagram(client, QString(tr("has left")).toUtf8());
+}
diff --git a/examples/network/multistreamserver/chatprovider.h b/examples/network/multistreamserver/chatprovider.h
new file mode 100644
index 0000000000..b6ff61a917
--- /dev/null
+++ b/examples/network/multistreamserver/chatprovider.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CHATPROVIDER_H
+#define CHATPROVIDER_H
+
+#include "provider.h"
+
+class ChatProvider : public Provider
+{
+ Q_OBJECT
+public:
+ explicit ChatProvider(QObject *parent = nullptr);
+
+ void readDatagram(QSctpSocket &from, const QByteArray &ba) Q_DECL_OVERRIDE;
+ void newConnection(QSctpSocket &client) Q_DECL_OVERRIDE;
+ void clientDisconnected(QSctpSocket &client) Q_DECL_OVERRIDE;
+};
+
+#endif
diff --git a/examples/network/multistreamserver/main.cpp b/examples/network/multistreamserver/main.cpp
new file mode 100644
index 0000000000..ae201f6b82
--- /dev/null
+++ b/examples/network/multistreamserver/main.cpp
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+
+#include "server.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ Server server;
+
+ return (server.exec() == QDialog::Accepted) ? 0 : -1;
+}
diff --git a/examples/network/multistreamserver/movieprovider.cpp b/examples/network/multistreamserver/movieprovider.cpp
new file mode 100644
index 0000000000..335038a515
--- /dev/null
+++ b/examples/network/multistreamserver/movieprovider.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "movieprovider.h"
+#include <QMovie>
+#include <QString>
+#include <QDataStream>
+
+MovieProvider::MovieProvider(QObject *parent)
+ : Provider(parent)
+{
+ movie = new QMovie(this);
+ movie->setCacheMode(QMovie::CacheAll);
+ movie->setFileName(QLatin1String("animation.gif"));
+ connect(movie, &QMovie::frameChanged, this, &MovieProvider::frameChanged);
+ movie->start();
+}
+
+void MovieProvider::frameChanged()
+{
+ QByteArray buf;
+ QDataStream ds(&buf, QIODevice::WriteOnly);
+
+ ds << movie->currentImage();
+ emit writeDatagram(0, buf);
+}
diff --git a/examples/network/multistreamserver/movieprovider.h b/examples/network/multistreamserver/movieprovider.h
new file mode 100644
index 0000000000..46de20a648
--- /dev/null
+++ b/examples/network/multistreamserver/movieprovider.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MOVIEPROVIDER_H
+#define MOVIEPROVIDER_H
+
+#include "provider.h"
+
+QT_BEGIN_NAMESPACE
+class QMovie;
+QT_END_NAMESPACE
+
+class MovieProvider : public Provider
+{
+ Q_OBJECT
+public:
+ explicit MovieProvider(QObject *parent = nullptr);
+
+private slots:
+ void frameChanged();
+
+private:
+ QMovie *movie;
+};
+
+#endif
diff --git a/examples/network/multistreamserver/multistreamserver.pro b/examples/network/multistreamserver/multistreamserver.pro
new file mode 100644
index 0000000000..75a7e6bbec
--- /dev/null
+++ b/examples/network/multistreamserver/multistreamserver.pro
@@ -0,0 +1,24 @@
+QT += network widgets
+
+HEADERS = server.h \
+ provider.h \
+ movieprovider.h \
+ timeprovider.h \
+ chatprovider.h
+SOURCES = server.cpp \
+ movieprovider.cpp \
+ timeprovider.cpp \
+ chatprovider.cpp \
+ main.cpp
+
+EXAMPLE_FILES = animation.gif
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/network/multistreamserver
+INSTALLS += target
+
+wince*: {
+ addFiles.files += *.gif
+ addFiles.path = .
+ DEPLOYMENT += addFiles
+}
diff --git a/examples/network/multistreamserver/provider.h b/examples/network/multistreamserver/provider.h
new file mode 100644
index 0000000000..5be14d5ed8
--- /dev/null
+++ b/examples/network/multistreamserver/provider.h
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef PROVIDER_H
+#define PROVIDER_H
+
+#include <QObject>
+
+QT_BEGIN_NAMESPACE
+class QSctpSocket;
+class QByteArray;
+QT_END_NAMESPACE
+
+class Provider : public QObject
+{
+ Q_OBJECT
+
+public:
+ explicit inline Provider(QObject *parent = nullptr) : QObject(parent) { }
+
+ virtual void readDatagram(QSctpSocket &, const QByteArray &) { }
+ virtual void newConnection(QSctpSocket &) { }
+ virtual void clientDisconnected(QSctpSocket &) { }
+
+signals:
+ void writeDatagram(QSctpSocket *to, const QByteArray &ba);
+};
+
+#endif
diff --git a/examples/network/multistreamserver/server.cpp b/examples/network/multistreamserver/server.cpp
new file mode 100644
index 0000000000..3b06c0fd37
--- /dev/null
+++ b/examples/network/multistreamserver/server.cpp
@@ -0,0 +1,171 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtWidgets>
+#include <QtNetwork>
+#include <QtAlgorithms>
+
+#include "server.h"
+#include "movieprovider.h"
+#include "timeprovider.h"
+#include "chatprovider.h"
+
+#include "../shared/sctpchannels.h"
+
+Server::Server(QWidget *parent)
+ : QDialog(parent)
+ , providers(SctpChannels::NumberOfChannels)
+{
+ setWindowTitle(tr("Multi-stream Server"));
+
+ sctpServer = new QSctpServer(this);
+ sctpServer->setMaxChannelCount(NumberOfChannels);
+
+ statusLabel = new QLabel;
+ QPushButton *quitButton = new QPushButton(tr("Quit"));
+
+ providers[SctpChannels::Movie] = new MovieProvider(this);
+ providers[SctpChannels::Time] = new TimeProvider(this);
+ providers[SctpChannels::Chat] = new ChatProvider(this);
+
+ connect(sctpServer, &QSctpServer::newConnection, this, &Server::newConnection);
+ connect(quitButton, &QPushButton::clicked, this, &Server::accept);
+ connect(providers[SctpChannels::Movie], &Provider::writeDatagram, this, &Server::writeDatagram);
+ connect(providers[SctpChannels::Time], &Provider::writeDatagram, this, &Server::writeDatagram);
+ connect(providers[SctpChannels::Chat], &Provider::writeDatagram, this, &Server::writeDatagram);
+
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ mainLayout->addWidget(statusLabel);
+ mainLayout->addWidget(quitButton);
+ setLayout(mainLayout);
+}
+
+Server::~Server()
+{
+ qDeleteAll(connections.begin(), connections.end());
+}
+
+int Server::exec()
+{
+ if (!sctpServer->listen()) {
+ QMessageBox::critical(this, windowTitle(),
+ tr("Unable to start the server: %1.")
+ .arg(sctpServer->errorString()));
+ return QDialog::Rejected;
+ }
+
+ QString ipAddress;
+ QList<QHostAddress> ipAddressesList = QNetworkInterface::allAddresses();
+ // use the first non-localhost IPv4 address
+ for (int i = 0; i < ipAddressesList.size(); ++i) {
+ if (ipAddressesList.at(i) != QHostAddress::LocalHost &&
+ ipAddressesList.at(i).toIPv4Address()) {
+ ipAddress = ipAddressesList.at(i).toString();
+ break;
+ }
+ }
+ // if we did not find one, use IPv4 localhost
+ if (ipAddress.isEmpty())
+ ipAddress = QHostAddress(QHostAddress::LocalHost).toString();
+ statusLabel->setText(tr("The server is running on\n\nIP: %1\nport: %2\n\n"
+ "Run the Multi-stream Client example now.")
+ .arg(ipAddress).arg(sctpServer->serverPort()));
+
+ return QDialog::exec();
+}
+
+void Server::newConnection()
+{
+ QSctpSocket *connection = sctpServer->nextPendingDatagramConnection();
+
+ connections.append(connection);
+ connect(connection, &QSctpSocket::channelReadyRead, this, &Server::readDatagram);
+ connect(connection, &QSctpSocket::disconnected, this, &Server::clientDisconnected);
+
+ for (Provider *provider : providers)
+ provider->newConnection(*connection);
+}
+
+void Server::clientDisconnected()
+{
+ QSctpSocket *connection = static_cast<QSctpSocket *>(sender());
+
+ connections.removeOne(connection);
+ connection->disconnect();
+
+ for (Provider *provider : providers)
+ provider->clientDisconnected(*connection);
+
+ connection->deleteLater();
+}
+
+void Server::readDatagram(int channel)
+{
+ QSctpSocket *connection = static_cast<QSctpSocket *>(sender());
+
+ connection->setCurrentReadChannel(channel);
+ providers[channel]->readDatagram(*connection, connection->readDatagram().data());
+}
+
+void Server::writeDatagram(QSctpSocket *to, const QByteArray &ba)
+{
+ int channel = providers.indexOf(static_cast<Provider *>(sender()));
+
+ if (to) {
+ to->setCurrentWriteChannel(channel);
+ to->writeDatagram(ba);
+ return;
+ }
+
+ for (QSctpSocket *connection : connections) {
+ connection->setCurrentWriteChannel(channel);
+ connection->writeDatagram(ba);
+ }
+}
diff --git a/examples/network/multistreamserver/server.h b/examples/network/multistreamserver/server.h
new file mode 100644
index 0000000000..d9a38e61a4
--- /dev/null
+++ b/examples/network/multistreamserver/server.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SERVER_H
+#define SERVER_H
+
+#include <QDialog>
+#include <QVector>
+#include <QList>
+
+QT_BEGIN_NAMESPACE
+class QSctpServer;
+class QSctpSocket;
+class QLabel;
+class QByteArray;
+QT_END_NAMESPACE
+
+class Provider;
+
+class Server : public QDialog
+{
+ Q_OBJECT
+public:
+ explicit Server(QWidget *parent = nullptr);
+ virtual ~Server();
+
+public slots:
+ int exec() Q_DECL_OVERRIDE;
+
+private slots:
+ void newConnection();
+ void clientDisconnected();
+ void readDatagram(int channel);
+ void writeDatagram(QSctpSocket *to, const QByteArray &ba);
+
+private:
+ QVector<Provider *> providers;
+ QSctpServer *sctpServer;
+ QList<QSctpSocket *> connections;
+
+ QLabel *statusLabel;
+};
+
+#endif
diff --git a/examples/network/multistreamserver/timeprovider.cpp b/examples/network/multistreamserver/timeprovider.cpp
new file mode 100644
index 0000000000..fb50baac26
--- /dev/null
+++ b/examples/network/multistreamserver/timeprovider.cpp
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "timeprovider.h"
+#include <QDataStream>
+#include <QTime>
+#include <QByteArray>
+
+TimeProvider::TimeProvider(QObject *parent)
+ : Provider(parent)
+{
+}
+
+void TimeProvider::readDatagram(QSctpSocket &from, const QByteArray &ba)
+{
+ QDataStream in_ds(ba);
+ QTime curTime = QTime::currentTime();
+ QTime clientTime;
+
+ in_ds >> clientTime;
+ // Send response only if a displayed part of the time is changed.
+ // So, sub-second differences are ignored.
+ if (!clientTime.isValid() || curTime.second() != clientTime.second()
+ || curTime.minute() != clientTime.minute()
+ || curTime.hour() != clientTime.hour()) {
+ QByteArray buf;
+ QDataStream out_ds(&buf, QIODevice::WriteOnly);
+
+ out_ds << curTime;
+ emit writeDatagram(&from, buf);
+ }
+}
diff --git a/examples/network/multistreamserver/timeprovider.h b/examples/network/multistreamserver/timeprovider.h
new file mode 100644
index 0000000000..f99cdbc717
--- /dev/null
+++ b/examples/network/multistreamserver/timeprovider.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef TIMEPROVIDER_H
+#define TIMEPROVIDER_H
+
+#include "provider.h"
+
+class TimeProvider : public Provider
+{
+ Q_OBJECT
+public:
+ explicit TimeProvider(QObject *parent = nullptr);
+
+ void readDatagram(QSctpSocket &from, const QByteArray &ba) Q_DECL_OVERRIDE;
+};
+
+#endif
diff --git a/examples/network/network-chat/connection.h b/examples/network/network-chat/connection.h
index bcd9e889f7..67d25d4d1e 100644
--- a/examples/network/network-chat/connection.h
+++ b/examples/network/network-chat/connection.h
@@ -88,7 +88,7 @@ signals:
void newMessage(const QString &from, const QString &message);
protected:
- void timerEvent(QTimerEvent *timerEvent) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *timerEvent) override;
private slots:
void processReadyRead();
diff --git a/examples/network/network-chat/server.h b/examples/network/network-chat/server.h
index 47adfc63c7..d86ed36bce 100644
--- a/examples/network/network-chat/server.h
+++ b/examples/network/network-chat/server.h
@@ -66,7 +66,7 @@ signals:
void newConnection(Connection *connection);
protected:
- void incomingConnection(qintptr socketDescriptor) Q_DECL_OVERRIDE;
+ void incomingConnection(qintptr socketDescriptor) override;
};
#endif
diff --git a/examples/network/network.pro b/examples/network/network.pro
index 86bb08d22a..5ad5f1939f 100644
--- a/examples/network/network.pro
+++ b/examples/network/network.pro
@@ -1,6 +1,7 @@
requires(qtHaveModule(network))
TEMPLATE = subdirs
+QT_FOR_CONFIG += network-private
SUBDIRS = \
download \
downloadmanager
@@ -18,10 +19,9 @@ qtHaveModule(widgets) {
multicastreceiver \
multicastsender
- load(qfeatures)
- !contains(QT_DISABLED_FEATURES, bearermanagement) {
+ qtConfig(bearermanagement) {
# no QProcess
- !vxworks:!qnx:!winrt:!integrity: SUBDIRS += network-chat
+ !vxworks:!qnx:!winrt:!integrity:!uikit: SUBDIRS += network-chat
SUBDIRS += \
bearermonitor \
@@ -30,6 +30,9 @@ qtHaveModule(widgets) {
}
- contains(QT_CONFIG, openssl):SUBDIRS += securesocketclient
- contains(QT_CONFIG, openssl-linked):SUBDIRS += securesocketclient
+ qtConfig(openssl): SUBDIRS += securesocketclient
+ qtConfig(openssl-linked): SUBDIRS += securesocketclient
+ qtConfig(sctp): SUBDIRS += multistreamserver multistreamclient
}
+
+EXAMPLE_FILES = shared
diff --git a/examples/network/shared/sctpchannels.h b/examples/network/shared/sctpchannels.h
new file mode 100644
index 0000000000..f8d78ee33b
--- /dev/null
+++ b/examples/network/shared/sctpchannels.h
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SCTPCHANNELS_H
+#define SCTPCHANNELS_H
+
+enum SctpChannels {
+ Movie = 0,
+ Time = 1,
+ Chat = 2,
+
+ NumberOfChannels = 3
+};
+
+#endif
diff --git a/examples/network/threadedfortuneserver/fortuneserver.h b/examples/network/threadedfortuneserver/fortuneserver.h
index 3922add519..dc0949bcb2 100644
--- a/examples/network/threadedfortuneserver/fortuneserver.h
+++ b/examples/network/threadedfortuneserver/fortuneserver.h
@@ -63,7 +63,7 @@ public:
FortuneServer(QObject *parent = 0);
protected:
- void incomingConnection(qintptr socketDescriptor) Q_DECL_OVERRIDE;
+ void incomingConnection(qintptr socketDescriptor) override;
private:
QStringList fortunes;
diff --git a/examples/network/threadedfortuneserver/fortunethread.h b/examples/network/threadedfortuneserver/fortunethread.h
index 038998d9ab..0a4948e1de 100644
--- a/examples/network/threadedfortuneserver/fortunethread.h
+++ b/examples/network/threadedfortuneserver/fortunethread.h
@@ -62,7 +62,7 @@ class FortuneThread : public QThread
public:
FortuneThread(int socketDescriptor, const QString &fortune, QObject *parent);
- void run() Q_DECL_OVERRIDE;
+ void run() override;
signals:
void error(QTcpSocket::SocketError socketError);
diff --git a/examples/network/torrent/connectionmanager.cpp b/examples/network/torrent/connectionmanager.cpp
index d7b0418619..87b7a16e28 100644
--- a/examples/network/torrent/connectionmanager.cpp
+++ b/examples/network/torrent/connectionmanager.cpp
@@ -86,7 +86,7 @@ QByteArray ConnectionManager::clientId() const
{
if (id.isEmpty()) {
// Generate peer id
- int startupTime = int(QDateTime::currentDateTime().toTime_t());
+ qint64 startupTime = QDateTime::currentSecsSinceEpoch();
id += QString::asprintf("-QT%04x-", QT_VERSION >> 8).toLatin1();
id += QByteArray::number(startupTime, 10);
diff --git a/examples/network/torrent/filemanager.h b/examples/network/torrent/filemanager.h
index 73061ad059..82f9983ea6 100644
--- a/examples/network/torrent/filemanager.h
+++ b/examples/network/torrent/filemanager.h
@@ -100,7 +100,7 @@ signals:
void pieceVerified(int pieceIndex, bool verified);
protected:
- void run() Q_DECL_OVERRIDE;
+ void run() override;
private slots:
bool verifySinglePiece(int pieceIndex);
diff --git a/examples/network/torrent/mainwindow.cpp b/examples/network/torrent/mainwindow.cpp
index 2b3d3e8b3a..efdf187174 100644
--- a/examples/network/torrent/mainwindow.cpp
+++ b/examples/network/torrent/mainwindow.cpp
@@ -67,8 +67,8 @@ signals:
void fileDropped(const QString &fileName);
protected:
- void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE;
- void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
+ void dragMoveEvent(QDragMoveEvent *event) override;
+ void dropEvent(QDropEvent *event) override;
#endif
};
@@ -80,7 +80,7 @@ public:
inline TorrentViewDelegate(MainWindow *mainWindow) : QItemDelegate(mainWindow) {}
void paint(QPainter *painter, const QStyleOptionViewItem &option,
- const QModelIndex &index ) const Q_DECL_OVERRIDE
+ const QModelIndex &index ) const override
{
if (index.column() != 2) {
QItemDelegate::paint(painter, option, index);
diff --git a/examples/network/torrent/mainwindow.h b/examples/network/torrent/mainwindow.h
index 7c18f770f8..9c55b72256 100644
--- a/examples/network/torrent/mainwindow.h
+++ b/examples/network/torrent/mainwindow.h
@@ -73,11 +73,11 @@ class MainWindow : public QMainWindow
public:
MainWindow(QWidget *parent = 0);
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
const TorrentClient *clientForRow(int row) const;
protected:
- void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
+ void closeEvent(QCloseEvent *event) override;
private slots:
void loadSettings();
diff --git a/examples/network/torrent/metainfo.cpp b/examples/network/torrent/metainfo.cpp
index e3718999b8..565533e2f9 100644
--- a/examples/network/torrent/metainfo.cpp
+++ b/examples/network/torrent/metainfo.cpp
@@ -141,7 +141,7 @@ bool MetaInfo::parse(const QByteArray &data)
}
if (dict.contains("creation date"))
- metaInfoCreationDate.setTime_t(dict.value("creation date").toInt());
+ metaInfoCreationDate.setSecsSinceEpoch(dict.value("creation date").toInt());
if (dict.contains("comment"))
metaInfoComment = QString::fromUtf8(dict.value("comment").toByteArray());
if (dict.contains("created by"))
diff --git a/examples/network/torrent/peerwireclient.h b/examples/network/torrent/peerwireclient.h
index 6fee52bee0..e03b538f63 100644
--- a/examples/network/torrent/peerwireclient.h
+++ b/examples/network/torrent/peerwireclient.h
@@ -122,14 +122,14 @@ public:
qint64 uploadSpeed() const;
bool canTransferMore() const;
- qint64 bytesAvailable() const Q_DECL_OVERRIDE { return incomingBuffer.size() + QTcpSocket::bytesAvailable(); }
+ qint64 bytesAvailable() const override { return incomingBuffer.size() + QTcpSocket::bytesAvailable(); }
qint64 socketBytesAvailable() const { return socket.bytesAvailable(); }
qint64 socketBytesToWrite() const { return socket.bytesToWrite(); }
- void setReadBufferSize(qint64 size) Q_DECL_OVERRIDE;
+ void setReadBufferSize(qint64 size) override;
void connectToHost(const QHostAddress &address,
- quint16 port, OpenMode openMode = ReadWrite) Q_DECL_OVERRIDE;
+ quint16 port, OpenMode openMode = ReadWrite) override;
void diconnectFromHost();
signals:
@@ -148,11 +148,11 @@ signals:
void bytesReceived(qint64 size);
protected:
- void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *event) override;
- qint64 readData(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
- qint64 readLineData(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
- qint64 writeData(const char *data, qint64 len) Q_DECL_OVERRIDE;
+ qint64 readData(char *data, qint64 maxlen) override;
+ qint64 readLineData(char *data, qint64 maxlen) override;
+ qint64 writeData(const char *data, qint64 len) override;
private slots:
void sendHandShake();
diff --git a/examples/network/torrent/torrentclient.cpp b/examples/network/torrent/torrentclient.cpp
index 6b184be39c..ba87924ff9 100644
--- a/examples/network/torrent/torrentclient.cpp
+++ b/examples/network/torrent/torrentclient.cpp
@@ -703,7 +703,7 @@ void TorrentClient::connectToPeers()
// Pick a random peer from the list of weighed peers.
TorrentPeer *peer = weighedPeers.takeAt(qrand() % weighedPeers.size());
weighedPeers.removeAll(peer);
- peer->connectStart = QDateTime::currentDateTime().toTime_t();
+ peer->connectStart = QDateTime::currentSecsSinceEpoch();
peer->lastVisited = peer->connectStart;
// Connect to the peer.
@@ -717,7 +717,7 @@ QList<TorrentPeer *> TorrentClient::weighedFreePeers() const
QList<TorrentPeer *> weighedPeers;
// Generate a list of peers that we want to connect to.
- uint now = QDateTime::currentDateTime().toTime_t();
+ qint64 now = QDateTime::currentSecsSinceEpoch();
QList<TorrentPeer *> freePeers;
QMap<QString, int> connectionsPerPeer;
foreach (TorrentPeer *peer, d->peers) {
diff --git a/examples/network/torrent/torrentclient.h b/examples/network/torrent/torrentclient.h
index 4db60b9a8c..b9b88b3a07 100644
--- a/examples/network/torrent/torrentclient.h
+++ b/examples/network/torrent/torrentclient.h
@@ -168,7 +168,7 @@ public slots:
void setupIncomingConnection(PeerWireClient *client);
protected slots:
- void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *event) override;
private slots:
// File management
diff --git a/examples/network/torrent/torrentserver.h b/examples/network/torrent/torrentserver.h
index 884cce1db8..b0d2b3c012 100644
--- a/examples/network/torrent/torrentserver.h
+++ b/examples/network/torrent/torrentserver.h
@@ -68,7 +68,7 @@ public:
void removeClient(TorrentClient *client);
protected:
- void incomingConnection(qintptr socketDescriptor) Q_DECL_OVERRIDE;
+ void incomingConnection(qintptr socketDescriptor) override;
private slots:
void removeClient();
diff --git a/examples/network/torrent/trackerclient.h b/examples/network/torrent/trackerclient.h
index 787e7b2c84..323fc67eba 100644
--- a/examples/network/torrent/trackerclient.h
+++ b/examples/network/torrent/trackerclient.h
@@ -88,7 +88,7 @@ signals:
void stopped();
protected:
- void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *event) override;
private slots:
void fetchPeerList();
diff --git a/examples/opengl/2dpainting/glwidget.h b/examples/opengl/2dpainting/glwidget.h
index 6f0a20022b..16ad1a95f3 100644
--- a/examples/opengl/2dpainting/glwidget.h
+++ b/examples/opengl/2dpainting/glwidget.h
@@ -67,7 +67,7 @@ public slots:
void animate();
protected:
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
private:
Helper *helper;
diff --git a/examples/opengl/2dpainting/widget.h b/examples/opengl/2dpainting/widget.h
index a1f36be183..40d20bc0a1 100644
--- a/examples/opengl/2dpainting/widget.h
+++ b/examples/opengl/2dpainting/widget.h
@@ -67,7 +67,7 @@ public slots:
void animate();
protected:
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
private:
Helper *helper;
diff --git a/examples/opengl/contextinfo/renderwindow.h b/examples/opengl/contextinfo/renderwindow.h
index 5e9212e04c..c148b71c3c 100644
--- a/examples/opengl/contextinfo/renderwindow.h
+++ b/examples/opengl/contextinfo/renderwindow.h
@@ -65,7 +65,7 @@ class RenderWindow : public QWindow
public:
RenderWindow(const QSurfaceFormat &format);
QOpenGLContext *context() { return m_context; }
- void exposeEvent(QExposeEvent *) Q_DECL_OVERRIDE;
+ void exposeEvent(QExposeEvent *) override;
void setForceGLSL110(bool enable) { m_forceGLSL110 = enable; }
signals:
diff --git a/examples/opengl/cube/mainwidget.h b/examples/opengl/cube/mainwidget.h
index 92182e82c2..cd2f8098ad 100644
--- a/examples/opengl/cube/mainwidget.h
+++ b/examples/opengl/cube/mainwidget.h
@@ -73,13 +73,13 @@ public:
~MainWidget();
protected:
- void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
+ void mousePressEvent(QMouseEvent *e) override;
+ void mouseReleaseEvent(QMouseEvent *e) override;
+ void timerEvent(QTimerEvent *e) override;
- void initializeGL() Q_DECL_OVERRIDE;
- void resizeGL(int w, int h) Q_DECL_OVERRIDE;
- void paintGL() Q_DECL_OVERRIDE;
+ void initializeGL() override;
+ void resizeGL(int w, int h) override;
+ void paintGL() override;
void initShaders();
void initTextures();
diff --git a/examples/opengl/hellogl2/glwidget.h b/examples/opengl/hellogl2/glwidget.h
index 9b4a087fd8..cff5633893 100644
--- a/examples/opengl/hellogl2/glwidget.h
+++ b/examples/opengl/hellogl2/glwidget.h
@@ -68,8 +68,8 @@ public:
GLWidget(QWidget *parent = 0);
~GLWidget();
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize minimumSizeHint() const override;
+ QSize sizeHint() const override;
public slots:
void setXRotation(int angle);
@@ -83,11 +83,11 @@ signals:
void zRotationChanged(int angle);
protected:
- void initializeGL() Q_DECL_OVERRIDE;
- void paintGL() Q_DECL_OVERRIDE;
- void resizeGL(int width, int height) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void initializeGL() override;
+ void paintGL() override;
+ void resizeGL(int width, int height) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
private:
void setupVertexAttribs();
diff --git a/examples/opengl/hellogl2/window.h b/examples/opengl/hellogl2/window.h
index 68ee754d8e..5cec60ff06 100644
--- a/examples/opengl/hellogl2/window.h
+++ b/examples/opengl/hellogl2/window.h
@@ -69,7 +69,7 @@ public:
Window(MainWindow *mw);
protected:
- void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
+ void keyPressEvent(QKeyEvent *event) override;
private slots:
void dockUndock();
diff --git a/examples/opengl/hellowindow/hellowindow.h b/examples/opengl/hellowindow/hellowindow.h
index 0229c393f9..1372152e93 100644
--- a/examples/opengl/hellowindow/hellowindow.h
+++ b/examples/opengl/hellowindow/hellowindow.h
@@ -112,10 +112,10 @@ public:
QColor color() const;
void updateColor();
- void exposeEvent(QExposeEvent *event) Q_DECL_OVERRIDE;
+ void exposeEvent(QExposeEvent *event) override;
private:
- void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
+ void mousePressEvent(QMouseEvent *) override;
int m_colorIndex;
QColor m_color;
diff --git a/examples/opengl/legacy/framebufferobject2/framebufferobject2.pro b/examples/opengl/legacy/framebufferobject2/framebufferobject2.pro
index 78fc6b1a63..3f2578bc1f 100644
--- a/examples/opengl/legacy/framebufferobject2/framebufferobject2.pro
+++ b/examples/opengl/legacy/framebufferobject2/framebufferobject2.pro
@@ -8,4 +8,4 @@ QT += opengl widgets
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/framebufferobject2
INSTALLS += target
-contains(QT_CONFIG, opengles.|angle|dynamicgl):error("This example requires Qt to be configured with -opengl desktop")
+qtConfig(opengles.|angle|dynamicgl): error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/framebufferobject2/glwidget.h b/examples/opengl/legacy/framebufferobject2/glwidget.h
index 8f46f65b29..d3e4aa5af5 100644
--- a/examples/opengl/legacy/framebufferobject2/glwidget.h
+++ b/examples/opengl/legacy/framebufferobject2/glwidget.h
@@ -55,12 +55,12 @@ class GLWidget : public QGLWidget
public:
GLWidget(QWidget *parent);
~GLWidget();
- void initializeGL() Q_DECL_OVERRIDE;
- void resizeGL(int w, int h) Q_DECL_OVERRIDE;
- void paintGL() Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE { update(); }
- void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE { killTimer(timerId); }
- void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE { timerId = startTimer(20); }
+ void initializeGL() override;
+ void resizeGL(int w, int h) override;
+ void paintGL() override;
+ void timerEvent(QTimerEvent *) override { update(); }
+ void mousePressEvent(QMouseEvent *) override { killTimer(timerId); }
+ void mouseReleaseEvent(QMouseEvent *) override { timerId = startTimer(20); }
void drawCube(int i, GLfloat z, GLfloat ri, GLfloat jmp, GLfloat amp);
diff --git a/examples/opengl/legacy/grabber/glwidget.h b/examples/opengl/legacy/grabber/glwidget.h
index 3a6e2fb3bb..67020b0ada 100644
--- a/examples/opengl/legacy/grabber/glwidget.h
+++ b/examples/opengl/legacy/grabber/glwidget.h
@@ -76,11 +76,11 @@ signals:
void zRotationChanged(int angle);
protected:
- void initializeGL() Q_DECL_OVERRIDE;
- void paintGL() Q_DECL_OVERRIDE;
- void resizeGL(int width, int height) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void initializeGL() override;
+ void paintGL() override;
+ void resizeGL(int width, int height) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
private slots:
void advanceGears();
diff --git a/examples/opengl/legacy/grabber/grabber.pro b/examples/opengl/legacy/grabber/grabber.pro
index 1db0e23156..88c03f1c5e 100644
--- a/examples/opengl/legacy/grabber/grabber.pro
+++ b/examples/opengl/legacy/grabber/grabber.pro
@@ -9,4 +9,4 @@ QT += opengl widgets
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/grabber
INSTALLS += target
-contains(QT_CONFIG, opengles.|angle|dynamicgl):error("This example requires Qt to be configured with -opengl desktop")
+qtConfig(opengles.|angle|dynamicgl): error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/hellogl/glwidget.h b/examples/opengl/legacy/hellogl/glwidget.h
index 89446d5937..8154d7405c 100644
--- a/examples/opengl/legacy/hellogl/glwidget.h
+++ b/examples/opengl/legacy/hellogl/glwidget.h
@@ -65,8 +65,8 @@ public:
GLWidget(QWidget *parent = 0);
~GLWidget();
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize minimumSizeHint() const override;
+ QSize sizeHint() const override;
//! [0]
//! [1]
@@ -83,11 +83,11 @@ signals:
//! [2]
protected:
- void initializeGL() Q_DECL_OVERRIDE;
- void paintGL() Q_DECL_OVERRIDE;
- void resizeGL(int width, int height) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void initializeGL() override;
+ void paintGL() override;
+ void resizeGL(int width, int height) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
//! [2]
//! [3]
diff --git a/examples/opengl/legacy/hellogl/hellogl.pro b/examples/opengl/legacy/hellogl/hellogl.pro
index c211242fd2..c6e926c245 100644
--- a/examples/opengl/legacy/hellogl/hellogl.pro
+++ b/examples/opengl/legacy/hellogl/hellogl.pro
@@ -14,4 +14,4 @@ QT += opengl widgets
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/hellogl
INSTALLS += target
-contains(QT_CONFIG, opengles.|angle):error("This example requires Qt to be configured with -opengl desktop")
+qtConfig(opengles.|angle): error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/hellogl/window.h b/examples/opengl/legacy/hellogl/window.h
index 8d684a155b..04e83694a4 100644
--- a/examples/opengl/legacy/hellogl/window.h
+++ b/examples/opengl/legacy/hellogl/window.h
@@ -67,7 +67,7 @@ public:
Window();
protected:
- void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
+ void keyPressEvent(QKeyEvent *event) override;
private:
QSlider *createSlider();
diff --git a/examples/opengl/legacy/legacy.pro b/examples/opengl/legacy/legacy.pro
index 0a74d50f7f..1398332c11 100644
--- a/examples/opengl/legacy/legacy.pro
+++ b/examples/opengl/legacy/legacy.pro
@@ -2,7 +2,7 @@ requires(qtHaveModule(opengl))
TEMPLATE = subdirs
-!contains(QT_CONFIG, dynamicgl): !contains(QT_CONFIG, opengles2) {
+!qtConfig(dynamicgl):!qtConfig(opengles2) {
# legacy desktop-only examples, no dynamic GL support
SUBDIRS = \
grabber \
diff --git a/examples/opengl/legacy/overpainting/glwidget.h b/examples/opengl/legacy/overpainting/glwidget.h
index ffa7922061..e5ea539f6d 100644
--- a/examples/opengl/legacy/overpainting/glwidget.h
+++ b/examples/opengl/legacy/overpainting/glwidget.h
@@ -68,7 +68,7 @@ public:
~GLWidget();
//! [0]
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
int xRotation() const { return xRot; }
int yRotation() const { return yRot; }
int zRotation() const { return zRot; }
@@ -80,12 +80,12 @@ public slots:
//! [1]
protected:
- void initializeGL() Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- void resizeGL(int width, int height) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
+ void initializeGL() override;
+ void paintEvent(QPaintEvent *event) override;
+ void resizeGL(int width, int height) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void showEvent(QShowEvent *event) override;
private slots:
void animate();
diff --git a/examples/opengl/legacy/overpainting/overpainting.pro b/examples/opengl/legacy/overpainting/overpainting.pro
index cc46f18889..17213a6079 100644
--- a/examples/opengl/legacy/overpainting/overpainting.pro
+++ b/examples/opengl/legacy/overpainting/overpainting.pro
@@ -16,4 +16,4 @@ SOURCES = bubble.cpp \
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/overpainting
INSTALLS += target
-contains(QT_CONFIG, opengles.|angle):error("This example requires Qt to be configured with -opengl desktop")
+qtConfig(opengles.|angle): error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/pbuffers/glwidget.h b/examples/opengl/legacy/pbuffers/glwidget.h
index d447abb638..397329c428 100644
--- a/examples/opengl/legacy/pbuffers/glwidget.h
+++ b/examples/opengl/legacy/pbuffers/glwidget.h
@@ -67,11 +67,11 @@ public:
~GLWidget();
protected:
- void initializeGL() Q_DECL_OVERRIDE;
- void paintGL() Q_DECL_OVERRIDE;
- void resizeGL(int width, int height) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE { setAnimationPaused(true); }
- void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE { setAnimationPaused(false); }
+ void initializeGL() override;
+ void paintGL() override;
+ void resizeGL(int width, int height) override;
+ void mousePressEvent(QMouseEvent *) override { setAnimationPaused(true); }
+ void mouseReleaseEvent(QMouseEvent *) override { setAnimationPaused(false); }
private:
void initializeGeometry();
diff --git a/examples/opengl/legacy/pbuffers/pbuffers.pro b/examples/opengl/legacy/pbuffers/pbuffers.pro
index d779a2a2dc..7572ba3583 100644
--- a/examples/opengl/legacy/pbuffers/pbuffers.pro
+++ b/examples/opengl/legacy/pbuffers/pbuffers.pro
@@ -10,4 +10,4 @@ QT += opengl widgets
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/pbuffers
INSTALLS += target
-contains(QT_CONFIG, opengles.|angle|dynamicgl):error("This example requires Qt to be configured with -opengl desktop")
+qtConfig(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 2ba40a6f74..f1baae3931 100644
--- a/examples/opengl/legacy/pbuffers2/pbuffers2.pro
+++ b/examples/opengl/legacy/pbuffers2/pbuffers2.pro
@@ -8,4 +8,4 @@ RESOURCES += pbuffers2.qrc
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/pbuffers2
INSTALLS += target
-contains(QT_CONFIG, opengles.|angle|dynamicgl):error("This example requires Qt to be configured with -opengl desktop")
+qtConfig(opengles.|angle|dynamicgl): error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/samplebuffers/glwidget.h b/examples/opengl/legacy/samplebuffers/glwidget.h
index f46f8e19ac..f02f0835ef 100644
--- a/examples/opengl/legacy/samplebuffers/glwidget.h
+++ b/examples/opengl/legacy/samplebuffers/glwidget.h
@@ -56,10 +56,10 @@ public:
GLWidget(QWidget *parent);
protected:
- void initializeGL() Q_DECL_OVERRIDE;
- void resizeGL(int w, int h) Q_DECL_OVERRIDE;
- void paintGL() Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
+ void initializeGL() override;
+ void resizeGL(int w, int h) override;
+ void paintGL() override;
+ void timerEvent(QTimerEvent *) override;
void makeObject();
void quad(GLenum primitive, GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2,
diff --git a/examples/opengl/legacy/samplebuffers/samplebuffers.pro b/examples/opengl/legacy/samplebuffers/samplebuffers.pro
index 3719f5039d..aca56f8df8 100644
--- a/examples/opengl/legacy/samplebuffers/samplebuffers.pro
+++ b/examples/opengl/legacy/samplebuffers/samplebuffers.pro
@@ -7,4 +7,4 @@ QT += opengl widgets
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/samplebuffers
INSTALLS += target
-contains(QT_CONFIG, opengles.|angle|dynamicgl):error("This example requires Qt to be configured with -opengl desktop")
+qtConfig(opengles.|angle|dynamicgl): error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/paintedwindow/paintedwindow.h b/examples/opengl/paintedwindow/paintedwindow.h
index 73a4b2e63d..7281451924 100644
--- a/examples/opengl/paintedwindow/paintedwindow.h
+++ b/examples/opengl/paintedwindow/paintedwindow.h
@@ -84,8 +84,8 @@ private slots:
void rotationDone();
private:
- void exposeEvent(QExposeEvent *) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
+ void exposeEvent(QExposeEvent *) override;
+ void mousePressEvent(QMouseEvent *) override;
void paint(QPainter *painter, const QRect &rect);
diff --git a/examples/opengl/qopenglwidget/glwidget.h b/examples/opengl/qopenglwidget/glwidget.h
index d677e414f7..de7805a907 100644
--- a/examples/opengl/qopenglwidget/glwidget.h
+++ b/examples/opengl/qopenglwidget/glwidget.h
@@ -85,9 +85,9 @@ private slots:
void handleButtonPress();
protected:
- void resizeGL(int w, int h) Q_DECL_OVERRIDE;
- void paintGL() Q_DECL_OVERRIDE;
- void initializeGL() Q_DECL_OVERRIDE;
+ void resizeGL(int w, int h) override;
+ void paintGL() override;
+ void initializeGL() override;
private:
void paintTexturedCube();
diff --git a/examples/opengl/qopenglwindow/main.cpp b/examples/opengl/qopenglwindow/main.cpp
index 5640acccc7..4287d42d24 100644
--- a/examples/opengl/qopenglwindow/main.cpp
+++ b/examples/opengl/qopenglwindow/main.cpp
@@ -79,9 +79,9 @@ public:
OpenGLWindow();
protected:
- void paintGL() Q_DECL_OVERRIDE;
- void resizeGL(int w, int h) Q_DECL_OVERRIDE;
- void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
+ void paintGL() override;
+ void resizeGL(int w, int h) override;
+ void keyPressEvent(QKeyEvent *e) override;
private:
void setAnimating(bool enabled);
diff --git a/examples/opengl/textures/glwidget.h b/examples/opengl/textures/glwidget.h
index c4c06f3864..0db2695c6a 100644
--- a/examples/opengl/textures/glwidget.h
+++ b/examples/opengl/textures/glwidget.h
@@ -66,8 +66,8 @@ public:
explicit GLWidget(QWidget *parent = 0);
~GLWidget();
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize minimumSizeHint() const override;
+ QSize sizeHint() const override;
void rotateBy(int xAngle, int yAngle, int zAngle);
void setClearColor(const QColor &color);
@@ -75,12 +75,12 @@ signals:
void clicked();
protected:
- void initializeGL() Q_DECL_OVERRIDE;
- void paintGL() Q_DECL_OVERRIDE;
- void resizeGL(int width, int height) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void initializeGL() override;
+ void paintGL() override;
+ void resizeGL(int width, int height) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
private:
void makeObject();
diff --git a/examples/opengl/threadedqopenglwidget/glwidget.h b/examples/opengl/threadedqopenglwidget/glwidget.h
index 8d2d8bbc70..c33f7e51a7 100644
--- a/examples/opengl/threadedqopenglwidget/glwidget.h
+++ b/examples/opengl/threadedqopenglwidget/glwidget.h
@@ -114,7 +114,7 @@ public:
~GLWidget();
protected:
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE { }
+ void paintEvent(QPaintEvent *) override { }
signals:
void renderRequested();
diff --git a/examples/qpa/windows/window.h b/examples/qpa/windows/window.h
index f64bea1676..5647688fbc 100644
--- a/examples/qpa/windows/window.h
+++ b/examples/qpa/windows/window.h
@@ -58,16 +58,16 @@ public:
Window(QScreen *screen);
protected:
- void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE;
+ void mousePressEvent(QMouseEvent *) override;
+ void mouseMoveEvent(QMouseEvent *) override;
+ void mouseReleaseEvent(QMouseEvent *) override;
- void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE;
+ void keyPressEvent(QKeyEvent *) override;
- void exposeEvent(QExposeEvent *) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
+ void exposeEvent(QExposeEvent *) override;
+ void resizeEvent(QResizeEvent *) override;
- void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *) override;
private:
void render();
diff --git a/examples/sql/books/bookdelegate.h b/examples/sql/books/bookdelegate.h
index ba46f7d60a..d07f2b9534 100644
--- a/examples/sql/books/bookdelegate.h
+++ b/examples/sql/books/bookdelegate.h
@@ -64,16 +64,16 @@ public:
BookDelegate(QObject *parent);
void paint(QPainter *painter, const QStyleOptionViewItem &option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
- QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE;
+ QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
bool editorEvent(QEvent *event, QAbstractItemModel *model,
const QStyleOptionViewItem &option,
- const QModelIndex &index) Q_DECL_OVERRIDE;
+ const QModelIndex &index) override;
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
private:
QPixmap star;
diff --git a/examples/sql/drilldown/imageitem.h b/examples/sql/drilldown/imageitem.h
index 7b1c869066..4f773a6dfc 100644
--- a/examples/sql/drilldown/imageitem.h
+++ b/examples/sql/drilldown/imageitem.h
@@ -66,8 +66,8 @@ public:
int id();
protected:
- void hoverEnterEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE;
- void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE;
+ void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
+ void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
private slots:
void setFrame(int frame);
diff --git a/examples/sql/drilldown/view.h b/examples/sql/drilldown/view.h
index 3aecf5ab58..9d6ef0e853 100644
--- a/examples/sql/drilldown/view.h
+++ b/examples/sql/drilldown/view.h
@@ -66,7 +66,7 @@ public:
View(const QString &items, const QString &images, QWidget *parent = 0);
protected:
- void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void mouseReleaseEvent(QMouseEvent *event) override;
//! [0]
//! [1]
diff --git a/examples/sql/querymodel/customsqlmodel.h b/examples/sql/querymodel/customsqlmodel.h
index b9b4dd4f95..5d2f625665 100644
--- a/examples/sql/querymodel/customsqlmodel.h
+++ b/examples/sql/querymodel/customsqlmodel.h
@@ -61,7 +61,7 @@ class CustomSqlModel : public QSqlQueryModel
public:
CustomSqlModel(QObject *parent = 0);
- QVariant data(const QModelIndex &item, int role) const Q_DECL_OVERRIDE;
+ QVariant data(const QModelIndex &item, int role) const override;
};
//! [0]
diff --git a/examples/sql/querymodel/editablesqlmodel.h b/examples/sql/querymodel/editablesqlmodel.h
index b88c9a3fb1..1341dd372a 100644
--- a/examples/sql/querymodel/editablesqlmodel.h
+++ b/examples/sql/querymodel/editablesqlmodel.h
@@ -60,8 +60,8 @@ class EditableSqlModel : public QSqlQueryModel
public:
EditableSqlModel(QObject *parent = 0);
- Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
- bool setData(const QModelIndex &index, const QVariant &value, int role) Q_DECL_OVERRIDE;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
+ bool setData(const QModelIndex &index, const QVariant &value, int role) override;
private:
bool setFirstName(int personId, const QString &firstName);
diff --git a/examples/sql/sqlbrowser/browser.h b/examples/sql/sqlbrowser/browser.h
index 8b36952ce4..fef410778b 100644
--- a/examples/sql/sqlbrowser/browser.h
+++ b/examples/sql/sqlbrowser/browser.h
@@ -117,7 +117,7 @@ class CustomModel: public QSqlTableModel
Q_OBJECT
public:
explicit CustomModel(QObject *parent = 0, QSqlDatabase db = QSqlDatabase()):QSqlTableModel(parent, db) {}
- QVariant data(const QModelIndex &idx, int role) const Q_DECL_OVERRIDE
+ QVariant data(const QModelIndex &idx, int role) const override
{
if (role == Qt::BackgroundRole && isDirty(idx))
return QBrush(QColor(Qt::yellow));
diff --git a/examples/touch/fingerpaint/mainwindow.h b/examples/touch/fingerpaint/mainwindow.h
index 3686947065..47c339050e 100644
--- a/examples/touch/fingerpaint/mainwindow.h
+++ b/examples/touch/fingerpaint/mainwindow.h
@@ -65,7 +65,7 @@ public:
MainWindow();
protected:
- void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
+ void closeEvent(QCloseEvent *event) override;
private slots:
void open();
diff --git a/examples/touch/fingerpaint/scribblearea.h b/examples/touch/fingerpaint/scribblearea.h
index d81414e8b9..5138e3a1ab 100644
--- a/examples/touch/fingerpaint/scribblearea.h
+++ b/examples/touch/fingerpaint/scribblearea.h
@@ -74,9 +74,9 @@ public slots:
void print();
protected:
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
+ void resizeEvent(QResizeEvent *event) override;
+ bool event(QEvent *event) override;
private:
void resizeImage(QImage *image, const QSize &newSize);
diff --git a/examples/touch/knobs/knob.h b/examples/touch/knobs/knob.h
index b35b16aabe..c16b61d6f1 100644
--- a/examples/touch/knobs/knob.h
+++ b/examples/touch/knobs/knob.h
@@ -58,7 +58,7 @@ class Knob : public QGraphicsEllipseItem
public:
Knob();
- bool sceneEvent(QEvent *event) Q_DECL_OVERRIDE;
+ bool sceneEvent(QEvent *event) override;
};
#endif // KNOB_H
diff --git a/examples/touch/pinchzoom/graphicsview.h b/examples/touch/pinchzoom/graphicsview.h
index f9dbc43980..d4e2e32d36 100644
--- a/examples/touch/pinchzoom/graphicsview.h
+++ b/examples/touch/pinchzoom/graphicsview.h
@@ -58,7 +58,7 @@ class GraphicsView : public QGraphicsView
public:
GraphicsView(QGraphicsScene *scene = 0, QWidget *parent = 0);
- bool viewportEvent(QEvent *event) Q_DECL_OVERRIDE;
+ bool viewportEvent(QEvent *event) override;
private:
qreal totalScaleFactor;
diff --git a/examples/touch/pinchzoom/mouse.h b/examples/touch/pinchzoom/mouse.h
index a01c4d629c..870bfcd6c0 100644
--- a/examples/touch/pinchzoom/mouse.h
+++ b/examples/touch/pinchzoom/mouse.h
@@ -61,13 +61,13 @@ class Mouse : public QGraphicsObject
public:
Mouse();
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- QPainterPath shape() const Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ QPainterPath shape() const override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
- QWidget *widget) Q_DECL_OVERRIDE;
+ QWidget *widget) override;
protected:
- void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *event) override;
private:
qreal angle;
diff --git a/examples/widgets/animation/animatedtiles/main.cpp b/examples/widgets/animation/animatedtiles/main.cpp
index 2202f6194b..0511fe8162 100644
--- a/examples/widgets/animation/animatedtiles/main.cpp
+++ b/examples/widgets/animation/animatedtiles/main.cpp
@@ -75,19 +75,19 @@ public:
setCacheMode(DeviceCoordinateCache);
}
- QRectF boundingRect() const Q_DECL_OVERRIDE
+ QRectF boundingRect() const override
{
return QRectF(-65, -65, 130, 130);
}
- QPainterPath shape() const Q_DECL_OVERRIDE
+ QPainterPath shape() const override
{
QPainterPath path;
path.addEllipse(boundingRect());
return path;
}
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *) Q_DECL_OVERRIDE
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *) override
{
bool down = option->state & QStyle::State_Sunken;
QRectF r = boundingRect();
@@ -112,13 +112,13 @@ signals:
void pressed();
protected:
- void mousePressEvent(QGraphicsSceneMouseEvent *) Q_DECL_OVERRIDE
+ void mousePressEvent(QGraphicsSceneMouseEvent *) override
{
emit pressed();
update();
}
- void mouseReleaseEvent(QGraphicsSceneMouseEvent *) Q_DECL_OVERRIDE
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *) override
{
update();
}
@@ -133,7 +133,7 @@ public:
View(QGraphicsScene *scene) : QGraphicsView(scene) { }
protected:
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE
+ void resizeEvent(QResizeEvent *event) override
{
QGraphicsView::resizeEvent(event);
fitInView(sceneRect(), Qt::KeepAspectRatio);
diff --git a/examples/widgets/animation/appchooser/main.cpp b/examples/widgets/animation/appchooser/main.cpp
index 59611274ef..c9821450c9 100644
--- a/examples/widgets/animation/appchooser/main.cpp
+++ b/examples/widgets/animation/appchooser/main.cpp
@@ -62,17 +62,17 @@ public:
{
}
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) Q_DECL_OVERRIDE
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override
{
painter->drawPixmap(QPointF(), p);
}
- virtual void mousePressEvent(QGraphicsSceneMouseEvent * ) Q_DECL_OVERRIDE
+ virtual void mousePressEvent(QGraphicsSceneMouseEvent *) override
{
emit clicked();
}
- virtual void setGeometry(const QRectF &rect) Q_DECL_OVERRIDE
+ virtual void setGeometry(const QRectF &rect) override
{
QGraphicsWidget::setGeometry(rect);
@@ -98,7 +98,7 @@ public:
{
}
- virtual void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE
+ virtual void resizeEvent(QResizeEvent *) override
{
fitInView(sceneRect(), Qt::KeepAspectRatio);
}
diff --git a/examples/widgets/animation/easing/animation.h b/examples/widgets/animation/easing/animation.h
index f8373ef686..696257bb4a 100644
--- a/examples/widgets/animation/easing/animation.h
+++ b/examples/widgets/animation/easing/animation.h
@@ -77,7 +77,7 @@ public:
m_path = QPainterPath();
}
- void updateCurrentTime(int currentTime) Q_DECL_OVERRIDE
+ void updateCurrentTime(int currentTime) override
{
if (m_pathType == CirclePath) {
if (m_path.isEmpty()) {
diff --git a/examples/widgets/animation/moveblocks/main.cpp b/examples/widgets/animation/moveblocks/main.cpp
index 3b271339e4..f85211ef88 100644
--- a/examples/widgets/animation/moveblocks/main.cpp
+++ b/examples/widgets/animation/moveblocks/main.cpp
@@ -80,7 +80,7 @@ class QGraphicsRectWidget : public QGraphicsWidget
{
public:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *,
- QWidget *) Q_DECL_OVERRIDE
+ QWidget *) override
{
painter->fillRect(rect(), Qt::blue);
}
@@ -98,14 +98,14 @@ public:
protected:
//![14]
- virtual bool eventTest(QEvent *event) Q_DECL_OVERRIDE
+ virtual bool eventTest(QEvent *event) override
{
return (event->type() == QEvent::Type(StateSwitchEvent::StateSwitchType))
&& (static_cast<StateSwitchEvent *>(event)->rand() == m_rand);
}
//![14]
- virtual void onTransition(QEvent *) Q_DECL_OVERRIDE {}
+ virtual void onTransition(QEvent *) override {}
private:
int m_rand;
@@ -122,7 +122,7 @@ public:
//![10]
//![11]
- virtual void onEntry(QEvent *) Q_DECL_OVERRIDE
+ virtual void onEntry(QEvent *) override
{
int n;
while ((n = (qrand() % m_stateCount + 1)) == m_lastIndex)
@@ -130,7 +130,7 @@ public:
m_lastIndex = n;
machine()->postEvent(new StateSwitchEvent(n));
}
- virtual void onExit(QEvent *) Q_DECL_OVERRIDE {}
+ virtual void onExit(QEvent *) override {}
//![11]
//![12]
@@ -174,7 +174,7 @@ public:
}
protected:
- virtual void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE
+ virtual void resizeEvent(QResizeEvent *event) override
{
fitInView(scene()->sceneRect());
QGraphicsView::resizeEvent(event);
diff --git a/examples/widgets/animation/states/main.cpp b/examples/widgets/animation/states/main.cpp
index 1c5cb2d12d..a3c7256933 100644
--- a/examples/widgets/animation/states/main.cpp
+++ b/examples/widgets/animation/states/main.cpp
@@ -58,12 +58,12 @@ public:
{
}
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) Q_DECL_OVERRIDE
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override
{
painter->drawPixmap(QPointF(), p);
}
- QRectF boundingRect() const Q_DECL_OVERRIDE
+ QRectF boundingRect() const override
{
return QRectF( QPointF(0, 0), p.size());
}
@@ -79,7 +79,7 @@ public:
{
}
- virtual void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE
+ virtual void resizeEvent(QResizeEvent *) override
{
fitInView(sceneRect(), Qt::KeepAspectRatio);
}
diff --git a/examples/widgets/animation/stickman/graphicsview.h b/examples/widgets/animation/stickman/graphicsview.h
index 64201f4e3d..4b9b8fc028 100644
--- a/examples/widgets/animation/stickman/graphicsview.h
+++ b/examples/widgets/animation/stickman/graphicsview.h
@@ -61,8 +61,8 @@ public:
GraphicsView(QWidget *parent = 0);
protected:
- virtual void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
- void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE;
+ virtual void resizeEvent(QResizeEvent *event) override;
+ void keyPressEvent(QKeyEvent *) override;
signals:
void keyPressed(int key);
diff --git a/examples/widgets/animation/stickman/lifecycle.cpp b/examples/widgets/animation/stickman/lifecycle.cpp
index c0623d02fe..0ece4f3932 100644
--- a/examples/widgets/animation/stickman/lifecycle.cpp
+++ b/examples/widgets/animation/stickman/lifecycle.cpp
@@ -70,7 +70,7 @@ public:
setTargetState(target);
}
- virtual bool eventTest(QEvent *e) Q_DECL_OVERRIDE
+ virtual bool eventTest(QEvent *e) override
{
if (QSignalTransition::eventTest(e)) {
QVariant key = static_cast<QStateMachine::SignalEvent*>(e)->arguments().at(0);
@@ -91,11 +91,11 @@ public:
: QEventTransition(this, QEvent::Timer)
{
setTargetState(target);
- qsrand((uint)QDateTime::currentDateTime().toTime_t());
+ qsrand((uint)QDateTime::currentSecsSinceEpoch());
startTimer(1000);
}
- virtual bool eventTest(QEvent *e) Q_DECL_OVERRIDE
+ virtual bool eventTest(QEvent *e) override
{
return QEventTransition::eventTest(e) && ((qrand() % 50) == 0);
}
diff --git a/examples/widgets/animation/stickman/node.h b/examples/widgets/animation/stickman/node.h
index cdf2df46cb..679999b7e8 100644
--- a/examples/widgets/animation/stickman/node.h
+++ b/examples/widgets/animation/stickman/node.h
@@ -60,18 +60,18 @@ public:
explicit Node(const QPointF &pos, QGraphicsItem *parent = 0);
~Node();
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
signals:
void positionChanged();
protected:
- QVariant itemChange(GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE;
+ QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
- void mousePressEvent(QGraphicsSceneMouseEvent *) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QGraphicsSceneMouseEvent *) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QGraphicsSceneMouseEvent *) Q_DECL_OVERRIDE;
+ void mousePressEvent(QGraphicsSceneMouseEvent *) override;
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *) override;
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *) override;
private:
bool m_dragging;
diff --git a/examples/widgets/animation/stickman/rectbutton.h b/examples/widgets/animation/stickman/rectbutton.h
index 79902c9d38..864a2c179e 100644
--- a/examples/widgets/animation/stickman/rectbutton.h
+++ b/examples/widgets/animation/stickman/rectbutton.h
@@ -60,13 +60,13 @@ public:
RectButton(QString buttonText);
~RectButton();
- virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
+ virtual QRectF boundingRect() const override;
+ virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
protected:
QString m_ButtonText;
- virtual void mousePressEvent (QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
+ virtual void mousePressEvent (QGraphicsSceneMouseEvent *event) override;
signals:
void clicked();
diff --git a/examples/widgets/animation/stickman/stickman.h b/examples/widgets/animation/stickman/stickman.h
index 302de06704..b5fbd14872 100644
--- a/examples/widgets/animation/stickman/stickman.h
+++ b/examples/widgets/animation/stickman/stickman.h
@@ -69,8 +69,8 @@ public:
StickMan();
~StickMan();
- virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
+ virtual QRectF boundingRect() const override;
+ virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
int nodeCount() const;
Node *node(int idx) const;
@@ -92,7 +92,7 @@ public slots:
void childPositionChanged();
protected:
- void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *e) override;
private:
diff --git a/examples/widgets/animation/sub-attaq/boat.h b/examples/widgets/animation/sub-attaq/boat.h
index 4b7b20c390..24b004a108 100644
--- a/examples/widgets/animation/sub-attaq/boat.h
+++ b/examples/widgets/animation/sub-attaq/boat.h
@@ -86,7 +86,7 @@ public:
void updateBoatMovement();
- virtual int type() const Q_DECL_OVERRIDE;
+ virtual int type() const override;
signals:
void boatDestroyed();
diff --git a/examples/widgets/animation/sub-attaq/boat_p.h b/examples/widgets/animation/sub-attaq/boat_p.h
index 6d3c3f69f8..5cad6bde96 100644
--- a/examples/widgets/animation/sub-attaq/boat_p.h
+++ b/examples/widgets/animation/sub-attaq/boat_p.h
@@ -81,7 +81,7 @@ public:
{
}
protected:
- virtual bool eventTest(QEvent *event) Q_DECL_OVERRIDE
+ virtual bool eventTest(QEvent *event) override
{
if (!QKeyEventTransition::eventTest(event))
return false;
@@ -100,13 +100,13 @@ public:
{
}
protected:
- virtual bool eventTest(QEvent *event) Q_DECL_OVERRIDE
+ virtual bool eventTest(QEvent *event) override
{
if (!QKeyEventTransition::eventTest(event))
return false;
return (boat->currentSpeed() >= 0);
}
- void onTransition(QEvent *) Q_DECL_OVERRIDE
+ void onTransition(QEvent *) override
{
//We decrease the speed if needed
if (key == Qt::Key_Left && boat->currentDirection() == Boat::Right)
@@ -131,7 +131,7 @@ public:
{
}
protected:
- virtual bool eventTest(QEvent *event) Q_DECL_OVERRIDE
+ virtual bool eventTest(QEvent *event) override
{
if (!QKeyEventTransition::eventTest(event))
return false;
@@ -150,7 +150,7 @@ public:
{
}
protected:
- void onEntry(QEvent *) Q_DECL_OVERRIDE
+ void onEntry(QEvent *) override
{
boat->setCurrentDirection(Boat::Right);
boat->updateBoatMovement();
@@ -167,7 +167,7 @@ public:
{
}
protected:
- void onEntry(QEvent *) Q_DECL_OVERRIDE
+ void onEntry(QEvent *) override
{
boat->setCurrentDirection(Boat::Left);
boat->updateBoatMovement();
@@ -184,7 +184,7 @@ public:
{
}
protected:
- void onEntry(QEvent *) Q_DECL_OVERRIDE
+ void onEntry(QEvent *) override
{
boat->setCurrentSpeed(0);
boat->setCurrentDirection(Boat::None);
@@ -202,7 +202,7 @@ public:
{
}
protected:
- void onEntry(QEvent *) Q_DECL_OVERRIDE
+ void onEntry(QEvent *) override
{
Bomb *b = new Bomb();
b->setPos(boat->x()+boat->size().width(),boat->y());
@@ -223,7 +223,7 @@ public:
{
}
protected:
- void onEntry(QEvent *) Q_DECL_OVERRIDE
+ void onEntry(QEvent *) override
{
Bomb *b = new Bomb();
b->setPos(boat->x() - b->size().width(), boat->y());
diff --git a/examples/widgets/animation/sub-attaq/pixmapitem.h b/examples/widgets/animation/sub-attaq/pixmapitem.h
index 139537bcc9..de8ed67a38 100644
--- a/examples/widgets/animation/sub-attaq/pixmapitem.h
+++ b/examples/widgets/animation/sub-attaq/pixmapitem.h
@@ -63,8 +63,8 @@ public:
PixmapItem(const QString &fileName, GraphicsScene::Mode mode, QGraphicsItem * parent = 0);
PixmapItem(const QString &fileName, QGraphicsScene *scene);
QSizeF size() const;
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override;
private:
QPixmap pix;
};
diff --git a/examples/widgets/animation/sub-attaq/qanimationstate.h b/examples/widgets/animation/sub-attaq/qanimationstate.h
index b4afdd699d..06ab4dfbcf 100644
--- a/examples/widgets/animation/sub-attaq/qanimationstate.h
+++ b/examples/widgets/animation/sub-attaq/qanimationstate.h
@@ -80,9 +80,9 @@ signals:
void animationFinished();
protected:
- void onEntry(QEvent *) Q_DECL_OVERRIDE;
- void onExit(QEvent *) Q_DECL_OVERRIDE;
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ void onEntry(QEvent *) override;
+ void onExit(QEvent *) override;
+ bool event(QEvent *e) override;
private:
Q_DISABLE_COPY(QAnimationState)
diff --git a/examples/widgets/animation/sub-attaq/states.h b/examples/widgets/animation/sub-attaq/states.h
index 5b6b38bee7..1d50abbf02 100644
--- a/examples/widgets/animation/sub-attaq/states.h
+++ b/examples/widgets/animation/sub-attaq/states.h
@@ -72,7 +72,7 @@ public:
~PlayState();
protected:
- void onEntry(QEvent *) Q_DECL_OVERRIDE;
+ void onEntry(QEvent *) override;
private :
GraphicsScene *scene;
@@ -94,7 +94,7 @@ class LevelState : public QState
public:
LevelState(GraphicsScene *scene, PlayState *game, QState *parent = 0);
protected:
- void onEntry(QEvent *) Q_DECL_OVERRIDE;
+ void onEntry(QEvent *) override;
private :
void initializeLevel();
GraphicsScene *scene;
@@ -107,8 +107,8 @@ public:
explicit PauseState(GraphicsScene *scene, QState *parent = 0);
protected:
- void onEntry(QEvent *) Q_DECL_OVERRIDE;
- void onExit(QEvent *) Q_DECL_OVERRIDE;
+ void onEntry(QEvent *) override;
+ void onExit(QEvent *) override;
private :
GraphicsScene *scene;
};
@@ -119,8 +119,8 @@ public:
LostState(GraphicsScene *scene, PlayState *game, QState *parent = 0);
protected:
- void onEntry(QEvent *) Q_DECL_OVERRIDE;
- void onExit(QEvent *) Q_DECL_OVERRIDE;
+ void onEntry(QEvent *) override;
+ void onExit(QEvent *) override;
private :
GraphicsScene *scene;
PlayState *game;
@@ -132,8 +132,8 @@ public:
WinState(GraphicsScene *scene, PlayState *game, QState *parent = 0);
protected:
- void onEntry(QEvent *) Q_DECL_OVERRIDE;
- void onExit(QEvent *) Q_DECL_OVERRIDE;
+ void onEntry(QEvent *) override;
+ void onExit(QEvent *) override;
private :
GraphicsScene *scene;
PlayState *game;
@@ -152,7 +152,7 @@ class UpdateScoreTransition : public QSignalTransition
public:
UpdateScoreTransition(GraphicsScene *scene, PlayState *game, QAbstractState *target);
protected:
- virtual bool eventTest(QEvent *event) Q_DECL_OVERRIDE;
+ virtual bool eventTest(QEvent *event) override;
private:
PlayState * game;
GraphicsScene *scene;
@@ -164,7 +164,7 @@ class WinTransition : public QSignalTransition
public:
WinTransition(GraphicsScene *scene, PlayState *game, QAbstractState *target);
protected:
- virtual bool eventTest(QEvent *event) Q_DECL_OVERRIDE;
+ virtual bool eventTest(QEvent *event) override;
private:
PlayState * game;
GraphicsScene *scene;
@@ -176,7 +176,7 @@ private:
public:
CustomSpaceTransition(QWidget *widget, PlayState *game, QEvent::Type type, int key);
protected:
- virtual bool eventTest(QEvent *event) Q_DECL_OVERRIDE;
+ virtual bool eventTest(QEvent *event) override;
private:
PlayState *game;
};
diff --git a/examples/widgets/animation/sub-attaq/submarine.h b/examples/widgets/animation/sub-attaq/submarine.h
index 179fe62ed0..abfdca6195 100644
--- a/examples/widgets/animation/sub-attaq/submarine.h
+++ b/examples/widgets/animation/sub-attaq/submarine.h
@@ -81,7 +81,7 @@ public:
void launchTorpedo(int speed);
void destroy();
- virtual int type() const Q_DECL_OVERRIDE;
+ virtual int type() const override;
QGraphicsRotation *rotation() const { return graphicsRotation; }
diff --git a/examples/widgets/animation/sub-attaq/submarine_p.h b/examples/widgets/animation/sub-attaq/submarine_p.h
index 72aa761ed4..b8d5532962 100644
--- a/examples/widgets/animation/sub-attaq/submarine_p.h
+++ b/examples/widgets/animation/sub-attaq/submarine_p.h
@@ -93,7 +93,7 @@ protected slots:
}
protected:
- void onEntry(QEvent *e) Q_DECL_OVERRIDE
+ void onEntry(QEvent *e) override
{
if (submarine->currentDirection() == SubMarine::Left) {
movementAnimation->setEndValue(QPointF(0,submarine->y()));
@@ -125,14 +125,14 @@ public:
}
protected:
- void onEntry(QEvent *e) Q_DECL_OVERRIDE
+ void onEntry(QEvent *e) override
{
returnAnimation->stop();
returnAnimation->setEndValue(submarine->currentDirection() == SubMarine::Right ? 360. : 180.);
QAnimationState::onEntry(e);
}
- void onExit(QEvent *e) Q_DECL_OVERRIDE
+ void onExit(QEvent *e) override
{
submarine->currentDirection() == SubMarine::Right ? submarine->setCurrentDirection(SubMarine::Left) : submarine->setCurrentDirection(SubMarine::Right);
QAnimationState::onExit(e);
diff --git a/examples/widgets/desktop/screenshot/screenshot.h b/examples/widgets/desktop/screenshot/screenshot.h
index 6db722fa76..240952120d 100644
--- a/examples/widgets/desktop/screenshot/screenshot.h
+++ b/examples/widgets/desktop/screenshot/screenshot.h
@@ -74,7 +74,7 @@ public:
Screenshot();
protected:
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
+ void resizeEvent(QResizeEvent *event) override;
private slots:
void newScreenshot();
diff --git a/examples/widgets/desktop/systray/window.h b/examples/widgets/desktop/systray/window.h
index b9ebe2c57f..001338df0c 100644
--- a/examples/widgets/desktop/systray/window.h
+++ b/examples/widgets/desktop/systray/window.h
@@ -78,10 +78,10 @@ class Window : public QDialog
public:
Window();
- void setVisible(bool visible) Q_DECL_OVERRIDE;
+ void setVisible(bool visible) override;
protected:
- void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
+ void closeEvent(QCloseEvent *event) override;
private slots:
void setIcon(int index);
diff --git a/examples/widgets/dialogs/classwizard/classwizard.h b/examples/widgets/dialogs/classwizard/classwizard.h
index 8be08f180c..fee0f6df66 100644
--- a/examples/widgets/dialogs/classwizard/classwizard.h
+++ b/examples/widgets/dialogs/classwizard/classwizard.h
@@ -69,7 +69,7 @@ class ClassWizard : public QWizard
public:
ClassWizard(QWidget *parent = 0);
- void accept() Q_DECL_OVERRIDE;
+ void accept() override;
};
//! [0]
@@ -117,7 +117,7 @@ public:
CodeStylePage(QWidget *parent = 0);
protected:
- void initializePage() Q_DECL_OVERRIDE;
+ void initializePage() override;
private:
QCheckBox *commentCheckBox;
@@ -138,7 +138,7 @@ public:
OutputFilesPage(QWidget *parent = 0);
protected:
- void initializePage() Q_DECL_OVERRIDE;
+ void initializePage() override;
private:
QLabel *outputDirLabel;
@@ -157,7 +157,7 @@ public:
ConclusionPage(QWidget *parent = 0);
protected:
- void initializePage() Q_DECL_OVERRIDE;
+ void initializePage() override;
private:
QLabel *label;
diff --git a/examples/widgets/dialogs/licensewizard/licensewizard.h b/examples/widgets/dialogs/licensewizard/licensewizard.h
index 4e7e6feb09..c7709d88b3 100644
--- a/examples/widgets/dialogs/licensewizard/licensewizard.h
+++ b/examples/widgets/dialogs/licensewizard/licensewizard.h
@@ -88,7 +88,7 @@ class IntroPage : public QWizardPage
public:
IntroPage(QWidget *parent = 0);
- int nextId() const Q_DECL_OVERRIDE;
+ int nextId() const override;
private:
QLabel *topLabel;
@@ -105,7 +105,7 @@ class EvaluatePage : public QWizardPage
public:
EvaluatePage(QWidget *parent = 0);
- int nextId() const Q_DECL_OVERRIDE;
+ int nextId() const override;
private:
QLabel *nameLabel;
@@ -122,7 +122,7 @@ class RegisterPage : public QWizardPage
public:
RegisterPage(QWidget *parent = 0);
- int nextId() const Q_DECL_OVERRIDE;
+ int nextId() const override;
private:
QLabel *nameLabel;
@@ -138,7 +138,7 @@ class DetailsPage : public QWizardPage
public:
DetailsPage(QWidget *parent = 0);
- int nextId() const Q_DECL_OVERRIDE;
+ int nextId() const override;
private:
QLabel *companyLabel;
@@ -157,9 +157,9 @@ class ConclusionPage : public QWizardPage
public:
ConclusionPage(QWidget *parent = 0);
- void initializePage() Q_DECL_OVERRIDE;
- int nextId() const Q_DECL_OVERRIDE;
- void setVisible(bool visible) Q_DECL_OVERRIDE;
+ void initializePage() override;
+ int nextId() const override;
+ void setVisible(bool visible) override;
private slots:
void printButtonClicked();
diff --git a/examples/widgets/draganddrop/draganddrop.pro b/examples/widgets/draganddrop/draganddrop.pro
index eb678eecd8..1ecafd33a1 100644
--- a/examples/widgets/draganddrop/draganddrop.pro
+++ b/examples/widgets/draganddrop/draganddrop.pro
@@ -4,5 +4,3 @@ SUBDIRS = draggableicons \
dropsite \
fridgemagnets \
puzzle
-
-wince: SUBDIRS -= dropsite
diff --git a/examples/widgets/draganddrop/draggableicons/dragwidget.h b/examples/widgets/draganddrop/draggableicons/dragwidget.h
index 3d02742530..18be074b61 100644
--- a/examples/widgets/draganddrop/draggableicons/dragwidget.h
+++ b/examples/widgets/draganddrop/draggableicons/dragwidget.h
@@ -65,10 +65,10 @@ public:
DragWidget(QWidget *parent = 0);
protected:
- void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
- void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE;
- void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void dragEnterEvent(QDragEnterEvent *event) override;
+ void dragMoveEvent(QDragMoveEvent *event) override;
+ void dropEvent(QDropEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
};
//! [0]
diff --git a/examples/widgets/draganddrop/draggabletext/dragwidget.h b/examples/widgets/draganddrop/draggabletext/dragwidget.h
index aa686fd4a4..24d1f6f5c7 100644
--- a/examples/widgets/draganddrop/draggabletext/dragwidget.h
+++ b/examples/widgets/draganddrop/draggabletext/dragwidget.h
@@ -64,9 +64,9 @@ public:
DragWidget(QWidget *parent = 0);
protected:
- void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
- void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void dragEnterEvent(QDragEnterEvent *event) override;
+ void dropEvent(QDropEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
};
#endif // DRAGWIDGET_H
diff --git a/examples/widgets/draganddrop/dropsite/droparea.h b/examples/widgets/draganddrop/dropsite/droparea.h
index 71084318c1..5b6e209dfa 100644
--- a/examples/widgets/draganddrop/dropsite/droparea.h
+++ b/examples/widgets/draganddrop/dropsite/droparea.h
@@ -74,10 +74,10 @@ signals:
//! [DropArea header part2]
protected:
- void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
- void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE;
- void dragLeaveEvent(QDragLeaveEvent *event) Q_DECL_OVERRIDE;
- void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
+ void dragEnterEvent(QDragEnterEvent *event) override;
+ void dragMoveEvent(QDragMoveEvent *event) override;
+ void dragLeaveEvent(QDragLeaveEvent *event) override;
+ void dropEvent(QDropEvent *event) override;
private:
QLabel *label;
diff --git a/examples/widgets/draganddrop/fridgemagnets/dragwidget.h b/examples/widgets/draganddrop/fridgemagnets/dragwidget.h
index 1117822fe2..104e500134 100644
--- a/examples/widgets/draganddrop/fridgemagnets/dragwidget.h
+++ b/examples/widgets/draganddrop/fridgemagnets/dragwidget.h
@@ -65,10 +65,10 @@ public:
DragWidget(QWidget *parent = 0);
protected:
- void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
- void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE;
- void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void dragEnterEvent(QDragEnterEvent *event) override;
+ void dragMoveEvent(QDragMoveEvent *event) override;
+ void dropEvent(QDropEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
};
//! [0]
diff --git a/examples/widgets/draganddrop/puzzle/pieceslist.h b/examples/widgets/draganddrop/puzzle/pieceslist.h
index 2cd6c83373..b67d2bdaf7 100644
--- a/examples/widgets/draganddrop/puzzle/pieceslist.h
+++ b/examples/widgets/draganddrop/puzzle/pieceslist.h
@@ -64,10 +64,10 @@ public:
static QString puzzleMimeType() { return QStringLiteral("image/x-puzzle-piece"); }
protected:
- void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
- void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE;
- void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
- void startDrag(Qt::DropActions supportedActions) Q_DECL_OVERRIDE;
+ void dragEnterEvent(QDragEnterEvent *event) override;
+ void dragMoveEvent(QDragMoveEvent *event) override;
+ void dropEvent(QDropEvent *event) override;
+ void startDrag(Qt::DropActions supportedActions) override;
int m_PieceSize;
};
diff --git a/examples/widgets/draganddrop/puzzle/puzzle.pro b/examples/widgets/draganddrop/puzzle/puzzle.pro
index 404b75187d..97e7206682 100644
--- a/examples/widgets/draganddrop/puzzle/puzzle.pro
+++ b/examples/widgets/draganddrop/puzzle/puzzle.pro
@@ -14,9 +14,3 @@ QMAKE_PROJECT_NAME = dndpuzzle
# install
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/draganddrop/puzzle
INSTALLS += target
-
-wince {
- addFile.files = example.jpg
- addFile.path = .
- INSTALLS += addFile
-}
diff --git a/examples/widgets/draganddrop/puzzle/puzzlewidget.h b/examples/widgets/draganddrop/puzzle/puzzlewidget.h
index 48c66b7b58..7dcb7dd497 100644
--- a/examples/widgets/draganddrop/puzzle/puzzlewidget.h
+++ b/examples/widgets/draganddrop/puzzle/puzzlewidget.h
@@ -77,12 +77,12 @@ signals:
void puzzleCompleted();
protected:
- void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
- void dragLeaveEvent(QDragLeaveEvent *event) Q_DECL_OVERRIDE;
- void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE;
- void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
+ void dragEnterEvent(QDragEnterEvent *event) override;
+ void dragLeaveEvent(QDragLeaveEvent *event) override;
+ void dragMoveEvent(QDragMoveEvent *event) override;
+ void dropEvent(QDropEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
private:
const QRect targetSquare(const QPoint &position) const;
diff --git a/examples/widgets/effects/blurpicker/blureffect.h b/examples/widgets/effects/blurpicker/blureffect.h
index 2ae2519bd7..241a0ea535 100644
--- a/examples/widgets/effects/blurpicker/blureffect.h
+++ b/examples/widgets/effects/blurpicker/blureffect.h
@@ -63,7 +63,7 @@ public:
QRectF boundingRect() const;
- void draw(QPainter *painter) Q_DECL_OVERRIDE;
+ void draw(QPainter *painter) override;
private:
void adjustForItem();
diff --git a/examples/widgets/effects/blurpicker/blurpicker.h b/examples/widgets/effects/blurpicker/blurpicker.h
index ba004a0a2b..3f444419a8 100644
--- a/examples/widgets/effects/blurpicker/blurpicker.h
+++ b/examples/widgets/effects/blurpicker/blurpicker.h
@@ -69,9 +69,9 @@ public:
void setIndex(qreal);
protected:
- void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void keyPressEvent(QKeyEvent *event) override;
+ void resizeEvent(QResizeEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
private:
void setupScene();
diff --git a/examples/widgets/effects/lighting/lighting.h b/examples/widgets/effects/lighting/lighting.h
index e77024b1c6..615824d46f 100644
--- a/examples/widgets/effects/lighting/lighting.h
+++ b/examples/widgets/effects/lighting/lighting.h
@@ -68,7 +68,7 @@ private:
void setupScene();
protected:
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
+ void resizeEvent(QResizeEvent *event) override;
private:
qreal angle;
diff --git a/examples/widgets/gestures/imagegestures/imagewidget.h b/examples/widgets/gestures/imagegestures/imagewidget.h
index 9ffc7491de..5e92541067 100644
--- a/examples/widgets/gestures/imagegestures/imagewidget.h
+++ b/examples/widgets/gestures/imagegestures/imagewidget.h
@@ -75,10 +75,10 @@ public:
void grabGestures(const QList<Qt::GestureType> &gestures);
protected:
- bool event(QEvent *event) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
- void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
+ void resizeEvent(QResizeEvent *event) override;
+ void mouseDoubleClickEvent(QMouseEvent *event) override;
private:
bool gestureEvent(QGestureEvent *event);
diff --git a/examples/widgets/graphicsview/basicgraphicslayouts/layoutitem.h b/examples/widgets/graphicsview/basicgraphicslayouts/layoutitem.h
index 8a940738a6..3535a26670 100644
--- a/examples/widgets/graphicsview/basicgraphicslayouts/layoutitem.h
+++ b/examples/widgets/graphicsview/basicgraphicslayouts/layoutitem.h
@@ -61,12 +61,12 @@ public:
LayoutItem(QGraphicsItem *parent = 0);
~LayoutItem();
// Inherited from QGraphicsLayoutItem
- void setGeometry(const QRectF &geom) Q_DECL_OVERRIDE;
- QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const Q_DECL_OVERRIDE;
+ void setGeometry(const QRectF &geom) override;
+ QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const override;
// Inherited from QGraphicsItem
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) override;
private:
QPixmap *m_pix;
diff --git a/examples/widgets/graphicsview/boxes/boxes.pro b/examples/widgets/graphicsview/boxes/boxes.pro
index 38aae1c2c4..afdca816b1 100644
--- a/examples/widgets/graphicsview/boxes/boxes.pro
+++ b/examples/widgets/graphicsview/boxes/boxes.pro
@@ -1,6 +1,6 @@
QT += opengl widgets
-contains(QT_CONFIG, opengles.|angle|dynamicgl):error("This example requires Qt to be configured with -opengl desktop")
+qtConfig(opengles.|angle|dynamicgl): error("This example requires Qt to be configured with -opengl desktop")
HEADERS += 3rdparty/fbm.h \
glbuffers.h \
@@ -24,7 +24,3 @@ RESOURCES += boxes.qrc
# install
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/graphicsview/boxes
INSTALLS += target
-
-wince {
- DEPLOYMENT_PLUGIN += qjpeg
-}
diff --git a/examples/widgets/graphicsview/boxes/glbuffers.h b/examples/widgets/graphicsview/boxes/glbuffers.h
index 25ab66fca6..0c2ff43c7e 100644
--- a/examples/widgets/graphicsview/boxes/glbuffers.h
+++ b/examples/widgets/graphicsview/boxes/glbuffers.h
@@ -110,8 +110,8 @@ public:
GLTexture2D(int width, int height);
explicit GLTexture2D(const QString& fileName, int width = 0, int height = 0);
void load(int width, int height, QRgb *data);
- virtual void bind() Q_DECL_OVERRIDE;
- virtual void unbind() Q_DECL_OVERRIDE;
+ virtual void bind() override;
+ virtual void unbind() override;
};
class GLTexture3D : public GLTexture
@@ -121,8 +121,8 @@ public:
// TODO: Implement function below
//GLTexture3D(const QString& fileName, int width = 0, int height = 0);
void load(int width, int height, int depth, QRgb *data);
- virtual void bind() Q_DECL_OVERRIDE;
- virtual void unbind() Q_DECL_OVERRIDE;
+ virtual void bind() override;
+ virtual void unbind() override;
};
class GLTextureCube : public GLTexture
@@ -131,8 +131,8 @@ public:
GLTextureCube(int size);
explicit GLTextureCube(const QStringList& fileNames, int size = 0);
void load(int size, int face, QRgb *data);
- virtual void bind() Q_DECL_OVERRIDE;
- virtual void unbind() Q_DECL_OVERRIDE;
+ virtual void bind() override;
+ virtual void unbind() override;
};
// TODO: Define and implement class below
@@ -146,7 +146,7 @@ public:
void begin(int face);
// end rendering
void end();
- virtual bool failed() const Q_DECL_OVERRIDE {return m_failed || m_fbo.failed();}
+ virtual bool failed() const override {return m_failed || m_fbo.failed();}
static void getViewMatrix(QMatrix4x4& mat, int face);
static void getProjectionMatrix(QMatrix4x4& mat, float nearZ, float farZ);
diff --git a/examples/widgets/graphicsview/boxes/main.cpp b/examples/widgets/graphicsview/boxes/main.cpp
index cc708e9433..b7242d529b 100644
--- a/examples/widgets/graphicsview/boxes/main.cpp
+++ b/examples/widgets/graphicsview/boxes/main.cpp
@@ -67,7 +67,7 @@ public:
}
protected:
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE {
+ void resizeEvent(QResizeEvent *event) override {
if (scene())
scene()->setSceneRect(QRect(QPoint(0, 0), event->size()));
QGraphicsView::resizeEvent(event);
diff --git a/examples/widgets/graphicsview/boxes/qtbox.h b/examples/widgets/graphicsview/boxes/qtbox.h
index 6eb3a39224..e283dccfb4 100644
--- a/examples/widgets/graphicsview/boxes/qtbox.h
+++ b/examples/widgets/graphicsview/boxes/qtbox.h
@@ -63,18 +63,18 @@ public:
ItemBase(int size, int x, int y);
virtual ~ItemBase();
- virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
+ virtual QRectF boundingRect() const override;
+ virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
protected:
virtual ItemBase *createNew(int size, int x, int y) = 0;
- virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) Q_DECL_OVERRIDE;
- virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
- virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE;
- virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
- virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
- virtual void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
- virtual void wheelEvent(QGraphicsSceneWheelEvent *event) Q_DECL_OVERRIDE;
- virtual int type() const Q_DECL_OVERRIDE;
+ virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override;
+ virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
+ virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override;
+ virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
+ virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
+ virtual void keyPressEvent(QKeyEvent *event) override;
+ virtual void wheelEvent(QGraphicsSceneWheelEvent *event) override;
+ virtual int type() const override;
bool isInResizeArea(const QPointF &pos);
static void duplicateSelectedItems(QGraphicsScene *scene);
@@ -92,9 +92,9 @@ class QtBox : public ItemBase
public:
QtBox(int size, int x, int y);
virtual ~QtBox();
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
+ virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
protected:
- virtual ItemBase *createNew(int size, int x, int y) Q_DECL_OVERRIDE;
+ virtual ItemBase *createNew(int size, int x, int y) override;
private:
QVector3D m_vertices[8];
QVector3D m_texCoords[4];
@@ -106,9 +106,9 @@ class CircleItem : public ItemBase
{
public:
CircleItem(int size, int x, int y);
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
+ virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
protected:
- virtual ItemBase *createNew(int size, int x, int y) Q_DECL_OVERRIDE;
+ virtual ItemBase *createNew(int size, int x, int y) override;
QColor m_color;
};
@@ -117,9 +117,9 @@ class SquareItem : public ItemBase
{
public:
SquareItem(int size, int x, int y);
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
+ virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
protected:
- virtual ItemBase *createNew(int size, int x, int y) Q_DECL_OVERRIDE;
+ virtual ItemBase *createNew(int size, int x, int y) override;
QPixmap m_image;
};
diff --git a/examples/widgets/graphicsview/boxes/scene.h b/examples/widgets/graphicsview/boxes/scene.h
index 843b48a656..b76fb1057c 100644
--- a/examples/widgets/graphicsview/boxes/scene.h
+++ b/examples/widgets/graphicsview/boxes/scene.h
@@ -81,13 +81,13 @@ class ColorEdit : public ParameterEdit
public:
ColorEdit(QRgb initialColor, int id);
QRgb color() const {return m_color;}
- virtual void emitChange() Q_DECL_OVERRIDE {emit colorChanged(m_color, m_id);}
+ virtual void emitChange() override { emit colorChanged(m_color, m_id); }
public slots:
void editDone();
signals:
void colorChanged(QRgb color, int id);
protected:
- virtual void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ virtual void mousePressEvent(QMouseEvent *event) override;
void setColor(QRgb color); // also emits colorChanged()
private:
QGraphicsScene *m_dialogParentScene;
@@ -103,7 +103,7 @@ class FloatEdit : public ParameterEdit
public:
FloatEdit(float initialValue, int id);
float value() const {return m_value;}
- virtual void emitChange() Q_DECL_OVERRIDE {emit valueChanged(m_value, m_id);}
+ virtual void emitChange() override { emit valueChanged(m_value, m_id); }
public slots:
void editDone();
signals:
@@ -120,9 +120,9 @@ class GraphicsWidget : public QGraphicsProxyWidget
public:
GraphicsWidget() : QGraphicsProxyWidget(0, Qt::Window) {}
protected:
- virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE;
- virtual void resizeEvent(QGraphicsSceneResizeEvent *event) Q_DECL_OVERRIDE;
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
+ virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
+ virtual void resizeEvent(QGraphicsSceneResizeEvent *event) override;
+ virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
};
class TwoSidedGraphicsWidget : public QObject
@@ -162,7 +162,7 @@ signals:
void shaderChanged(int);
void doubleClicked();
protected:
- virtual void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ virtual void mouseDoubleClickEvent(QMouseEvent *event) override;
QVector<QByteArray> m_parameterNames;
QComboBox *m_textureCombo;
@@ -189,7 +189,7 @@ signals:
void doubleClicked();
void newItemTriggered(ItemDialog::ItemType type);
protected:
- virtual void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ virtual void mouseDoubleClickEvent(QMouseEvent *event) override;
};
class Scene : public QGraphicsScene
@@ -198,7 +198,7 @@ class Scene : public QGraphicsScene
public:
Scene(int width, int height, int maxTextureSize);
~Scene();
- virtual void drawBackground(QPainter *painter, const QRectF &rect) Q_DECL_OVERRIDE;
+ virtual void drawBackground(QPainter *painter, const QRectF &rect) override;
public slots:
void setShader(int index);
@@ -214,10 +214,10 @@ protected:
void defaultStates();
void renderCubemaps();
- virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
- virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
- virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
- virtual void wheelEvent(QGraphicsSceneWheelEvent * event) Q_DECL_OVERRIDE;
+ virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
+ virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
+ virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
+ virtual void wheelEvent(QGraphicsSceneWheelEvent * event) override;
private:
void initGL();
QPointF pixelPosToViewPos(const QPointF& p);
diff --git a/examples/widgets/graphicsview/chip/chip.h b/examples/widgets/graphicsview/chip/chip.h
index c1d6523122..f3d54e6295 100644
--- a/examples/widgets/graphicsview/chip/chip.h
+++ b/examples/widgets/graphicsview/chip/chip.h
@@ -59,14 +59,14 @@ class Chip : public QGraphicsItem
public:
Chip(const QColor &color, int x, int y);
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- QPainterPath shape() const Q_DECL_OVERRIDE;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget) Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ QPainterPath shape() const override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget) override;
protected:
- void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
+ void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
private:
int x;
diff --git a/examples/widgets/graphicsview/chip/view.h b/examples/widgets/graphicsview/chip/view.h
index 8f0049c628..2d174250c2 100644
--- a/examples/widgets/graphicsview/chip/view.h
+++ b/examples/widgets/graphicsview/chip/view.h
@@ -70,7 +70,7 @@ public:
protected:
#ifndef QT_NO_WHEELEVENT
- void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE;
+ void wheelEvent(QWheelEvent *) override;
#endif
private:
diff --git a/examples/widgets/graphicsview/collidingmice/mouse.h b/examples/widgets/graphicsview/collidingmice/mouse.h
index 1cc0d52c62..bd9e592242 100644
--- a/examples/widgets/graphicsview/collidingmice/mouse.h
+++ b/examples/widgets/graphicsview/collidingmice/mouse.h
@@ -59,13 +59,13 @@ class Mouse : public QGraphicsItem
public:
Mouse();
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- QPainterPath shape() const Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ QPainterPath shape() const override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
- QWidget *widget) Q_DECL_OVERRIDE;
+ QWidget *widget) override;
protected:
- void advance(int step) Q_DECL_OVERRIDE;
+ void advance(int step) override;
private:
qreal angle;
diff --git a/examples/widgets/graphicsview/diagramscene/arrow.h b/examples/widgets/graphicsview/diagramscene/arrow.h
index 2252091d4b..e0fa389d53 100644
--- a/examples/widgets/graphicsview/diagramscene/arrow.h
+++ b/examples/widgets/graphicsview/diagramscene/arrow.h
@@ -73,9 +73,9 @@ public:
Arrow(DiagramItem *startItem, DiagramItem *endItem,
QGraphicsItem *parent = 0);
- int type() const Q_DECL_OVERRIDE { return Type; }
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- QPainterPath shape() const Q_DECL_OVERRIDE;
+ int type() const override { return Type; }
+ QRectF boundingRect() const override;
+ QPainterPath shape() const override;
void setColor(const QColor &color) { myColor = color; }
DiagramItem *startItem() const { return myStartItem; }
DiagramItem *endItem() const { return myEndItem; }
@@ -83,7 +83,7 @@ public:
void updatePosition();
protected:
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) override;
private:
DiagramItem *myStartItem;
diff --git a/examples/widgets/graphicsview/diagramscene/diagramitem.h b/examples/widgets/graphicsview/diagramscene/diagramitem.h
index f1c4222aed..3a43ec57fc 100644
--- a/examples/widgets/graphicsview/diagramscene/diagramitem.h
+++ b/examples/widgets/graphicsview/diagramscene/diagramitem.h
@@ -85,11 +85,11 @@ public:
QPolygonF polygon() const { return myPolygon; }
void addArrow(Arrow *arrow);
QPixmap image() const;
- int type() const Q_DECL_OVERRIDE { return Type;}
+ int type() const override { return Type;}
protected:
- void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) Q_DECL_OVERRIDE;
- QVariant itemChange(GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE;
+ void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override;
+ QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
private:
DiagramType myDiagramType;
diff --git a/examples/widgets/graphicsview/diagramscene/diagramscene.h b/examples/widgets/graphicsview/diagramscene/diagramscene.h
index 6f38201f00..95f7f3c621 100644
--- a/examples/widgets/graphicsview/diagramscene/diagramscene.h
+++ b/examples/widgets/graphicsview/diagramscene/diagramscene.h
@@ -95,9 +95,9 @@ signals:
void itemSelected(QGraphicsItem *item);
protected:
- void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent) Q_DECL_OVERRIDE;
+ void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent) override;
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent) override;
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent) override;
private:
bool isItemChange(int type);
diff --git a/examples/widgets/graphicsview/diagramscene/diagramtextitem.h b/examples/widgets/graphicsview/diagramscene/diagramtextitem.h
index 9db03141b1..f5d3d3b95e 100644
--- a/examples/widgets/graphicsview/diagramscene/diagramtextitem.h
+++ b/examples/widgets/graphicsview/diagramscene/diagramtextitem.h
@@ -71,16 +71,16 @@ public:
DiagramTextItem(QGraphicsItem *parent = 0);
- int type() const Q_DECL_OVERRIDE { return Type; }
+ int type() const override { return Type; }
signals:
void lostFocus(DiagramTextItem *item);
void selectedChange(QGraphicsItem *item);
protected:
- QVariant itemChange(GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE;
- void focusOutEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
- void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
+ QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
+ void focusOutEvent(QFocusEvent *event) override;
+ void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override;
};
//! [0]
diff --git a/examples/widgets/graphicsview/dragdroprobot/coloritem.h b/examples/widgets/graphicsview/dragdroprobot/coloritem.h
index 9c7471ffbd..7701928c27 100644
--- a/examples/widgets/graphicsview/dragdroprobot/coloritem.h
+++ b/examples/widgets/graphicsview/dragdroprobot/coloritem.h
@@ -59,13 +59,13 @@ class ColorItem : public QGraphicsItem
public:
ColorItem();
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
protected:
- void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
+ void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
private:
QColor color;
diff --git a/examples/widgets/graphicsview/dragdroprobot/main.cpp b/examples/widgets/graphicsview/dragdroprobot/main.cpp
index 6906976cb6..ff3758ac60 100644
--- a/examples/widgets/graphicsview/dragdroprobot/main.cpp
+++ b/examples/widgets/graphicsview/dragdroprobot/main.cpp
@@ -63,7 +63,7 @@ public:
}
protected:
- virtual void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE
+ virtual void resizeEvent(QResizeEvent *) override
{
}
};
diff --git a/examples/widgets/graphicsview/dragdroprobot/robot.h b/examples/widgets/graphicsview/dragdroprobot/robot.h
index 8e20bf2cbf..e25966c7c4 100644
--- a/examples/widgets/graphicsview/dragdroprobot/robot.h
+++ b/examples/widgets/graphicsview/dragdroprobot/robot.h
@@ -65,9 +65,9 @@ public:
RobotPart(QGraphicsItem *parent = 0);
protected:
- void dragEnterEvent(QGraphicsSceneDragDropEvent *event) Q_DECL_OVERRIDE;
- void dragLeaveEvent(QGraphicsSceneDragDropEvent *event) Q_DECL_OVERRIDE;
- void dropEvent(QGraphicsSceneDragDropEvent *event) Q_DECL_OVERRIDE;
+ void dragEnterEvent(QGraphicsSceneDragDropEvent *event) override;
+ void dragLeaveEvent(QGraphicsSceneDragDropEvent *event) override;
+ void dropEvent(QGraphicsSceneDragDropEvent *event) override;
QColor color;
bool dragOver;
@@ -80,12 +80,12 @@ class RobotHead : public RobotPart
public:
RobotHead(QGraphicsItem *parent = 0);
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) override;
protected:
- void dragEnterEvent(QGraphicsSceneDragDropEvent *event) Q_DECL_OVERRIDE;
- void dropEvent(QGraphicsSceneDragDropEvent *event) Q_DECL_OVERRIDE;
+ void dragEnterEvent(QGraphicsSceneDragDropEvent *event) override;
+ void dropEvent(QGraphicsSceneDragDropEvent *event) override;
private:
QPixmap pixmap;
@@ -98,8 +98,8 @@ class RobotTorso : public RobotPart
public:
RobotTorso(QGraphicsItem *parent = 0);
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) override;
};
//! [2]
@@ -109,8 +109,8 @@ class RobotLimb : public RobotPart
public:
RobotLimb(QGraphicsItem *parent = 0);
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) override;
};
//! [3]
@@ -120,8 +120,8 @@ class Robot : public RobotPart
public:
Robot(QGraphicsItem *parent = 0);
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) override;
};
//! [4]
diff --git a/examples/widgets/graphicsview/elasticnodes/edge.h b/examples/widgets/graphicsview/elasticnodes/edge.h
index 6409af3a89..19072b8b33 100644
--- a/examples/widgets/graphicsview/elasticnodes/edge.h
+++ b/examples/widgets/graphicsview/elasticnodes/edge.h
@@ -67,11 +67,11 @@ public:
void adjust();
enum { Type = UserType + 2 };
- int type() const Q_DECL_OVERRIDE { return Type; }
+ int type() const override { return Type; }
protected:
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
private:
Node *source, *dest;
diff --git a/examples/widgets/graphicsview/elasticnodes/graphwidget.h b/examples/widgets/graphicsview/elasticnodes/graphwidget.h
index 2b26cb6d67..79acb89985 100644
--- a/examples/widgets/graphicsview/elasticnodes/graphwidget.h
+++ b/examples/widgets/graphicsview/elasticnodes/graphwidget.h
@@ -71,12 +71,12 @@ public slots:
void zoomOut();
protected:
- void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
+ void keyPressEvent(QKeyEvent *event) override;
+ void timerEvent(QTimerEvent *event) override;
#ifndef QT_NO_WHEELEVENT
- void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
+ void wheelEvent(QWheelEvent *event) override;
#endif
- void drawBackground(QPainter *painter, const QRectF &rect) Q_DECL_OVERRIDE;
+ void drawBackground(QPainter *painter, const QRectF &rect) override;
void scaleView(qreal scaleFactor);
diff --git a/examples/widgets/graphicsview/elasticnodes/node.h b/examples/widgets/graphicsview/elasticnodes/node.h
index 6c8a49ca4f..487ae0d68e 100644
--- a/examples/widgets/graphicsview/elasticnodes/node.h
+++ b/examples/widgets/graphicsview/elasticnodes/node.h
@@ -70,20 +70,20 @@ public:
QList<Edge *> edges() const;
enum { Type = UserType + 1 };
- int type() const Q_DECL_OVERRIDE { return Type; }
+ int type() const override { return Type; }
void calculateForces();
bool advance();
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- QPainterPath shape() const Q_DECL_OVERRIDE;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ QPainterPath shape() const override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
protected:
- QVariant itemChange(GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE;
+ QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
- void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
+ void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
private:
QList<Edge *> edgeList;
diff --git a/examples/widgets/graphicsview/embeddeddialogs/customproxy.h b/examples/widgets/graphicsview/embeddeddialogs/customproxy.h
index 05ae087931..36209b7073 100644
--- a/examples/widgets/graphicsview/embeddeddialogs/customproxy.h
+++ b/examples/widgets/graphicsview/embeddeddialogs/customproxy.h
@@ -61,15 +61,15 @@ class CustomProxy : public QGraphicsProxyWidget
public:
explicit CustomProxy(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
- QRectF boundingRect() const Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
void paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option,
- QWidget *widget) Q_DECL_OVERRIDE;
+ QWidget *widget) override;
protected:
- void hoverEnterEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE;
- void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE;
- bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) Q_DECL_OVERRIDE;
- QVariant itemChange(GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE;
+ void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
+ void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
+ bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) override;
+ QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
private slots:
void updateStep(qreal step);
diff --git a/examples/widgets/graphicsview/embeddeddialogs/main.cpp b/examples/widgets/graphicsview/embeddeddialogs/main.cpp
index dcab0ee3a8..cbd5dd5890 100644
--- a/examples/widgets/graphicsview/embeddeddialogs/main.cpp
+++ b/examples/widgets/graphicsview/embeddeddialogs/main.cpp
@@ -62,11 +62,7 @@ int main(int argc, char *argv[])
QGraphicsScene scene;
scene.setStickyFocus(true);
-#ifndef Q_OS_WINCE
const int gridSize = 10;
-#else
- const int gridSize = 5;
-#endif
for (int y = 0; y < gridSize; ++y) {
for (int x = 0; x < gridSize; ++x) {
diff --git a/examples/widgets/graphicsview/flowlayout/flowlayout.h b/examples/widgets/graphicsview/flowlayout/flowlayout.h
index cb3d2ad590..808f5d2c77 100644
--- a/examples/widgets/graphicsview/flowlayout/flowlayout.h
+++ b/examples/widgets/graphicsview/flowlayout/flowlayout.h
@@ -60,14 +60,14 @@ public:
qreal spacing(Qt::Orientation o) const;
// inherited functions
- void setGeometry(const QRectF &geom) Q_DECL_OVERRIDE;
+ void setGeometry(const QRectF &geom) override;
- int count() const Q_DECL_OVERRIDE;
- QGraphicsLayoutItem *itemAt(int index) const Q_DECL_OVERRIDE;
- void removeAt(int index) Q_DECL_OVERRIDE;
+ int count() const override;
+ QGraphicsLayoutItem *itemAt(int index) const override;
+ void removeAt(int index) override;
protected:
- QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const Q_DECL_OVERRIDE;
+ QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const override;
private:
qreal doLayout(const QRectF &geom, bool applyNewGeometry) const;
diff --git a/examples/widgets/graphicsview/graphicsview.pro b/examples/widgets/graphicsview/graphicsview.pro
index 06a7ce8071..5a054fe6b2 100644
--- a/examples/widgets/graphicsview/graphicsview.pro
+++ b/examples/widgets/graphicsview/graphicsview.pro
@@ -15,6 +15,6 @@ SUBDIRS = \
contains(DEFINES, QT_NO_CURSOR)|contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= dragdroprobot
-qtHaveModule(opengl):!contains(QT_CONFIG, opengles.):!contains(QT_CONFIG,dynamicgl) {
+qtHaveModule(opengl):!qtConfig(opengles.):!qtConfig(dynamicgl) {
SUBDIRS += boxes
}
diff --git a/examples/widgets/graphicsview/padnavigator/padnavigator.h b/examples/widgets/graphicsview/padnavigator/padnavigator.h
index 1fcc9b0cf3..00cf2c0212 100644
--- a/examples/widgets/graphicsview/padnavigator/padnavigator.h
+++ b/examples/widgets/graphicsview/padnavigator/padnavigator.h
@@ -67,7 +67,7 @@ public:
explicit PadNavigator(const QSize &size, QWidget *parent = 0);
protected:
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
+ void resizeEvent(QResizeEvent *event) override;
private:
Ui::Form form;
diff --git a/examples/widgets/graphicsview/padnavigator/roundrectitem.h b/examples/widgets/graphicsview/padnavigator/roundrectitem.h
index 3fbf8d2c2f..e76862c08c 100644
--- a/examples/widgets/graphicsview/padnavigator/roundrectitem.h
+++ b/examples/widgets/graphicsview/padnavigator/roundrectitem.h
@@ -66,8 +66,8 @@ public:
QPixmap pixmap() const;
void setPixmap(const QPixmap &pixmap);
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) override;
bool fill() const;
void setFill(bool fill);
diff --git a/examples/widgets/graphicsview/padnavigator/splashitem.h b/examples/widgets/graphicsview/padnavigator/splashitem.h
index 6945e90a86..2ad54f82a1 100644
--- a/examples/widgets/graphicsview/padnavigator/splashitem.h
+++ b/examples/widgets/graphicsview/padnavigator/splashitem.h
@@ -60,8 +60,8 @@ class SplashItem : public QGraphicsObject
public:
explicit SplashItem(QGraphicsItem *parent = 0);
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) override;
private:
QString text;
diff --git a/examples/widgets/graphicsview/simpleanchorlayout/main.cpp b/examples/widgets/graphicsview/simpleanchorlayout/main.cpp
index 99cb2d01fa..299a5ad7bd 100644
--- a/examples/widgets/graphicsview/simpleanchorlayout/main.cpp
+++ b/examples/widgets/graphicsview/simpleanchorlayout/main.cpp
@@ -62,7 +62,7 @@ public:
{
}
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget * = 0) Q_DECL_OVERRIDE
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget * = 0) override
{
QFont font;
font.setPixelSize(0.75 * qMin(boundingRect().width(), boundingRect().height()));
diff --git a/examples/widgets/graphicsview/weatheranchorlayout/main.cpp b/examples/widgets/graphicsview/weatheranchorlayout/main.cpp
index 01ce1ce0f0..ec1f73bf9c 100644
--- a/examples/widgets/graphicsview/weatheranchorlayout/main.cpp
+++ b/examples/widgets/graphicsview/weatheranchorlayout/main.cpp
@@ -69,7 +69,7 @@ public:
{
}
- virtual void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE
+ virtual void resizeEvent(QResizeEvent *event) override
{
w->setGeometry(0, 0, event->size().width(), event->size().height());
}
@@ -101,7 +101,7 @@ public:
original->setZValue(z);
}
- void setGeometry (const QRectF &rect) Q_DECL_OVERRIDE
+ void setGeometry (const QRectF &rect) override
{
original->setTransform(QTransform::fromScale(rect.width() / r.width(),
rect.height() / r.height()), true);
@@ -110,7 +110,7 @@ public:
}
protected:
- QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const Q_DECL_OVERRIDE
+ QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const override
{
Q_UNUSED(constraint);
QSizeF sh;
@@ -148,7 +148,7 @@ public:
{
}
- void paint(QPainter *painter, const QStyleOptionGraphicsItem*, QWidget*) Q_DECL_OVERRIDE
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override
{
QPointF reflection = QPointF();
reflection.setY(scaled.height() + 2);
@@ -180,14 +180,14 @@ public:
painter->drawPixmap(reflection, tmp);
}
- void resizeEvent(QGraphicsSceneResizeEvent *event) Q_DECL_OVERRIDE
+ void resizeEvent(QGraphicsSceneResizeEvent *event) override
{
QSize newSize = event->newSize().toSize();
newSize.setHeight(newSize.height() / 2);
scaled = original.scaled(newSize);
}
- QRectF boundingRect() const Q_DECL_OVERRIDE
+ QRectF boundingRect() const override
{
QSize size(scaled.width(), scaled.height() * 2 + 2);
return QRectF(QPointF(0, 0), size);
diff --git a/examples/widgets/itemviews/addressbook/tablemodel.h b/examples/widgets/itemviews/addressbook/tablemodel.h
index de81df1430..9a669c508d 100644
--- a/examples/widgets/itemviews/addressbook/tablemodel.h
+++ b/examples/widgets/itemviews/addressbook/tablemodel.h
@@ -64,14 +64,14 @@ public:
TableModel(QObject *parent = 0);
TableModel(QList<QPair<QString, QString> > listofPairs, QObject *parent = 0);
- int rowCount(const QModelIndex &parent) const Q_DECL_OVERRIDE;
- int columnCount(const QModelIndex &parent) const Q_DECL_OVERRIDE;
- QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
- QVariant headerData(int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE;
- Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
- bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) Q_DECL_OVERRIDE;
- bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex()) Q_DECL_OVERRIDE;
- bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex()) Q_DECL_OVERRIDE;
+ int rowCount(const QModelIndex &parent) const override;
+ int columnCount(const QModelIndex &parent) const override;
+ QVariant data(const QModelIndex &index, int role) const override;
+ QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
+ bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
+ bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex()) override;
+ bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex()) override;
QList<QPair<QString, QString> > getList();
private:
diff --git a/examples/widgets/itemviews/chart/pieview.h b/examples/widgets/itemviews/chart/pieview.h
index 9e2011499e..aa397e6d55 100644
--- a/examples/widgets/itemviews/chart/pieview.h
+++ b/examples/widgets/itemviews/chart/pieview.h
@@ -61,44 +61,44 @@ class PieView : public QAbstractItemView
public:
PieView(QWidget *parent = 0);
- QRect visualRect(const QModelIndex &index) const Q_DECL_OVERRIDE;
- void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) Q_DECL_OVERRIDE;
- QModelIndex indexAt(const QPoint &point) const Q_DECL_OVERRIDE;
+ QRect visualRect(const QModelIndex &index) const override;
+ void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override;
+ QModelIndex indexAt(const QPoint &point) const override;
protected slots:
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight,
- const QVector<int> &roles = QVector<int>()) Q_DECL_OVERRIDE;
- void rowsInserted(const QModelIndex &parent, int start, int end) Q_DECL_OVERRIDE;
- void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) Q_DECL_OVERRIDE;
+ const QVector<int> &roles = QVector<int>()) override;
+ void rowsInserted(const QModelIndex &parent, int start, int end) override;
+ void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) override;
protected:
- bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event) Q_DECL_OVERRIDE;
+ bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event) override;
QModelIndex moveCursor(QAbstractItemView::CursorAction cursorAction,
- Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE;
+ Qt::KeyboardModifiers modifiers) override;
- int horizontalOffset() const Q_DECL_OVERRIDE;
- int verticalOffset() const Q_DECL_OVERRIDE;
+ int horizontalOffset() const override;
+ int verticalOffset() const override;
- bool isIndexHidden(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ bool isIndexHidden(const QModelIndex &index) const override;
- void setSelection(const QRect&, QItemSelectionModel::SelectionFlags command) Q_DECL_OVERRIDE;
+ void setSelection(const QRect&, QItemSelectionModel::SelectionFlags command) override;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void mousePressEvent(QMouseEvent *event) override;
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
- void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
+ void resizeEvent(QResizeEvent *event) override;
+ void scrollContentsBy(int dx, int dy) override;
- QRegion visualRegionForSelection(const QItemSelection &selection) const Q_DECL_OVERRIDE;
+ QRegion visualRegionForSelection(const QItemSelection &selection) const override;
private:
QRect itemRect(const QModelIndex &item) const;
QRegion itemRegion(const QModelIndex &index) const;
int rows(const QModelIndex &index = QModelIndex()) const;
- void updateGeometries() Q_DECL_OVERRIDE;
+ void updateGeometries() override;
int margin;
int totalSize;
diff --git a/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.h b/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.h
index 00db49220a..e2aff3c829 100644
--- a/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.h
+++ b/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.h
@@ -69,8 +69,8 @@ public:
void setFilterMaximumDate(const QDate &date);
protected:
- bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const Q_DECL_OVERRIDE;
- bool lessThan(const QModelIndex &left, const QModelIndex &right) const Q_DECL_OVERRIDE;
+ bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
+ bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
private:
bool dateInRange(const QDate &date) const;
diff --git a/examples/widgets/itemviews/editabletreemodel/treemodel.h b/examples/widgets/itemviews/editabletreemodel/treemodel.h
index e9dfbf63d2..d76d138831 100644
--- a/examples/widgets/itemviews/editabletreemodel/treemodel.h
+++ b/examples/widgets/itemviews/editabletreemodel/treemodel.h
@@ -68,33 +68,33 @@ public:
~TreeModel();
//! [0] //! [1]
- QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
+ QVariant data(const QModelIndex &index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation,
- int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ int role = Qt::DisplayRole) const override;
QModelIndex index(int row, int column,
- const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QModelIndex parent(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &parent = QModelIndex()) const override;
+ QModelIndex parent(const QModelIndex &index) const override;
- int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
//! [1]
//! [2]
- Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
bool setData(const QModelIndex &index, const QVariant &value,
- int role = Qt::EditRole) Q_DECL_OVERRIDE;
+ int role = Qt::EditRole) override;
bool setHeaderData(int section, Qt::Orientation orientation,
- const QVariant &value, int role = Qt::EditRole) Q_DECL_OVERRIDE;
+ const QVariant &value, int role = Qt::EditRole) override;
bool insertColumns(int position, int columns,
- const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
+ const QModelIndex &parent = QModelIndex()) override;
bool removeColumns(int position, int columns,
- const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
+ const QModelIndex &parent = QModelIndex()) override;
bool insertRows(int position, int rows,
- const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
+ const QModelIndex &parent = QModelIndex()) override;
bool removeRows(int position, int rows,
- const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
+ const QModelIndex &parent = QModelIndex()) override;
private:
void setupModelData(const QStringList &lines, TreeItem *parent);
diff --git a/examples/widgets/itemviews/fetchmore/filelistmodel.h b/examples/widgets/itemviews/fetchmore/filelistmodel.h
index 79646799b2..9251eaf959 100644
--- a/examples/widgets/itemviews/fetchmore/filelistmodel.h
+++ b/examples/widgets/itemviews/fetchmore/filelistmodel.h
@@ -63,8 +63,8 @@ class FileListModel : public QAbstractListModel
public:
FileListModel(QObject *parent = 0);
- int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
signals:
void numberPopulated(int number);
@@ -73,8 +73,8 @@ public slots:
void setDirPath(const QString &path);
protected:
- bool canFetchMore(const QModelIndex &parent) const Q_DECL_OVERRIDE;
- void fetchMore(const QModelIndex &parent) Q_DECL_OVERRIDE;
+ bool canFetchMore(const QModelIndex &parent) const override;
+ void fetchMore(const QModelIndex &parent) override;
private:
QStringList fileList;
diff --git a/examples/widgets/itemviews/frozencolumn/freezetablewidget.h b/examples/widgets/itemviews/frozencolumn/freezetablewidget.h
index 137ee83d5d..51c46fb7e7 100644
--- a/examples/widgets/itemviews/frozencolumn/freezetablewidget.h
+++ b/examples/widgets/itemviews/frozencolumn/freezetablewidget.h
@@ -63,9 +63,9 @@ public:
protected:
- virtual void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
- virtual QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE;
- void scrollTo (const QModelIndex & index, ScrollHint hint = EnsureVisible) Q_DECL_OVERRIDE;
+ virtual void resizeEvent(QResizeEvent *event) override;
+ virtual QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override;
+ void scrollTo (const QModelIndex & index, ScrollHint hint = EnsureVisible) override;
private:
QTableView *frozenTableView;
diff --git a/examples/widgets/itemviews/interview/model.h b/examples/widgets/itemviews/interview/model.h
index cd69cb6986..969cf693b2 100644
--- a/examples/widgets/itemviews/interview/model.h
+++ b/examples/widgets/itemviews/interview/model.h
@@ -64,17 +64,17 @@ public:
Model(int rows, int columns, QObject *parent = 0);
~Model();
- QModelIndex index(int row, int column, const QModelIndex &parent) const Q_DECL_OVERRIDE;
- QModelIndex parent(const QModelIndex &child) const Q_DECL_OVERRIDE;
+ QModelIndex index(int row, int column, const QModelIndex &parent) const override;
+ QModelIndex parent(const QModelIndex &child) const override;
- int rowCount(const QModelIndex &parent) const Q_DECL_OVERRIDE;
- int columnCount(const QModelIndex &parent) const Q_DECL_OVERRIDE;
+ int rowCount(const QModelIndex &parent) const override;
+ int columnCount(const QModelIndex &parent) const override;
- QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
- QVariant headerData(int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE;
+ QVariant data(const QModelIndex &index, int role) const override;
+ QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
- bool hasChildren(const QModelIndex &parent) const Q_DECL_OVERRIDE;
- Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ bool hasChildren(const QModelIndex &parent) const override;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
private:
diff --git a/examples/widgets/itemviews/pixelator/imagemodel.h b/examples/widgets/itemviews/pixelator/imagemodel.h
index 8b476a3d04..c6c510dcac 100644
--- a/examples/widgets/itemviews/pixelator/imagemodel.h
+++ b/examples/widgets/itemviews/pixelator/imagemodel.h
@@ -64,11 +64,11 @@ public:
void setImage(const QImage &image);
- int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
- QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
+ QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
private:
QImage modelImage;
diff --git a/examples/widgets/itemviews/pixelator/pixeldelegate.h b/examples/widgets/itemviews/pixelator/pixeldelegate.h
index 85ef0e0b1c..d968d9e8d2 100644
--- a/examples/widgets/itemviews/pixelator/pixeldelegate.h
+++ b/examples/widgets/itemviews/pixelator/pixeldelegate.h
@@ -72,10 +72,10 @@ public:
PixelDelegate(QObject *parent = 0);
void paint(QPainter *painter, const QStyleOptionViewItem &option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
QSize sizeHint(const QStyleOptionViewItem &option,
- const QModelIndex &index ) const Q_DECL_OVERRIDE;
+ const QModelIndex &index ) const override;
public slots:
void setPixelSize(int size);
diff --git a/examples/widgets/itemviews/puzzle/piecesmodel.h b/examples/widgets/itemviews/puzzle/piecesmodel.h
index d7293ffa6c..bd979f4c7e 100644
--- a/examples/widgets/itemviews/puzzle/piecesmodel.h
+++ b/examples/widgets/itemviews/puzzle/piecesmodel.h
@@ -68,16 +68,16 @@ class PiecesModel : public QAbstractListModel
public:
explicit PiecesModel(int pieceSize, QObject *parent = 0);
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
- Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
- bool removeRows(int row, int count, const QModelIndex &parent) Q_DECL_OVERRIDE;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
+ bool removeRows(int row, int count, const QModelIndex &parent) override;
bool dropMimeData(const QMimeData *data, Qt::DropAction action,
- int row, int column, const QModelIndex &parent) Q_DECL_OVERRIDE;
- QMimeData *mimeData(const QModelIndexList &indexes) const Q_DECL_OVERRIDE;
- QStringList mimeTypes() const Q_DECL_OVERRIDE;
- int rowCount(const QModelIndex &parent) const Q_DECL_OVERRIDE;
- Qt::DropActions supportedDropActions() const Q_DECL_OVERRIDE;
+ int row, int column, const QModelIndex &parent) override;
+ QMimeData *mimeData(const QModelIndexList &indexes) const override;
+ QStringList mimeTypes() const override;
+ int rowCount(const QModelIndex &parent) const override;
+ Qt::DropActions supportedDropActions() const override;
void addPiece(const QPixmap &pixmap, const QPoint &location);
void addPieces(const QPixmap& pixmap);
diff --git a/examples/widgets/itemviews/puzzle/puzzle.pro b/examples/widgets/itemviews/puzzle/puzzle.pro
index a5379293ff..55f1d7e709 100644
--- a/examples/widgets/itemviews/puzzle/puzzle.pro
+++ b/examples/widgets/itemviews/puzzle/puzzle.pro
@@ -12,8 +12,3 @@ SOURCES = main.cpp \
# install
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/puzzle
INSTALLS += target
-
-
-wince* {
- DEPLOYMENT_PLUGIN += qjpeg qgif
-}
diff --git a/examples/widgets/itemviews/puzzle/puzzlewidget.h b/examples/widgets/itemviews/puzzle/puzzlewidget.h
index 2b6bd061ba..137e0b7162 100644
--- a/examples/widgets/itemviews/puzzle/puzzlewidget.h
+++ b/examples/widgets/itemviews/puzzle/puzzlewidget.h
@@ -77,12 +77,12 @@ signals:
void puzzleCompleted();
protected:
- void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
- void dragLeaveEvent(QDragLeaveEvent *event) Q_DECL_OVERRIDE;
- void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE;
- void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
+ void dragEnterEvent(QDragEnterEvent *event) override;
+ void dragLeaveEvent(QDragLeaveEvent *event) override;
+ void dragMoveEvent(QDragMoveEvent *event) override;
+ void dropEvent(QDropEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
private:
int findPiece(const QRect &pieceRect) const;
diff --git a/examples/widgets/itemviews/simpledommodel/dommodel.h b/examples/widgets/itemviews/simpledommodel/dommodel.h
index 7028aa89b2..411f58295c 100644
--- a/examples/widgets/itemviews/simpledommodel/dommodel.h
+++ b/examples/widgets/itemviews/simpledommodel/dommodel.h
@@ -66,15 +66,15 @@ public:
explicit DomModel(QDomDocument document, QObject *parent = 0);
~DomModel();
- QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
- Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ QVariant data(const QModelIndex &index, int role) const override;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
QVariant headerData(int section, Qt::Orientation orientation,
- int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ int role = Qt::DisplayRole) const override;
QModelIndex index(int row, int column,
- const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QModelIndex parent(const QModelIndex &child) const Q_DECL_OVERRIDE;
- int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
+ const QModelIndex &parent = QModelIndex()) const override;
+ QModelIndex parent(const QModelIndex &child) const override;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
private:
QDomDocument domDocument;
diff --git a/examples/widgets/itemviews/simpletreemodel/treemodel.h b/examples/widgets/itemviews/simpletreemodel/treemodel.h
index 8c67477d4b..800728fb82 100644
--- a/examples/widgets/itemviews/simpletreemodel/treemodel.h
+++ b/examples/widgets/itemviews/simpletreemodel/treemodel.h
@@ -66,15 +66,15 @@ public:
explicit TreeModel(const QString &data, QObject *parent = 0);
~TreeModel();
- QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
- Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ QVariant data(const QModelIndex &index, int role) const override;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
QVariant headerData(int section, Qt::Orientation orientation,
- int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ int role = Qt::DisplayRole) const override;
QModelIndex index(int row, int column,
- const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QModelIndex parent(const QModelIndex &index) const Q_DECL_OVERRIDE;
- int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
+ const QModelIndex &parent = QModelIndex()) const override;
+ QModelIndex parent(const QModelIndex &index) const override;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
private:
void setupModelData(const QStringList &lines, TreeItem *parent);
diff --git a/examples/widgets/itemviews/spinboxdelegate/delegate.h b/examples/widgets/itemviews/spinboxdelegate/delegate.h
index 7c9c50706e..47ef1555f7 100644
--- a/examples/widgets/itemviews/spinboxdelegate/delegate.h
+++ b/examples/widgets/itemviews/spinboxdelegate/delegate.h
@@ -62,14 +62,14 @@ public:
SpinBoxDelegate(QObject *parent = 0);
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
- void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE;
+ void setEditorData(QWidget *editor, const QModelIndex &index) const override;
void setModelData(QWidget *editor, QAbstractItemModel *model,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
void updateEditorGeometry(QWidget *editor,
- const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QStyleOptionViewItem &option, const QModelIndex &index) const override;
};
//! [0]
diff --git a/examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.h b/examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.h
index 5fbd4894d5..333467720f 100644
--- a/examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.h
+++ b/examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.h
@@ -62,10 +62,10 @@ class SpreadSheetDelegate : public QItemDelegate
public:
SpreadSheetDelegate(QObject *parent = 0);
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
- void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
+ void setEditorData(QWidget *editor, const QModelIndex &index) const override;
void setModelData(QWidget *editor, QAbstractItemModel *model,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
private slots:
void commitAndCloseEditor();
diff --git a/examples/widgets/itemviews/spreadsheet/spreadsheetitem.h b/examples/widgets/itemviews/spreadsheet/spreadsheetitem.h
index e43d222f48..46460df527 100644
--- a/examples/widgets/itemviews/spreadsheet/spreadsheetitem.h
+++ b/examples/widgets/itemviews/spreadsheet/spreadsheetitem.h
@@ -61,10 +61,10 @@ public:
SpreadSheetItem();
SpreadSheetItem(const QString &text);
- QTableWidgetItem *clone() const Q_DECL_OVERRIDE;
+ QTableWidgetItem *clone() const override;
- QVariant data(int role) const Q_DECL_OVERRIDE;
- void setData(int role, const QVariant &value) Q_DECL_OVERRIDE;
+ QVariant data(int role) const override;
+ void setData(int role, const QVariant &value) override;
QVariant display() const;
inline QString formula() const
diff --git a/examples/widgets/itemviews/stardelegate/stardelegate.h b/examples/widgets/itemviews/stardelegate/stardelegate.h
index f8e49e5bd1..ffc65fbedd 100644
--- a/examples/widgets/itemviews/stardelegate/stardelegate.h
+++ b/examples/widgets/itemviews/stardelegate/stardelegate.h
@@ -62,14 +62,14 @@ public:
StarDelegate(QWidget *parent = 0) : QStyledItemDelegate(parent) {}
void paint(QPainter *painter, const QStyleOptionViewItem &option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
QSize sizeHint(const QStyleOptionViewItem &option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
- void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
+ void setEditorData(QWidget *editor, const QModelIndex &index) const override;
void setModelData(QWidget *editor, QAbstractItemModel *model,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
private slots:
void commitAndCloseEditor();
diff --git a/examples/widgets/itemviews/stardelegate/stareditor.h b/examples/widgets/itemviews/stardelegate/stareditor.h
index 6bd5008d50..4a4c3a4954 100644
--- a/examples/widgets/itemviews/stardelegate/stareditor.h
+++ b/examples/widgets/itemviews/stardelegate/stareditor.h
@@ -63,7 +63,7 @@ class StarEditor : public QWidget
public:
StarEditor(QWidget *parent = 0);
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
void setStarRating(const StarRating &starRating) {
myStarRating = starRating;
}
@@ -73,9 +73,9 @@ signals:
void editingFinished();
protected:
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
private:
int starAtPosition(int x);
diff --git a/examples/widgets/layouts/borderlayout/borderlayout.h b/examples/widgets/layouts/borderlayout/borderlayout.h
index 0ccdb1be60..4c0c01f90b 100644
--- a/examples/widgets/layouts/borderlayout/borderlayout.h
+++ b/examples/widgets/layouts/borderlayout/borderlayout.h
@@ -63,16 +63,16 @@ public:
BorderLayout(int spacing = -1);
~BorderLayout();
- void addItem(QLayoutItem *item) Q_DECL_OVERRIDE;
+ void addItem(QLayoutItem *item) override;
void addWidget(QWidget *widget, Position position);
- Qt::Orientations expandingDirections() const Q_DECL_OVERRIDE;
- bool hasHeightForWidth() const Q_DECL_OVERRIDE;
- int count() const Q_DECL_OVERRIDE;
- QLayoutItem *itemAt(int index) const Q_DECL_OVERRIDE;
- QSize minimumSize() const Q_DECL_OVERRIDE;
- void setGeometry(const QRect &rect) Q_DECL_OVERRIDE;
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QLayoutItem *takeAt(int index) Q_DECL_OVERRIDE;
+ Qt::Orientations expandingDirections() const override;
+ bool hasHeightForWidth() const override;
+ int count() const override;
+ QLayoutItem *itemAt(int index) const override;
+ QSize minimumSize() const override;
+ void setGeometry(const QRect &rect) override;
+ QSize sizeHint() const override;
+ QLayoutItem *takeAt(int index) override;
void add(QLayoutItem *item, Position position);
diff --git a/examples/widgets/layouts/flowlayout/flowlayout.h b/examples/widgets/layouts/flowlayout/flowlayout.h
index 90cc59dcfd..3155d5d347 100644
--- a/examples/widgets/layouts/flowlayout/flowlayout.h
+++ b/examples/widgets/layouts/flowlayout/flowlayout.h
@@ -62,18 +62,18 @@ public:
explicit FlowLayout(int margin = -1, int hSpacing = -1, int vSpacing = -1);
~FlowLayout();
- void addItem(QLayoutItem *item) Q_DECL_OVERRIDE;
+ void addItem(QLayoutItem *item) override;
int horizontalSpacing() const;
int verticalSpacing() const;
- Qt::Orientations expandingDirections() const Q_DECL_OVERRIDE;
- bool hasHeightForWidth() const Q_DECL_OVERRIDE;
- int heightForWidth(int) const Q_DECL_OVERRIDE;
- int count() const Q_DECL_OVERRIDE;
- QLayoutItem *itemAt(int index) const Q_DECL_OVERRIDE;
- QSize minimumSize() const Q_DECL_OVERRIDE;
- void setGeometry(const QRect &rect) Q_DECL_OVERRIDE;
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QLayoutItem *takeAt(int index) Q_DECL_OVERRIDE;
+ Qt::Orientations expandingDirections() const override;
+ bool hasHeightForWidth() const override;
+ int heightForWidth(int) const override;
+ int count() const override;
+ QLayoutItem *itemAt(int index) const override;
+ QSize minimumSize() const override;
+ void setGeometry(const QRect &rect) override;
+ QSize sizeHint() const override;
+ QLayoutItem *takeAt(int index) override;
private:
int doLayout(const QRect &rect, bool testOnly) const;
diff --git a/examples/widgets/mainwindows/application/mainwindow.h b/examples/widgets/mainwindows/application/mainwindow.h
index 9e3e1e907a..1300247ce7 100644
--- a/examples/widgets/mainwindows/application/mainwindow.h
+++ b/examples/widgets/mainwindows/application/mainwindow.h
@@ -71,7 +71,7 @@ public:
void loadFile(const QString &fileName);
protected:
- void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
+ void closeEvent(QCloseEvent *event) override;
private slots:
void newFile();
diff --git a/examples/widgets/mainwindows/mainwindow/colorswatch.cpp b/examples/widgets/mainwindows/mainwindow/colorswatch.cpp
index 73076c20b0..c47b80275f 100644
--- a/examples/widgets/mainwindows/mainwindow/colorswatch.cpp
+++ b/examples/widgets/mainwindows/mainwindow/colorswatch.cpp
@@ -112,8 +112,8 @@ class ColorDock : public QFrame
public:
explicit ColorDock(const QString &c, QWidget *parent);
- QSize sizeHint() const Q_DECL_OVERRIDE { return szHint; }
- QSize minimumSizeHint() const Q_DECL_OVERRIDE { return minSzHint; }
+ QSize sizeHint() const override { return szHint; }
+ QSize minimumSizeHint() const override { return minSzHint; }
void setCustomSizeHint(const QSize &size);
@@ -121,7 +121,7 @@ public slots:
void changeSizeHints();
protected:
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *) override;
private:
const QString color;
diff --git a/examples/widgets/mainwindows/mainwindow/colorswatch.h b/examples/widgets/mainwindows/mainwindow/colorswatch.h
index c2f6ef19b9..ec9d9e7372 100644
--- a/examples/widgets/mainwindows/mainwindow/colorswatch.h
+++ b/examples/widgets/mainwindows/mainwindow/colorswatch.h
@@ -69,9 +69,9 @@ public:
protected:
#ifndef QT_NO_CONTEXTMENU
- void contextMenuEvent(QContextMenuEvent *event) Q_DECL_OVERRIDE;
+ void contextMenuEvent(QContextMenuEvent *event) override;
#endif // QT_NO_CONTEXTMENU
- void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
+ void resizeEvent(QResizeEvent *e) override;
private slots:
void changeClosable(bool on);
@@ -130,12 +130,12 @@ class BlueTitleBar : public QWidget
public:
explicit BlueTitleBar(QWidget *parent = Q_NULLPTR);
- QSize sizeHint() const Q_DECL_OVERRIDE { return minimumSizeHint(); }
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override { return minimumSizeHint(); }
+ QSize minimumSizeHint() const override;
protected:
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
public slots:
void updateMask();
diff --git a/examples/widgets/mainwindows/mdi/mainwindow.h b/examples/widgets/mainwindows/mdi/mainwindow.h
index 4525b52697..f163145c2c 100644
--- a/examples/widgets/mainwindows/mdi/mainwindow.h
+++ b/examples/widgets/mainwindows/mdi/mainwindow.h
@@ -71,7 +71,7 @@ public:
bool openFile(const QString &fileName);
protected:
- void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
+ void closeEvent(QCloseEvent *event) override;
private slots:
void newFile();
diff --git a/examples/widgets/mainwindows/mdi/mdichild.h b/examples/widgets/mainwindows/mdi/mdichild.h
index 22fbb28212..2ac8194f73 100644
--- a/examples/widgets/mainwindows/mdi/mdichild.h
+++ b/examples/widgets/mainwindows/mdi/mdichild.h
@@ -69,7 +69,7 @@ public:
QString currentFile() { return curFile; }
protected:
- void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
+ void closeEvent(QCloseEvent *event) override;
private slots:
void documentWasModified();
diff --git a/examples/widgets/mainwindows/menus/mainwindow.h b/examples/widgets/mainwindows/menus/mainwindow.h
index 590d7c7550..1f1a065aaf 100644
--- a/examples/widgets/mainwindows/menus/mainwindow.h
+++ b/examples/widgets/mainwindows/menus/mainwindow.h
@@ -70,7 +70,7 @@ public:
protected:
#ifndef QT_NO_CONTEXTMENU
- void contextMenuEvent(QContextMenuEvent *event) Q_DECL_OVERRIDE;
+ void contextMenuEvent(QContextMenuEvent *event) override;
#endif // QT_NO_CONTEXTMENU
//! [0]
diff --git a/examples/widgets/mainwindows/sdi/mainwindow.h b/examples/widgets/mainwindows/sdi/mainwindow.h
index 4b4beaeaae..059710eacb 100644
--- a/examples/widgets/mainwindows/sdi/mainwindow.h
+++ b/examples/widgets/mainwindows/sdi/mainwindow.h
@@ -73,7 +73,7 @@ public:
void tile(const QMainWindow *previous);
protected:
- void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
+ void closeEvent(QCloseEvent *event) override;
private slots:
void newFile();
diff --git a/examples/widgets/painting/affine/affine.pro b/examples/widgets/painting/affine/affine.pro
index be6a83960d..0ad869183c 100644
--- a/examples/widgets/painting/affine/affine.pro
+++ b/examples/widgets/painting/affine/affine.pro
@@ -16,7 +16,3 @@ RESOURCES += affine.qrc
# install
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/painting/affine
INSTALLS += target
-
-wince {
- DEPLOYMENT_PLUGIN += qjpeg
-}
diff --git a/examples/widgets/painting/affine/xform.h b/examples/widgets/painting/affine/xform.h
index 11c8fbde90..f2eed99b4f 100644
--- a/examples/widgets/painting/affine/xform.h
+++ b/examples/widgets/painting/affine/xform.h
@@ -80,14 +80,14 @@ public:
enum XFormType { VectorType, PixmapType, TextType };
XFormView(QWidget *parent);
- void paint(QPainter *) Q_DECL_OVERRIDE;
+ void paint(QPainter *) override;
void drawVectorType(QPainter *painter);
void drawPixmapType(QPainter *painter);
void drawTextType(QPainter *painter);
- QSize sizeHint() const Q_DECL_OVERRIDE { return QSize(500, 500); }
+ QSize sizeHint() const override { return QSize(500, 500); }
- void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
+ void mousePressEvent(QMouseEvent *e) override;
+ void resizeEvent(QResizeEvent *e) override;
HoverPoints *hoverPoints() { return pts; }
bool animation() const { return timer.isActive(); }
@@ -124,9 +124,9 @@ signals:
void shearChanged(int shear);
protected:
- void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *e) override;
#ifndef QT_NO_WHEELEVENT
- void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE;
+ void wheelEvent(QWheelEvent *) override;
#endif
private:
diff --git a/examples/widgets/painting/basicdrawing/renderarea.h b/examples/widgets/painting/basicdrawing/renderarea.h
index db44d8aa14..fb4aab470b 100644
--- a/examples/widgets/painting/basicdrawing/renderarea.h
+++ b/examples/widgets/painting/basicdrawing/renderarea.h
@@ -67,8 +67,8 @@ public:
RenderArea(QWidget *parent = 0);
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize minimumSizeHint() const override;
+ QSize sizeHint() const override;
public slots:
void setShape(Shape shape);
@@ -78,7 +78,7 @@ public slots:
void setTransformed(bool transformed);
protected:
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
private:
Shape shape;
diff --git a/examples/widgets/painting/composition/composition.cpp b/examples/widgets/painting/composition/composition.cpp
index 1c2802f860..d5d674fd83 100644
--- a/examples/widgets/painting/composition/composition.cpp
+++ b/examples/widgets/painting/composition/composition.cpp
@@ -290,7 +290,7 @@ void CompositionRenderer::updateCirclePos()
if (m_current_object != NoObject)
return;
QDateTime dt = QDateTime::currentDateTime();
- qreal t = (dt.toTime_t() * 1000 + dt.time().msec()) / 1000.0;
+ qreal t = dt.toMSecsSinceEpoch() / 1000.0;
qreal x = width() / qreal(2) + (qCos(t*8/11) + qSin(-t)) * width() / qreal(4);
qreal y = height() / qreal(2) + (qSin(t*6/7) + qCos(t * qreal(1.5))) * height() / qreal(4);
diff --git a/examples/widgets/painting/composition/composition.h b/examples/widgets/painting/composition/composition.h
index 015dd13098..49853f503b 100644
--- a/examples/widgets/painting/composition/composition.h
+++ b/examples/widgets/painting/composition/composition.h
@@ -118,21 +118,21 @@ class CompositionRenderer : public ArthurFrame
public:
CompositionRenderer(QWidget *parent);
- void paint(QPainter *) Q_DECL_OVERRIDE;
+ void paint(QPainter *) override;
void setCirclePos(const QPointF &pos);
- QSize sizeHint() const Q_DECL_OVERRIDE { return QSize(500, 400); }
+ QSize sizeHint() const override { return QSize(500, 400); }
bool animationEnabled() const { return m_animation_enabled; }
int circleColor() const { return m_circle_hue; }
int circleAlpha() const { return m_circle_alpha; }
protected:
- void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
+ void mousePressEvent(QMouseEvent *) override;
+ void mouseMoveEvent(QMouseEvent *) override;
+ void mouseReleaseEvent(QMouseEvent *) override;
+ void timerEvent(QTimerEvent *) override;
public slots:
void setClearMode() { m_composition_mode = QPainter::CompositionMode_Clear; update(); }
diff --git a/examples/widgets/painting/composition/composition.pro b/examples/widgets/painting/composition/composition.pro
index 3b64714ba2..5fdbe4a5a2 100644
--- a/examples/widgets/painting/composition/composition.pro
+++ b/examples/widgets/painting/composition/composition.pro
@@ -6,7 +6,7 @@ SHARED_FOLDER = ../shared
include($$SHARED_FOLDER/shared.pri)
RESOURCES += composition.qrc
-qtHaveModule(opengl): !contains(QT_CONFIG,dynamicgl) {
+qtHaveModule(opengl):!qtConfig(dynamicgl) {
DEFINES += USE_OPENGL
QT += opengl
}
@@ -15,7 +15,3 @@ QT += widgets
# install
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/painting/composition
INSTALLS += target
-
-wince* {
- DEPLOYMENT_PLUGIN += qjpeg
-}
diff --git a/examples/widgets/painting/concentriccircles/circlewidget.h b/examples/widgets/painting/concentriccircles/circlewidget.h
index 99e39ca2bb..79fd5c71da 100644
--- a/examples/widgets/painting/concentriccircles/circlewidget.h
+++ b/examples/widgets/painting/concentriccircles/circlewidget.h
@@ -64,14 +64,14 @@ public:
void setFloatBased(bool floatBased);
void setAntialiased(bool antialiased);
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize minimumSizeHint() const override;
+ QSize sizeHint() const override;
public slots:
void nextAnimationFrame();
protected:
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
private:
bool floatBased;
diff --git a/examples/widgets/painting/deform/pathdeform.h b/examples/widgets/painting/deform/pathdeform.h
index 46c1d2c5ac..68908045b9 100644
--- a/examples/widgets/painting/deform/pathdeform.h
+++ b/examples/widgets/painting/deform/pathdeform.h
@@ -69,14 +69,14 @@ class PathDeformRenderer : public ArthurFrame
public:
explicit PathDeformRenderer(QWidget *widget, bool smallScreen = false);
- void paint(QPainter *painter) Q_DECL_OVERRIDE;
+ void paint(QPainter *painter) override;
- void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
+ void mousePressEvent(QMouseEvent *e) override;
+ void mouseReleaseEvent(QMouseEvent *e) override;
+ void mouseMoveEvent(QMouseEvent *e) override;
+ void timerEvent(QTimerEvent *e) override;
- QSize sizeHint() const Q_DECL_OVERRIDE { return QSize(600, 500); }
+ QSize sizeHint() const override { return QSize(600, 500); }
bool animated() const { return m_animated; }
int radius() const { return int(m_radius); }
diff --git a/examples/widgets/painting/gradients/gradients.h b/examples/widgets/painting/gradients/gradients.h
index b15a586d72..b4db298bb4 100644
--- a/examples/widgets/painting/gradients/gradients.h
+++ b/examples/widgets/painting/gradients/gradients.h
@@ -76,9 +76,9 @@ public:
void setGradientStops(const QGradientStops &stops);
- void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *e) override;
- QSize sizeHint() const Q_DECL_OVERRIDE { return QSize(150, 40); }
+ QSize sizeHint() const override { return QSize(150, 40); }
QPolygonF points() const;
HoverPoints *hoverPoints() const { return m_hoverPoints; }
@@ -125,12 +125,12 @@ class GradientRenderer : public ArthurFrame
public:
GradientRenderer(QWidget *parent);
- void paint(QPainter *p) Q_DECL_OVERRIDE;
+ void paint(QPainter *p) override;
- QSize sizeHint() const Q_DECL_OVERRIDE { return QSize(400, 400); }
+ QSize sizeHint() const override { return QSize(400, 400); }
HoverPoints *hoverPoints() const { return m_hoverPoints; }
- void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
+ void mousePressEvent(QMouseEvent *e) override;
public slots:
void setGradientStops(const QGradientStops &stops);
diff --git a/examples/widgets/painting/painterpaths/renderarea.h b/examples/widgets/painting/painterpaths/renderarea.h
index 0c07108589..5f0874b772 100644
--- a/examples/widgets/painting/painterpaths/renderarea.h
+++ b/examples/widgets/painting/painterpaths/renderarea.h
@@ -62,8 +62,8 @@ class RenderArea : public QWidget
public:
explicit RenderArea(const QPainterPath &path, QWidget *parent = 0);
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize minimumSizeHint() const override;
+ QSize sizeHint() const override;
public slots:
void setFillRule(Qt::FillRule rule);
@@ -73,7 +73,7 @@ public slots:
void setRotationAngle(int degrees);
protected:
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
//! [0]
//! [1]
diff --git a/examples/widgets/painting/pathstroke/pathstroke.h b/examples/widgets/painting/pathstroke/pathstroke.h
index f5f2a9ae00..71352c8cc2 100644
--- a/examples/widgets/painting/pathstroke/pathstroke.h
+++ b/examples/widgets/painting/pathstroke/pathstroke.h
@@ -65,14 +65,14 @@ public:
explicit PathStrokeRenderer(QWidget *parent, bool smallScreen = false);
- void paint(QPainter *) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
- bool event(QEvent *e) Q_DECL_OVERRIDE;
-
- QSize sizeHint() const Q_DECL_OVERRIDE { return QSize(500, 500); }
+ void paint(QPainter *) override;
+ void mousePressEvent(QMouseEvent *e) override;
+ void mouseMoveEvent(QMouseEvent *e) override;
+ void mouseReleaseEvent(QMouseEvent *e) override;
+ void timerEvent(QTimerEvent *e) override;
+ bool event(QEvent *e) override;
+
+ QSize sizeHint() const override { return QSize(500, 500); }
bool animation() const { return m_timer.isActive(); }
diff --git a/examples/widgets/painting/shared/arthurstyle.h b/examples/widgets/painting/shared/arthurstyle.h
index ca5993b5a2..8ea8354bab 100644
--- a/examples/widgets/painting/shared/arthurstyle.h
+++ b/examples/widgets/painting/shared/arthurstyle.h
@@ -63,23 +63,23 @@ public:
void drawHoverRect(QPainter *painter, const QRect &rect) const;
void drawPrimitive(PrimitiveElement element, const QStyleOption *option,
- QPainter *painter, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ QPainter *painter, const QWidget *widget = 0) const override;
void drawControl(ControlElement element, const QStyleOption *option,
- QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE;
+ QPainter *painter, const QWidget *widget) const override;
void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option,
- QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE;
+ QPainter *painter, const QWidget *widget) const override;
QSize sizeFromContents(ContentsType type, const QStyleOption *option,
- const QSize &size, const QWidget *widget) const Q_DECL_OVERRIDE;
+ const QSize &size, const QWidget *widget) const override;
- QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const Q_DECL_OVERRIDE;
+ QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const override;
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt,
- SubControl sc, const QWidget *widget) const Q_DECL_OVERRIDE;
+ SubControl sc, const QWidget *widget) const override;
- int pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const Q_DECL_OVERRIDE;
+ int pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const override;
- void polish(QPalette &palette) Q_DECL_OVERRIDE;
- void polish(QWidget *widget) Q_DECL_OVERRIDE;
- void unpolish(QWidget *widget) Q_DECL_OVERRIDE;
+ void polish(QPalette &palette) override;
+ void polish(QWidget *widget) override;
+ void unpolish(QWidget *widget) override;
};
#endif
diff --git a/examples/widgets/painting/shared/arthurwidgets.h b/examples/widgets/painting/shared/arthurwidgets.h
index 0133073c04..d6e1e44b3a 100644
--- a/examples/widgets/painting/shared/arthurwidgets.h
+++ b/examples/widgets/painting/shared/arthurwidgets.h
@@ -68,9 +68,9 @@ public:
setAttribute(Qt::WA_AcceptTouchEvents);
}
void disableAutoBufferSwap() { setAutoBufferSwap(false); }
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE { parentWidget()->update(); }
+ void paintEvent(QPaintEvent *) override { parentWidget()->update(); }
protected:
- bool event(QEvent *event) Q_DECL_OVERRIDE
+ bool event(QEvent *event) override
{
switch (event->type()) {
case QEvent::TouchBegin:
@@ -126,8 +126,8 @@ signals:
void descriptionEnabledChanged(bool);
protected:
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *) override;
+ void resizeEvent(QResizeEvent *) override;
#if defined(QT_OPENGL_SUPPORT)
GLWidget *glw;
diff --git a/examples/widgets/painting/shared/hoverpoints.h b/examples/widgets/painting/shared/hoverpoints.h
index 6f8c122042..6bf1cafe4e 100644
--- a/examples/widgets/painting/shared/hoverpoints.h
+++ b/examples/widgets/painting/shared/hoverpoints.h
@@ -85,7 +85,7 @@ public:
HoverPoints(QWidget *widget, PointShape shape);
- bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *object, QEvent *event) override;
void paintPoints();
diff --git a/examples/widgets/painting/shared/shared.pri b/examples/widgets/painting/shared/shared.pri
index c8d119f4e5..362cc6819c 100644
--- a/examples/widgets/painting/shared/shared.pri
+++ b/examples/widgets/painting/shared/shared.pri
@@ -1,6 +1,6 @@
INCLUDEPATH += $$PWD
-qtHaveModule(opengl)|contains(QT_CONFIG, opengles2) {
+qtHaveModule(opengl)|qtConfig(opengles2) {
DEFINES += QT_OPENGL_SUPPORT
QT += opengl widgets
}
diff --git a/examples/widgets/painting/transformations/renderarea.h b/examples/widgets/painting/transformations/renderarea.h
index 2cc9ac274a..140be27b2b 100644
--- a/examples/widgets/painting/transformations/renderarea.h
+++ b/examples/widgets/painting/transformations/renderarea.h
@@ -75,11 +75,11 @@ public:
void setOperations(const QList<Operation> &operations);
void setShape(const QPainterPath &shape);
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize minimumSizeHint() const override;
+ QSize sizeHint() const override;
protected:
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
//! [1]
//! [2]
diff --git a/examples/widgets/richtext/syntaxhighlighter/highlighter.h b/examples/widgets/richtext/syntaxhighlighter/highlighter.h
index 56274778ce..39141615fc 100644
--- a/examples/widgets/richtext/syntaxhighlighter/highlighter.h
+++ b/examples/widgets/richtext/syntaxhighlighter/highlighter.h
@@ -67,7 +67,7 @@ public:
Highlighter(QTextDocument *parent = 0);
protected:
- void highlightBlock(const QString &text) Q_DECL_OVERRIDE;
+ void highlightBlock(const QString &text) override;
private:
struct HighlightingRule
diff --git a/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro b/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro
index 93cd950b0b..ae51662341 100644
--- a/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro
+++ b/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro
@@ -9,10 +9,3 @@ SOURCES = highlighter.cpp \
# install
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/richtext/syntaxhighlighter
INSTALLS += target
-
-
-wince {
- addFiles.files = main.cpp mainwindow.cpp
- addFiles.path = .
- INSTALLS += addFiles
-}
diff --git a/examples/widgets/richtext/textedit/textedit.h b/examples/widgets/richtext/textedit/textedit.h
index d130b9cca7..e5f04e706c 100644
--- a/examples/widgets/richtext/textedit/textedit.h
+++ b/examples/widgets/richtext/textedit/textedit.h
@@ -78,7 +78,7 @@ public slots:
void fileNew();
protected:
- virtual void closeEvent(QCloseEvent *e) Q_DECL_OVERRIDE;
+ virtual void closeEvent(QCloseEvent *e) override;
private slots:
void fileOpen();
diff --git a/examples/widgets/scroller/graphicsview/main.cpp b/examples/widgets/scroller/graphicsview/main.cpp
index 4009041cd8..c33a3091ed 100644
--- a/examples/widgets/scroller/graphicsview/main.cpp
+++ b/examples/widgets/scroller/graphicsview/main.cpp
@@ -74,7 +74,7 @@ public:
setFlag(QGraphicsItem::ItemClipsToShape, true);
}
- QRectF boundingRect() const Q_DECL_OVERRIDE
+ QRectF boundingRect() const override
{
// here we only want the size of the children and not the size of the children of the children...
qreal halfpw = m_pen.widthF() / 2;
@@ -85,7 +85,7 @@ public:
return rect;
}
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
{
Q_UNUSED(option);
Q_UNUSED(widget);
@@ -114,7 +114,7 @@ public:
: QGraphicsObject(parent)
{ }
- QRectF boundingRect() const Q_DECL_OVERRIDE
+ QRectF boundingRect() const override
{
QRectF rect;
foreach (QGraphicsItem *item, childItems())
@@ -122,7 +122,7 @@ public:
return rect;
}
- void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*) Q_DECL_OVERRIDE
+ void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override
{ }
};
@@ -150,7 +150,7 @@ public:
return m_viewport;
}
- bool event(QEvent *e) Q_DECL_OVERRIDE
+ bool event(QEvent *e) override
{
switch (e->type()) {
// ![2]
@@ -179,7 +179,7 @@ public:
return QGraphicsObject::event(e);
}
- bool sceneEvent(QEvent *e) Q_DECL_OVERRIDE
+ bool sceneEvent(QEvent *e) override
{
switch (e->type()) {
case QEvent::TouchBegin: {
@@ -204,12 +204,12 @@ public:
return QGraphicsObject::sceneEvent(e);
}
- QRectF boundingRect() const Q_DECL_OVERRIDE
+ QRectF boundingRect() const override
{
return QRectF(0, 0, m_size.width() + 3, m_size.height());
}
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
{
Q_UNUSED(option);
Q_UNUSED(widget);
@@ -275,7 +275,7 @@ public:
protected:
- void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE
+ void resizeEvent(QResizeEvent *e) override
{
// resize the scene according to our own size to prevent scrolling
m_scene->setSceneRect(0, 0, m_view->viewport()->width(), m_view->viewport()->height());
diff --git a/examples/widgets/statemachine/factorial/main.cpp b/examples/widgets/statemachine/factorial/main.cpp
index 995ae4d246..d0d61cb7df 100644
--- a/examples/widgets/statemachine/factorial/main.cpp
+++ b/examples/widgets/statemachine/factorial/main.cpp
@@ -103,7 +103,7 @@ public:
: QSignalTransition(fact, SIGNAL(xChanged(int))), m_fact(fact)
{}
- virtual bool eventTest(QEvent *e) Q_DECL_OVERRIDE
+ virtual bool eventTest(QEvent *e) override
{
if (!QSignalTransition::eventTest(e))
return false;
@@ -111,7 +111,7 @@ public:
return se->arguments().at(0).toInt() > 1;
}
- virtual void onTransition(QEvent *e) Q_DECL_OVERRIDE
+ virtual void onTransition(QEvent *e) override
{
QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(e);
int x = se->arguments().at(0).toInt();
@@ -133,7 +133,7 @@ public:
: QSignalTransition(fact, SIGNAL(xChanged(int))), m_fact(fact)
{}
- virtual bool eventTest(QEvent *e) Q_DECL_OVERRIDE
+ virtual bool eventTest(QEvent *e) override
{
if (!QSignalTransition::eventTest(e))
return false;
@@ -141,7 +141,7 @@ public:
return se->arguments().at(0).toInt() <= 1;
}
- virtual void onTransition(QEvent *) Q_DECL_OVERRIDE
+ virtual void onTransition(QEvent *) override
{
fprintf(stdout, "%d\n", m_fact->property("fac").toInt());
}
diff --git a/examples/widgets/statemachine/pingpong/main.cpp b/examples/widgets/statemachine/pingpong/main.cpp
index ef799ec998..8c3b9f674b 100644
--- a/examples/widgets/statemachine/pingpong/main.cpp
+++ b/examples/widgets/statemachine/pingpong/main.cpp
@@ -75,7 +75,7 @@ public:
: QState(parent) {}
protected:
- virtual void onEntry(QEvent *) Q_DECL_OVERRIDE
+ virtual void onEntry(QEvent *) override
{
machine()->postEvent(new PingEvent());
fprintf(stdout, "ping?\n");
@@ -90,10 +90,10 @@ public:
PongTransition() {}
protected:
- virtual bool eventTest(QEvent *e) Q_DECL_OVERRIDE {
+ virtual bool eventTest(QEvent *e) override {
return (e->type() == QEvent::User+3);
}
- virtual void onTransition(QEvent *) Q_DECL_OVERRIDE
+ virtual void onTransition(QEvent *) override
{
machine()->postDelayedEvent(new PingEvent(), 500);
fprintf(stdout, "ping?\n");
@@ -108,10 +108,10 @@ public:
PingTransition() {}
protected:
- virtual bool eventTest(QEvent *e) Q_DECL_OVERRIDE {
+ virtual bool eventTest(QEvent *e) override {
return (e->type() == QEvent::User+2);
}
- virtual void onTransition(QEvent *) Q_DECL_OVERRIDE
+ virtual void onTransition(QEvent *) override
{
machine()->postDelayedEvent(new PongEvent(), 500);
fprintf(stdout, "pong!\n");
diff --git a/examples/widgets/statemachine/rogue/movementtransition.h b/examples/widgets/statemachine/rogue/movementtransition.h
index 05fc7edf61..74ffed6608 100644
--- a/examples/widgets/statemachine/rogue/movementtransition.h
+++ b/examples/widgets/statemachine/rogue/movementtransition.h
@@ -69,7 +69,7 @@ public:
//![1]
protected:
- bool eventTest(QEvent *event) Q_DECL_OVERRIDE {
+ bool eventTest(QEvent *event) override {
if (event->type() == QEvent::StateMachineWrapped &&
static_cast<QStateMachine::WrappedEvent *>(event)->event()->type() == QEvent::KeyPress) {
QEvent *wrappedEvent = static_cast<QStateMachine::WrappedEvent *>(event)->event();
@@ -86,7 +86,7 @@ protected:
//![1]
//![2]
- void onTransition(QEvent *event) Q_DECL_OVERRIDE {
+ void onTransition(QEvent *event) override {
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(
static_cast<QStateMachine::WrappedEvent *>(event)->event());
diff --git a/examples/widgets/statemachine/rogue/window.h b/examples/widgets/statemachine/rogue/window.h
index 2ac9650201..af34815ffd 100644
--- a/examples/widgets/statemachine/rogue/window.h
+++ b/examples/widgets/statemachine/rogue/window.h
@@ -77,10 +77,10 @@ public:
void setStatus(const QString &status);
QString status() const;
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
protected:
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
//![0]
//![1]
diff --git a/examples/widgets/statemachine/trafficlight/main.cpp b/examples/widgets/statemachine/trafficlight/main.cpp
index ebfb3bface..143f2a9324 100644
--- a/examples/widgets/statemachine/trafficlight/main.cpp
+++ b/examples/widgets/statemachine/trafficlight/main.cpp
@@ -74,7 +74,7 @@ public slots:
void turnOn() { setOn(true); }
protected:
- virtual void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE
+ virtual void paintEvent(QPaintEvent *) override
{
if (!m_on)
return;
diff --git a/examples/widgets/tools/completer/fsmodel.h b/examples/widgets/tools/completer/fsmodel.h
index a9b7db3849..a243c48b43 100644
--- a/examples/widgets/tools/completer/fsmodel.h
+++ b/examples/widgets/tools/completer/fsmodel.h
@@ -63,7 +63,7 @@ class FileSystemModel : public QFileSystemModel
{
public:
FileSystemModel(QObject *parent = 0);
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
};
//! [0]
diff --git a/examples/widgets/tools/customcompleter/textedit.h b/examples/widgets/tools/customcompleter/textedit.h
index ce407cbf53..d0636ab670 100644
--- a/examples/widgets/tools/customcompleter/textedit.h
+++ b/examples/widgets/tools/customcompleter/textedit.h
@@ -70,8 +70,8 @@ public:
QCompleter *completer() const;
protected:
- void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
- void focusInEvent(QFocusEvent *e) Q_DECL_OVERRIDE;
+ void keyPressEvent(QKeyEvent *e) override;
+ void focusInEvent(QFocusEvent *e) override;
private slots:
void insertCompletion(const QString &completion);
diff --git a/examples/widgets/tools/echoplugin/plugin/echoplugin.h b/examples/widgets/tools/echoplugin/plugin/echoplugin.h
index 94feb1a2ea..f0f237099c 100644
--- a/examples/widgets/tools/echoplugin/plugin/echoplugin.h
+++ b/examples/widgets/tools/echoplugin/plugin/echoplugin.h
@@ -63,7 +63,7 @@ class EchoPlugin : public QObject, EchoInterface
Q_INTERFACES(EchoInterface)
public:
- QString echo(const QString &message) Q_DECL_OVERRIDE;
+ QString echo(const QString &message) override;
};
//! [0]
diff --git a/examples/widgets/tools/i18n/languagechooser.h b/examples/widgets/tools/i18n/languagechooser.h
index 8af7be6d71..13363c7111 100644
--- a/examples/widgets/tools/i18n/languagechooser.h
+++ b/examples/widgets/tools/i18n/languagechooser.h
@@ -71,8 +71,8 @@ public:
explicit LanguageChooser(const QString& defaultLang = QString(), QWidget *parent = 0);
protected:
- bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE;
- void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *object, QEvent *event) override;
+ void closeEvent(QCloseEvent *event) override;
private slots:
void checkBoxToggled();
diff --git a/examples/widgets/tools/plugandpaint/app/app.pro b/examples/widgets/tools/plugandpaint/app/app.pro
index 8139cd53ad..e35203edf2 100644
--- a/examples/widgets/tools/plugandpaint/app/app.pro
+++ b/examples/widgets/tools/plugandpaint/app/app.pro
@@ -13,11 +13,16 @@ SOURCES = main.cpp \
paintarea.cpp \
plugindialog.cpp
-LIBS = -L../plugins -lpnp_basictools
+LIBS = -L../plugins
-if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
- mac:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)_debug
- win32:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)d
+macx-xcode:qtConfig(simulator_and_device) {
+ LIBS += -lpnp_basictools$($${QMAKE_XCODE_LIBRARY_PLATFORM_SUFFIX_SETTING})$($${QMAKE_XCODE_LIBRARY_SUFFIX_SETTING})
+} else {
+ LIBS += -lpnp_basictools
+ if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
+ mac:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)_debug
+ win32:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)d
+ }
}
#! [0]
diff --git a/examples/widgets/tools/plugandpaint/app/paintarea.h b/examples/widgets/tools/plugandpaint/app/paintarea.h
index 415e4c0be4..1c8ee1ee1b 100644
--- a/examples/widgets/tools/plugandpaint/app/paintarea.h
+++ b/examples/widgets/tools/plugandpaint/app/paintarea.h
@@ -76,13 +76,13 @@ public:
QImage image() const { return theImage; }
QColor brushColor() const { return color; }
int brushWidth() const { return thickness; }
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
protected:
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
private:
void setupPainter(QPainter &painter);
diff --git a/examples/widgets/tools/plugandpaint/plugins/basictools/basictools.pro b/examples/widgets/tools/plugandpaint/plugins/basictools/basictools.pro
index f28be96b03..8317019c10 100644
--- a/examples/widgets/tools/plugandpaint/plugins/basictools/basictools.pro
+++ b/examples/widgets/tools/plugandpaint/plugins/basictools/basictools.pro
@@ -14,3 +14,4 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tools/plugandpaint/plugins
INSTALLS += target
CONFIG += install_ok # Do not cargo-cult this!
+uikit: CONFIG += debug_and_release simulator_and_device
diff --git a/examples/widgets/tools/plugandpaint/plugins/basictools/basictoolsplugin.h b/examples/widgets/tools/plugandpaint/plugins/basictools/basictoolsplugin.h
index 6e6d639d12..fd9bb9e5f3 100644
--- a/examples/widgets/tools/plugandpaint/plugins/basictools/basictoolsplugin.h
+++ b/examples/widgets/tools/plugandpaint/plugins/basictools/basictoolsplugin.h
@@ -78,22 +78,22 @@ class BasicToolsPlugin : public QObject,
public:
//! [1]
// BrushInterface
- QStringList brushes() const Q_DECL_OVERRIDE;
+ QStringList brushes() const override;
QRect mousePress(const QString &brush, QPainter &painter,
- const QPoint &pos) Q_DECL_OVERRIDE;
+ const QPoint &pos) override;
QRect mouseMove(const QString &brush, QPainter &painter,
- const QPoint &oldPos, const QPoint &newPos) Q_DECL_OVERRIDE;
+ const QPoint &oldPos, const QPoint &newPos) override;
QRect mouseRelease(const QString &brush, QPainter &painter,
- const QPoint &pos) Q_DECL_OVERRIDE;
+ const QPoint &pos) override;
// ShapeInterface
- QStringList shapes() const Q_DECL_OVERRIDE;
- QPainterPath generateShape(const QString &shape, QWidget *parent) Q_DECL_OVERRIDE;
+ QStringList shapes() const override;
+ QPainterPath generateShape(const QString &shape, QWidget *parent) override;
// FilterInterface
- QStringList filters() const Q_DECL_OVERRIDE;
+ QStringList filters() const override;
QImage filterImage(const QString &filter, const QImage &image,
- QWidget *parent) Q_DECL_OVERRIDE;
+ QWidget *parent) override;
//! [3]
};
//! [2] //! [3]
diff --git a/examples/widgets/tools/plugandpaint/plugins/extrafilters/extrafilters.pro b/examples/widgets/tools/plugandpaint/plugins/extrafilters/extrafilters.pro
index deb3c5e70e..4716665d34 100644
--- a/examples/widgets/tools/plugandpaint/plugins/extrafilters/extrafilters.pro
+++ b/examples/widgets/tools/plugandpaint/plugins/extrafilters/extrafilters.pro
@@ -14,3 +14,4 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tools/plugandpaint/plugins
INSTALLS += target
CONFIG += install_ok # Do not cargo-cult this!
+uikit: CONFIG += debug_and_release simulator_and_device
diff --git a/examples/widgets/tools/plugandpaint/plugins/extrafilters/extrafiltersplugin.h b/examples/widgets/tools/plugandpaint/plugins/extrafilters/extrafiltersplugin.h
index 4beac9a7fb..dddde78caa 100644
--- a/examples/widgets/tools/plugandpaint/plugins/extrafilters/extrafiltersplugin.h
+++ b/examples/widgets/tools/plugandpaint/plugins/extrafilters/extrafiltersplugin.h
@@ -66,9 +66,9 @@ class ExtraFiltersPlugin : public QObject, public FilterInterface
Q_INTERFACES(FilterInterface)
public:
- QStringList filters() const Q_DECL_OVERRIDE;
+ QStringList filters() const override;
QImage filterImage(const QString &filter, const QImage &image,
- QWidget *parent) Q_DECL_OVERRIDE;
+ QWidget *parent) override;
};
//! [0]
diff --git a/examples/widgets/tools/settingseditor/settingstree.h b/examples/widgets/tools/settingseditor/settingstree.h
index b46a3d38da..15efa0e6aa 100644
--- a/examples/widgets/tools/settingseditor/settingstree.h
+++ b/examples/widgets/tools/settingseditor/settingstree.h
@@ -71,7 +71,7 @@ public:
~SettingsTree();
void setSettingsObject(const SettingsPtr &settings);
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
public slots:
void setAutoRefresh(bool autoRefresh);
@@ -80,7 +80,7 @@ public slots:
void refresh();
protected:
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
private slots:
void updateSetting(QTreeWidgetItem *item);
diff --git a/examples/widgets/tools/settingseditor/variantdelegate.h b/examples/widgets/tools/settingseditor/variantdelegate.h
index 3860ecb2f4..a15228fdf9 100644
--- a/examples/widgets/tools/settingseditor/variantdelegate.h
+++ b/examples/widgets/tools/settingseditor/variantdelegate.h
@@ -62,12 +62,12 @@ public:
VariantDelegate(QObject *parent = 0);
void paint(QPainter *painter, const QStyleOptionViewItem &option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
- void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
+ void setEditorData(QWidget *editor, const QModelIndex &index) const override;
void setModelData(QWidget *editor, QAbstractItemModel *model,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
static bool isSupportedType(QVariant::Type type);
static QString displayText(const QVariant &value);
diff --git a/examples/widgets/tools/styleplugin/plugin/simplestyle.h b/examples/widgets/tools/styleplugin/plugin/simplestyle.h
index 05905cd87b..51d6d5b77e 100644
--- a/examples/widgets/tools/styleplugin/plugin/simplestyle.h
+++ b/examples/widgets/tools/styleplugin/plugin/simplestyle.h
@@ -64,7 +64,7 @@ class SimpleStyle : public QProxyStyle
public:
SimpleStyle() {};
- void polish(QPalette &palette) Q_DECL_OVERRIDE;
+ void polish(QPalette &palette) override;
};
#endif
diff --git a/examples/widgets/tools/styleplugin/plugin/simplestyleplugin.h b/examples/widgets/tools/styleplugin/plugin/simplestyleplugin.h
index 980de4c1df..88805d4887 100644
--- a/examples/widgets/tools/styleplugin/plugin/simplestyleplugin.h
+++ b/examples/widgets/tools/styleplugin/plugin/simplestyleplugin.h
@@ -68,7 +68,7 @@ public:
SimpleStylePlugin() {}
QStringList keys() const;
- QStyle *create(const QString &key) Q_DECL_OVERRIDE;
+ QStyle *create(const QString &key) override;
};
//! [0]
diff --git a/examples/widgets/tools/tools.pro b/examples/widgets/tools/tools.pro
index f3cbd73d98..dd8401567b 100644
--- a/examples/widgets/tools/tools.pro
+++ b/examples/widgets/tools/tools.pro
@@ -16,8 +16,7 @@ SUBDIRS = \
contains(DEFINES, QT_NO_TRANSLATION): SUBDIRS -= i18n
-load(qfeatures)
-contains(QT_DISABLED_FEATURES, library) {
+!qtConfig(library) {
SUBDIRS -= \
echoplugin \
plugandpaint
diff --git a/examples/widgets/tools/treemodelcompleter/treemodelcompleter.h b/examples/widgets/tools/treemodelcompleter/treemodelcompleter.h
index 7e10f87f5b..1d28fddee0 100644
--- a/examples/widgets/tools/treemodelcompleter/treemodelcompleter.h
+++ b/examples/widgets/tools/treemodelcompleter/treemodelcompleter.h
@@ -68,8 +68,8 @@ public slots:
void setSeparator(const QString &separator);
protected:
- QStringList splitPath(const QString &path) const Q_DECL_OVERRIDE;
- QString pathFromIndex(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ QStringList splitPath(const QString &path) const override;
+ QString pathFromIndex(const QModelIndex &index) const override;
private:
QString sep;
diff --git a/examples/widgets/tools/undo/commands.h b/examples/widgets/tools/undo/commands.h
index 1a14b3fa56..de3bebd740 100644
--- a/examples/widgets/tools/undo/commands.h
+++ b/examples/widgets/tools/undo/commands.h
@@ -58,8 +58,8 @@ class AddShapeCommand : public QUndoCommand
{
public:
AddShapeCommand(Document *doc, const Shape &shape, QUndoCommand *parent = 0);
- void undo() Q_DECL_OVERRIDE;
- void redo() Q_DECL_OVERRIDE;
+ void undo() override;
+ void redo() override;
private:
Document *m_doc;
@@ -71,8 +71,8 @@ class RemoveShapeCommand : public QUndoCommand
{
public:
RemoveShapeCommand(Document *doc, const QString &shapeName, QUndoCommand *parent = 0);
- void undo() Q_DECL_OVERRIDE;
- void redo() Q_DECL_OVERRIDE;
+ void undo() override;
+ void redo() override;
private:
Document *m_doc;
@@ -86,11 +86,11 @@ public:
SetShapeColorCommand(Document *doc, const QString &shapeName, const QColor &color,
QUndoCommand *parent = 0);
- void undo() Q_DECL_OVERRIDE;
- void redo() Q_DECL_OVERRIDE;
+ void undo() override;
+ void redo() override;
- bool mergeWith(const QUndoCommand *command) Q_DECL_OVERRIDE;
- int id() const Q_DECL_OVERRIDE;
+ bool mergeWith(const QUndoCommand *command) override;
+ int id() const override;
private:
Document *m_doc;
@@ -105,11 +105,11 @@ public:
SetShapeRectCommand(Document *doc, const QString &shapeName, const QRect &rect,
QUndoCommand *parent = 0);
- void undo() Q_DECL_OVERRIDE;
- void redo() Q_DECL_OVERRIDE;
+ void undo() override;
+ void redo() override;
- bool mergeWith(const QUndoCommand *command) Q_DECL_OVERRIDE;
- int id() const Q_DECL_OVERRIDE;
+ bool mergeWith(const QUndoCommand *command) override;
+ int id() const override;
private:
Document *m_doc;
diff --git a/examples/widgets/tools/undo/document.h b/examples/widgets/tools/undo/document.h
index 41e53a9a04..8076d7185c 100644
--- a/examples/widgets/tools/undo/document.h
+++ b/examples/widgets/tools/undo/document.h
@@ -110,10 +110,10 @@ signals:
void currentShapeChanged(const QString &shapeName);
protected:
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
private:
void setCurrentShape(int index);
diff --git a/examples/widgets/tools/undoframework/commands.h b/examples/widgets/tools/undoframework/commands.h
index 22c62fe9fd..dc53c14557 100644
--- a/examples/widgets/tools/undoframework/commands.h
+++ b/examples/widgets/tools/undoframework/commands.h
@@ -64,10 +64,10 @@ public:
MoveCommand(DiagramItem *diagramItem, const QPointF &oldPos,
QUndoCommand *parent = 0);
- void undo() Q_DECL_OVERRIDE;
- void redo() Q_DECL_OVERRIDE;
- bool mergeWith(const QUndoCommand *command) Q_DECL_OVERRIDE;
- int id() const Q_DECL_OVERRIDE { return Id; }
+ void undo() override;
+ void redo() override;
+ bool mergeWith(const QUndoCommand *command) override;
+ int id() const override { return Id; }
private:
DiagramItem *myDiagramItem;
@@ -82,8 +82,8 @@ class DeleteCommand : public QUndoCommand
public:
explicit DeleteCommand(QGraphicsScene *graphicsScene, QUndoCommand *parent = 0);
- void undo() Q_DECL_OVERRIDE;
- void redo() Q_DECL_OVERRIDE;
+ void undo() override;
+ void redo() override;
private:
DiagramItem *myDiagramItem;
@@ -99,8 +99,8 @@ public:
QUndoCommand *parent = 0);
~AddCommand();
- void undo() Q_DECL_OVERRIDE;
- void redo() Q_DECL_OVERRIDE;
+ void undo() override;
+ void redo() override;
private:
DiagramItem *myDiagramItem;
diff --git a/examples/widgets/tools/undoframework/diagramitem.h b/examples/widgets/tools/undoframework/diagramitem.h
index 246443b64d..1638dcbea8 100644
--- a/examples/widgets/tools/undoframework/diagramitem.h
+++ b/examples/widgets/tools/undoframework/diagramitem.h
@@ -71,7 +71,7 @@ public:
DiagramType diagramType() const {
return polygon() == boxPolygon ? Box : Triangle;
}
- int type() const Q_DECL_OVERRIDE { return Type; }
+ int type() const override { return Type; }
private:
QPolygonF boxPolygon;
diff --git a/examples/widgets/tools/undoframework/diagramscene.h b/examples/widgets/tools/undoframework/diagramscene.h
index 6b275ce5d3..b1e2804ba6 100644
--- a/examples/widgets/tools/undoframework/diagramscene.h
+++ b/examples/widgets/tools/undoframework/diagramscene.h
@@ -72,8 +72,8 @@ signals:
void itemMoved(DiagramItem *movedItem, const QPointF &movedFromPosition);
protected:
- void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
+ void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
private:
QGraphicsItem *movingItem;
diff --git a/examples/widgets/tutorials/modelview/1_readonly/mymodel.h b/examples/widgets/tutorials/modelview/1_readonly/mymodel.h
index 68480c9f5e..e675cc6bc2 100644
--- a/examples/widgets/tutorials/modelview/1_readonly/mymodel.h
+++ b/examples/widgets/tutorials/modelview/1_readonly/mymodel.h
@@ -60,9 +60,9 @@ class MyModel : public QAbstractTableModel
Q_OBJECT
public:
MyModel(QObject *parent);
- int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE ;
- int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override ;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
};
//! [Quoting ModelView Tutorial]
diff --git a/examples/widgets/tutorials/modelview/2_formatting/mymodel.h b/examples/widgets/tutorials/modelview/2_formatting/mymodel.h
index 1d94c9fbeb..9c12f98ba9 100644
--- a/examples/widgets/tutorials/modelview/2_formatting/mymodel.h
+++ b/examples/widgets/tutorials/modelview/2_formatting/mymodel.h
@@ -58,9 +58,9 @@ class MyModel : public QAbstractTableModel
Q_OBJECT
public:
MyModel(QObject *parent);
- int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE ;
- int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override ;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
};
#endif // MYMODEL_H
diff --git a/examples/widgets/tutorials/modelview/3_changingmodel/mymodel.h b/examples/widgets/tutorials/modelview/3_changingmodel/mymodel.h
index 5d67d88e45..dfcf0f6239 100644
--- a/examples/widgets/tutorials/modelview/3_changingmodel/mymodel.h
+++ b/examples/widgets/tutorials/modelview/3_changingmodel/mymodel.h
@@ -59,9 +59,9 @@ class MyModel : public QAbstractTableModel
Q_OBJECT
public:
MyModel(QObject *parent);
- int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE ;
- int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override ;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
QTimer *timer;
private:
int selectedCell;
diff --git a/examples/widgets/tutorials/modelview/4_headers/mymodel.h b/examples/widgets/tutorials/modelview/4_headers/mymodel.h
index 74e2a93626..fb2d7aa940 100644
--- a/examples/widgets/tutorials/modelview/4_headers/mymodel.h
+++ b/examples/widgets/tutorials/modelview/4_headers/mymodel.h
@@ -58,10 +58,10 @@ class MyModel : public QAbstractTableModel
Q_OBJECT
public:
MyModel(QObject *parent);
- int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE ;
- int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
- QVariant headerData(int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override ;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
+ QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
};
#endif // MYMODEL_H
diff --git a/examples/widgets/tutorials/modelview/5_edit/mymodel.h b/examples/widgets/tutorials/modelview/5_edit/mymodel.h
index a95e120de3..dd0d4f5066 100644
--- a/examples/widgets/tutorials/modelview/5_edit/mymodel.h
+++ b/examples/widgets/tutorials/modelview/5_edit/mymodel.h
@@ -65,11 +65,11 @@ class MyModel : public QAbstractTableModel
Q_OBJECT
public:
MyModel(QObject *parent);
- int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE ;
- int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
- bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole) Q_DECL_OVERRIDE;
- Qt::ItemFlags flags(const QModelIndex & index) const Q_DECL_OVERRIDE ;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override ;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
+ bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole) override;
+ Qt::ItemFlags flags(const QModelIndex & index) const override ;
private:
QString m_gridData[ROWS][COLS]; //holds text entered into QTableView
signals:
diff --git a/examples/widgets/widgets.pro b/examples/widgets/widgets.pro
index cc489b5c16..65a96dd718 100644
--- a/examples/widgets/widgets.pro
+++ b/examples/widgets/widgets.pro
@@ -22,11 +22,11 @@ SUBDIRS = \
tutorials \
widgets
-contains(QT_CONFIG, opengl(es2)?) {
+qtConfig(opengl(es2)?) {
SUBDIRS += windowcontainer
}
-!contains(QT_CONFIG, opengl(es2)?): SUBDIRS -= windowcontainer
+!qtConfig(opengl(es2)?): SUBDIRS -= windowcontainer
contains(DEFINES, QT_NO_CURSOR): SUBDIRS -= mainwindows
contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= draganddrop
mac:SUBDIRS += mac
diff --git a/examples/widgets/widgets/analogclock/analogclock.h b/examples/widgets/widgets/analogclock/analogclock.h
index 2098b83ec4..19e580d1ac 100644
--- a/examples/widgets/widgets/analogclock/analogclock.h
+++ b/examples/widgets/widgets/analogclock/analogclock.h
@@ -62,7 +62,7 @@ public:
AnalogClock(QWidget *parent = 0);
protected:
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
};
//! [0]
diff --git a/examples/widgets/widgets/calculator/button.h b/examples/widgets/widgets/calculator/button.h
index b06edc1405..057640700f 100644
--- a/examples/widgets/widgets/calculator/button.h
+++ b/examples/widgets/widgets/calculator/button.h
@@ -61,7 +61,7 @@ class Button : public QToolButton
public:
explicit Button(const QString &text, QWidget *parent = 0);
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
};
//! [0]
diff --git a/examples/widgets/widgets/charactermap/characterwidget.h b/examples/widgets/widgets/charactermap/characterwidget.h
index 8f8406f244..53add51e6f 100644
--- a/examples/widgets/widgets/charactermap/characterwidget.h
+++ b/examples/widgets/widgets/charactermap/characterwidget.h
@@ -69,7 +69,7 @@ class CharacterWidget : public QWidget
public:
CharacterWidget(QWidget *parent = 0);
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
public slots:
void updateFont(const QFont &font);
@@ -81,9 +81,9 @@ signals:
void characterSelected(const QString &character);
protected:
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
private:
void calculateSquareSize();
diff --git a/examples/widgets/widgets/codeeditor/codeeditor.h b/examples/widgets/widgets/codeeditor/codeeditor.h
index ba6a28c27c..65be76d81d 100644
--- a/examples/widgets/widgets/codeeditor/codeeditor.h
+++ b/examples/widgets/widgets/codeeditor/codeeditor.h
@@ -76,7 +76,7 @@ public:
int lineNumberAreaWidth();
protected:
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
+ void resizeEvent(QResizeEvent *event) override;
private slots:
void updateLineNumberAreaWidth(int newBlockCount);
@@ -97,12 +97,12 @@ public:
codeEditor = editor;
}
- QSize sizeHint() const Q_DECL_OVERRIDE {
+ QSize sizeHint() const override {
return QSize(codeEditor->lineNumberAreaWidth(), 0);
}
protected:
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE {
+ void paintEvent(QPaintEvent *event) override {
codeEditor->lineNumberAreaPaintEvent(event);
}
diff --git a/examples/widgets/widgets/elidedlabel/elidedlabel.h b/examples/widgets/widgets/elidedlabel/elidedlabel.h
index 98ce1fed33..8a2a40f49a 100644
--- a/examples/widgets/widgets/elidedlabel/elidedlabel.h
+++ b/examples/widgets/widgets/elidedlabel/elidedlabel.h
@@ -72,7 +72,7 @@ public:
bool isElided() const { return elided; }
protected:
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
signals:
void elisionChanged(bool elided);
diff --git a/examples/widgets/widgets/elidedlabel/testwidget.h b/examples/widgets/widgets/elidedlabel/testwidget.h
index 1871a7af6a..840bc98b40 100644
--- a/examples/widgets/widgets/elidedlabel/testwidget.h
+++ b/examples/widgets/widgets/elidedlabel/testwidget.h
@@ -67,7 +67,7 @@ public:
TestWidget(QWidget *parent = 0);
protected:
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
+ void resizeEvent(QResizeEvent *event) override;
private slots:
void switchText();
diff --git a/examples/widgets/widgets/icons/icons.pro b/examples/widgets/widgets/icons/icons.pro
index 4ee95592c8..450bdf9f8a 100644
--- a/examples/widgets/widgets/icons/icons.pro
+++ b/examples/widgets/widgets/icons/icons.pro
@@ -17,14 +17,3 @@ EXAMPLE_FILES = images/*
# install
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/icons
INSTALLS += target
-
-
-wince {
- imageFiles.files = images/*
- wincewm*: {
- imageFiles.path = "/My Documents/My Pictures"
- } else {
- imageFiles.path = images
- }
- INSTALLS += imageFiles
-}
diff --git a/examples/widgets/widgets/icons/iconsizespinbox.h b/examples/widgets/widgets/icons/iconsizespinbox.h
index 1bbd2f793f..96a56e75c9 100644
--- a/examples/widgets/widgets/icons/iconsizespinbox.h
+++ b/examples/widgets/widgets/icons/iconsizespinbox.h
@@ -61,8 +61,8 @@ class IconSizeSpinBox : public QSpinBox
public:
explicit IconSizeSpinBox(QWidget *parent = Q_NULLPTR);
- int valueFromText(const QString &text) const Q_DECL_OVERRIDE;
- QString textFromValue(int value) const Q_DECL_OVERRIDE;
+ int valueFromText(const QString &text) const override;
+ QString textFromValue(int value) const override;
};
//! [0]
diff --git a/examples/widgets/widgets/icons/imagedelegate.h b/examples/widgets/widgets/icons/imagedelegate.h
index 28822d01fb..928085d85b 100644
--- a/examples/widgets/widgets/icons/imagedelegate.h
+++ b/examples/widgets/widgets/icons/imagedelegate.h
@@ -64,10 +64,10 @@ public:
//! [1]
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
- void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
+ void setEditorData(QWidget *editor, const QModelIndex &index) const override;
void setModelData(QWidget *editor, QAbstractItemModel *model,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
//! [1] //! [2]
private slots:
diff --git a/examples/widgets/widgets/imageviewer/imageviewer.pro b/examples/widgets/widgets/imageviewer/imageviewer.pro
index 2853f1699f..4903a68537 100644
--- a/examples/widgets/widgets/imageviewer/imageviewer.pro
+++ b/examples/widgets/widgets/imageviewer/imageviewer.pro
@@ -8,8 +8,3 @@ SOURCES = imageviewer.cpp \
# install
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/imageviewer
INSTALLS += target
-
-
-wince {
- DEPLOYMENT_PLUGIN += qjpeg qgif
-}
diff --git a/examples/widgets/widgets/mousebuttons/buttontester.h b/examples/widgets/widgets/mousebuttons/buttontester.h
index 24976052d7..cd05171d86 100644
--- a/examples/widgets/widgets/mousebuttons/buttontester.h
+++ b/examples/widgets/widgets/mousebuttons/buttontester.h
@@ -61,11 +61,11 @@ class ButtonTester : public QTextEdit
Q_OBJECT
protected:
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
+ void mouseDoubleClickEvent(QMouseEvent *event) override;
#ifndef QT_NO_WHEELEVENT
- void wheelEvent(QWheelEvent * event) Q_DECL_OVERRIDE;
+ void wheelEvent(QWheelEvent * event) override;
#endif
int buttonByNumber(const Qt::MouseButton button);
QString enumNameFromValue(const Qt::MouseButton button);
diff --git a/examples/widgets/widgets/movie/movie.pro b/examples/widgets/widgets/movie/movie.pro
index 94d86454d8..e3b9b5129c 100644
--- a/examples/widgets/widgets/movie/movie.pro
+++ b/examples/widgets/widgets/movie/movie.pro
@@ -9,10 +9,3 @@ EXAMPLE_FILES = animation.gif
# install
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/movie
INSTALLS += target
-
-
-wince {
- addFiles.files += *.gif
- addFiles.path = .
- INSTALLS += addFiles
-}
diff --git a/examples/widgets/widgets/scribble/mainwindow.h b/examples/widgets/widgets/scribble/mainwindow.h
index 3cd4b395d9..9e0ddaff71 100644
--- a/examples/widgets/widgets/scribble/mainwindow.h
+++ b/examples/widgets/widgets/scribble/mainwindow.h
@@ -65,7 +65,7 @@ public:
MainWindow();
protected:
- void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
+ void closeEvent(QCloseEvent *event) override;
private slots:
void open();
diff --git a/examples/widgets/widgets/scribble/scribblearea.h b/examples/widgets/widgets/scribble/scribblearea.h
index 4c1df541af..7729fb5b89 100644
--- a/examples/widgets/widgets/scribble/scribblearea.h
+++ b/examples/widgets/widgets/scribble/scribblearea.h
@@ -78,11 +78,11 @@ public slots:
void print();
protected:
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
+ void resizeEvent(QResizeEvent *event) override;
private:
void drawLineTo(const QPoint &endPoint);
diff --git a/examples/widgets/widgets/shapedclock/shapedclock.h b/examples/widgets/widgets/shapedclock/shapedclock.h
index f2e58951fa..6468d21618 100644
--- a/examples/widgets/widgets/shapedclock/shapedclock.h
+++ b/examples/widgets/widgets/shapedclock/shapedclock.h
@@ -60,13 +60,13 @@ class ShapedClock : public QWidget
public:
ShapedClock(QWidget *parent = 0);
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
protected:
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
+ void resizeEvent(QResizeEvent *event) override;
private:
QPoint dragPosition;
diff --git a/examples/widgets/widgets/styles/norwegianwoodstyle.h b/examples/widgets/widgets/styles/norwegianwoodstyle.h
index 06c433630a..c41d81d23a 100644
--- a/examples/widgets/widgets/styles/norwegianwoodstyle.h
+++ b/examples/widgets/widgets/styles/norwegianwoodstyle.h
@@ -66,17 +66,17 @@ class NorwegianWoodStyle : public QProxyStyle
public:
NorwegianWoodStyle();
- void polish(QPalette &palette) Q_DECL_OVERRIDE;
- void polish(QWidget *widget) Q_DECL_OVERRIDE;
- void unpolish(QWidget *widget) Q_DECL_OVERRIDE;
+ void polish(QPalette &palette) override;
+ void polish(QWidget *widget) override;
+ void unpolish(QWidget *widget) override;
int pixelMetric(PixelMetric metric, const QStyleOption *option,
- const QWidget *widget) const Q_DECL_OVERRIDE;
+ const QWidget *widget) const override;
int styleHint(StyleHint hint, const QStyleOption *option,
- const QWidget *widget, QStyleHintReturn *returnData) const Q_DECL_OVERRIDE;
+ const QWidget *widget, QStyleHintReturn *returnData) const override;
void drawPrimitive(PrimitiveElement element, const QStyleOption *option,
- QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE;
+ QPainter *painter, const QWidget *widget) const override;
void drawControl(ControlElement control, const QStyleOption *option,
- QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE;
+ QPainter *painter, const QWidget *widget) const override;
private:
static void setTexture(QPalette &palette, QPalette::ColorRole role,
diff --git a/examples/widgets/widgets/tablet/tabletapplication.h b/examples/widgets/widgets/tablet/tabletapplication.h
index 6b24992c5a..6b3b2a1730 100644
--- a/examples/widgets/widgets/tablet/tabletapplication.h
+++ b/examples/widgets/widgets/tablet/tabletapplication.h
@@ -64,7 +64,7 @@ public:
TabletApplication(int &argv, char **args)
: QApplication(argv, args) {}
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
void setCanvas(TabletCanvas *canvas)
{ m_canvas = canvas; }
diff --git a/examples/widgets/widgets/tablet/tabletcanvas.h b/examples/widgets/widgets/tablet/tabletcanvas.h
index baf042cb64..1784e05916 100644
--- a/examples/widgets/widgets/tablet/tabletcanvas.h
+++ b/examples/widgets/widgets/tablet/tabletcanvas.h
@@ -95,9 +95,9 @@ public:
{ return a > b ? a : b; }
protected:
- void tabletEvent(QTabletEvent *event) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
+ void tabletEvent(QTabletEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
+ void resizeEvent(QResizeEvent *event) override;
private:
void initPixmap();
diff --git a/examples/widgets/widgets/tetrix/tetrixboard.h b/examples/widgets/widgets/tetrix/tetrixboard.h
index d777a76a20..7c6871dfbd 100644
--- a/examples/widgets/widgets/tetrix/tetrixboard.h
+++ b/examples/widgets/widgets/tetrix/tetrixboard.h
@@ -70,8 +70,8 @@ public:
TetrixBoard(QWidget *parent = 0);
void setNextPieceLabel(QLabel *label);
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ QSize minimumSizeHint() const override;
public slots:
void start();
@@ -83,9 +83,9 @@ signals:
void linesRemovedChanged(int numLines);
protected:
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
+ void keyPressEvent(QKeyEvent *event) override;
+ void timerEvent(QTimerEvent *event) override;
//! [0]
//! [1]
diff --git a/examples/widgets/widgets/tooltips/sortingbox.h b/examples/widgets/widgets/tooltips/sortingbox.h
index 326eeee5a7..2ac27614a5 100644
--- a/examples/widgets/widgets/tooltips/sortingbox.h
+++ b/examples/widgets/widgets/tooltips/sortingbox.h
@@ -70,12 +70,12 @@ public:
SortingBox();
protected:
- bool event(QEvent *event) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
+ void resizeEvent(QResizeEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
private slots:
void createNewCircle();
diff --git a/examples/widgets/widgets/wiggly/wigglywidget.h b/examples/widgets/widgets/wiggly/wigglywidget.h
index 1967b809f5..58a7d045e1 100644
--- a/examples/widgets/widgets/wiggly/wigglywidget.h
+++ b/examples/widgets/widgets/wiggly/wigglywidget.h
@@ -66,8 +66,8 @@ public slots:
void setText(const QString &newText) { text = newText; }
protected:
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
+ void timerEvent(QTimerEvent *event) override;
private:
QBasicTimer timer;
diff --git a/examples/widgets/windowcontainer/windowcontainer.cpp b/examples/widgets/windowcontainer/windowcontainer.cpp
index 39b45a80ce..9f2124c4e1 100644
--- a/examples/widgets/windowcontainer/windowcontainer.cpp
+++ b/examples/widgets/windowcontainer/windowcontainer.cpp
@@ -73,7 +73,7 @@ public:
{
}
- void render(QPainter *p) Q_DECL_OVERRIDE {
+ void render(QPainter *p) override {
QLinearGradient g(0, 0, 0, height());
g.setColorAt(0, QColor("lightsteelblue"));
g.setColorAt(1, Qt::black);
@@ -101,7 +101,7 @@ public:
p->drawPolyline(m_polygon);
}
- void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE {
+ void mousePressEvent(QMouseEvent *e) override {
if (!m_mouseDown) {
m_mouseDown = true;
m_polygon.clear();
@@ -110,14 +110,14 @@ public:
}
}
- void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE {
+ void mouseMoveEvent(QMouseEvent *e) override {
if (m_mouseDown) {
m_polygon.append(e->pos());
renderLater();
}
}
- void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE {
+ void mouseReleaseEvent(QMouseEvent *e) override {
if (m_mouseDown) {
m_mouseDown = false;
m_polygon.append(e->pos());
@@ -125,23 +125,23 @@ public:
}
}
- void focusInEvent(QFocusEvent *) Q_DECL_OVERRIDE {
+ void focusInEvent(QFocusEvent *) override {
m_focus = true;
renderLater();
}
- void focusOutEvent(QFocusEvent *) Q_DECL_OVERRIDE {
+ void focusOutEvent(QFocusEvent *) override {
m_focus = false;
m_polygon.clear();
renderLater();
}
- void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE {
+ void keyPressEvent(QKeyEvent *e) override {
m_key = e->text();
renderLater();
}
- void keyReleaseEvent(QKeyEvent *) Q_DECL_OVERRIDE {
+ void keyReleaseEvent(QKeyEvent *) override {
m_key = QString();
renderLater();
}
diff --git a/examples/xml/saxbookmarks/xbelhandler.h b/examples/xml/saxbookmarks/xbelhandler.h
index e1fd06dd3f..3f4cb109e9 100644
--- a/examples/xml/saxbookmarks/xbelhandler.h
+++ b/examples/xml/saxbookmarks/xbelhandler.h
@@ -65,12 +65,12 @@ public:
XbelHandler(QTreeWidget *treeWidget);
bool startElement(const QString &namespaceURI, const QString &localName,
- const QString &qName, const QXmlAttributes &attributes) Q_DECL_OVERRIDE;
+ const QString &qName, const QXmlAttributes &attributes) override;
bool endElement(const QString &namespaceURI, const QString &localName,
- const QString &qName) Q_DECL_OVERRIDE;
- bool characters(const QString &str) Q_DECL_OVERRIDE;
- bool fatalError(const QXmlParseException &exception) Q_DECL_OVERRIDE;
- QString errorString() const Q_DECL_OVERRIDE;
+ const QString &qName) override;
+ bool characters(const QString &str) override;
+ bool fatalError(const QXmlParseException &exception) override;
+ QString errorString() const override;
private:
QTreeWidgetItem *createChildItem(const QString &tagName);