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. Reusable QML Module and Type.
Qt 6.11 is out! See what's new in the release blog

Reusable QML Module and Type.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 1 Posters 470 Views 1 Watching
  • 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.
  • MesrineM Offline
    MesrineM Offline
    Mesrine
    wrote on last edited by
    #1

    Hello everyone,
    I am working on creating reusable QML modules.
    For example DateTime pickers QML types.

    The thing is that I want to create many QML types that select date and time like in this page.

    But If my custom QML Type contains a button, then if someone uses the module in a bigger project with some nice design for the buttons, this will break the style of the app.

    My approach for solving this is to have a custom Style in a custom Module called MyDesigns.
    The custom Design has a type called MyButton.
    So for all my other reusable modules that contain a button, I use the MyButton type.

    If someone just wants to use my reusable modules,
    They could use my MyDesigns module or create a module with the same name MyDesigns with a MyButton type that does not break the style of their app.

    Is there a better way to do this?

    MesrineM 1 Reply Last reply
    0
    • MesrineM Mesrine

      Hello everyone,
      I am working on creating reusable QML modules.
      For example DateTime pickers QML types.

      The thing is that I want to create many QML types that select date and time like in this page.

      But If my custom QML Type contains a button, then if someone uses the module in a bigger project with some nice design for the buttons, this will break the style of the app.

      My approach for solving this is to have a custom Style in a custom Module called MyDesigns.
      The custom Design has a type called MyButton.
      So for all my other reusable modules that contain a button, I use the MyButton type.

      If someone just wants to use my reusable modules,
      They could use my MyDesigns module or create a module with the same name MyDesigns with a MyButton type that does not break the style of their app.

      Is there a better way to do this?

      MesrineM Offline
      MesrineM Offline
      Mesrine
      wrote on last edited by
      #2

      @Mesrine

      I found this nice explanation.
      Let's see if can make it work.

      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