add tabAt(int) function

actually the correspondent qtabwidget is widget(), but on a
qgraphicsproxywidget it is taken, maybe needs a beter name?
CCMAIL: plasma-devel@kde.org

svn path=/trunk/KDE/kdelibs/; revision=1019013
This commit is contained in:
Marco Martin 2009-09-02 15:54:18 +00:00
parent 0c51475fe0
commit 462f323042
2 changed files with 27 additions and 0 deletions

View File

@ -425,6 +425,25 @@ QGraphicsLayoutItem *TabBar::takeTab(int index)
return returnItem;
}
QGraphicsLayoutItem *TabBar::tabAt(int index)
{
if (index > d->pages.count()) {
return 0;
}
QGraphicsWidget *page = d->pages.value(index);
QGraphicsLayoutItem *returnItem = 0;
QGraphicsLayout *lay = page->layout();
if (lay && lay->count() == 1) {
returnItem = lay->itemAt(0);
} else {
returnItem = lay;
}
return returnItem;
}
void TabBar::setTabText(int index, const QString &label)
{
if (index > d->pages.count()) {

View File

@ -125,6 +125,14 @@ public:
* @since 4.4
*/
QGraphicsLayoutItem *takeTab(int index);
/**
* Returns the contents of a page
*
* @arg index the index of the tab to retrieve
* @since 4.4
*/
QGraphicsLayoutItem *tabAt(int index);
/**
* @return the index of the tab currently active