Doc snippets: Use nullptr instead of 0 literal

Also mark constructors explicit, where applicable.

Pick-to: 5.15
Fixes: QTBUG-84859
Change-Id: I145d366d854fd6b4373bcc23d0b880d6361d9014
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
Paul Wicking 2020-06-10 07:22:27 +02:00
parent c208b648f9
commit f3c402a6df
11 changed files with 11 additions and 11 deletions

View File

@ -65,7 +65,7 @@ class ClipWindow : public QMainWindow
Q_OBJECT Q_OBJECT
public: public:
ClipWindow(QWidget *parent = 0); explicit ClipWindow(QWidget *parent = nullptr);
public slots: public slots:
void updateClipboard(); void updateClipboard();

View File

@ -53,7 +53,7 @@
{ {
Q_OBJECT Q_OBJECT
public: public:
MyGLWindow(QScreen *screen = 0); explicit MyGLWindow(QScreen *screen = nullptr);
protected: protected:
void initializeGL(); void initializeGL();

View File

@ -66,7 +66,7 @@ class DragWidget : public QFrame
Q_OBJECT Q_OBJECT
public: public:
DragWidget(QWidget *parent); explicit DragWidget(QWidget *parent = nullptr);
void setData(const QString &mimetype, const QByteArray &newData); void setData(const QString &mimetype, const QByteArray &newData);
signals: signals:

View File

@ -67,7 +67,7 @@ class MainWindow : public QMainWindow
Q_OBJECT Q_OBJECT
public: public:
MainWindow(QWidget *parent = 0); explicit MainWindow(QWidget *parent = nullptr);
public slots: public slots:
void setDragResult(const QString &actionText); void setDragResult(const QString &actionText);

View File

@ -65,7 +65,7 @@ class MainWindow : public QMainWindow
Q_OBJECT Q_OBJECT
public: public:
MainWindow(QWidget *parent = 0); explicit MainWindow(QWidget *parent = nullptr);
protected: protected:
void mousePressEvent(QMouseEvent *event) override; void mousePressEvent(QMouseEvent *event) override;

View File

@ -64,7 +64,7 @@ class Window : public QWidget
Q_OBJECT Q_OBJECT
public: public:
Window(QWidget *parent = 0); explicit Window(QWidget *parent = nullptr);
protected: protected:
void dragEnterEvent(QDragEnterEvent *event) override; void dragEnterEvent(QDragEnterEvent *event) override;

View File

@ -64,7 +64,7 @@ class Window : public QWidget
Q_OBJECT Q_OBJECT
public: public:
Window(QWidget *parent = 0); explicit Window(QWidget *parent = nullptr);
protected: protected:
void dragMoveEvent(QDragMoveEvent *event) override; void dragMoveEvent(QDragMoveEvent *event) override;

View File

@ -58,7 +58,7 @@ class Window : public QWidget
Q_OBJECT Q_OBJECT
public: public:
Window(QWidget *parent = 0); explicit Window(QWidget *parent = nullptr);
protected: protected:
void paintEvent(QPaintEvent *event) override; void paintEvent(QPaintEvent *event) override;

View File

@ -54,7 +54,7 @@
class MainWindow : public QMainWindow class MainWindow : public QMainWindow
{ {
public: public:
MainWindow(QWidget *parent = 0); explicit MainWindow(QWidget *parent = nullptr);
}; };
//! [0] //! [1] //! [0] //! [1]

View File

@ -68,7 +68,7 @@ void mergeFormat(QTextEdit *edit)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QWidget *parent = 0; QWidget *parent = nullptr;
QString aStringContainingHTMLtext("<h1>Scribe Overview</h1>"); QString aStringContainingHTMLtext("<h1>Scribe Overview</h1>");
QApplication app(argc, argv); QApplication app(argc, argv);

View File

@ -58,7 +58,7 @@ class TextEdit : public QTextEdit
Q_OBJECT Q_OBJECT
public: public:
TextEdit(QWidget *parent=0); explicit TextEdit(QWidget *parent = nullptr);
bool canInsertFromMimeData( const QMimeData *source ) const override; bool canInsertFromMimeData( const QMimeData *source ) const override;
void insertFromMimeData( const QMimeData *source ) override; void insertFromMimeData( const QMimeData *source ) override;
}; };