the count is always 1 larger than the index, so > is not enough
svn path=/trunk/KDE/kdelibs/; revision=1036289
This commit is contained in:
parent
a1d93d4118
commit
211a206277
@ -405,7 +405,7 @@ int TabBar::count() const
|
|||||||
|
|
||||||
void TabBar::removeTab(int index)
|
void TabBar::removeTab(int index)
|
||||||
{
|
{
|
||||||
if (index > d->pages.count()) {
|
if (index >= d->pages.count()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -432,7 +432,7 @@ void TabBar::removeTab(int index)
|
|||||||
|
|
||||||
QGraphicsLayoutItem *TabBar::takeTab(int index)
|
QGraphicsLayoutItem *TabBar::takeTab(int index)
|
||||||
{
|
{
|
||||||
if (index > d->pages.count()) {
|
if (index >= d->pages.count()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -475,7 +475,7 @@ QGraphicsLayoutItem *TabBar::takeTab(int index)
|
|||||||
|
|
||||||
QGraphicsLayoutItem *TabBar::tabAt(int index)
|
QGraphicsLayoutItem *TabBar::tabAt(int index)
|
||||||
{
|
{
|
||||||
if (index > d->pages.count()) {
|
if (index >= d->pages.count()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -488,13 +488,13 @@ QGraphicsLayoutItem *TabBar::tabAt(int index)
|
|||||||
} else {
|
} else {
|
||||||
returnItem = lay;
|
returnItem = lay;
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnItem;
|
return returnItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabBar::setTabText(int index, const QString &label)
|
void TabBar::setTabText(int index, const QString &label)
|
||||||
{
|
{
|
||||||
if (index > d->pages.count()) {
|
if (index >= d->pages.count()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user