Podrška #20241
Zatvoren
- Naslov promijenjeno iz qml qt 4.7 beta u qml qt 4.7 beta, qt quick
http://lists.trolltech.com/pipermail/qt-qml/2010-April/000097.html
attached is a small example button.zip which demonstrates how to create a C++
plugin which can be used fom qml. The plugin implements a native type called
NativeBackend which implements a C++ function called nativeFunction().
An instance of NativeBackend is instantiated declaratively in Button.qml.
Unzip, cd to button, call qmake, make and run it with qml Button.qml. Clicking
on the text label will change the text to the return value of the native
function.
The file qmldir has to live in the same directory as Button.qml. The engine
parses it automatically when loading Button.qml. The files contains the single
line "plugin nativebackend lib" which makes the engine expect a plugin binary
in the lib subdirectory.
If you run qml with QML_IMPORT_TRACE=1 you will also get debug output from the
import loading mechanism:
~/tmp/button$ QML_IMPORT_TRACE=1 qml Button.qml
- Status promijenjeno iz Dodijeljeno u Zatvoreno
Također dostupno kao Atom
PDF