Corrected issues with building and packaging

This commit is contained in:
Nav
2021-04-14 23:17:30 +01:00
parent d76b1e3f24
commit e79b3a42fb
8 changed files with 37 additions and 15 deletions

View File

@@ -51,7 +51,7 @@ void Insight::startup() {
std::string qtAppName = "Bloom";
char* appArguments[] = {qtAppName.data()};
auto appArgCount = 1;
// QCoreApplication::addLibraryPath(QString::fromStdString(Application::getApplicationDirPath() + "/plugins"));
QCoreApplication::addLibraryPath(QString::fromStdString(Application::getApplicationDirPath() + "/plugins"));
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
this->application = new QApplication(appArgCount, appArguments);

View File

@@ -127,6 +127,28 @@ void InsightWindow::init(
this->ioUnavailableWidget->show();
}
/*
* Do not delete svgWidget. It seems like it's absolutely pointless, but it's really not. I know this is gross but
* I don't seem to have any other option.
*
* You see, we use Qt's SVG libraries for some icons and other graphics in the Insight window, but because these are
* all loaded via the .ui and .qss file (at runtime, by Qt), and the fact that we don't use QSvgWidget anywhere in
* our C++ code, the linker doesn't link the SVG library to the Bloom binary! This then leads to the failure of
* rendering SVG images at runtime.
*
* I've scowered the internet looking for a solution to this, but I've found nothing! There was one post on the
* Qt forum, where someone had the very same issue: https://forum.qt.io/topic/61875/cmake-is-not-linking but no
* helpful responses.
*
* The easy solution is finding an excuse to use the QSvgWidget class in our code, but we have no real requirement
* of that.
*
* So for now, I'm just going to create an instance to QSvgWidget() here. Doing so will force the linker to link
* the libQt5Svg library. This will need to remain here until I find a better solution, or an actual need for the
* QSVGWidget class in our code.
*/
auto svgWidget = QSvgWidget();
}
void InsightWindow::selectVariant(const TargetVariant* variant) {