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?
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'.
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.