Qqmlapplicationengine failed to load component network error

I'm new to qml and python This is the code and error I get: Error: QQmlApplicationEngine failed to load component c:%5CUsers%5Cpcmcb%5COneDrive%5CDesktop%5Capp%5Capp%5Cqml/main.qml: Network error ...

I’m new to qml and python This is the code and error I get:

Error:

QQmlApplicationEngine failed to load component
c:%5CUsers%5Cpcmcb%5COneDrive%5CDesktop%5Capp%5Capp%5Cqml/main.qml: Network error

main.py:

mport sys
import os

from PySide6.QtGui import QGuiApplication
from PySide6.QtQml import QQmlApplicationEngine


if __name__ == "__main__":
app = QGuiApplication(sys.argv)
engine = QQmlApplicationEngine()
engine.load(os.path.join(os.path.dirname(__file__), "qml/main.qml"))


if not engine.rootObjects():
    sys.exit(-1)
sys.exit(app.exec_())

main.qml:

import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import QtQuick.Controls.Material 2.15

ApplicationWindow{
    id: window
    width: 400
    height: 580
    visible: true
    title: qsTr("Login Page")
}

When I try to run the code it gives me the error that I typed above

eyllanesc's user avatar

eyllanesc

230k18 gold badges147 silver badges218 bronze badges

asked Nov 13, 2021 at 19:55

Bobby's user avatar

load() method requires a QUrl so passing it a string can cause problems, change to:

import os
from pathlib import Path
import sys

from PySide6.QtCore import QCoreApplication, Qt, QUrl
from PySide6.QtGui import QGuiApplication
from PySide6.QtQml import QQmlApplicationEngine

CURRENT_DIRECTORY = Path(__file__).resolve().parent


def main():
    app = QGuiApplication(sys.argv)

    engine = QQmlApplicationEngine()

    filename = os.fspath(CURRENT_DIRECTORY / "qml" / "main.qml")
    url = QUrl.fromLocalFile(filename)

    def handle_object_created(obj, obj_url):
        if obj is None and url == obj_url:
            QCoreApplication.exit(-1)

    engine.objectCreated.connect(handle_object_created, Qt.QueuedConnection)
    engine.load(url)

    sys.exit(app.exec())


if __name__ == "__main__":
    main()

answered Nov 13, 2021 at 20:03

eyllanesc's user avatar

eyllanesceyllanesc

230k18 gold badges147 silver badges218 bronze badges

