MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / SetTabOrder

Function SetTabOrder

lib/utils/tab-helpers.cpp:176–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176void SetTabOrder(QTabWidget *tabWidget)
177{
178 if (!tabWidgetOrderValid()) {
179 resetTabWidgetOrder();
180 }
181
182 auto &tabOrder = getTabOrderVector();
183
184 auto bar = tabWidget->tabBar();
185 for (int i = 0; i < bar->count(); ++i) {
186 int curPos = findTabIndex(tabWidget, tabOrder[i]);
187
188 if (i != curPos && curPos != -1) {
189 bar->moveTab(curPos, i);
190 }
191 }
192
193 QWidget::connect(bar, &QTabBar::tabMoved,
194 [&tabOrder](int from, int to) {
195 std::swap(tabOrder[from], tabOrder[to]);
196 });
197}
198
199void SetCurrentTab(QTabWidget *tabWidget)
200{

Callers 1

LoadUIMethod · 0.85

Calls 5

tabWidgetOrderValidFunction · 0.85
resetTabWidgetOrderFunction · 0.85
findTabIndexFunction · 0.85
countMethod · 0.80
swapFunction · 0.50

Tested by

no test coverage detected