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. how do I reference "styles" from a related QtDS project in my QtQuick application?
Forum Updated to NodeBB v4.3 + New Features

how do I reference "styles" from a related QtDS project in my QtQuick application?

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

    I'm struggling with knowing how to integrate a Qt Design Studio project into my QtQuick application. For reference, my projects are available here in my github account:

    The QtDS project: https://github.com/alpartis/sunnygui
    The QtQuick app:  https://github.com/alpartis/sunrise
    

    These projects are meant to sit side-by-side on the filesystem so that sunrise can reference sunnygui forms and styles by way of the use of sunnygui.qrc in the sunrise project. sunnygui.qrc contains aliases and references to .ui.qml forms, which, in turn, make use of "styles" also contained in the sunnygui project.

    The problem I'm having at the moment is in successfully referencing the SunScreen.ui.qml (with alias "SunScreenForm") and the "styles" contained therein from SunScreen.qml in the sunrise application.

    Everything appears to be correct in the QtDS project and I'm able to use styles in sunnygui/SunScreen.ui.qml something like this:

    import QtQuick 2.12
    import sunnygui 1.0
    
    Rectangle {
        color: SunStyles.sunshineYellow
    }
    

    There is a qmldir file in sunnygui/imports/sunnygui/ that defines SunStyles.

    Now, over in the QtQuick application project, I have included a sunnygui.qrc resource file that sets up the "SunScreenForm" alias in reference to the ../sunnygui/SunScreen.ui.qml. Consequently, I have sunrise/SunScreen.qml that looks something like this:

    import QtQuick 2.12
    import "qrc:/forms/SunScreenForm"
    
    Item {
        SunScreenForm {    <--- "Unknown component"
        }
    }
    

    What is the "typical" way to integrate the .ui.qml forms from a Qt Design Studio project into a QtQuick application?

    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