This topic has been deleted. Only users with topic management privileges can see it.

  • This is the error I am getting
    QQmlApplicationEngine failed to load component
    qrc:/Test_C/main.qml:13:5: CircularProgressBar is not a type
    QML debugging is enabled. Only use this in a safe environment.

    Code:
    #include <QGuiApplication>
    #include <QQmlApplicationEngine>

    int main(int argc, char *argv[])
    {
    QGuiApplication app(argc, argv);

    QQmlApplicationEngine engine;
    const QUrl url(u"qrc:/Test_C/main.qml"_qs);
    QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
                     &app, [url](QObject *obj, const QUrl &objUrl) {
        if (!obj && url == objUrl)
            QCoreApplication::exit(-1);
    }, Qt::QueuedConnection);
    engine.load(url);
    
    return app.exec();
    

    }

    import QtQuick
    import QtQuick.Window
    import QtQuick.Controls
    import Qt5Compat.GraphicalEffects

    Window {
    visible: true
    color: «#55557f»
    width: 800
    height: 480
    title: qsTr(«Hello World»)

    CircularProgressBar{
        id:progress1
        x: 49
        y: 79
        value:10
        progressColor:"Blue"
    

    }
    }

  • @Pr0y said in QQmlApplicationEngine failed to load component:

    qrc:/Test_C/main.qml:13:5: CircularProgressBar is not a type

    the error message says it all, your CircularProgressBar is the issue, it’s not known at run time.

    Either, you haven’t added it to your resource system or there is some other error inside the class file. I can’t tell, as you do not show that one

  • //this is CircularProgressBar

    import QtQuick
    import QtQuick.Shapes
    import Qt5Compat.GraphicalEffects
    
    Item {
        property int startAngle: -90
        property real maxvalue: 100
        property real value: 30
        property color bgColor: "transparent"
        property color bgStrokeColor: "gray"
        property int strokeBgWidth: 16
        property bool textShowValue: true
        property color progressColor: "Pink"
        property int progressWidth: 16
        property string text: "%"
    
        id:progress
        implicitWidth: 250
        implicitHeight: 250
    
        Shape{
            id:shape
            anchors.fill: parent
            layer.enabled: true
            layer.samples: 12
    
            ShapePath{
                id:pathBG
                strokeColor:progress.bgStrokeColor
                fillColor:progress.bgColor
                strokeWidth:progress.strokeBgWidth
                capStyle: ShapePath.RoundCap
                PathAngleArc{
                    radiusX: 100
                    radiusY: 100
                    centerX: 120
                    centerY: 120
                    startAngle: progress.startAngle
                    sweepAngle: 360
                }
            }
            ShapePath{
                id:path
                strokeColor:progress.progressColor
                fillColor:"transparent"
                strokeWidth:progress.strokeBgWidth
                capStyle: ShapePath.RoundCap
                PathAngleArc{
                    radiusX: 100
                    radiusY: 100
                    centerX: 120
                    centerY: 120
                    startAngle: progress.startAngle
                    sweepAngle: (360/progress.maxvalue * progress.value)
                }
            }
            Text{
                id:textProgress
                text:progress.textShowValue?parseInt(progress.value) + progress.text:progress.text
                anchors.verticalCenter: parent.verticalCenter
                anchors.horizontalCenter: parent.horizontalCenter
                color:"Black"
                font.bold: true
                font.pointSize: 20
            }
        }
    }
    
  • @Pr0y Please read what @J-Hilk wrote again.

  • I am very new to this field ,can you guide me…
    On the Design window I can see things are working but when I run those errors I am getting…..
    //this is project file
    QT += quick quickcontrols2

    SOURCES +=
    main.cpp

    resources.files = main.qml
    resources.prefix = /$${TARGET}
    RESOURCES += resources

    Additional import path used to resolve QML modules in Qt Creator’s code model

    QML_IMPORT_PATH =

    Additional import path used to resolve QML modules just for Qt Quick Designer

    QML_DESIGNER_IMPORT_PATH =

    Default rules for deployment.

    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target

    DISTFILES +=
    CircularProgressBar.qml

  • @Pr0y in your project tree, left hand side, if you’re using QtCreator, you should see a Resources folder with a qml.qrc file in it. Expand that and tell me/us or screenshot the content. I think your CircularProgressBar is not in there, and thats the reason for your problem

  • Image__.PNG
    //after adding a qrc file and then adding CircularProgressBar there This is the view
    snap.PNG
    //Project file is..
    //But still error
    QT += quick quickcontrols2

    SOURCES +=
    main.cpp

    resources.files = main.qml
    resources.prefix = /$${TARGET}
    RESOURCES += resources
    CircularBar.qrc

    Additional import path used to resolve QML modules in Qt Creator’s code model

    QML_IMPORT_PATH =

    Additional import path used to resolve QML modules just for Qt Quick Designer

    QML_DESIGNER_IMPORT_PATH =

    Default rules for deployment.

    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target

    DISTFILES +=

  • @Pr0y

    well your qml file seems to be fine.

    f7792959-8c17-4ff5-b835-f43b368fe05d-image.png

    it has to be the project setup, is the error message the same ?

  • It is working ….
    added the CircularProgressBar in resource file

  • Thank you all

  • Lucas Danzinger

    Hello again, I’m in the process of learning QT and building a simple ArcGIS driven app. The entire time I’ve been working on it, I periodically attempt to run my app and it gives me back something like the below in application output:

    ArcGIS.Runtime.Core: void __cdecl QmlUtils::registerTypes(const char *) ArcGIS.Runtime

    ArcGIS.Runtime.Plugin: void __cdecl ArcGISRuntimePlugin::initializeEngine(class QQmlEngine *,const char *) ArcGIS.Runtime

    ArcGIS.Runtime.Core: void __cdecl QmlUtils::initializeRuntimeLicense(void) Invalid clientId QVariant(QString, «39DN») status 1

    ArcGIS.Runtime.Core: void __cdecl QmlUtils::initializeImageProvider(class QQmlEngine *)

    ArcGIS.Runtime.Core: void __cdecl QmlUtils::initializeImageProvider(class QQmlEngine *) Setting global image provider QVariant(void*, 0x29ce2d516f0)

    ArcGIS.Extras.Plugin: void __cdecl ArcGISExtrasPlugin::registerTypes(const char *) ArcGIS.Extras

    ArcGIS.Extras.Plugin: void __cdecl ArcGISExtrasPlugin::registerTypes(const char *) Registering Singleton Types

    ArcGIS.Extras.Core: void __cdecl TkTypes::registerTypes(const char *) ArcGIS.Extras

    ArcGIS.Extras.Plugin: void __cdecl ArcGISExtrasPlugin::initializeEngine(class QQmlEngine *,const char *) ArcGIS.Extras

    QQmlApplicationEngine failed to load component

    C:projectsQtbuild-Test-Desktop_Qt_5_5_1_MSVC2013_64bit-DebugdebugTest.exe exited with code -1

    It never gives an actual error of any useful variety, it always just says «exited with code 1», and usually that line is preceded by «QqmlApplicationEngine failed to load component». This always seems to happen in the middle of the ArcGIS initializers.

    Until today, I just assumed that QT creator was terrible at detecting errors in my code, because the solution was always some mistake I’d made in regards to general QT Quick types. However, I am wondering now if it might be possible that it normally gives a real error message, and somehow ArcGIS SDK is hiding that from me?

    This does not happen with any one specific error, it happens at least whenever I make a mistake with QML Types, like putting a Rectangle inside of a ListModel’s ListElement.   Because it happens and gives the exact same error for almost every mistake I ever make, I have spent countless hours manually tracking down my mistakes over the course of this project.

    It’s possible I’m using the wrong kit for my system or something, but unless I make a mistake like the one mentioned above, the application compiles and runs flawlessly on my desktop as well as my phone, so I don’t really know, maybe you can help me figure it out.

    The ArcGIS portion of my app runs fine when I finally figure out what QML mistake I made and fix it.

    I’m running QTQuick 2.4 and ArcGIS Runtime SDK 10.2.6

    I’m building for Desktop Qt 5.5.1 MSVC2013 64bit, I’m on Windows 10, 64bit.

    Я новичок в qml и python Это код и ошибка, которые я получаю:

    Ошибка:

    QQmlApplicationEngine failed to load component
    c:%5CUsers%5Cpcmcb%5COneDrive%5CDesktop%5Capp%5Capp%5Cqml/main.qml: Network error
    

    Main.py :

    mport sys
    import os
    
    from PySide6.QtGui import QGuiApplication
    from PySide6.QtQml import QQmlApplicationEngine
    
    
    if __name__ == "__main__":
    app = QGuiApplication(sys.argv)
    engine = QQmlApplicationEngine()
    engine.load(os.path.join(os.path.dirname(__file__), "qml/main.qml"))
    
    
    if not engine.rootObjects():
        sys.exit(-1)
    sys.exit(app.exec_())
    

    Main.qml :

    import QtQuick 2.15
    import QtQuick.Window 2.15
    import QtQuick.Controls 2.15
    import QtQuick.Controls.Material 2.15
    
    ApplicationWindow{
        id: window
        width: 400
        height: 580
        visible: true
        title: qsTr("Login Page")
    }
    

    Когда я пытаюсь запустить код, он выдает ошибку, которую я ввел выше

    1 ответ

    Лучший ответ

    Метод load() требует QUrl, поэтому передача ему строки может вызвать проблемы, измените его на:

    import os
    from pathlib import Path
    import sys
    
    from PySide6.QtCore import QCoreApplication, Qt, QUrl
    from PySide6.QtGui import QGuiApplication
    from PySide6.QtQml import QQmlApplicationEngine
    
    CURRENT_DIRECTORY = Path(__file__).resolve().parent
    
    
    def main():
        app = QGuiApplication(sys.argv)
    
        engine = QQmlApplicationEngine()
    
        filename = os.fspath(CURRENT_DIRECTORY / "qml" / "main.qml")
        url = QUrl.fromLocalFile(filename)
    
        def handle_object_created(obj, obj_url):
            if obj is None and url == obj_url:
                QCoreApplication.exit(-1)
    
        engine.objectCreated.connect(handle_object_created, Qt.QueuedConnection)
        engine.load(url)
    
        sys.exit(app.exec())
    
    
    if __name__ == "__main__":
        main()
    


    0

    eyllanesc
    13 Ноя 2021 в 23:03

    Я работаю над проектом Qt, основанным на cmake. Версия Qt — 5.7, Ubuntu 14.04. Я получаю ошибку:

    QQmlApplicationEngine failed to load component
    qrc:/main.qml:-1 File not found
    

    CMakeLists.txt это:

    file(GLOB_RECURSE UI_FILES *.ui)
    file(GLOB_RECURSE CODE_FILES *.cpp *.h)
    
    qt5_wrap_ui(UI_HEADERS ${UI_FILES})
    qt5_add_resources(RESOURCE_FILES ../resources/resources.qrc)
    
    set(SOURCES
    assets/assets.qrc
    icons/icons.qrc
    qml/qml.qrc)
    
    include(../vendor/CMakeLists.txt)
    
    if (WIN32)
    set(WINDOWS_RES_FILE ${CMAKE_CURRENT_BINARY_DIR}/resources.obj)
    if (MSVC)
    add_custom_command(OUTPUT ${WINDOWS_RES_FILE}
    COMMAND rc.exe /fo ${WINDOWS_RES_FILE} resources.rc
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/win
    )
    else()
    add_custom_command(OUTPUT ${WINDOWS_RES_FILE}
    COMMAND windres.exe resources.rc ${WINDOWS_RES_FILE}
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/win
    )
    endif()
    endif()
    
    add_executable(${CMAKE_PROJECT_NAME}
    ${SOURCES}
    ${UI_HEADERS}
    ${CODE_FILES}
    ${RESOURCE_FILES}
    ${WINDOWS_RES_FILE}
    ${VENDOR_SOURCES}
    )
    
    target_link_libraries(${CMAKE_PROJECT_NAME}
    Qt5::Core
    Qt5::Qml
    Qt5::Quick
    Qt5::Concurrent
    Qt5::Widgets)
    
    find_package( PythonLibs 2.7 REQUIRED )
    include_directories( ${PYTHON_INCLUDE_DIRS} )
    
    find_package( Boost COMPONENTS python REQUIRED )
    include_directories(${Boost_INCLUDE_DIR})
    link_directories(${Boost_LIBRARY_DIR})
    
    target_link_libraries(${CMAKE_PROJECT_NAME}
    ${PYTHON_LIBRARIES}
    ${Boost_LIBRARIES}
    ${SWORD_LIBRARIES})
    
    include_directories(${SWORD_INCLUDE_DIRS})
    
    set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/data/Info.plist)
    
    if (UNIX)
    install(TARGETS ${CMAKE_PROJECT_NAME}
    RUNTIME DESTINATION bin)
    elseif (WIN32)
    install(TARGETS ${CMAKE_PROJECT_NAME}
    DESTINATION ${CMAKE_INSTALL_BINDIR})
    endif()
    

    Дерево вывода проекта:

    .
    |-- build
    |   |-- CMakeCache.txt
    |   |-- CMakeFiles
    |   |   |-- 3.6.0-rc4
    |   |   |   |-- CMakeCCompiler.cmake
    |   |   |   |-- CMakeCXXCompiler.cmake
    |   |   |   |-- CMakeDetermineCompilerABI_C.bin
    |   |   |   |-- CMakeDetermineCompilerABI_CXX.bin
    |   |   |   |-- CMakeSystem.cmake
    |   |   |   |-- CompilerIdC
    |   |   |   |   |-- a.out
    |   |   |   |   `-- CMakeCCompilerId.c
    |   |   |   `-- CompilerIdCXX
    |   |   |       |-- a.out
    |   |   |       `-- CMakeCXXCompilerId.cpp
    |   |   |-- cmake.check_cache
    |   |   |-- CMakeDirectoryInformation.cmake
    |   |   |-- CMakeOutput.log
    |   |   |-- CMakeRuleHashes.txt
    |   |   |-- CMakeTmp
    |   |   |-- feature_tests.bin
    |   |   |-- feature_tests.c
    |   |   |-- feature_tests.cxx
    |   |   |-- Makefile2
    |   |   |-- Makefile.cmake
    |   |   |-- Progress
    |   |   |   |-- 1
    |   |   |   |-- 11
    |   |   |   |-- 2
    |   |   |   |-- 3
    |   |   |   `-- count.txt
    |   |   |-- progress.marks
    |   |   |-- TargetDirectories.txt
    |   |   `-- uninstall.dir
    |   |       |-- build.make
    |   |       |-- cmake_clean.cmake
    |   |       |-- DependInfo.cmake
    |   |       `-- progress.make
    |   |-- cmake_install.cmake
    |   |-- CTestTestfile.cmake
    |   |-- ecm_uninstall.cmake
    |   |-- Makefile
    |   |-- source
    |   |   |-- __
    |   |   |   `-- resources
    |   |   |       `-- resources.qrc.depends
    |   |   |-- CMakeFiles
    |   |   |   |-- CMakeDirectoryInformation.cmake
    |   |   |   |-- progress.marks
    |   |   |   |-- tutifruti_automoc.dir
    |   |   |   |   |-- AutogenInfo.cmake
    |   |   |   |   |-- AutomocOldMocDefinitions.cmake
    |   |   |   |   |-- build.make
    |   |   |   |   |-- cmake_clean.cmake
    |   |   |   |   |-- DependInfo.cmake
    |   |   |   |   |-- depend.internal
    |   |   |   |   |-- depend.make
    |   |   |   |   `-- progress.make
    |   |   |   `-- tutifruti.dir
    |   |   |       |-- __
    |   |   |       |   `-- vendor
    |   |   |       |       `-- material
    |   |   |       |           `-- src
    |   |   |       |               `-- core
    |   |   |       |-- build.make
    |   |   |       |-- cmake_clean.cmake
    |   |   |       |-- CXX.includecache
    |   |   |       |-- DependInfo.cmake
    |   |   |       |-- depend.internal
    |   |   |       |-- depend.make
    |   |   |       |-- flags.make
    |   |   |       |-- link.txt
    |   |   |       `-- progress.make
    |   |   |-- cmake_install.cmake
    |   |   |-- CTestTestfile.cmake
    |   |   |-- defines.h
    |   |   |-- Makefile
    |   |   |-- moc_main_window.cpp
    |   |   |-- qrc_resources.cpp
    |   |   |-- tutifruti_automoc.cpp
    |   |   |-- tutifruti_automoc.dir
    |   |   |   `-- vendor
    |   |   |       `-- material
    |   |   |           `-- src
    |   |   |               |-- core
    |   |   |               |   |-- moc_device.cpp
    |   |   |               |   `-- moc_units.cpp
    |   |   |               `-- moc_plugin.cpp
    |   |   `-- ui_main_window.h
    |   `-- tests
    |       |-- CMakeFiles
    |       |   |-- CMakeDirectoryInformation.cmake
    |       |   `-- progress.marks
    |       |-- cmake_install.cmake
    |       |-- CTestTestfile.cmake
    |       |-- defines.h
    |       `-- Makefile
    |-- cmake
    |   |-- FindCaffe.cmake
    |   |-- FindSWORD.cmake
    |   `-- LibFindMacros.cmake
    |-- CMakeLists.txt
    |-- CMakeLists.txt.user
    |-- LICENCE
    |-- Licence.rtf
    |-- README.md
    |-- resources
    |   |-- icons
    |   |   |-- action_home.svg
    |   |   |-- action_list.svg
    |   |   |-- action_search.svg
    |   |   |-- action_settings.svg
    |   |   |-- file_cloud_done.svg
    |   |   |-- icons.qrc
    |   |   |-- maps_place.svg
    |   |   |-- navigation_check.svg
    |   |   `-- social_school.svg
    |   `-- resources.qrc
    |-- source
    |   |-- assets
    |   |   |-- assets.qrc
    |   |   |-- book-open-page.svg
    |   |   `-- book-open.svg
    |   |-- backend
    |   |   |-- biblechapter.cpp
    |   |   |-- biblechapter.h
    |   |   |-- bible.cpp
    |   |   |-- bible.h
    |   |   |-- biblemanager.cpp
    |   |   |-- biblemanager.h
    |   |   |-- CMakeLists.txt
    |   |   |-- module.cpp
    |   |   |-- module.h
    |   |   |-- plugin.cpp
    |   |   |-- progress.h
    |   |   `-- promise.h
    |   |-- CMakeLists.txt
    |   |-- cpp
    |   |-- icons
    |   |   |-- action_home.svg
    |   |   |-- action_list.svg
    |   |   |-- action_search.svg
    |   |   |-- action_settings.svg
    |   |   |-- file_cloud_done.svg
    |   |   |-- icons.qrc
    |   |   |-- maps_place.svg
    |   |   |-- navigation_check.svg
    |   |   `-- social_school.svg
    |   |-- icons.yml
    |   |-- main.cpp
    |   |-- python
    |   |   |-- data
    |   |   |   |-- external
    |   |   |   |-- interim
    |   |   |   |-- processed
    |   |   |   `-- raw
    |   |   |-- docs
    |   |   |   |-- commands.rst
    |   |   |   |-- conf.py
    |   |   |   |-- getting-started.rst
    |   |   |   |-- index.rst
    |   |   |   |-- make.bat
    |   |   |   `-- Makefile
    |   |   |-- LICENSE
    |   |   |-- Makefile
    |   |   |-- models
    |   |   |-- notebooks
    |   |   |-- README.md
    |   |   |-- references
    |   |   |-- reports
    |   |   |   `-- figures
    |   |   |-- requirements.txt
    |   |   |-- src
    |   |   |   |-- data
    |   |   |   |   `-- make_dataset.py
    |   |   |   |-- features
    |   |   |   |   `-- build_features.py
    |   |   |   |-- __init__.py
    |   |   |   |-- models
    |   |   |   |   |-- predict_model.py
    |   |   |   |   `-- train_model.py
    |   |   |   `-- visualization
    |   |   |       `-- visualize.py
    |   |   `-- tox.ini
    |   `-- qml
    |       |-- components
    |       |   |-- BibleView.qml
    |       |   |-- Placeholder.qml
    |       |   `-- VerseDelegate.qml
    |       |-- main.qml
    |       |-- qml.qrc
    |       `-- ui
    |           |-- HomeTab.qml
    |           `-- SettingsPage.qml
    |-- tests
    |   |-- CMakeLists.txt
    |   |-- defines.h.cmake
    |   `-- example_tests.cpp.example
    |-- text.txt
    |-- vendor
    |   |-- CMakeLists.txt
    |   `-- material
    |       |-- CHANGELOG.md
    |       |-- CONTRIBUTING.md
    |       |-- demo
    |       |   |-- BottomSheetDemo.qml
    |       |   |-- ButtonDemo.qml
    |       |   |-- CheckBoxDemo.qml
    |       |   |-- ColorPaletteDemo.qml
    |       |   |-- CustomIconsDemo.qml
    |       |   |-- DatePickerDemo.qml
    |       |   |-- demo.pro
    |       |   |-- demo.qmlproject
    |       |   |-- demo.qrc
    |       |   |-- DialogDemo.qml
    |       |   |-- FormsDemo.qml
    |       |   |-- icons
    |       |   |   |-- action_account_circle.svg
    |       |   |   |-- action_autorenew.svg
    |       |   |   |-- action_delete.svg
    |       |   |   |-- action_language.svg
    |       |   |   |-- action_settings.svg
    |       |   |   |-- alert_warning.svg
    |       |   |   |-- communication_email.svg
    |       |   |   |-- content_add.svg
    |       |   |   |-- content_create.svg
    |       |   |   |-- content_forward.svg
    |       |   |   |-- device_access_alarm.svg
    |       |   |   |-- file_file_download.svg
    |       |   |   |-- icons.qrc
    |       |   |   |-- image_color_lens.svg
    |       |   |   |-- image_edit.svg
    |       |   |   |-- maps_place.svg
    |       |   |   |-- navigation_arrow_drop_down.svg
    |       |   |   `-- social_share.svg
    |       |   |-- icons.yml
    |       |   |-- images
    |       |   |   |-- balloon.jpg
    |       |   |   |-- go-last.color.svg
    |       |   |   |-- list-add.color.svg
    |       |   |   |-- weather-pouring.svg
    |       |   |   `-- weather-sunset.svg
    |       |   |-- ListItemsDemo.qml
    |       |   |-- main.cpp
    |       |   |-- main.qml
    |       |   |-- PageStackDemo.qml
    |       |   |-- ProgressBarDemo.qml
    |       |   |-- RadioButtonDemo.qml
    |       |   |-- SidebarPage.qml
    |       |   |-- SliderDemo.qml
    |       |   |-- SubPage.qml
    |       |   |-- SwitchDemo.qml
    |       |   |-- TextFieldDemo.qml
    |       |   |-- TimePickerDemo.qml
    |       |   `-- TypographyDemo.qml
    |       |-- deploy_key.enc
    |       |-- documentation
    |       |   |-- images
    |       |   |   `-- buttons.png
    |       |   |-- material.qdoc
    |       |   `-- material.qdocconf
    |       |-- fonts
    |       |   |-- fonts.qrc
    |       |   |-- MaterialFontLoader.qml
    |       |   |-- qmldir
    |       |   `-- roboto
    |       |       |-- Roboto-BlackItalic.ttf
    |       |       |-- Roboto-Black.ttf
    |       |       |-- Roboto-BoldItalic.ttf
    |       |       |-- Roboto-Bold.ttf
    |       |       |-- RobotoCondensed-BoldItalic.ttf
    |       |       |-- RobotoCondensed-Bold.ttf
    |       |       |-- RobotoCondensed-Italic.ttf
    |       |       |-- RobotoCondensed-LightItalic.ttf
    |       |       |-- RobotoCondensed-Light.ttf
    |       |       |-- RobotoCondensed-Regular.ttf
    |       |       |-- Roboto-Italic.ttf
    |       |       |-- Roboto-LightItalic.ttf
    |       |       |-- Roboto-Light.ttf
    |       |       |-- Roboto-MediumItalic.ttf
    |       |       |-- Roboto-Medium.ttf
    |       |       |-- Roboto-Regular.ttf
    |       |       |-- Roboto-ThinItalic.ttf
    |       |       `-- Roboto-Thin.ttf
    |       |-- icons
    |       |   |-- core_icons.qrc
    |       |   |-- navigation_arrow_back.svg
    |       |   |-- navigation_chevron_left.svg
    |       |   |-- navigation_chevron_right.svg
    |       |   |-- navigation_close.svg
    |       |   |-- navigation_menu.svg
    |       |   `-- navigation_more_vert.svg
    |       |-- icons.yml
    |       |-- LICENSE
    |       |-- LICENSE.CC-BY
    |       |-- LICENSE.MPL
    |       |-- material.pri
    |       |-- qml-material.pro
    |       |-- qpm.json
    |       |-- README.md
    |       |-- scripts
    |       |   |-- build_docs.sh
    |       |   |-- deploy.sh
    |       |   |-- icons.py
    |       |   |-- lint.sh
    |       |   |-- make_awesome.py
    |       |   |-- normalize_imports.sh
    |       |   `-- qrc.py
    |       |-- src
    |       |   |-- components
    |       |   |   |-- ActionButton.qml
    |       |   |   |-- Card.qml
    |       |   |   |-- components.qrc
    |       |   |   |-- DatePicker.qml
    |       |   |   |-- IconButton.qml
    |       |   |   |-- OverlayLayer.qml
    |       |   |   |-- OverlayView.qml
    |       |   |   |-- ProgressCircle.qml
    |       |   |   |-- Scrollbar.qml
    |       |   |   |-- Snackbar.qml
    |       |   |   |-- ThinDivider.qml
    |       |   |   |-- TimePicker.qml
    |       |   |   |-- Tooltip.qml
    |       |   |   `-- Wave.qml
    |       |   |-- controls
    |       |   |   |-- Action.qml
    |       |   |   |-- Button.qml
    |       |   |   |-- CheckBox.qml
    |       |   |   |-- controls.qrc
    |       |   |   |-- Label.qml
    |       |   |   |-- ProgressBar.qml
    |       |   |   |-- RadioButton.qml
    |       |   |   |-- Slider.qml
    |       |   |   |-- Switch.qml
    |       |   |   |-- Tab.qml
    |       |   |   `-- TextField.qml
    |       |   |-- core
    |       |   |   |-- AwesomeIcon.qml
    |       |   |   |-- awesome.js
    |       |   |   |-- core.qrc
    |       |   |   |-- device.cpp
    |       |   |   |-- device.h
    |       |   |   |-- FontAwesome.otf
    |       |   |   |-- Icon.qml
    |       |   |   |-- Ink.qml
    |       |   |   |-- MaterialAnimation.qml
    |       |   |   |-- Object.qml
    |       |   |   |-- Palette.qml
    |       |   |   |-- PlatformExtensions.qml
    |       |   |   |-- ThemePalette.qml
    |       |   |   |-- Theme.qml
    |       |   |   |-- units.cpp
    |       |   |   |-- units.h
    |       |   |   |-- UnitsHelper.qml
    |       |   |   |-- utils.js
    |       |   |   `-- View.qml
    |       |   |-- extras
    |       |   |   |-- AutomaticGrid.qml
    |       |   |   |-- CircleImage.qml
    |       |   |   |-- CircleMask.qml
    |       |   |   |-- ColumnFlow.qml
    |       |   |   |-- extras.qrc
    |       |   |   |-- Image.qml
    |       |   |   `-- qmldir
    |       |   |-- listitems
    |       |   |   |-- BaseListItem.qml
    |       |   |   |-- CMakeLists.txt
    |       |   |   |-- Divider.qml
    |       |   |   |-- listitems.qrc
    |       |   |   |-- qmldir
    |       |   |   |-- SectionHeader.qml
    |       |   |   |-- SimpleMenu.qml
    |       |   |   |-- Standard.qml
    |       |   |   |-- Subheader.qml
    |       |   |   `-- Subtitled.qml
    |       |   |-- material.qrc
    |       |   |-- plugin.cpp
    |       |   |-- plugin.h
    |       |   |-- popups
    |       |   |   |-- BottomActionSheet.qml
    |       |   |   |-- BottomSheet.qml
    |       |   |   |-- Dialog.qml
    |       |   |   |-- Dropdown.qml
    |       |   |   |-- InputDialog.qml
    |       |   |   |-- MenuField.qml
    |       |   |   |-- Popover.qml
    |       |   |   |-- PopupBase.qml
    |       |   |   |-- popups.qrc
    |       |   |   `-- TimePickerDialog.qml
    |       |   |-- qmldir
    |       |   |-- src.pro
    |       |   |-- styles
    |       |   |   |-- ApplicationWindowStyle.qml
    |       |   |   |-- ButtonStyle.qml
    |       |   |   |-- CheckBoxStyle.qml
    |       |   |   |-- CMakeLists.txt
    |       |   |   |-- ProgressBarStyle.qml
    |       |   |   |-- qmldir
    |       |   |   |-- RadioButtonStyle.qml
    |       |   |   |-- SliderStyle.qml
    |       |   |   |-- styles.qrc
    |       |   |   |-- SwitchStyle.qml
    |       |   |   |-- TextFieldStyle.qml
    |       |   |   |-- ToolBarStyle.qml
    |       |   |   `-- ToolButtonStyle.qml
    |       |   `-- window
    |       |       |-- ActionBar.qml
    |       |       |-- ApplicationWindow.qml
    |       |       |-- AppTheme.qml
    |       |       |-- MainView.qml
    |       |       |-- NavigationDrawerPage.qml
    |       |       |-- NavigationDrawer.qml
    |       |       |-- Page.qml
    |       |       |-- PageSidebar.qml
    |       |       |-- PageStack.qml
    |       |       |-- Sidebar.qml
    |       |       |-- TabBar.qml
    |       |       |-- TabbedPage.qml
    |       |       |-- Toolbar.qml
    |       |       |-- Window.qml
    |       |       `-- window.qrc
    |       |-- styles_demo
    |       |   |-- main.qml
    |       |   `-- Makefile
    |       |-- tests
    |       |   |-- icons
    |       |   |   |-- action_alarm.svg
    |       |   |   |-- action_search.svg
    |       |   |   |-- action_settings.svg
    |       |   |   |-- content_add.svg
    |       |   |   `-- icons.qrc
    |       |   |-- icons.yml
    |       |   |-- tests.cpp
    |       |   |-- tests.pro
    |       |   |-- tst_actionbar.qml
    |       |   |-- tst_card.qml
    |       |   `-- tst_pagestack.qml
    |       `-- vendor.cmake
    `-- win
    |-- appicon.ico
    |-- CMakeLists.txt
    |-- installer.cmake.nsi
    |-- installer.cmake.wxs
    |-- qt.conf
    `-- resources.rc
    

    Как убрать эту ошибку из проекта?

    0

    Решение

    Ты можешь использовать QDirIterator перепроверить, какие ресурсы содержит приложение. Например в main():

    QDirIterator it(":/", QDirIterator::Subdirectories);
    while (it.hasNext())
    qDebug() << it.next();
    

    Не зная, как обработка ресурсов Qt работает с CMake, я бы сказал, что следующие строки выглядят как преступник.

    qt5_add_resources(RESOURCE_FILES ../resources/resources.qrc)
    
    set(SOURCES
    assets/assets.qrc
    icons/icons.qrc
    qml/qml.qrc)
    

    Почему один .qrc добавлено с qt5_add_resources()тогда как остальные добавляются в SOURCES?

    3

    Другие решения

    Других решений пока нет …

    Понравилась статья? Поделить с друзьями:
  • Qgis как изменить язык
  • Pytorch memory error
  • Python перезапуск программы при ошибке
  • Python как изменить раскладку клавиатуры
  • Python как изменить название переменной во всем коде