Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/5.14' into 5.15
Browse files Browse the repository at this point in the history
Change-Id: I9953c1ca16862184c2373027e946c482ce8e6f0e
  • Loading branch information
Qt Forward Merge Bot committed Oct 12, 2019
2 parents e55a79b + a90899d commit 8d8140d
Show file tree
Hide file tree
Showing 100 changed files with 481 additions and 340 deletions.
4 changes: 2 additions & 2 deletions examples/widgets/dialogs/classwizard/classwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ void ClassWizard::accept()
block += "public:\n";

if (field("qobjectCtor").toBool()) {
block += " " + className + "(QObject *parent = 0);\n";
block += " " + className + "(QObject *parent = nullptr);\n";
} else if (field("qwidgetCtor").toBool()) {
block += " " + className + "(QWidget *parent = 0);\n";
block += " " + className + "(QWidget *parent = nullptr);\n";
} else if (field("defaultCtor").toBool()) {
block += " " + className + "();\n";
if (field("copyCtor").toBool()) {
Expand Down
12 changes: 6 additions & 6 deletions examples/widgets/dialogs/classwizard/classwizard.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ClassWizard : public QWizard
Q_OBJECT

public:
ClassWizard(QWidget *parent = 0);
ClassWizard(QWidget *parent = nullptr);

void accept() override;
};
Expand All @@ -79,7 +79,7 @@ class IntroPage : public QWizardPage
Q_OBJECT

public:
IntroPage(QWidget *parent = 0);
IntroPage(QWidget *parent = nullptr);

private:
QLabel *label;
Expand All @@ -92,7 +92,7 @@ class ClassInfoPage : public QWizardPage
Q_OBJECT

public:
ClassInfoPage(QWidget *parent = 0);
ClassInfoPage(QWidget *parent = nullptr);

private:
QLabel *classNameLabel;
Expand All @@ -114,7 +114,7 @@ class CodeStylePage : public QWizardPage
Q_OBJECT

public:
CodeStylePage(QWidget *parent = 0);
CodeStylePage(QWidget *parent = nullptr);

protected:
void initializePage() override;
Expand All @@ -135,7 +135,7 @@ class OutputFilesPage : public QWizardPage
Q_OBJECT

public:
OutputFilesPage(QWidget *parent = 0);
OutputFilesPage(QWidget *parent = nullptr);

protected:
void initializePage() override;
Expand All @@ -154,7 +154,7 @@ class ConclusionPage : public QWizardPage
Q_OBJECT

public:
ConclusionPage(QWidget *parent = 0);
ConclusionPage(QWidget *parent = nullptr);

protected:
void initializePage() override;
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/dialogs/extension/finddialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class FindDialog : public QDialog
Q_OBJECT

public:
FindDialog(QWidget *parent = 0);
FindDialog(QWidget *parent = nullptr);

private:
QLabel *label;
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/dialogs/findfiles/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class Window : public QWidget
Q_OBJECT

public:
Window(QWidget *parent = 0);
Window(QWidget *parent = nullptr);

private slots:
void browse();
Expand Down
12 changes: 6 additions & 6 deletions examples/widgets/dialogs/licensewizard/licensewizard.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class LicenseWizard : public QWizard
Page_Conclusion };
//! [2]

LicenseWizard(QWidget *parent = 0);
LicenseWizard(QWidget *parent = nullptr);

private slots:
void showHelp();
Expand All @@ -86,7 +86,7 @@ class IntroPage : public QWizardPage
Q_OBJECT

public:
IntroPage(QWidget *parent = 0);
IntroPage(QWidget *parent = nullptr);

int nextId() const override;

Expand All @@ -103,7 +103,7 @@ class EvaluatePage : public QWizardPage
Q_OBJECT

public:
EvaluatePage(QWidget *parent = 0);
EvaluatePage(QWidget *parent = nullptr);

int nextId() const override;

Expand All @@ -120,7 +120,7 @@ class RegisterPage : public QWizardPage
Q_OBJECT

public:
RegisterPage(QWidget *parent = 0);
RegisterPage(QWidget *parent = nullptr);

int nextId() const override;

Expand All @@ -136,7 +136,7 @@ class DetailsPage : public QWizardPage
Q_OBJECT

public:
DetailsPage(QWidget *parent = 0);
DetailsPage(QWidget *parent = nullptr);

