Wednesday, October 6, 2010

QML: Bouncing Hello World

Now that we have seen how to write a Hello World Program, its time to proceed forward and understand the power of QML.

The following example takes the normal Hello World example and converts it to a bouncing rectangle that contains the "Hello MeeGo" text inside.

Observe the use of the Animations and MouseArea. It took me 15 mins to get this working ... just imagine, how much you would require to make this work in any other language.

import Qt 4.7

Rectangle {
width: 400
height: 800

Rectangle {

id: rect1
width: 200
height: 100
x: 60
color: "lightgreen"
border.width: 2
border.color: "black"
radius: 10


Text {
x: 25
y: 40
font.bold: true
font.pointSize: 20
style: Text.Outline
styleColor: "yellow"
color: "magenta"
text: "Hello MeeGo"
}

// Animation to make the rectangle bounce down and go back up
SequentialAnimation on y {
NumberAnimation { from: 50; to: 700; easing.type: Easing.OutBounce; duration: 2000 }
loops: Animation.Infinite
PauseAnimation { duration: 200 }
NumberAnimation { to: 50; easing.type: Easing.OutQuad; duration: 1000 }
}
}

// clicking on the view will change the color of the smaller rectangle
MouseArea {
anchors.fill: parent
onClicked: {rect1.color = "lightblue"}
}

// Animation to chnage the color of the outter rectangle
ColorAnimation on color { from: "red"; to: "yellow"; duration: 2000; loops: Animation.Infinite }

}

Thursday, September 23, 2010

MeeGo Awareness in Bangalore

I had been thinking about spreading the MeeGo word in bangalore, from quite some time. But, not until a few days back, did i have any good ideas to implement this.

One fine day, when i was napping in the Nokia cab on my way to office, i had this idea of educating my close friends about MeeGo and how to develop applications for it. The idea was targeted more towards people who love technology and are interested in learning something new. When i expanded this idea, i felt that there could be a lot technical people, who are working in different technologies and domains, but would love to do something different.

Based on this idea, i have prepared a survey to gauge people's interest in learning about MeeGo and Qt. If the survey proves to be conclusive, i will take this idea forward to the higher management and we may see some MeeGo trainings for people outside Nokia.

So, if you are interested, please go ahead and fill this survey

https://spreadsheets.google.com/viewform?formkey=dEgtNEo5S1BhenBTMUt3WjhtN05WTnc6MQ

It would be great, if you can pass on this survey to your friends.

Thank you
Raghu

Wednesday, August 11, 2010

QML Examples: Hello World

Our first QML program will start with Hello World. The below code will create a Light Blue colored Rectangle with Width of 200 pixels and Height of 200 pixels.

Within that rectangle, it will print the Text "Hello World" starting at (x,y) = (66,93)

This program can be executed using qml viewer.


import Qt 4.7

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

Tuesday, December 8, 2009




Created some wallpapers for Nokia N900 .. they seem to have come out very well. Get the full image by click on the above thumbnails, they are of size 3200 x 480 ... split them to 800 x480 and you will have a set of panoramic wallpapers.

Karmic Koala and ATI Graphics Driver

Yesterday, my Ubuntu 9.10 machine suddenly started complaining about display settings at startup. This happened after a recent update to Karmic koala. Because of this issue, my X would default to low resolution settings.

I looked it up on the net and found out that there support for some of the older ATI cards is missing in the latest official drivers. I have an ATI 2400 XT. After quite a bit of googling around, i found the solution. I had to install open-source drivers. The installation instructions were found here,
http://wiki.cchtml.com/index.php/Ubuntu_Jaunty_Installation_Guide

Note: at the end of everything, if u r still facing issues, delete the xorg.conf file and reboot