QML hello.qml

Matthias Apitz guru at unixarea.de
Fri Apr 22 13:07:40 UTC 2016


Hello,

I'm doing first steps in QML and follow the tutorial. The system is
CURRENT on amd64 with qt5 from ports head: 

# pkg info | grep '^qt5-'
qt5-core-5.4.1_2               Qt core non-graphical module
qt5-dbus-5.4.1                 Qt D-Bus inter-process communication module
qt5-gui-5.4.1_3                Qt graphical user interface module
qt5-imageformats-5.4.1         Qt plugins for additional image formats
qt5-network-5.4.1              Qt network module
qt5-opengl-5.4.1               Qt 5-compatible OpenGL support module
qt5-printsupport-5.4.1         Qt print support module
qt5-qml-5.4.1                  Qt QML and JavaScript language module
qt5-quick-5.4.1                Qt declarative framework for dynamic user interfaces
qt5-sql-5.4.1                  Qt SQL database integration module
qt5-svg-5.4.1                  Qt SVG support module
qt5-testlib-5.4.1              Qt unit testing module
qt5-webkit-5.4.1_2             Qt WebKit implementation
qt5-widgets-5.4.1              Qt C++ widgets module
qt5-xml-5.4.1                  Qt SAX and DOM implementations
qt5-xmlpatterns-5.4.1          Qt support for XPath, XQuery, XSLT and XML Schema

With the example below the command

$ /usr/local/lib/qt5/bin/qmlscene hello.qml

gives only a grey box, but no text in it. What do I wrong?
Thanks

	matthias

// http://doc.qt.io/qt-5/qml-tutorial1.html
//

import QtQuick 2.0

Rectangle {
    id: page
    width: 320; height: 480
    color: "lightgray"

    Text {
        id: helloText
        text: "Hello world!"
        y: 30
        anchors.horizontalCenter: page.horizontalCenter
        font.pointSize: 24; font.bold: true
    }
}

-- 
Matthias Apitz, ✉ guru at unixarea.de, ⌂ http://www.unixarea.de/  ☎ +49-176-38902045
¡Dios querido denos otra vez los problemas de ayer, los que tuvimos en la RDA!
My Lord, give us back the problems of yesterday, those we have had in the GDR.


More information about the freebsd-questions mailing list