Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QmlDesigner
Qt 6.11 is out! See what's new in the release blog

QmlDesigner

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 1.7k 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.
  • K Offline
    K Offline
    kostya111
    wrote on last edited by
    #1

    I have my own qml element inherited from QDeclarativeItem and written in C++. It is placed in plugin.
    QmlDesigner can see it. However when I place it on canvas QmlDesigner set it's width and height to 0. How can I tell QmlDesigner to set default width and height?
    In addition to this the element have property named source and I want QmlDesigner display 'three dots' beside it to show dialog 'Open File'. QmlDesigner does it with standart 'Qml Image Element'. I've seen source code of 'Qml Image Element' and I did'n find any special code to do it, including setting width and height.

    I have QtCreator 2.5.2

    And just one more question. Is there way to use QmlDesigner as stand alone app instead as plugin to QtCreator?

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kostya111
      wrote on last edited by
      #2

      I've found solution for this question.
      You may control appearance of 'Properties pane' by adding specifics file to your elements in directory '/usr/share/qtcreator/qmldesigner/propertyeditor'.
      You may set default property value by providing plugin to qmldesigner with .metainfo file just like '<QT_CREATOR_SRC_PATH>/src/plugins/qmldesigner/qtquickplugin'.

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

        bq. How can I tell QmlDesigner to set default width and height?

        There are two possible solutions.

        Give your custom item a default size in the constructor in C++

        Create a .metainfo file that populates the item library and sets a default size

        bq. Is there way to use QmlDesigner as stand alone app instead as plugin to QtCreator?

        Short answer: No
        Qt Quick Designer is integrated into Qt Creator quite heavily.
        A stand alone version would be a huge amount of 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