"quick": add example "painted-item"; small revisions;

This commit is contained in:
polos 2017-02-04 12:37:26 +01:00
parent fcbf75464c
commit 0ff3dee53c
20 changed files with 350 additions and 15 deletions

View file

@ -10,7 +10,8 @@ static QObject* lisp_provider(QQmlEngine*, QJSEngine*) { return lisp; }
QObject* ini() {
if(!lisp) {
lisp = new Lisp;
qmlRegisterSingletonType<Lisp>("EQL5", 1, 0, "EQL5", lisp_provider); }
qmlRegisterSingletonType<Lisp>("EQL5", 1, 0, "EQL5", lisp_provider);
qmlRegisterType<PaintedItem>("EQL5", 1, 0, "PaintedItem"); }
return lisp; }
QVariant Lisp::apply(QObject* caller, const QString& function, const QVariantList& arguments) {
@ -19,4 +20,9 @@ QVariant Lisp::apply(QObject* caller, const QString& function, const QVariantLis
Q_ARG(QString, function),
Q_ARG(QVariantList, arguments)); }
void PaintedItem::paint(QPainter* painter) {
eql_fun("qml:paint",
Q_ARG(QQuickPaintedItem*, this),
Q_ARG(QPainter*, painter)); }
QT_END_NAMESPACE