void TabBarWidget::addTab(int index, Window *window) { insertTab(index, window->getTitle()); setTabData(index, window->getIdentifier()); connect(window, SIGNAL(iconChanged(QIcon)), this, SLOT(updateTabs())); connect(window, SIGNAL(loadingStateChanged(WindowLoadingState)), this, SLOT(updateTabs())); connect(window, SIGNAL(isPinnedChanged(bool)), this, SLOT(updatePinnedTabsAmount())); if (window->isPinned()) { updatePinnedTabsAmount(); } updateTabs(index); }
void TabBarWidget::addTab(int index, Window *window) { insertTab(index, window->getTitle()); setTabData(index, QVariant::fromValue(window)); connect(window, SIGNAL(iconChanged(QIcon)), this, SLOT(updateTabs())); connect(window, SIGNAL(loadingStateChanged(WindowLoadingState)), this, SLOT(updateTabs())); connect(window, SIGNAL(isPinnedChanged(bool)), this, SLOT(updatePinnedTabsAmount())); connect(tabButton(index, QTabBar::LeftSide), SIGNAL(destroyed()), window, SLOT(deleteLater())); if (window->isPinned()) { updatePinnedTabsAmount(); } updateTabs(index); }