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. CMAKE QML files addition Questions
Qt 6.11 is out! See what's new in the release blog

CMAKE QML files addition Questions

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

    Hello I need some claification arround adding QML files to my executable project in CMAKE:

    Q . What is the difference (Pos and Cons ) between :

    qt_add_resources(RESOURCES example.qrc)
    add_executable(myapp ${SRC_LIST} ${RESOURCES})
    

    and

    qt_add_qml_module(myapp 
        URI MyCo.Frames
        RESOURCE_PREFIX /my.company.com/imports
        QML_FILES
            path/to/somewhere/MyFrame.qml
            AnotherFrame.qml
    )
    

    thank you.

    1 Reply Last reply
    1
    • N Offline
      N Offline
      NYBL
      wrote on last edited by NYBL
      #2

      From what i understand
      qt_add_resources- for images etc
      qt_add_qml_module- compiles qml files to qrc and creates some qml boilerplate like qml_register_type<> or qmldir

      add_executable- for cpp files

      1 Reply Last reply
      1

      • Login

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