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 Custom Style with Qt 6.1.1 and CMake
Forum Updated to NodeBB v4.3 + New Features

QML Custom Style with Qt 6.1.1 and CMake

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

    I'm failing at making a custom style for static-compiled Qt 6.1.1 project using CMake. Stumped on what I've missed. Set up a gitlab project that tries to have just the parts I think I need that hopefully will be a useful public reference once I get it working.
    https://gitlab.com/christoferjennings/qml-custom-style

    The README has links to docs I tried to follow. The project structure is...

    qml-custom-style
    ├── AStyle
    │   ├── Button.qml
    │   ├── astyle.qrc
    │   └── qmldir
    ├── CMakeLists.txt
    ├── README.md
    ├── main.cpp
    ├── main.qml
    └── qml.qrc
    

    There is no qtquickcontrols2.conf because I'm trying to make this work for static builds, and as far as I can tell the docs say I should just import AStyle in main.qml

    When I run the app I get this...

    QQmlApplicationEngine failed to load component
    qrc:/main.qml:6:1: module "AStyle" is not installed
    

    I'm trying to get the style on the path with this in CMakeLists.txt (Modified from this QT Creator doc)

    set(QML_IMPORT_PATH
        ${CMAKE_SOURCE_DIR}
        ${CMAKE_SOURCE_DIR}/qml ${CMAKE_BINARY_DIR}/imports
        ${CMAKE_PREFIX_PATH}/qml ${CMAKE_PREFIX_PATH}/imports
        CACHE STRING "" FORCE)
    

    I'm pretty sure there are too many paths in there. Maybe just the first line matters(?) but I've been experimenting and just left the code as-is for now.

    I wish I could form a clear question about this. But I feel like I'm just going in circles reading this then that then this then that etc. in the docs. All I can ask is, "what'd I miss?"

    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