Graphic UI objects names change, Ribbon init() now remember current tab
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user