summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qlabel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/widgets/qlabel.cpp')
-rw-r--r--src/widgets/widgets/qlabel.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/widgets/widgets/qlabel.cpp b/src/widgets/widgets/qlabel.cpp
index 5d09e14073..60f88df9af 100644
--- a/src/widgets/widgets/qlabel.cpp
+++ b/src/widgets/widgets/qlabel.cpp
@@ -288,7 +288,7 @@ void QLabel::setText(const QString &text)
return;
QWidgetTextControl *oldControl = d->control;
- d->control = 0;
+ d->control = nullptr;
d->clearContents();
d->text = text;
@@ -303,7 +303,7 @@ void QLabel::setText(const QString &text)
d->ensureTextControl();
} else {
delete d->control;
- d->control = 0;
+ d->control = nullptr;
}
if (d->isRichText) {
@@ -714,7 +714,7 @@ void QLabel::setTextInteractionFlags(Qt::TextInteractionFlags flags)
d->ensureTextControl();
} else {
delete d->control;
- d->control = 0;
+ d->control = nullptr;
}
if (d->control)
@@ -1021,13 +1021,13 @@ void QLabel::paintEvent(QPaintEvent *)
QStyleOption opt;
opt.initFrom(this);
#ifndef QT_NO_STYLE_STYLESHEET
- if (QStyleSheetStyle* cssStyle = qobject_cast<QStyleSheetStyle*>(style)) {
+ if (QStyleSheetStyle* cssStyle = qt_styleSheet(style))
cssStyle->styleSheetPalette(this, &opt, &opt.palette);
- }
#endif
if (d->control) {
#ifndef QT_NO_SHORTCUT
- const bool underline = (bool)style->styleHint(QStyle::SH_UnderlineShortcut, 0, this, 0);
+ const bool underline = static_cast<bool>(style->styleHint(QStyle::SH_UnderlineShortcut,
+ nullptr, this, nullptr));
if (d->shortcutId != 0
&& underline != d->shortcutCursor.charFormat().fontUnderline()) {
QTextCharFormat fmt;
@@ -1294,20 +1294,20 @@ void QLabel::setMovie(QMovie *movie)
void QLabelPrivate::clearContents()
{
delete control;
- control = 0;
+ control = nullptr;
isTextLabel = false;
hasShortcut = false;
#ifndef QT_NO_PICTURE
delete picture;
- picture = 0;
+ picture = nullptr;
#endif
delete scaledpixmap;
- scaledpixmap = 0;
+ scaledpixmap = nullptr;
delete cachedimage;
- cachedimage = 0;
+ cachedimage = nullptr;
delete pixmap;
- pixmap = 0;
+ pixmap = nullptr;
text.clear();
Q_Q(QLabel);
@@ -1321,7 +1321,7 @@ void QLabelPrivate::clearContents()
QObject::disconnect(movie, SIGNAL(resized(QSize)), q, SLOT(_q_movieResized(QSize)));
QObject::disconnect(movie, SIGNAL(updated(QRect)), q, SLOT(_q_movieUpdated(QRect)));
}
- movie = 0;
+ movie = nullptr;
#endif
#ifndef QT_NO_CURSOR
if (onAnchor) {
@@ -1428,9 +1428,9 @@ void QLabel::setScaledContents(bool enable)
d->scaledcontents = enable;
if (!enable) {
delete d->scaledpixmap;
- d->scaledpixmap = 0;
+ d->scaledpixmap = nullptr;
delete d->cachedimage;
- d->cachedimage = 0;
+ d->cachedimage = nullptr;
}
update(contentsRect());
}
@@ -1629,7 +1629,7 @@ QMenu *QLabelPrivate::createStandardContextMenu(const QPoint &pos)
}
if (linkToCopy.isEmpty() && !control)
- return 0;
+ return nullptr;
return control->createStandardContextMenu(p, q_func());
}