Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Custom QML element init

$
0
0
I have a QML plugin, it exports the class “Window”. This class has “width” and “height” properties. For some reason I have to recreate window to reflect any changes. I have a QML: import Graphic 1.0 // my plugin Window {     width: 800     height: 600 } I know I could use QSize 800×600 to make it at once, but the given example represents the idea of separate properties (I have also fullscreen, etc,etc). How do I make my C++ class to automatically init() when, lets say “Component.onCompleted” happens? This is the code: import Graphic 1.0 // my plugin import QtQuick 2.0 // for Component Window {     width: 800     height: 600     Component.onCompleted: init() } It basically does the job, but I want my interface to be more transparent, so user does not need to set this init() manually. Is this possible?

Viewing all articles
Browse latest Browse all 4972

Latest Images

Trending Articles



Latest Images