guiqt.cpp: Replace gQApp with Qt provided qApp.

pull/1451/head
Karl Robillard 2024-02-29 15:12:29 -05:00
parent 1aabaab696
commit a7d02916ff
1 changed files with 5 additions and 14 deletions

View File

@ -20,12 +20,6 @@
#include <QSettings> #include <QSettings>
#include <fstream>
// FOR TESTING
#include <iostream>
namespace SolveSpace { namespace SolveSpace {
namespace Platform { namespace Platform {
@ -950,10 +944,8 @@ void OpenInBrowser(const std::string& url) {
} }
} }
QApplication* gQApp;
std::vector<std::string> InitGui(int argc, char** argv) { std::vector<std::string> InitGui(int argc, char** argv) {
gQApp = new QApplication(argc, argv); new QApplication(argc, argv);
std::vector<std::string> args = SolveSpace::Platform::InitCli(argc, argv); std::vector<std::string> args = SolveSpace::Platform::InitCli(argc, argv);
return args; return args;
} }
@ -967,18 +959,17 @@ void RunGui() {
std::cout << "failed to open qss" << std::endl; std::cout << "failed to open qss" << std::endl;
} else { } else {
QString StyleSheet = QLatin1String(File.readAll()); QString StyleSheet = QLatin1String(File.readAll());
gQApp->setStyleSheet(StyleSheet); qApp->setStyleSheet(StyleSheet);
} }
gQApp->exec(); qApp->exec();
} }
void ExitGui() { void ExitGui() {
// gQApp->exit; qApp->quit();
gQApp->quit();
} }
void ClearGui() { void ClearGui() {
delete gQApp; delete qApp;
} }
} }