int nextId() const override;

Expand All @@ -155,7 +155,7 @@ class ConclusionPage : public QWizardPage
Q_OBJECT

public:
ConclusionPage(QWidget *parent = 0);
ConclusionPage(QWidget *parent = nullptr);

void initializePage() override;
int nextId() const override;
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/dialogs/standarddialogs/dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Dialog : public QWidget
Q_OBJECT

public:
Dialog(QWidget *parent = 0);
Dialog(QWidget *parent = nullptr);

private slots:
void setInteger();
Expand Down
8 changes: 4 additions & 4 deletions examples/widgets/dialogs/tabdialog/tabdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class GeneralTab : public QWidget
Q_OBJECT

public:
explicit GeneralTab(const QFileInfo &fileInfo, QWidget *parent = 0);
explicit GeneralTab(const QFileInfo &fileInfo, QWidget *parent = nullptr);
};
//! [0]

Expand All @@ -76,7 +76,7 @@ class PermissionsTab : public QWidget
Q_OBJECT

public:
explicit PermissionsTab(const QFileInfo &fileInfo, QWidget *parent = 0);
explicit PermissionsTab(const QFileInfo &fileInfo, QWidget *parent = nullptr);
};
//! [1]

Expand All @@ -87,7 +87,7 @@ class ApplicationsTab : public QWidget
Q_OBJECT

public:
explicit ApplicationsTab(const QFileInfo &fileInfo, QWidget *parent = 0);
explicit ApplicationsTab(const QFileInfo &fileInfo, QWidget *parent = nullptr);
};
//! [2]

Expand All @@ -98,7 +98,7 @@ class TabDialog : public QDialog
Q_OBJECT

public:
explicit TabDialog(const QString &fileName, QWidget *parent = 0);
explicit TabDialog(const QString &fileName, QWidget *parent = nullptr);

private:
QTabWidget *tabWidget;
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/effects/blurpicker/blurpicker.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class BlurPicker: public QGraphicsView
Q_PROPERTY(qreal index READ index WRITE setIndex)

public:
BlurPicker(QWidget *parent = 0);
BlurPicker(QWidget *parent = nullptr);

qreal index() const;
void setIndex(qreal);
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/effects/fademessage/fademessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class FadeMessage: public QGraphicsView
Q_OBJECT

public:
FadeMessage(QWidget *parent = 0);
FadeMessage(QWidget *parent = nullptr);

private:
void setupScene();
Expand Down
28 changes: 12 additions & 16 deletions examples/widgets/gestures/imagegestures/imagewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,23 @@

#include "imagewidget.h"

#include <QtWidgets>
#include <QDir>
#include <QImageReader>
#include <QGestureEvent>
#include <QPainter>

Q_LOGGING_CATEGORY(lcExample, "qt.examples.imagegestures")

//! [constructor]
ImageWidget::ImageWidget(QWidget *parent)
: QWidget(parent),
position(0),
horizontalOffset(0),
verticalOffset(0),
rotationAngle(0),
scaleFactor(1),
currentStepScaleFactor(1)

: QWidget(parent), position(0), horizontalOffset(0), verticalOffset(0)
, rotationAngle(0), scaleFactor(1), currentStepScaleFactor(1)
{
setMinimumSize(QSize(100,100));
setMinimumSize(QSize(100, 100));
}
//! [constructor]

void ImageWidget::grabGestures(const QList<Qt::GestureType> &gestures)
void ImageWidget::grabGestures(const QVector<Qt::GestureType> &gestures)
{
//! [enable gestures]
for (Qt::GestureType gesture : gestures)
Expand All @@ -96,11 +93,11 @@ void ImageWidget::paintEvent(QPaintEvent*)
const qreal wh = height();
const qreal ww = width();

p.translate(ww/2, wh/2);
p.translate(ww / 2, wh / 2);
p.translate(horizontalOffset, verticalOffset);
p.rotate(rotationAngle);
p.scale(currentStepScaleFactor * scaleFactor, currentStepScaleFactor * scaleFactor);
p.translate(-iw/2, -ih/2);
p.translate(-iw / 2, -ih / 2);
p.drawImage(0, 0, currentImage);
}
//! [paint method]
Expand Down Expand Up @@ -198,16 +195,15 @@ void ImageWidget::openDirectory(const QString &path)
{
this->path = path;
QDir dir(path);
QStringList nameFilters;
nameFilters << "*.jpg" << "*.png";
const QStringList nameFilters{"*.jpg", "*.png"};
files = dir.entryList(nameFilters, QDir::Files|QDir::Readable, QDir::Name);

position = 0;
goToImage(0);
update();
}

