QSplitter: some cleanup
Use nullptr instead of 0 for pointers Change-Id: I048e48eb4701c08af9d05df69d6f8a261db015cf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
parent
093290a662
commit
a0ab7c6e29
@ -826,7 +826,7 @@ QSplitterLayoutStruct *QSplitterPrivate::findWidget(QWidget *w) const
|
||||
if (list.at(i)->widget == w)
|
||||
return list.at(i);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -855,7 +855,7 @@ void QSplitterPrivate::insertWidget_helper(int index, QWidget *widget, bool show
|
||||
QSplitterLayoutStruct *QSplitterPrivate::insertWidget(int index, QWidget *w)
|
||||
{
|
||||
Q_Q(QSplitter);
|
||||
QSplitterLayoutStruct *sls = 0;
|
||||
QSplitterLayoutStruct *sls = nullptr;
|
||||
int i;
|
||||
int last = list.count();
|
||||
for (i = 0; i < list.size(); ++i) {
|
||||
@ -872,9 +872,8 @@ QSplitterLayoutStruct *QSplitterPrivate::insertWidget(int index, QWidget *w)
|
||||
if (sls) {
|
||||
list.move(i,index);
|
||||
} else {
|
||||
QSplitterHandle *newHandle = 0;
|
||||
sls = new QSplitterLayoutStruct;
|
||||
newHandle = q->createHandle();
|
||||
QSplitterHandle *newHandle = q->createHandle();
|
||||
newHandle->setObjectName(QLatin1String("qt_splithandle_") + w->objectName());
|
||||
sls->handle = newHandle;
|
||||
sls->widget = w;
|
||||
@ -1246,7 +1245,7 @@ QSplitterHandle *QSplitter::handle(int index) const
|
||||
{
|
||||
Q_D(const QSplitter);
|
||||
if (index < 0 || index >= d->list.size())
|
||||
return 0;
|
||||
return nullptr;
|
||||
return d->list.at(index)->handle;
|
||||
}
|
||||
|
||||
@ -1259,7 +1258,7 @@ QWidget *QSplitter::widget(int index) const
|
||||
{
|
||||
Q_D(const QSplitter);
|
||||
if (index < 0 || index >= d->list.size())
|
||||
return 0;
|
||||
return nullptr;
|
||||
return d->list.at(index)->widget;
|
||||
}
|
||||
|
||||
@ -1460,7 +1459,7 @@ void QSplitter::moveSplitter(int pos, int index)
|
||||
void QSplitter::getRange(int index, int *min, int *max) const
|
||||
{
|
||||
Q_D(const QSplitter);
|
||||
d->getRange(index, min, 0, 0, max);
|
||||
d->getRange(index, min, nullptr, nullptr, max);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user