diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-11-22 14:46:58 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-12-06 12:13:20 +0100 |
commit | ece0c0a5e7e0b18beb58ccd868bde54c7be64f78 (patch) | |
tree | fa4a0fdbda040d24f1a2d07a320635c76980f431 /src/widgets/kernel/qtooltip.cpp | |
parent | b19220d17fa66de5ded41690ffff263ee2af5c63 (diff) |
Tidy nullptr usage
Move away from using 0 as pointer literal.
Done using clang-tidy. This is not complete as
run-clang-tidy can't handle all of qtbase in one go.
Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/widgets/kernel/qtooltip.cpp')
-rw-r--r-- | src/widgets/kernel/qtooltip.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp index 97a279d65d..b290713440 100644 --- a/src/widgets/kernel/qtooltip.cpp +++ b/src/widgets/kernel/qtooltip.cpp @@ -151,7 +151,7 @@ public slots: */ void styleSheetParentDestroyed() { setProperty("_q_stylesheet_parent", QVariant()); - styleSheetParent = 0; + styleSheetParent = nullptr; } private: @@ -163,11 +163,11 @@ private: QRect rect; }; -QTipLabel *QTipLabel::instance = 0; +QTipLabel *QTipLabel::instance = nullptr; QTipLabel::QTipLabel(const QString &text, const QPoint &pos, QWidget *w, int msecDisplayTime) #ifndef QT_NO_STYLE_STYLESHEET - : QLabel(w, Qt::ToolTip | Qt::BypassGraphicsProxyWidget), styleSheetParent(0), widget(0) + : QLabel(w, Qt::ToolTip | Qt::BypassGraphicsProxyWidget), styleSheetParent(nullptr), widget(nullptr) #else : QLabel(w, Qt::ToolTip | Qt::BypassGraphicsProxyWidget), widget(0) #endif @@ -178,12 +178,12 @@ QTipLabel::QTipLabel(const QString &text, const QPoint &pos, QWidget *w, int mse setBackgroundRole(QPalette::ToolTipBase); setPalette(QToolTip::palette()); ensurePolished(); - setMargin(1 + style()->pixelMetric(QStyle::PM_ToolTipLabelFrameWidth, 0, this)); + setMargin(1 + style()->pixelMetric(QStyle::PM_ToolTipLabelFrameWidth, nullptr, this)); setFrameStyle(QFrame::NoFrame); setAlignment(Qt::AlignLeft); setIndent(1); qApp->installEventFilter(this); - setWindowOpacity(style()->styleHint(QStyle::SH_ToolTipLabel_Opacity, 0, this) / 255.0); + setWindowOpacity(style()->styleHint(QStyle::SH_ToolTipLabel_Opacity, nullptr, this) / 255.0); setMouseTracking(true); fadingOut = false; reuseTip(text, msecDisplayTime, pos); @@ -204,7 +204,7 @@ void QTipLabel::reuseTip(const QString &text, int msecDisplayTime, const QPoint if (styleSheetParent){ disconnect(styleSheetParent, SIGNAL(destroyed()), QTipLabel::instance, SLOT(styleSheetParentDestroyed())); - styleSheetParent = 0; + styleSheetParent = nullptr; } #endif @@ -278,7 +278,7 @@ void QTipLabel::mouseMoveEvent(QMouseEvent *e) QTipLabel::~QTipLabel() { - instance = 0; + instance = nullptr; } void QTipLabel::hideTip() @@ -547,7 +547,7 @@ void QToolTip::showText(const QPoint &pos, const QString &text, QWidget *w) */ bool QToolTip::isVisible() { - return (QTipLabel::instance != 0 && QTipLabel::instance->isVisible()); + return (QTipLabel::instance != nullptr && QTipLabel::instance->isVisible()); } /*! |