| 163 | |
| 164 | template <class T> |
| 165 | static T* widget(SidebarWidgetType* type) |
| 166 | { |
| 167 | Sidebar* sidebar = current(); |
| 168 | if (!type || !sidebar || !sidebar->isActive(type)) |
| 169 | return (T*)nullptr; |
| 170 | QWidget* widget = sidebar->widget(type); |
| 171 | if (!widget) |
| 172 | return (T*)nullptr; |
| 173 | return qobject_cast<T*>(widget); |
| 174 | } |
| 175 | |
| 176 | template <class T> |
| 177 | static T* widget(const QString& name) |