toBoolean() isn't even a function in that class, and declaring the
button on the stack causes crashes upon closing the application.
Change-Id: I063cac2bb144cfb9786f20bbc122d5af92a4c2c0
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
//! [5]
-QPushButton button;
-QJSValue scriptButton = myEngine.newQObject(&button);
+QPushButton *button = new QPushButton;
+QJSValue scriptButton = myEngine.newQObject(button);
myEngine.globalObject().setProperty("button", scriptButton);
myEngine.evaluate("button.checkable = true");
-qDebug() << scriptButton.property("checkable").toBoolean();
+qDebug() << scriptButton.property("checkable").toBool();
scriptButton.property("show").call(); // call the show() slot
//! [5]