mode: set tabs movable
This commit is contained in:
parent
ade970b35a
commit
2ac2606bad
@ -87,12 +87,19 @@ Mode::Mode(AppWindow *window, QString name, QString SCPIname)
|
|||||||
connect(tabbar, &QTabBar::tabCloseRequested, [=](int index){
|
connect(tabbar, &QTabBar::tabCloseRequested, [=](int index){
|
||||||
delete modes[index];
|
delete modes[index];
|
||||||
});
|
});
|
||||||
|
connect(tabbar, &QTabBar::tabMoved, [=](int from, int to){
|
||||||
|
auto modeFrom = modes.at(from);
|
||||||
|
auto modeTo = modes.at(to);
|
||||||
|
modes[from] = modeTo;
|
||||||
|
modes[to] = modeFrom;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
connect(this, &Mode::statusbarMessage, window, &AppWindow::setModeStatus);
|
connect(this, &Mode::statusbarMessage, window, &AppWindow::setModeStatus);
|
||||||
modes.push_back(this);
|
modes.push_back(this);
|
||||||
tabbar->blockSignals(true);
|
tabbar->blockSignals(true);
|
||||||
tabbar->insertTab(tabbar->count(), name);
|
tabbar->insertTab(tabbar->count(), name);
|
||||||
tabbar->blockSignals(false);
|
tabbar->blockSignals(false);
|
||||||
|
tabbar->setMovable(true);
|
||||||
window->getSCPI()->add(this);
|
window->getSCPI()->add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user