Install Qt Components for Desktop

There are not so many components for QML. To use buttons, tabs, windows etc, you need Qt Components for Desktop.

Qt Labs blog article says that you can install Qt Components for Desktop with “qmake && make install”. But it is too difficult to understand for newbies like me. I’ll explain how to install.

# My environment is Linux. On Windows and Mac, not same way can be used.

First, download Qt Components for Desktop.

Open this URL and “download master as tar.gz” to download latest version. Using January 24 2012 version is  also good choice. I succeeded with this version.

# Of course you can download via git instead. Execute “git clone git://gitorious.org/qt-components/desktop.git”

Extract the tar.gz file. This time, extracted directory will be named as “qt-components-desktop”

Move to “qt-components-desktop” directory and check the contents with ls.

$ > cd /home/phanect/Desktop/qt-components-desktop
$ > ls
components  desktop.pro  desktop.qmlproject  examples  Makefile  qmldesktopviewer  README  src

Next, let’s compile and install.

At fitst, we have to execute qmake command. You should use qmake included in QtSDK. I failed to install when I use qmake provided by linux distributer. (openSUSE)

Just execute following command.

/home/phanect/bin/QtSDK/Desktop/Qt/4.8.0/gcc/bin/qmake

# I’m using Qt 4.8.0.

And, execute make install. This make command should be installed from system repository.

make install

Then see /home/phanect/bin/QtSDK/Desktop/Qt/4.8.0/gcc/imports/QtDesktop/ and you can find various files.

Then, you can use various components.

import QtQuick 1.1
import QtDesktop 0.1

Rectangle {
width: 360
height: 360

Button {

}
}

Write “import QtDesktop 0.1″ to use components.

Qt Developer Conference Tokyo 2011

I’ve been Qt Developer Conference Tokyo 2011(#qtdc_jp) at Akihabara UDX. I didn’t attend today’s GIS class to attend this event. :P It was so varuable today.

I exhibited KDE & Plasma Active with terucco, one of KDE JP members. Terucco brought his FreeBSD machine with KDE and I exhibited Plasma Active (… on VirtualBox on my netbook, not tablet)

And it was the first time to see @moguriso, @IoriAyane, @kenya888 offline.

After the exhibition and seminars, I took lightning talk about Plasma Active. I made a screencast of Plasma Active, and presented with it.
At least there were no critical problem, but I found some problem:

1. I modified video at last night, but I used old version by mistake.
I created it on my home computer and forgot to download it on my mobile PC, and @himamura kindly gave me his WiMAX access point so that I can download from my dropbox. But I forgot… Sorry, @himamura… I waste your kindness… OTL
Anyway, preparation should be done sooner.

2. Not attractive for people who are interested in their business
I’ve believed it must be interesting for audience to see the demo, and boring to just listen to my explanation only with the text-based slides. So I just showed 2 slides to tell “Plasma active is a tablet UI” and almost all explanation was with demo video.
However, audience come to QtDC to improve their business, so I should tell them it is useful for their business at first. I planned to explain that “it is supported by two German company and useful for your business” at the last slide, but I ran out of the time and couldn’t.
It is important to consider audience’s character and interest.

We had a party after the event, and after that, some Nokia staffs and exhibiters had another party.
Fortunately I had a seat by Lars Knoll, the chief maintainer of Qt. I talked with him and Daniel Kihnberg (Qt Ecosystem Director) a lot.
I asked him relationship between QML and C++. As I thought, it is different from e.g. relationship between HTML and PHP. When you develop application with Qt Quick, C++ is used to create QML element, and module. (I don’t know module in Qt yet, so I may misunderstand him.)

I also asked him for plans about file processing method for QML. He answered it is not planned yet.

We also talked about English. It is difficult for Japanese to improve/keep English skill because there are few opportunity to talk in English in Japan. I think Europeans are generally better at English than Japanese because people don’t need passport to go other EU countries, and Lars agreed. But for example, German (Lars is from Germany) don’t have so many opportunities to talk in English and most books and documents are translated to German. There seems similar problem.

Lars also told me that people use English usually in small countries like Norway and Sweden. For example, Movies are in English and there are only Norwegian subtitles. That’s good environment.

It was great day. I appreciate all Qt DevCon staff to give us such a interesting opportunity.

Text Background color in QML

On Text element of QML, there is no background color property. So you have to use Rectangle element.

Rectangle {
    color: "#808080"
    Text {
        text: "Hello, World"
    }
    width: childrenRect.width
    height: childrenRect.height
}

The result is…