MCPcopy Create free account
hub / github.com/KDE/labplot / updateTabs

Method updateTabs

src/3rdparty/Qt-Advanced-Docking-System/src/DockAreaTabBar.cpp:96–124  ·  view source on GitHub ↗

============================================================================

Source from the content-addressed store, hash-verified

94
95//============================================================================
96void DockAreaTabBarPrivate::updateTabs()
97{
98 // Set active TAB and update all other tabs to be inactive
99 for (int i = 0; i < _this->count(); ++i)
100 {
101 auto TabWidget = _this->tab(i);
102 if (!TabWidget)
103 {
104 continue;
105 }
106
107 if (i == CurrentIndex)
108 {
109 TabWidget->show();
110 TabWidget->setActiveTab(true);
111 // Sometimes the synchronous calculation of the rectangular area fails
112 // Therefore we use QTimer::singleShot here to execute the call
113 // within the event loop - see #520
114 QTimer::singleShot(0, TabWidget, [&, TabWidget]
115 {
116 _this->ensureWidgetVisible(TabWidget);
117 });
118 }
119 else
120 {
121 TabWidget->setActiveTab(false);
122 }
123 }
124}
125
126
127//============================================================================

Callers 2

setCurrentIndexMethod · 0.80
removeTabMethod · 0.80

Calls 4

showMethod · 0.80
setActiveTabMethod · 0.80
countMethod · 0.45
tabMethod · 0.45

Tested by

no test coverage detected