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 can I create simple container directly usable in QML designer.
Forum Updated to NodeBB v4.3 + New Features

How can I create simple container directly usable in QML designer.

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

    Hello.

    Let say I want to create simple control that would have a expand/collapse button, with some label, plus some place for user defined context, that would be shown or hidden depending on control state.

    While the above is simple to achieve in QML, I can't find any materials on how to write it so that I could use it in QML designer like standard controls (so drag it onto my form, and using the designer "inject" it with some context - be it, other control, text, image etc.).

    How can I achieve this?

    Thanks in advance.

    Best regards.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      ThomasHartmann
      wrote on last edited by
      #2

      Here you can find a small example how to integrate a custom qml plugin into the designer: https://qt.gitorious.org/qt-creator/qt-creator/source/394c9dd5507df610f7d60a56b7bf7e707a59142f:tests/manual/qml/testprojects/plugins

      This is a manual test case, that we use to test the integration of custom QML items. If you put the QML file next to the file you edit (no import needed) nothing is required to get a basic integration.

      To get something like a collapsable GroupBox working I would suggest to overload the default property using an lias property, like the GroupBox of the Qt Quick Controls does it. The state of of the GroupBox should be exposed as a boolean property.

      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