import QtQml.StateMachine not working
-
can someone please explain me why i cant import QtQm.StateMachine?
or better
point me to some documentation about it?i cant find any explanations in the documentation.
https://doc.qt.io/qt-6/qtstatemachine-index.html
Thank you. -
Hi,
Did you apply the cmake/qmake configuration explained in that file ?
-
yes, as mentioned in the documentation i pasted
find_package(Qt6 REQUIRED COMPONENTS StateMachine) target_link_libraries(mytarget PRIVATE Qt6::StateMachine)into the CMakeLists.txt
but getting the following errormessages:
..\CMakeLists.txt:14: error: Found package configuration file: C:/Qt/6.4.2/android_armv7/lib/cmake/Qt6/Qt6Config.cmake but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT FOUND. Reason given by package: Failed to find required Qt component "StateMachine". Expected Config file at "C:/Qt/6.4.2/android_armv7/lib/cmake/Qt6StateMachine/Qt6StateMachineConfig.cmake" does NOT exist
Am i supposed to add more? sry, i'm a big noob and probably ask naive questions..
-
Might be a silly question but did you check whether you have the module installed for that platform ?
-
I had the same issue. Adding the following cache variable or setting it in command line with
-DQT_DEBUG_FIND_PACKAGE=ON, hinted the issue for me:"QT_DEBUG_FIND_PACKAGE": "TRUE",StateMachine depends on GUI and it depends on WrapOpenGL and that depends on glx library:
... [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY OPENGL_INCLUDE_DIR) [cmake] -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_INCLUDE_DIR OpenGL) [cmake] -- Could NOT find WrapOpenGL (missing: WrapOpenGL_FOUND) [cmake] CMake Warning at /home/mohammad/vcpkg/scripts/buildsystems/vcpkg.cmake:904 (_find_package): [cmake] Found package configuration file: [cmake] [cmake] /home/mohammad/Qt/6.10.0/gcc_arm64/lib/cmake/Qt6Gui/Qt6GuiConfig.cmake [cmake] [cmake] but it set Qt6Gui_FOUND to FALSE so package "Qt6Gui" is considered to be [cmake] NOT FOUND. Reason given by package: [cmake] [cmake] Qt6Gui could not be found because dependency WrapOpenGL could not be found. ... [cmake] Found package configuration file: [cmake] [cmake] /home/mohammad/Qt/6.10.0/gcc_arm64/lib/cmake/Qt6StateMachine/Qt6StateMachineConfig.cmake [cmake] [cmake] but it set Qt6StateMachine_FOUND to FALSE so package "Qt6StateMachine" is [cmake] considered to be NOT FOUND. Reason given by package: [cmake] [cmake] Qt6StateMachine could not be found because dependency Qt6Gui could not be [cmake] found.Installing one package fixed my issue:
sudo apt-get install libgl1-mesa-dev