int KMultiTabBar::appendButton(const QPixmap &pic ,int id,QPopupMenu *popup,const QString&) { KMultiTabBarButton *btn; m_buttons.append(btn= new KMultiTabBarButton(pic,QString::null, popup,id,this,m_position,m_internal->m_style)); m_l->insertWidget(0,btn); btn->show(); m_btnTabSep->show(); return 0; }
KMultiTabBarButton* KMultiTabBar::button(int id) const { QListIterator<KMultiTabBarButton*> it(d->m_buttons); while ( it.hasNext() ) { KMultiTabBarButton *button = it.next(); if ( button->id() == id ) return button; } return 0; }
int KMultiTabBar::appendButton(const QPixmap &pic, int id, QMenu *popup, const QString&) { KMultiTabBarButton *btn = new KMultiTabBarButton(pic, QString(), id, this); // a button with a QMenu can have another size. Make sure the button has always the same size. btn->setFixedWidth(btn->height()); btn->setMenu(popup); d->m_buttons.append(btn); d->m_l->insertWidget(0,btn); btn->show(); d->m_btnTabSep->show(); return 0; }