Adds activeTabChanged() signal to let API users know about this state

change. It might be use to re-polish style sheets.
This commit is contained in:
mfreiholz
2016-02-26 09:07:19 +01:00
parent 014fb04daf
commit 74f6ba333f
9 changed files with 65 additions and 31 deletions

View File

@@ -70,6 +70,8 @@ SectionWidget* ContainerWidget::addSectionContent(const SectionContent::RefPtr&
data.content = sc;
data.titleWidget = new SectionTitleWidget(sc, NULL);
data.contentWidget = new SectionContentWidget(sc, NULL);
QObject::connect(data.titleWidget, &SectionTitleWidget::activeTabChanged, this, &ContainerWidget::onActiveTabChanged);
return dropContent(data, sw, area, false);
}
@@ -1021,6 +1023,16 @@ bool ContainerWidget::takeContent(const SectionContent::RefPtr& sc, InternalCont
return found;
}
void ContainerWidget::onActiveTabChanged()
{
SectionTitleWidget* stw = qobject_cast<SectionTitleWidget*>(sender());
if (stw)
{
qDebug() << "Active tab changed" << stw->_content->uid() << stw->isActiveTab();
emit activeTabChanged(stw->_content, stw->isActiveTab());
}
}
void ContainerWidget::onActionToggleSectionContentVisibility(bool visible)
{
QAction* a = qobject_cast<QAction*>(sender());