fixed template function for MostRecentlyFocused panel

This commit is contained in:
itsmattkc
2019-06-25 09:15:30 -07:00
parent 7adef178b4
commit 2e349323f0
3 changed files with 28 additions and 20 deletions
+4 -17
View File
@@ -20,6 +20,9 @@
#include "panelfocusmanager.h"
#include "panel/project/project.h"
#include "panel/viewer/viewer.h"
PanelFocusManager* olive::panel_focus_manager = nullptr;
PanelFocusManager::PanelFocusManager(QObject *parent) :
@@ -28,7 +31,7 @@ PanelFocusManager::PanelFocusManager(QObject *parent) :
}
PanelWidget *PanelFocusManager::CurrentlyFocused()
PanelWidget *PanelFocusManager::CurrentlyFocused() const
{
if (focus_history_.isEmpty()) {
return nullptr;
@@ -76,19 +79,3 @@ void PanelFocusManager::FocusChanged(QWidget *old, QWidget *now)
parent = parent->parent();
}
}
template<typename T>
T *PanelFocusManager::MostRecentlyFocused()
{
T* cast_test;
for (int i=0;i<focus_history_.size();i++) {
cast_test = dynamic_cast<T*>(focus_history_.at(i));
if (cast_test != nullptr) {
return cast_test;
}
}
return nullptr;
}