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 Debug error finding file
Forum Updated to NodeBB v4.3 + New Features

QML Debug error finding file

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 91 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.
  • N Offline
    N Offline
    nekkceb
    wrote on last edited by
    #1

    I am getting the following error in the QML debugger pane of Qt Windows 11:

    file:///D:/dev/QtPlay/QGraph/QGraphApp/build/Desktop_Qt_6_8_2_MinGW_64_bit-Debug/qml/QGraphApp/Graph1.qml: No such file or directory D:/dev/QtPlay/QGraph/QGraphApp/build/Desktop_Qt_6_8_2_MinGW_64_bit-Debug/qml/QGraphApp/Graph1.qml: -1
    

    The Graph1.qml is in my main program source folder under qml/QGraphApp/Graph1.qml. When I look in the directory structure shown in the error, there is no folder

    D:/dev/QtPlay/QGraph/QGraphApp/build/Desktop_Qt_6_8_2_MinGW_64_bit-Debug/qml
    

    But why is it looking there for Graph1.qml and not my source folder?
    Here is my CMakeLists.txt file:

    cmake_minimum_required(VERSION 3.16)
    
    project(QGraphApp VERSION 0.1 LANGUAGES CXX)
    list(APPEND CMAKE_PREFIX_PATH "${QT_PREFIX}/lib/cmake")
    message(CMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}")
    message(QT_VERSION= "${QT_VERSION}")
    
    find_package(Qt6 REQUIRED COMPONENTS Charts Core Gui Qml Quick QuickControls2)
    find_package(Qt6 REQUIRED COMPONENTS QuickWidgets)
    qt_standard_project_setup()
    set(CMAKE_AUTOUIC ON)
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_AUTORCC ON)
    
    set(CMAKE_CXX_STANDARD 17)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
    
    # set(PROJECT_SOURCES
    # )
    
    qt_add_executable(QGraphApp
      main.cpp
      mainqgraph.cpp
      mainqgraph.h
      mainqgraph.ui
      datasource.h
      datasource.cpp
      graphappquickview.cpp
      graphappquickview.h
    )
    
    # Resources:
    qt6_add_qml_module(QGraphApp
        URI QGraphApp
        QML_FILES
            "./qml/QGraphApp/Graph1.qml"
    )
    
    target_link_libraries(QGraphApp PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
    
    target_link_libraries(QGraphApp PRIVATE Qt6::QuickWidgets Qt6::QuickControls2 Qt6::Charts)
    
    set_target_properties(QGraphApp PROPERTIES
        ${BUNDLE_ID_OPTION}
        MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
        MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
        MACOSX_BUNDLE TRUE
        WIN32_EXECUTABLE TRUE
    )
    
    install(TARGETS QGraphApp
        BUNDLE DESTINATION .
        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
    )
    
    qt_finalize_executable(QGraphApp)
    

    Am I trying to load the Graph1.qml file incorrectly?

    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