| 181 | |
| 182 | template <class T> |
| 183 | static T* activateWidget(SidebarWidgetType* type) |
| 184 | { |
| 185 | Sidebar* sidebar = current(); |
| 186 | if (!type || !sidebar) |
| 187 | return (T*)nullptr; |
| 188 | sidebar->activate(type); |
| 189 | QWidget* widget = sidebar->widget(type); |
| 190 | if (!widget) |
| 191 | return (T*)nullptr; |
| 192 | T* result = qobject_cast<T*>(widget); |
| 193 | if (!result) |
| 194 | return (T*)nullptr; |
| 195 | return result; |
| 196 | } |
| 197 | |
| 198 | template <class T> |
| 199 | static T* activateWidget(const QString& name) |