Fix nullptr literal 0s which would look odd as nullptr
These all invoke the QFlags<>(Zero *) ctor, which is designed to accept a 0, but no other int. But in doing so, it requires passing a nullptr literal, and 0 is not a nullptr literal accepted under -Wzero-as-null-pointer-constant or similar warnings. Fix by using the QFlags::QFlags() ctor instead. Task-number: QTBUG-45291 Change-Id: I73f9c9f4de11eeb1ba04ace6c7121d17510ea29f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
efeab107bf
commit
c27d4981e9
|
|
@ -878,7 +878,7 @@ public:
|
|||
explicit QTouchEvent(QEvent::Type eventType,
|
||||
QTouchDevice *device = Q_NULLPTR,
|
||||
Qt::KeyboardModifiers modifiers = Qt::NoModifier,
|
||||
Qt::TouchPointStates touchPointStates = 0,
|
||||
Qt::TouchPointStates touchPointStates = Qt::TouchPointStates(),
|
||||
const QList<QTouchEvent::TouchPoint> &touchPoints = QList<QTouchEvent::TouchPoint>());
|
||||
~QTouchEvent();
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ public:
|
|||
PolylineMode
|
||||
};
|
||||
|
||||
explicit QPaintEngine(PaintEngineFeatures features=0);
|
||||
explicit QPaintEngine(PaintEngineFeatures features=PaintEngineFeatures());
|
||||
virtual ~QPaintEngine();
|
||||
|
||||
bool isActive() const { return active; }
|
||||
|
|
@ -220,7 +220,7 @@ public:
|
|||
inline bool isExtended() const { return extended; }
|
||||
|
||||
protected:
|
||||
QPaintEngine(QPaintEnginePrivate &data, PaintEngineFeatures devcaps=0);
|
||||
QPaintEngine(QPaintEnginePrivate &data, PaintEngineFeatures devcaps=PaintEngineFeatures());
|
||||
|
||||
QPaintEngineState *state;
|
||||
PaintEngineFeatures gccaps;
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@ public:
|
|||
inline void drawPixmap(int x, int y, int w, int h, const QPixmap &pm);
|
||||
|
||||
void drawPixmapFragments(const PixmapFragment *fragments, int fragmentCount,
|
||||
const QPixmap &pixmap, PixmapFragmentHints hints = 0);
|
||||
const QPixmap &pixmap, PixmapFragmentHints hints = PixmapFragmentHints());
|
||||
|
||||
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect,
|
||||
Qt::ImageConversionFlags flags = Qt::AutoColor);
|
||||
|
|
|
|||
|
|
@ -157,17 +157,17 @@ public:
|
|||
};
|
||||
Q_DECLARE_FLAGS(FindFlags, FindFlag)
|
||||
|
||||
QTextCursor find(const QString &subString, int from = 0, FindFlags options = 0) const;
|
||||
QTextCursor find(const QString &subString, const QTextCursor &cursor, FindFlags options = 0) const;
|
||||
QTextCursor find(const QString &subString, int from = 0, FindFlags options = FindFlags()) const;
|
||||
QTextCursor find(const QString &subString, const QTextCursor &cursor, FindFlags options = FindFlags()) const;
|
||||
|
||||
#ifndef QT_NO_REGEXP
|
||||
QTextCursor find(const QRegExp &expr, int from = 0, FindFlags options = 0) const;
|
||||
QTextCursor find(const QRegExp &expr, const QTextCursor &cursor, FindFlags options = 0) const;
|
||||
QTextCursor find(const QRegExp &expr, int from = 0, FindFlags options = FindFlags()) const;
|
||||
QTextCursor find(const QRegExp &expr, const QTextCursor &cursor, FindFlags options = FindFlags()) const;
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_REGULAREXPRESSION
|
||||
QTextCursor find(const QRegularExpression &expr, int from = 0, FindFlags options = 0) const;
|
||||
QTextCursor find(const QRegularExpression &expr, const QTextCursor &cursor, FindFlags options = 0) const;
|
||||
QTextCursor find(const QRegularExpression &expr, int from = 0, FindFlags options = FindFlags()) const;
|
||||
QTextCursor find(const QRegularExpression &expr, const QTextCursor &cursor, FindFlags options = FindFlags()) const;
|
||||
#endif
|
||||
|
||||
QTextFrame *frameAt(int pos) const;
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public:
|
|||
QNetworkConfigurationManager::Capabilities capabilities() const;
|
||||
|
||||
QNetworkConfiguration defaultConfiguration() const;
|
||||
QList<QNetworkConfiguration> allConfigurations(QNetworkConfiguration::StateFlags flags = 0) const;
|
||||
QList<QNetworkConfiguration> allConfigurations(QNetworkConfiguration::StateFlags flags = QNetworkConfiguration::StateFlags()) const;
|
||||
QNetworkConfiguration configurationFromIdentifier(const QString &identifier) const;
|
||||
|
||||
bool isOnline() const;
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ public:
|
|||
static QColor getColor(const QColor &initial = Qt::white,
|
||||
QWidget *parent = Q_NULLPTR,
|
||||
const QString &title = QString(),
|
||||
ColorDialogOptions options = 0);
|
||||
ColorDialogOptions options = ColorDialogOptions());
|
||||
|
||||
// obsolete
|
||||
static QRgb getRgba(QRgb rgba = 0xffffffff, bool *ok = Q_NULLPTR, QWidget *parent = Q_NULLPTR);
|
||||
|
|
|
|||
|
|
@ -205,14 +205,14 @@ public:
|
|||
const QString &dir = QString(),
|
||||
const QString &filter = QString(),
|
||||
QString *selectedFilter = Q_NULLPTR,
|
||||
Options options = 0);
|
||||
Options options = Options());
|
||||
|
||||
static QUrl getOpenFileUrl(QWidget *parent = Q_NULLPTR,
|
||||
const QString &caption = QString(),
|
||||
const QUrl &dir = QUrl(),
|
||||
const QString &filter = QString(),
|
||||
QString *selectedFilter = Q_NULLPTR,
|
||||
Options options = 0,
|
||||
Options options = Options(),
|
||||
const QStringList &supportedSchemes = QStringList());
|
||||
|
||||
static QString getSaveFileName(QWidget *parent = Q_NULLPTR,
|
||||
|
|
@ -220,14 +220,14 @@ public:
|
|||
const QString &dir = QString(),
|
||||
const QString &filter = QString(),
|
||||
QString *selectedFilter = Q_NULLPTR,
|
||||
Options options = 0);
|
||||
Options options = Options());
|
||||
|
||||
static QUrl getSaveFileUrl(QWidget *parent = Q_NULLPTR,
|
||||
const QString &caption = QString(),
|
||||
const QUrl &dir = QUrl(),
|
||||
const QString &filter = QString(),
|
||||
QString *selectedFilter = Q_NULLPTR,
|
||||
Options options = 0,
|
||||
Options options = Options(),
|
||||
const QStringList &supportedSchemes = QStringList());
|
||||
|
||||
static QString getExistingDirectory(QWidget *parent = Q_NULLPTR,
|
||||
|
|
@ -246,14 +246,14 @@ public:
|
|||
const QString &dir = QString(),
|
||||
const QString &filter = QString(),
|
||||
QString *selectedFilter = Q_NULLPTR,
|
||||
Options options = 0);
|
||||
Options options = Options());
|
||||
|
||||
static QList<QUrl> getOpenFileUrls(QWidget *parent = Q_NULLPTR,
|
||||
const QString &caption = QString(),
|
||||
const QUrl &dir = QUrl(),
|
||||
const QString &filter = QString(),
|
||||
QString *selectedFilter = Q_NULLPTR,
|
||||
Options options = 0,
|
||||
Options options = Options(),
|
||||
const QStringList &supportedSchemes = QStringList());
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public:
|
|||
|
||||
static QFont getFont(bool *ok, QWidget *parent = Q_NULLPTR);
|
||||
static QFont getFont(bool *ok, const QFont &initial, QWidget *parent = Q_NULLPTR, const QString &title = QString(),
|
||||
FontDialogOptions options = 0);
|
||||
FontDialogOptions options = FontDialogOptions());
|
||||
|
||||
Q_SIGNALS:
|
||||
void currentFontChanged(const QFont &font);
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ public:
|
|||
virtual ~QGraphicsGridLayout();
|
||||
|
||||
void addItem(QGraphicsLayoutItem *item, int row, int column, int rowSpan, int columnSpan,
|
||||
Qt::Alignment alignment = 0);
|
||||
inline void addItem(QGraphicsLayoutItem *item, int row, int column, Qt::Alignment alignment = 0);
|
||||
Qt::Alignment alignment = Qt::Alignment());
|
||||
inline void addItem(QGraphicsLayoutItem *item, int row, int column, Qt::Alignment alignment = Qt::Alignment());
|
||||
|
||||
void setHorizontalSpacing(qreal spacing);
|
||||
qreal horizontalSpacing() const;
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public:
|
|||
void addSpacing(int size);
|
||||
void addStretch(int stretch = 0);
|
||||
void addSpacerItem(QSpacerItem *spacerItem);
|
||||
void addWidget(QWidget *, int stretch = 0, Qt::Alignment alignment = 0);
|
||||
void addWidget(QWidget *, int stretch = 0, Qt::Alignment alignment = Qt::Alignment());
|
||||
void addLayout(QLayout *layout, int stretch = 0);
|
||||
void addStrut(int);
|
||||
void addItem(QLayoutItem *) Q_DECL_OVERRIDE;
|
||||
|
|
@ -72,7 +72,7 @@ public:
|
|||
void insertSpacing(int index, int size);
|
||||
void insertStretch(int index, int stretch = 0);
|
||||
void insertSpacerItem(int index, QSpacerItem *spacerItem);
|
||||
void insertWidget(int index, QWidget *widget, int stretch = 0, Qt::Alignment alignment = 0);
|
||||
void insertWidget(int index, QWidget *widget, int stretch = 0, Qt::Alignment alignment = Qt::Alignment());
|
||||
void insertLayout(int index, QLayout *layout, int stretch = 0);
|
||||
void insertItem(int index, QLayoutItem *);
|
||||
|
||||
|
|
|
|||
|
|
@ -93,10 +93,10 @@ public:
|
|||
void invalidate() Q_DECL_OVERRIDE;
|
||||
|
||||
inline void addWidget(QWidget *w) { QLayout::addWidget(w); }
|
||||
void addWidget(QWidget *, int row, int column, Qt::Alignment = 0);
|
||||
void addWidget(QWidget *, int row, int column, int rowSpan, int columnSpan, Qt::Alignment = 0);
|
||||
void addLayout(QLayout *, int row, int column, Qt::Alignment = 0);
|
||||
void addLayout(QLayout *, int row, int column, int rowSpan, int columnSpan, Qt::Alignment = 0);
|
||||
void addWidget(QWidget *, int row, int column, Qt::Alignment = Qt::Alignment());
|
||||
void addWidget(QWidget *, int row, int column, int rowSpan, int columnSpan, Qt::Alignment = Qt::Alignment());
|
||||
void addLayout(QLayout *, int row, int column, Qt::Alignment = Qt::Alignment());
|
||||
void addLayout(QLayout *, int row, int column, int rowSpan, int columnSpan, Qt::Alignment = Qt::Alignment());
|
||||
|
||||
void setOriginCorner(Qt::Corner);
|
||||
Qt::Corner originCorner() const;
|
||||
|
|
@ -107,7 +107,7 @@ public:
|
|||
int count() const Q_DECL_OVERRIDE;
|
||||
void setGeometry(const QRect&) Q_DECL_OVERRIDE;
|
||||
|
||||
void addItem(QLayoutItem *item, int row, int column, int rowSpan = 1, int columnSpan = 1, Qt::Alignment = 0);
|
||||
void addItem(QLayoutItem *item, int row, int column, int rowSpan = 1, int columnSpan = 1, Qt::Alignment = Qt::Alignment());
|
||||
|
||||
void setDefaultPositioning(int n, Qt::Orientation orient);
|
||||
void getItemPosition(int idx, int *row, int *column, int *rowSpan, int *columnSpan) const;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class QSize;
|
|||
class Q_WIDGETS_EXPORT QLayoutItem
|
||||
{
|
||||
public:
|
||||
inline explicit QLayoutItem(Qt::Alignment alignment = 0);
|
||||
inline explicit QLayoutItem(Qt::Alignment alignment = Qt::Alignment());
|
||||
virtual ~QLayoutItem();
|
||||
virtual QSize sizeHint() const = 0;
|
||||
virtual QSize minimumSize() const = 0;
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ Q_WIDGETS_EXPORT void qDrawBorderPixmap(QPainter *painter,
|
|||
const QMargins &sourceMargins,
|
||||
const QTileRules &rules = QTileRules()
|
||||
#ifndef Q_QDOC
|
||||
, QDrawBorderPixmap::DrawingHints hints = 0
|
||||
, QDrawBorderPixmap::DrawingHints hints = QDrawBorderPixmap::DrawingHints()
|
||||
#endif
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -136,9 +136,9 @@ public:
|
|||
void setCenterOnScroll(bool enabled);
|
||||
bool centerOnScroll() const;
|
||||
|
||||
bool find(const QString &exp, QTextDocument::FindFlags options = 0);
|
||||
bool find(const QString &exp, QTextDocument::FindFlags options = QTextDocument::FindFlags());
|
||||
#ifndef QT_NO_REGEXP
|
||||
bool find(const QRegExp &exp, QTextDocument::FindFlags options = 0);
|
||||
bool find(const QRegExp &exp, QTextDocument::FindFlags options = QTextDocument::FindFlags());
|
||||
#endif
|
||||
|
||||
inline QString toPlainText() const
|
||||
|
|
|
|||
|
|
@ -153,9 +153,9 @@ public:
|
|||
QTextOption::WrapMode wordWrapMode() const;
|
||||
void setWordWrapMode(QTextOption::WrapMode policy);
|
||||
|
||||
bool find(const QString &exp, QTextDocument::FindFlags options = 0);
|
||||
bool find(const QString &exp, QTextDocument::FindFlags options = QTextDocument::FindFlags());
|
||||
#ifndef QT_NO_REGEXP
|
||||
bool find(const QRegExp &exp, QTextDocument::FindFlags options = 0);
|
||||
bool find(const QRegExp &exp, QTextDocument::FindFlags options = QTextDocument::FindFlags());
|
||||
#endif
|
||||
|
||||
QString toPlainText() const;
|
||||
|
|
|
|||
Loading…
Reference in New Issue