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:
used DLL's "LibEGL, QICore, etc..." from qt\5.15.2\msvc2019_64\bin
Did you use
windeployqt
?See also https://wiki.qt.io/Deploy_an_Application_on_Windows
-
@JKSH I'll try that
-
@Lord-Bytor said in Invalid property assignment error in DLL but not QT creator:
@JKSH I'll try that
Good luck.
The
windeployqt
documentation is at https://doc.qt.io/qt-5/windows-deployment.html ; you might need to use the--qmldir
and--qmlimport
options. -
Well I've used windeployqt and I may have had some success because the image in my QML is showing up properly but all other colors seem non functional. I built including every possible library just to be on the safe side and still no other colors.
Edit: in the output of windeployqt I see Qt5Declarative.dll does not exist, not sure if thats important
What I expect:
What I actually see:
-
@Lord-Bytor said in Invalid property assignment error in DLL but not QT creator:
I may have had some success because the image in my QML is showing up properly but all other colors seem non functional.
That's very odd.
Try these:
- Launch your app from the Command Line. Do you see any error messages?
- While your deployed app is running, use Process Explorer to see the list of DLLs that your app is using. Pay extra attention to the absolute paths of the Qt DLLs. Repeat this while you run your app from Qt Creator. What differences do you see (if any)?
-
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. I based it loosely off of the quickrendercontrol example but as a dll rather than app
-
@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