Hello world!


Hello World in QML. QML is Qt’s Markup Language to create vivid UIs. It’s new and in a preview state. Expect examples shown break until QML get’s stable.

This is how a QML Hello World could look like.

import Qt 4.6

Rectangle {
 width: 200
 height: 200
 Text {
   x: 66
   y: 93
   text: "Hello World"
 }
}

It’s not XML (thank’s god). It look’s more like CSS or JSON. It allows you to describe your user interface in a declarative way and provide the logic with JavaScript. If speed is an issue or you need to access native components QML can easily be extended with Qt’s C++.
What does it do?
There is a QmlViewer application which evaluates the code and displays a text “Hello World” on position 66,93 inside a rectangle of 200×200. That’s all. It looks like this:

That’s all for now.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s