From 25f18defd4255d0c58fad44e8bbd37530ac38f83 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 12 Jun 2017 17:05:28 +0100 Subject: [PATCH] Use a qt.conf to point plugins at qtplugins/ in the application path. * We can point the platform plugins path at the application dir for qwindows.dll for example, but there's no equivalent for image format plugins which we need for qsvg.dll. So instead we shove them all under an explicit qtplugins path. * Also now that we have this, copy qsvg.dll into the distribution. --- qrenderdoc/Code/qrenderdoc.cpp | 18 +----------------- qrenderdoc/Resources/qt.conf | 2 ++ qrenderdoc/Resources/resources.qrc | 3 +++ qrenderdoc/qrenderdoc_local.vcxproj | 22 +++++++++++++++++++++- 4 files changed, 27 insertions(+), 18 deletions(-) create mode 100644 qrenderdoc/Resources/qt.conf diff --git a/qrenderdoc/Code/qrenderdoc.cpp b/qrenderdoc/Code/qrenderdoc.cpp index da7f271ae..d3d95c1ee 100644 --- a/qrenderdoc/Code/qrenderdoc.cpp +++ b/qrenderdoc/Code/qrenderdoc.cpp @@ -137,21 +137,7 @@ int main(int argc, char *argv[]) filename = QString(); } - argc += 2; - - char **argv_mod = new char *[argc]; - - for(int i = 0; i < argc - 2; i++) - argv_mod[i] = argv[i]; - - char arg[] = "-platformpluginpath"; - QString path = QFileInfo(QString::fromUtf8(argv[0])).absolutePath(); - QByteArray pathChars = path.toUtf8(); - - argv_mod[argc - 2] = arg; - argv_mod[argc - 1] = pathChars.data(); - - QApplication application(argc, argv_mod); + QApplication application(argc, argv); { PersistantConfig config; @@ -247,7 +233,5 @@ int main(int argc, char *argv[]) Formatter::shutdown(); } - delete[] argv_mod; - return 0; } diff --git a/qrenderdoc/Resources/qt.conf b/qrenderdoc/Resources/qt.conf new file mode 100644 index 000000000..263ef410a --- /dev/null +++ b/qrenderdoc/Resources/qt.conf @@ -0,0 +1,2 @@ +[Paths] +Plugins=qtplugins diff --git a/qrenderdoc/Resources/resources.qrc b/qrenderdoc/Resources/resources.qrc index 4548fa1a7..2d1bcbcd5 100644 --- a/qrenderdoc/Resources/resources.qrc +++ b/qrenderdoc/Resources/resources.qrc @@ -68,4 +68,7 @@ action.png action_hover.png + + qt.conf + diff --git a/qrenderdoc/qrenderdoc_local.vcxproj b/qrenderdoc/qrenderdoc_local.vcxproj index 23ea29da9..aed75432f 100644 --- a/qrenderdoc/qrenderdoc_local.vcxproj +++ b/qrenderdoc/qrenderdoc_local.vcxproj @@ -1512,7 +1512,12 @@ false - qwindows.dll + qtplugins\platforms\qwindows.dll + PreserveNewest + false + + + qtplugins\imageformats\qsvg.dll PreserveNewest false @@ -1541,6 +1546,21 @@ PreserveNewest false + + qtplugins\platforms\qwindowsd.dll + PreserveNewest + false + + + qtplugins\imageformats\qsvgd.dll + PreserveNewest + false + + + Qt5Cored.dll + PreserveNewest + False + Qt5Cored.dll PreserveNewest