summaryrefslogtreecommitdiffstats
path: root/examples/widgets/draganddrop/dropsite
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/draganddrop/dropsite')
-rw-r--r--examples/widgets/draganddrop/dropsite/droparea.h4
-rw-r--r--examples/widgets/draganddrop/dropsite/dropsitewindow.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/examples/widgets/draganddrop/dropsite/droparea.h b/examples/widgets/draganddrop/dropsite/droparea.h
index 5b6e209dfa..ab1de8ea44 100644
--- a/examples/widgets/draganddrop/dropsite/droparea.h
+++ b/examples/widgets/draganddrop/dropsite/droparea.h
@@ -63,13 +63,13 @@ class DropArea : public QLabel
Q_OBJECT
public:
- DropArea(QWidget *parent = 0);
+ explicit DropArea(QWidget *parent = nullptr);
public slots:
void clear();
signals:
- void changed(const QMimeData *mimeData = 0);
+ void changed(const QMimeData *mimeData = nullptr);
//! [DropArea header part1]
//! [DropArea header part2]
diff --git a/examples/widgets/draganddrop/dropsite/dropsitewindow.cpp b/examples/widgets/draganddrop/dropsite/dropsitewindow.cpp
index dc865ac171..28a42ee614 100644
--- a/examples/widgets/draganddrop/dropsite/dropsitewindow.cpp
+++ b/examples/widgets/draganddrop/dropsite/dropsitewindow.cpp
@@ -88,8 +88,8 @@ DropSiteWindow::DropSiteWindow()
buttonBox->addButton(clearButton, QDialogButtonBox::ActionRole);
buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
- connect(quitButton, &QAbstractButton::pressed, this, &QWidget::close);
- connect(clearButton, &QAbstractButton::pressed, dropArea, &DropArea::clear);
+ connect(quitButton, &QAbstractButton::clicked, this, &QWidget::close);
+ connect(clearButton, &QAbstractButton::clicked, dropArea, &DropArea::clear);
//! [constructor part4]
//! [constructor part5]
@@ -113,7 +113,7 @@ void DropSiteWindow::updateFormatsTable(const QMimeData *mimeData)
//! [updateFormatsTable() part1]
//! [updateFormatsTable() part2]
- foreach (QString format, mimeData->formats()) {
+ for (const QString &format : mimeData->formats()) {
QTableWidgetItem *formatItem = new QTableWidgetItem(format);
formatItem->setFlags(Qt::ItemIsEnabled);
formatItem->setTextAlignment(Qt::AlignTop | Qt::AlignLeft);