Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML with VS Code - Builds but fails at runtime (Windows)
Forum Updated to NodeBB v4.3 + New Features

QML with VS Code - Builds but fails at runtime (Windows)

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 58 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hanjo
    wrote last edited by
    #1

    Hi I am new to QML and CMake. And can't figure out what is going wrong on Windows.
    After a whole weekend of trying all kinds of rituals I am at my ends, I hope maybe some here got some pointers for me?

    In VS Code I can build it but once I try and run it it throws the error that the plugins are not initialized.
    I tried to use windeploy.exe to get the right dll's but then it only says it found them but still not wants to use them???

    My project setup:
    I am using VCPKG in manifest mode to download the following ports:

    • qtdeclarative
    • qtbase
    • qttools
    • qt5compat

    (I tried downloading just "qt" but then it fails on the QTwebengine and I just want a desktop application so I thought it was okay?)

    I also have QT 6.8.3 installed on my system through the QT online installer.

    CMakeLists.txt

    cmake_minimum_required(VERSION 3.10)
    project(DeckRC
            VERSION 0.0.1
            DESCRIPTION "DeckRC - A Decky Plugin for Remote Control"
            LANGUAGES CXX
    )
    
    set(CMAKE_CXX_STANDARD 20)
    set(CXX_STANDARD_REQUIRED ON)
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_AUTORCC ON)
    set(CMAKE_AUTOUIC ON)
    
    list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
    message(STATUS "Config: ${CONFIG_NAME}")
    add_compile_definitions(CONFIG_NAME="${CONFIG_NAME}")
    
    #find_package(SDL2 REQUIRED)
    find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick)
    
    qt_standard_project_setup(REQUIRES 6.8)
    qt6_add_executable(DeckRC
        src/main.cpp
    )
    
    qt6_add_qml_module(DeckRC
        URI ${CONFIG_NAME}
        VERSION 1.0
        QML_FILES
            src/QML/Main.qml
    )
    
    #add_executable(DeckRC src/main.cpp)
    
    #target_link_libraries(DeckRC PRIVATE SDL2::SDL2main SDL2::SDL2)
    target_link_libraries(DeckRC PRIVATE
            Qt6::Core
            Qt6::Gui
            Qt6::Quick
    )
    
    include(GNUInstallDirs)
    install(TARGETS DeckRC
        BUNDLE  DESTINATION ${CMAKE_INSTALL_BINDIR}
        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
    )
    
    
    qt_generate_deploy_qml_app_script(
        TARGET DeckRC
        OUTPUT_SCRIPT deploy_script
    )
    install(SCRIPT ${deploy_script})
    

    I compiled it with MVSC 2022

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved