qtutils: implement parent finder

This commit is contained in:
itsmattkc
2022-07-22 17:33:31 -07:00
parent 3fab456816
commit a3cde5bd44
2 changed files with 17 additions and 10 deletions
+2 -10
View File
@@ -23,6 +23,7 @@
#include <QDir>
#include <QFileInfo>
#include "common/qtutils.h"
#include "common/xmlutils.h"
#include "core.h"
#include "dialog/progress/progress.h"
@@ -173,16 +174,7 @@ void Project::RegenerateUuid()
Project *Project::GetProjectFromObject(const QObject *o)
{
QObject *t = o->parent();
while (t) {
if (Project *p = dynamic_cast<Project*>(t)) {
return p;
}
t = t->parent();
}
return nullptr;
return QtUtils::GetParentOfType<Project>(o);
}
void Project::ColorManagerValueChanged(const NodeInput &input, const TimeRange &range)