QImage ImageWidget::loadImage(const QString &fileName)
QImage ImageWidget::loadImage(const QString &fileName) const
{
QImageReader reader(fileName);
reader.setAutoTransform(true);
Expand Down
10 changes: 5 additions & 5 deletions examples/widgets/gestures/imagegestures/imagewidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
#ifndef IMAGEWIDGET_H
#define IMAGEWIDGET_H

#include <QWidget>
#include <QImage>
#include <QtWidgets>
#include <QLoggingCategory>
#include <QWidget>

QT_BEGIN_NAMESPACE
class QGestureEvent;
Expand All @@ -70,9 +70,9 @@ class ImageWidget : public QWidget
Q_OBJECT

public:
ImageWidget(QWidget *parent = 0);
ImageWidget(QWidget *parent = nullptr);
void openDirectory(const QString &path);
void grabGestures(const QList<Qt::GestureType> &gestures);
void grabGestures(const QVector<Qt::GestureType> &gestures);

protected:
bool event(QEvent *event) override;
Expand All @@ -87,7 +87,7 @@ class ImageWidget : public QWidget
void swipeTriggered(QSwipeGesture*);
//! [class definition begin]

QImage loadImage(const QString &fileName);
QImage loadImage(const QString &fileName) const;
void loadImage();
void goNextImage();
void goPrevImage();
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/gestures/imagegestures/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ int main(int argc, char *argv[])
return -1;
}

QList<Qt::GestureType> gestures;
QVector<Qt::GestureType> gestures;
if (!commandLineParser.isSet(disablePanOption))
gestures << Qt::PanGesture;
if (!commandLineParser.isSet(disablePinchOption))
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/gestures/imagegestures/mainwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void MainWidget::openDirectory(const QString &path)
imageWidget->openDirectory(path);
}

void MainWidget::grabGestures(const QList<Qt::GestureType> &gestures)
void MainWidget::grabGestures(const QVector<Qt::GestureType> &gestures)
{
imageWidget->grabGestures(gestures);
}
4 changes: 2 additions & 2 deletions examples/widgets/gestures/imagegestures/mainwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class MainWidget : public QMainWindow
Q_OBJECT

public:
MainWidget(QWidget *parent = 0);
void grabGestures(const QList<Qt::GestureType> &gestures);
MainWidget(QWidget *parent = nullptr);
void grabGestures(const QVector<Qt::GestureType> &gestures);

public slots:
void openDirectory(const QString &path);
Expand Down
5 changes: 3 additions & 2 deletions examples/widgets/graphicsview/collidingmice/mouse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ static qreal normalizeAngle(qreal angle)
}

//! [0]
Mouse::Mouse()
: color(QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256))
Mouse::Mouse() : color(QRandomGenerator::global()->bounded(256),
QRandomGenerator::global()->bounded(256),
QRandomGenerator::global()->bounded(256))
{
setRotation(QRandomGenerator::global()->bounded(360 * 16));
}
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/itemviews/frozencolumn/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ int main(int argc, char* argv[])
model->setHorizontalHeaderLabels(list);

int row = 0;
QStandardItem *newItem = 0;
QStandardItem *newItem = nullptr;
while (!stream.atEnd()) {
line = stream.readLine();
if (!line.startsWith('#') && line.contains(',')) {
Expand Down
4 changes: 2 additions & 2 deletions examples/widgets/itemviews/interview/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ bool Model::hasChildren(const QModelIndex &parent) const
Qt::ItemFlags Model::flags(const QModelIndex &index) const
{
if (!index.isValid())
return 0;
return {};
return Qt::ItemIsDragEnabled|QAbstractItemModel::flags(index);
}

Expand All @@ -146,7 +146,7 @@ Model::Node *Model::node(int row, Node *parent) const

Model::Node *Model::parent(Node *child) const
{
return child ? child->parent : 0;
return child ? child->parent : nullptr;
}

int Model::row(Node *node) const
Expand Down
Loading

0 comments on commit 8d8140d

Please sign in to comment.