Hi,
It looks like the documentation has some errors in it. The Button QML type was updated in Qt 5, but they forgot to update that example. Replace “label” with “text”, and you should be fine :)
Thanks for bringing this up; I’ll have it fixed.
You can see the latest Button documentation at http://qt-project.org/doc/qt-5/qml-qtquick-controls-button.html
EDIT: Whoops, I misunderstood that example. It DOESN’T refer to the built-in Button [qt-project.org] provided by Qt, but instead it asks readers to implement their own Button. Please ignore what I wrote above.
Anyway, that page does not show all the code used to create the example, it only walks through and discusses the important parts of the code. The code is in your Qt installation for you to study — somewhere like C:\Qt\5.2.0\msvc2012_64_opengl\examples\quick\tutorials\gettingStartedQml\core\Button.qml. You can find the full Button code here, which declares the “label” property.
May I ask how you are running the example?
IMHO, this example is rather complicated for a “getting started” tutorial. I’d start with http://qt-project.org/doc/qt-5/qml-tutorial.html instead.
↧