summaryrefslogtreecommitdiff
path: root/src/lib.cpp
blob: 2815863687be99889af076e1cd1dc8e6922eaa02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <QApplication>
#include <QMainWindow>
#include <QWidget>

#include "lib.h"

// shamelessly ripped from https://stackoverflow.com/a/46456214
AssignmentList *getMainWindow() {
	foreach(QWidget *w, QApplication::topLevelWidgets())
		if(AssignmentList *mainWin = qobject_cast<AssignmentList*>(w))
			return mainWin;
	return nullptr;
}