summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@qt.io>2018-06-01 14:15:15 +0200
committerMorten Johan Sørvig <morten.sorvig@qt.io>2018-06-01 14:15:15 +0200
commit02c8fa204f53af27907ef48bc74c500d7a05c3a0 (patch)
tree56519f143a72884a47c757d96c411e26c10c8a10 /examples
parent36e8cf3cdb50c0447695f35c2e63eed139704c13 (diff)
parent0a63d5fed6e020e81d3c570d299d1292c33fa284 (diff)
Merge remote-tracking branch 'gerrit/5.11' into wip/webassembly
Diffstat (limited to 'examples')
-rw-r--r--examples/network/torrent/mainwindow.cpp6
-rw-r--r--examples/sql/doc/images/masterdetail-example.pngbin66419 -> 114703 bytes
-rw-r--r--examples/sql/masterdetail/images/icon.pngbin30095 -> 19832 bytes
-rw-r--r--examples/sql/masterdetail/images/image.pngbin166692 -> 81486 bytes
-rw-r--r--examples/vulkan/hellovulkancubes/renderer.cpp2
-rw-r--r--examples/vulkan/hellovulkantexture/hellovulkantexture.cpp2
-rw-r--r--examples/vulkan/hellovulkanwindow/hellovulkanwindow.cpp2
-rw-r--r--examples/vulkan/shared/trianglerenderer.cpp2
-rw-r--r--examples/widgets/doc/images/echoplugin.pngbin0 -> 7758 bytes
-rw-r--r--examples/widgets/doc/src/dirview.qdoc21
-rw-r--r--examples/widgets/doc/src/fetchmore.qdoc8
-rw-r--r--examples/widgets/doc/src/lineedits.qdoc2
-rw-r--r--examples/widgets/graphicsview/elasticnodes/graphwidget.cpp2
-rw-r--r--examples/widgets/graphicsview/elasticnodes/node.cpp2
-rw-r--r--examples/widgets/graphicsview/elasticnodes/node.h2
-rw-r--r--examples/widgets/graphicsview/graphicsview.pro2
-rw-r--r--examples/widgets/itemviews/itemviews.pro2
-rw-r--r--examples/widgets/mainwindows/mainwindow/mainwindow.cpp12
-rw-r--r--examples/widgets/mainwindows/mainwindow/mainwindow.h2
-rw-r--r--examples/widgets/painting/gradients/gradients.cpp78
-rw-r--r--examples/widgets/richtext/orderform/detailsdialog.cpp4
-rw-r--r--examples/widgets/richtext/orderform/mainwindow.cpp4
-rw-r--r--examples/widgets/tools/echoplugin/echowindow/echowindow.cpp8
-rw-r--r--examples/widgets/tutorials/modelview/6_treeview/mainwindow.cpp4
-rw-r--r--examples/widgets/widgets.pro2
-rw-r--r--examples/widgets/widgets/digitalclock/digitalclock.cpp2
26 files changed, 100 insertions, 71 deletions
diff --git a/examples/network/torrent/mainwindow.cpp b/examples/network/torrent/mainwindow.cpp
index f80c2c6975..660472c05c 100644
--- a/examples/network/torrent/mainwindow.cpp
+++ b/examples/network/torrent/mainwindow.cpp
@@ -62,7 +62,7 @@ class TorrentView : public QTreeWidget
public:
TorrentView(QWidget *parent = 0);
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
signals:
void fileDropped(const QString &fileName);
@@ -702,12 +702,12 @@ void MainWindow::closeEvent(QCloseEvent *)
TorrentView::TorrentView(QWidget *parent)
: QTreeWidget(parent)
{
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
setAcceptDrops(true);
#endif
}
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
void TorrentView::dragMoveEvent(QDragMoveEvent *event)
{
// Accept file actions with a '.torrent' extension.
diff --git a/examples/sql/doc/images/masterdetail-example.png b/examples/sql/doc/images/masterdetail-example.png
index 6bf19f3b55..bca1d3e7e5 100644
--- a/examples/sql/doc/images/masterdetail-example.png
+++ b/examples/sql/doc/images/masterdetail-example.png
Binary files differ
diff --git a/examples/sql/masterdetail/images/icon.png b/examples/sql/masterdetail/images/icon.png
index 31f68b8eb5..ee76fad2d3 100644
--- a/examples/sql/masterdetail/images/icon.png
+++ b/examples/sql/masterdetail/images/icon.png
Binary files differ
diff --git a/examples/sql/masterdetail/images/image.png b/examples/sql/masterdetail/images/image.png
index 1d7803746b..a726dc6f34 100644
--- a/examples/sql/masterdetail/images/image.png
+++ b/examples/sql/masterdetail/images/image.png
Binary files differ
diff --git a/examples/vulkan/hellovulkancubes/renderer.cpp b/examples/vulkan/hellovulkancubes/renderer.cpp
index 523511337d..2e913bcae8 100644
--- a/examples/vulkan/hellovulkancubes/renderer.cpp
+++ b/examples/vulkan/hellovulkancubes/renderer.cpp
@@ -893,7 +893,7 @@ void Renderer::buildFrame()
VkCommandBuffer cb = m_window->currentCommandBuffer();
const QSize sz = m_window->swapChainImageSize();
- VkClearColorValue clearColor = { 0.67f, 0.84f, 0.9f, 1.0f };
+ VkClearColorValue clearColor = {{ 0.67f, 0.84f, 0.9f, 1.0f }};
VkClearDepthStencilValue clearDS = { 1, 0 };
VkClearValue clearValues[3];
memset(clearValues, 0, sizeof(clearValues));
diff --git a/examples/vulkan/hellovulkantexture/hellovulkantexture.cpp b/examples/vulkan/hellovulkantexture/hellovulkantexture.cpp
index 543eb7884a..ffe1a31442 100644
--- a/examples/vulkan/hellovulkantexture/hellovulkantexture.cpp
+++ b/examples/vulkan/hellovulkantexture/hellovulkantexture.cpp
@@ -768,7 +768,7 @@ void VulkanRenderer::startNextFrame()
// Add the necessary barriers and do the host-linear -> device-optimal copy, if not yet done.
ensureTexture();
- VkClearColorValue clearColor = { 0, 0, 0, 1 };
+ VkClearColorValue clearColor = {{ 0, 0, 0, 1 }};
VkClearDepthStencilValue clearDS = { 1, 0 };
VkClearValue clearValues[2];
memset(clearValues, 0, sizeof(clearValues));
diff --git a/examples/vulkan/hellovulkanwindow/hellovulkanwindow.cpp b/examples/vulkan/hellovulkanwindow/hellovulkanwindow.cpp
index 0a7d1d4174..31d32307a9 100644
--- a/examples/vulkan/hellovulkanwindow/hellovulkanwindow.cpp
+++ b/examples/vulkan/hellovulkanwindow/hellovulkanwindow.cpp
@@ -94,7 +94,7 @@ void VulkanRenderer::startNextFrame()
if (m_green > 1.0f)
m_green = 0.0f;
- VkClearColorValue clearColor = { 0.0f, m_green, 0.0f, 1.0f };
+ VkClearColorValue clearColor = {{ 0.0f, m_green, 0.0f, 1.0f }};
VkClearDepthStencilValue clearDS = { 1.0f, 0 };
VkClearValue clearValues[2];
memset(clearValues, 0, sizeof(clearValues));
diff --git a/examples/vulkan/shared/trianglerenderer.cpp b/examples/vulkan/shared/trianglerenderer.cpp
index f346f90c89..6ed7e65ff9 100644
--- a/examples/vulkan/shared/trianglerenderer.cpp
+++ b/examples/vulkan/shared/trianglerenderer.cpp
@@ -452,7 +452,7 @@ void TriangleRenderer::startNextFrame()
VkCommandBuffer cb = m_window->currentCommandBuffer();
const QSize sz = m_window->swapChainImageSize();
- VkClearColorValue clearColor = { 0, 0, 0, 1 };
+ VkClearColorValue clearColor = {{ 0, 0, 0, 1 }};
VkClearDepthStencilValue clearDS = { 1, 0 };
VkClearValue clearValues[3];
memset(clearValues, 0, sizeof(clearValues));
diff --git a/examples/widgets/doc/images/echoplugin.png b/examples/widgets/doc/images/echoplugin.png
new file mode 100644
index 0000000000..6c4fd2f6d8
--- /dev/null
+++ b/examples/widgets/doc/images/echoplugin.png
Binary files differ
diff --git a/examples/widgets/doc/src/dirview.qdoc b/examples/widgets/doc/src/dirview.qdoc
index d9a16fa58d..6db339eced 100644
--- a/examples/widgets/doc/src/dirview.qdoc
+++ b/examples/widgets/doc/src/dirview.qdoc
@@ -37,6 +37,10 @@
\borderedimage dirview-example.png
+ \quotefromfile itemviews/dirview/main.cpp
+ \skipto QCommandLineParser parser
+ \printuntil parser.positionalArguments
+
The example supports a number of command line options.
These options include:
\list
@@ -47,22 +51,17 @@
use custom directory options
\endlist
- \quotefromfile itemviews/dirview/main.cpp
- \skipto QCommandLineParser parser
- \printuntil parser.positionalArguments
-
- Declares a QFileSystemModel as data model for viewing
- the local file system. QFileSystem works with a cache, that is,
- it is updated continually with QFileSystemWatcher on that folder.
-
\skipto QFileSystemModel
\printuntil tree.setModel
- Creates a model/view implementation called \c tree
- for viewing the filesystem.
+ Declares \c model as data model for reading the local filesystem.
+ \c model.setRootPath("") sets the current folder as the folder from
+ which \c model will start reading.
+ QTreeView object \c tree visualizes the filesystem in a tree structure.
\skipto tree.setAnimated(false)
\printuntil tree.setWindowTitle
- Sets some formatting options for \c tree.
+ Sets layout options for animation, indentation, sorting, and sizing of the
+ filesystem tree.
*/
diff --git a/examples/widgets/doc/src/fetchmore.qdoc b/examples/widgets/doc/src/fetchmore.qdoc
index 2355a466fe..df0cf3b8ec 100644
--- a/examples/widgets/doc/src/fetchmore.qdoc
+++ b/examples/widgets/doc/src/fetchmore.qdoc
@@ -34,9 +34,11 @@
\image fetchmore-example.png
- The user of the example can enter a directory in the \uicontrol
- Directory line edit. The contents of the directory will
- be listed in the list view below.
+
+ This example consists of a dialog where you can enter a directory
+ name in the \uicontrol Directory edit field. The application loads and
+ visualizes all files it finds as you are typing. It is not required
+ to press [Enter] to launch the search.
When you have large - or perhaps even infinite - data sets, you
will need to add items to the model in batches, and preferably only
diff --git a/examples/widgets/doc/src/lineedits.qdoc b/examples/widgets/doc/src/lineedits.qdoc
index 5cf321bbb1..08de3c08dd 100644
--- a/examples/widgets/doc/src/lineedits.qdoc
+++ b/examples/widgets/doc/src/lineedits.qdoc
@@ -148,7 +148,7 @@
\snippet widgets/lineedits/window.cpp 12
Each entry in the relevant combobox is associated with an input mask. We set
- a new mask by calling the QLineEdit::setMask() function with a suitable string;
+ a new mask by calling the QLineEdit::setInputMask() function with a suitable string;
the mask is disabled if an empty string is used.
The \c accessChanged() slot handles changes to the combobox in the
diff --git a/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp b/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp
index 4259aab803..81928a4ee1 100644
--- a/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp
+++ b/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp
@@ -174,7 +174,7 @@ void GraphWidget::timerEvent(QTimerEvent *event)
bool itemsMoved = false;
foreach (Node *node, nodes) {
- if (node->advance())
+ if (node->advancePosition())
itemsMoved = true;
}
diff --git a/examples/widgets/graphicsview/elasticnodes/node.cpp b/examples/widgets/graphicsview/elasticnodes/node.cpp
index 94df45524a..71737c984b 100644
--- a/examples/widgets/graphicsview/elasticnodes/node.cpp
+++ b/examples/widgets/graphicsview/elasticnodes/node.cpp
@@ -138,7 +138,7 @@ void Node::calculateForces()
//! [6]
//! [7]
-bool Node::advance()
+bool Node::advancePosition()
{
if (newPos == pos())
return false;
diff --git a/examples/widgets/graphicsview/elasticnodes/node.h b/examples/widgets/graphicsview/elasticnodes/node.h
index 487ae0d68e..43ea1fb24b 100644
--- a/examples/widgets/graphicsview/elasticnodes/node.h
+++ b/examples/widgets/graphicsview/elasticnodes/node.h
@@ -73,7 +73,7 @@ public:
int type() const override { return Type; }
void calculateForces();
- bool advance();
+ bool advancePosition();
QRectF boundingRect() const override;
QPainterPath shape() const override;
diff --git a/examples/widgets/graphicsview/graphicsview.pro b/examples/widgets/graphicsview/graphicsview.pro
index 5a054fe6b2..b9bef70a0e 100644
--- a/examples/widgets/graphicsview/graphicsview.pro
+++ b/examples/widgets/graphicsview/graphicsview.pro
@@ -13,7 +13,7 @@ SUBDIRS = \
simpleanchorlayout \
weatheranchorlayout
-contains(DEFINES, QT_NO_CURSOR)|contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= dragdroprobot
+contains(DEFINES, QT_NO_CURSOR)|!qtConfig(draganddrop): SUBDIRS -= dragdroprobot
qtHaveModule(opengl):!qtConfig(opengles.):!qtConfig(dynamicgl) {
SUBDIRS += boxes
diff --git a/examples/widgets/itemviews/itemviews.pro b/examples/widgets/itemviews/itemviews.pro
index 75307bd74e..b4a002c156 100644
--- a/examples/widgets/itemviews/itemviews.pro
+++ b/examples/widgets/itemviews/itemviews.pro
@@ -20,5 +20,5 @@ SUBDIRS = addressbook \
spreadsheet \
stardelegate \
storageview
-contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= puzzle
+!qtConfig(draganddrop): SUBDIRS -= puzzle
!qtHaveModule(xml): SUBDIRS -= simpledommodel
diff --git a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
index b2c5ccc473..fe31207326 100644
--- a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
+++ b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
@@ -187,6 +187,13 @@ void MainWindow::setupMenuBar()
#endif
dockWidgetMenu = menuBar()->addMenu(tr("&Dock Widgets"));
+
+ QMenu *aboutMenu = menuBar()->addMenu(tr("About"));
+ QAction *aboutAct = aboutMenu->addAction(tr("&About"), this, &MainWindow::about);
+ aboutAct->setStatusTip(tr("Show the application's About box"));
+
+ QAction *aboutQtAct = aboutMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt);
+ aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
}
void MainWindow::setDockOptions()
@@ -476,3 +483,8 @@ void MainWindow::destroyDockWidget(QAction *action)
if (destroyDockWidgetMenu->isEmpty())
destroyDockWidgetMenu->setEnabled(false);
}
+
+void MainWindow::about()
+{
+ QMessageBox::about(this, tr("About MainWindows"), message);
+}
diff --git a/examples/widgets/mainwindows/mainwindow/mainwindow.h b/examples/widgets/mainwindows/mainwindow/mainwindow.h
index 9b1af6df80..a2c9d30ded 100644
--- a/examples/widgets/mainwindows/mainwindow/mainwindow.h
+++ b/examples/widgets/mainwindows/mainwindow/mainwindow.h
@@ -77,6 +77,8 @@ public slots:
void createDockWidget();
void destroyDockWidget(QAction *action);
+ void about();
+
private:
void setupToolBar();
void setupMenuBar();
diff --git a/examples/widgets/painting/gradients/gradients.cpp b/examples/widgets/painting/gradients/gradients.cpp
index 5433b28025..78c174a8bf 100644
--- a/examples/widgets/painting/gradients/gradients.cpp
+++ b/examples/widgets/painting/gradients/gradients.cpp
@@ -88,7 +88,8 @@ ShadeWidget::ShadeWidget(ShadeType type, QWidget *parent)
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
- connect(m_hoverPoints, SIGNAL(pointsChanged(QPolygonF)), this, SIGNAL(colorsChanged()));
+ connect(m_hoverPoints, &HoverPoints::pointsChanged,
+ this, &ShadeWidget::colorsChanged);
}
QPolygonF ShadeWidget::points() const
@@ -191,10 +192,14 @@ GradientEditor::GradientEditor(QWidget *parent)
vbox->addWidget(m_blue_shade);
vbox->addWidget(m_alpha_shade);
- connect(m_red_shade, SIGNAL(colorsChanged()), this, SLOT(pointsUpdated()));
- connect(m_green_shade, SIGNAL(colorsChanged()), this, SLOT(pointsUpdated()));
- connect(m_blue_shade, SIGNAL(colorsChanged()), this, SLOT(pointsUpdated()));
- connect(m_alpha_shade, SIGNAL(colorsChanged()), this, SLOT(pointsUpdated()));
+ connect(m_red_shade, &ShadeWidget::colorsChanged,
+ this, &GradientEditor::pointsUpdated);
+ connect(m_green_shade, &ShadeWidget::colorsChanged,
+ this, &GradientEditor::pointsUpdated);
+ connect(m_blue_shade, &ShadeWidget::colorsChanged,
+ this, &GradientEditor::pointsUpdated);
+ connect(m_alpha_shade, &ShadeWidget::colorsChanged,
+ this, &GradientEditor::pointsUpdated);
}
inline static bool x_less_than(const QPointF &p1, const QPointF &p2)
@@ -354,33 +359,46 @@ GradientWidget::GradientWidget(QWidget *parent)
defaultsGroupLayout->addWidget(default3Button);
editorGroupLayout->addWidget(default4Button);
- connect(m_editor, SIGNAL(gradientStopsChanged(QGradientStops)),
- m_renderer, SLOT(setGradientStops(QGradientStops)));
-
- connect(m_linearButton, SIGNAL(clicked()), m_renderer, SLOT(setLinearGradient()));
- connect(m_radialButton, SIGNAL(clicked()), m_renderer, SLOT(setRadialGradient()));
- connect(m_conicalButton, SIGNAL(clicked()), m_renderer, SLOT(setConicalGradient()));
-
- connect(m_padSpreadButton, SIGNAL(clicked()), m_renderer, SLOT(setPadSpread()));
- connect(m_reflectSpreadButton, SIGNAL(clicked()), m_renderer, SLOT(setReflectSpread()));
- connect(m_repeatSpreadButton, SIGNAL(clicked()), m_renderer, SLOT(setRepeatSpread()));
-
- connect(default1Button, SIGNAL(clicked()), this, SLOT(setDefault1()));
- connect(default2Button, SIGNAL(clicked()), this, SLOT(setDefault2()));
- connect(default3Button, SIGNAL(clicked()), this, SLOT(setDefault3()));
- connect(default4Button, SIGNAL(clicked()), this, SLOT(setDefault4()));
-
- connect(showSourceButton, SIGNAL(clicked()), m_renderer, SLOT(showSource()));
+ connect(m_editor, &GradientEditor::gradientStopsChanged,
+ m_renderer, &GradientRenderer::setGradientStops);
+ connect(m_linearButton, &QRadioButton::clicked,
+ m_renderer, &GradientRenderer::setLinearGradient);
+ connect(m_radialButton, &QRadioButton::clicked,
+ m_renderer, &GradientRenderer::setRadialGradient);
+ connect(m_conicalButton,&QRadioButton::clicked,
+ m_renderer, &GradientRenderer::setConicalGradient);
+
+ connect(m_padSpreadButton, &QRadioButton::clicked,
+ m_renderer, &GradientRenderer::setPadSpread);
+ connect(m_reflectSpreadButton, &QRadioButton::clicked,
+ m_renderer, &GradientRenderer::setReflectSpread);
+ connect(m_repeatSpreadButton, &QRadioButton::clicked,
+ m_renderer, &GradientRenderer::setRepeatSpread);
+
+ connect(default1Button, &QPushButton::clicked,
+ this, &GradientWidget::setDefault1);
+ connect(default2Button, &QPushButton::clicked,
+ this, &GradientWidget::setDefault2);
+ connect(default3Button, &QPushButton::clicked,
+ this, &GradientWidget::setDefault3);
+ connect(default4Button, &QPushButton::clicked,
+ this, &GradientWidget::setDefault4);
+
+ connect(showSourceButton, &QPushButton::clicked,
+ m_renderer, &GradientRenderer::showSource);
#ifdef QT_OPENGL_SUPPORT
- connect(enableOpenGLButton, SIGNAL(clicked(bool)), m_renderer, SLOT(enableOpenGL(bool)));
+ connect(enableOpenGLButton, QOverload<bool>::of(&QPushButton::clicked),
+ m_renderer, &ArthurFrame::enableOpenGL);
#endif
- connect(whatsThisButton, SIGNAL(clicked(bool)), m_renderer, SLOT(setDescriptionEnabled(bool)));
- connect(whatsThisButton, SIGNAL(clicked(bool)),
- m_renderer->hoverPoints(), SLOT(setDisabled(bool)));
- connect(m_renderer, SIGNAL(descriptionEnabledChanged(bool)),
- whatsThisButton, SLOT(setChecked(bool)));
- connect(m_renderer, SIGNAL(descriptionEnabledChanged(bool)),
- m_renderer->hoverPoints(), SLOT(setDisabled(bool)));
+
+ connect(whatsThisButton, QOverload<bool>::of(&QPushButton::clicked),
+ m_renderer, &ArthurFrame::setDescriptionEnabled);
+ connect(whatsThisButton, QOverload<bool>::of(&QPushButton::clicked),
+ m_renderer->hoverPoints(), &HoverPoints::setDisabled);
+ connect(m_renderer, QOverload<bool>::of(&ArthurFrame::descriptionEnabledChanged),
+ whatsThisButton, &QPushButton::setChecked);
+ connect(m_renderer, QOverload<bool>::of(&ArthurFrame::descriptionEnabledChanged),
+ m_renderer->hoverPoints(), &HoverPoints::setDisabled);
m_renderer->loadSourceFile(":res/gradients/gradients.cpp");
m_renderer->loadDescription(":res/gradients/gradients.html");
diff --git a/examples/widgets/richtext/orderform/detailsdialog.cpp b/examples/widgets/richtext/orderform/detailsdialog.cpp
index 3ec13c4c70..9ef9eff73d 100644
--- a/examples/widgets/richtext/orderform/detailsdialog.cpp
+++ b/examples/widgets/richtext/orderform/detailsdialog.cpp
@@ -71,8 +71,8 @@ DetailsDialog::DetailsDialog(const QString &title, QWidget *parent)
buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok
| QDialogButtonBox::Cancel);
- connect(buttonBox, SIGNAL(accepted()), this, SLOT(verify()));
- connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ connect(buttonBox, &QDialogButtonBox::accepted, this, &DetailsDialog::verify);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &DetailsDialog::reject);
//! [0]
//! [1]
diff --git a/examples/widgets/richtext/orderform/mainwindow.cpp b/examples/widgets/richtext/orderform/mainwindow.cpp
index 030072978e..b207ee4dbc 100644
--- a/examples/widgets/richtext/orderform/mainwindow.cpp
+++ b/examples/widgets/richtext/orderform/mainwindow.cpp
@@ -75,8 +75,8 @@ MainWindow::MainWindow()
letters = new QTabWidget;
- connect(newAction, SIGNAL(triggered()), this, SLOT(openDialog()));
- connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));
+ connect(newAction, &QAction::triggered, this, &MainWindow::openDialog);
+ connect(quitAction, &QAction::triggered, this, &MainWindow::close);
setCentralWidget(letters);
setWindowTitle(tr("Order Form"));
diff --git a/examples/widgets/tools/echoplugin/echowindow/echowindow.cpp b/examples/widgets/tools/echoplugin/echowindow/echowindow.cpp
index 1efc7b9355..64b59d506e 100644
--- a/examples/widgets/tools/echoplugin/echowindow/echowindow.cpp
+++ b/examples/widgets/tools/echoplugin/echowindow/echowindow.cpp
@@ -83,10 +83,10 @@ void EchoWindow::createGUI()
label->setFrameStyle(QFrame::Box | QFrame::Plain);
button = new QPushButton(tr("Send Message"));
- connect(lineEdit, SIGNAL(editingFinished()),
- this, SLOT(sendEcho()));
- connect(button, SIGNAL(clicked()),
- this, SLOT(sendEcho()));
+ connect(lineEdit, &QLineEdit::editingFinished,
+ this, &EchoWindow::sendEcho);
+ connect(button, &QPushButton::clicked,
+ this, &EchoWindow::sendEcho);
layout = new QGridLayout;
layout->addWidget(new QLabel(tr("Message:")), 0, 0);
diff --git a/examples/widgets/tutorials/modelview/6_treeview/mainwindow.cpp b/examples/widgets/tutorials/modelview/6_treeview/mainwindow.cpp
index f33155375c..1016afba07 100644
--- a/examples/widgets/tutorials/modelview/6_treeview/mainwindow.cpp
+++ b/examples/widgets/tutorials/modelview/6_treeview/mainwindow.cpp
@@ -55,10 +55,6 @@
#include <QStandardItem>
#include "mainwindow.h"
-
-const int ROWS = 2;
-const int COLUMNS = 3;
-
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
diff --git a/examples/widgets/widgets.pro b/examples/widgets/widgets.pro
index cef4936d32..f9d863b69e 100644
--- a/examples/widgets/widgets.pro
+++ b/examples/widgets/widgets.pro
@@ -26,5 +26,5 @@ qtHaveModule(gui):qtConfig(opengl): \
SUBDIRS += windowcontainer
contains(DEFINES, QT_NO_CURSOR): SUBDIRS -= mainwindows
-contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= draganddrop
+!qtConfig(draganddrop): SUBDIRS -= draganddrop
mac:SUBDIRS += mac
diff --git a/examples/widgets/widgets/digitalclock/digitalclock.cpp b/examples/widgets/widgets/digitalclock/digitalclock.cpp
index 6787c975c5..dec7e64fc3 100644
--- a/examples/widgets/widgets/digitalclock/digitalclock.cpp
+++ b/examples/widgets/widgets/digitalclock/digitalclock.cpp
@@ -59,7 +59,7 @@ DigitalClock::DigitalClock(QWidget *parent)
setSegmentStyle(Filled);
QTimer *timer = new QTimer(this);
- connect(timer, SIGNAL(timeout()), this, SLOT(showTime()));
+ connect(timer, &QTimer::timeout, this, &DigitalClock::showTime);
timer->start(1000);
showTime();