Unsolved Invalid property assignment error in DLL but not QT creator
-
@Lord-Bytor said in Invalid property assignment error in DLL but not QT creator:
Unfortunately this dll being used by a game engine rather than an app so I can't really run it from creator or launch it from the command line.
Then do the first part of Step #2. Are your Qt DLLs being loaded from the folder(s) that you expect?
-
Well it looks like all dll's are running from the correct location with the exception of Qt5Svg.dll which path is from perforce instead. That dll exists at the expected folder, so I'm puzzled as to why it's using preforce's copy instead.
-
@Lord-Bytor said in Invalid property assignment error in DLL but not QT creator:
path is from perforce
Check your PATH. Make sure that the PATH does not contain any folders which contains Qt DLLs. (This is the #1 cause of strange loading issues)
-
@JKSH Fixed path, doesn't load Qt5Svg.dll at all but my example still loads.. still doesn't recognize color in hex format and Qt.rgba does nothing to change color of text or background
-
@Lord-Bytor said in Invalid property assignment error in DLL but not QT creator:
still doesn't recognize color in hex format and Qt.rgba does nothing to change color of text or background
Hmm... very strange.
Are you able to create and deploy a small QML app that has coloured background and text?
-
So I built a small window example
import QtQuick 2.2 import QtQuick.Window 2.2 Window { width: 640 height: 480 visible: true color: "#67ee62" title: qsTr("Hello World") Text { id: text1 color: "#f63c3c" text: qsTr("Text") font.pixelSize: 12 } }
deployed and application works
updated qml of my dll to use the same and I getqrc:/rendercontrol/demo.qml:2:1: module "QtQuick.Window" is not installed :
I have QT += quick in the .pro file of dll and deploying the same as app, but getting very different results
-
@Lord-Bytor said in Invalid property assignment error in DLL but not QT creator:
I have QT += quick in the .pro file
This only affects compilation; it does not contribute to deployment.
qrc:/rendercontrol/demo.qml:2:1: module "QtQuick.Window" is not installed
...
deploying the same as app, but getting very different results
Inspect every single file in the deployment folders of your example app and your big DLL. Ensure that all the files that were deployed with your example app also exist when you deploy your DLL (including
qmldir
files).Also, try cleaning your project (delete the "build" folder) and build it again from scratch before deploying.
-
@JKSH Well, I've checked and rebuilt multiple times beyond comparing all folders, I think there is just some sort of issue running this in a DLL maybe in how Unity takes in DLLs. I may just have to go with a different solution.
-
@Lord-Bytor said in Invalid property assignment error in DLL but not QT creator:
maybe in how Unity takes in DLLs
I just remembered: You Unity app's working directory is probably different from your DLL's location, so Qt can't find the QML modules. If you want to check, record the results of
QDir::currentPath()
from your DLL and from your small window example app.Anyway, call
QQmlEngine::addImportPath()
to tell Qt where to find the QML modules: https://stackoverflow.com/questions/35352930/qt5-qml-module-is-not-installed/49326965#49326965 -
@JKSH Well, progress in that I'm getting a new error "Cannot load library D:\Dev\UnityProjects\QT experiment\Assets\Plugins\QtQuick.2\qtquick2plugin.dll: The specified module could not be found" that dll is present at that exact location though
Edit: Dependency walker shows it needs QT5Quick.dll, QT5Core etc... but those are all in its parent folder as produced by windeployqt