Revision as of 13:13, 4 February 2012

Qt is one of the many UI frameworks that runs on the Beagle. It also runs on many other platforms such as Microsoft Windows, Mac OS X, and Linux, and it appears to be one of the more popular choices for the Beagle. It even runs on dumb cell phones. We'll be using it with X11, however there is an embedded version that doesn't need X.

Installing on the Beagle

Qt Tutorials

Widgets

There are several nice Qt Tutorials here. I suggest you start with the Widgets Tutorial. Here's how you can run the examples on the Beagle.

Go to the Creating a Window tutorial and download the main.cpp and toplevel.pro files. Put them in their own directory.

Run qmake. (Be sure you have sourced the file noted above.) This will create a Makefile.

Run make. This should compile the program. It takes about 30 seconds for the first make.

Do an ls to see what files were created. You should see toplevel. Run it.

Congratulations, you've just compiled and run your first Qt program.

Work through the rest of the widgets tutorials to learn about building at Qt from the bottom up. The Address Book tutorials look like they are also a good place to explore.

Qt Designer

It's possible to build a user interface from the command line, building a graphics user interface is more easily done with a graphical program. Qt Designer is Qt's tool for designing and building graphical user interfaces (GUIs) from Qt components. The Qt Designer Tutorial is a good overview of what Designer can do. Designer runs on the host and the Beagle and should already be installed.

The Qt Designer tutorial ends rather quickly. I suggest you follow it up by looking at the Qt Designer Examples. Here you will learn different ways to take the *.ui file created by Designer and use it with your other Qt code.

This site has some nice instructions on getting QT going on the Beagle by recompiling everything. I don't think recompiling is really necessary. It's set up for using Qt embedded.

Qt Quick and Qt Creator

Qt Quick is another way of building a UI. Qt Quick is based on JavaScript, HTML and CSS. Qt Creator is a cross-platform integrated development environment (IDE) tailored to the needs of Qt developers; however it doesn't appear to run on the Beagle. I need to look into this some more.

I'm working through this example. I can't change mousearea1 to MouseArea to match the figure. I think something is missing in the instructions.