Graphic UI objects names change, Ribbon init() now remember current tab

This commit is contained in:
2021-02-18 15:21:53 +03:00
parent 63aea62c89
commit 17911b8651
5 changed files with 93 additions and 83 deletions

View File

@@ -91,6 +91,12 @@ void Ribbon::init() {
if (parent == 0) return;
if (parent->menuBar() == 0) return;
QList<QAction * > lm = parent->menuBar()->actions(), la;
QString prev_tab;
if (tab) {
if (tab->currentIndex() >= 0)
prev_tab = tab->tabText(tab->currentIndex());
tab->deleteLater();
}
clear();
if (scroll_area) delete scroll_area;
buttons.clear();
@@ -192,6 +198,8 @@ void Ribbon::init() {
tl->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Fixed));
//sa->widget()->setLayout(tl);
tab->widget(tab->count() - 1)->setLayout(tl);
if (i->text() == prev_tab)
tab->setCurrentIndex(tab->count() - 1);
}
setFloatable(false);
setMovable(false);