Skip to content

Commit

Permalink
find main window
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCrazyT committed Jan 8, 2023
1 parent 207e2d1 commit 4f73d75
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pluginmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ DLL_EXPORT void plugsetup(PLUG_SETUPSTRUCT* setupStruct){
// Create the QuickAccess dialog
QWidget* wnd = QApplication::activeWindow();
if(wnd == NULL){
wnd = QApplication::topLevelWidgets().at(0);
foreach (QWidget *w, qApp->topLevelWidgets()){
if (QMainWindow* mainWin = qobject_cast<QMainWindow*>(w)) {
wnd = w;
break;
}
}
}
dbg(wnd->objectName().toStdString().c_str());
QMainWindow* mwnd = qobject_cast<QMainWindow*>(wnd);
Expand Down

0 comments on commit 4f73d75

Please sign in to comment.