Thursday, April 29, 2010

Spring short vacation 2010

In Japan, last week of April and first week of May are short vacation weeks. Of course, I take a short vacation, so I suspend posts and comments to this blog for a moment. Resume will be May 10, 2010.

Monday, April 26, 2010

Your Linux can become to develop Qt applications for symbian

These sources (1, 2) are explaining approaches to develop Qt applications for symbian on your Linux.

If you are a Linux guru or a Linux user, and you are interested in developing open mobile application, these posts are good solution. Especially, openSUSE may be most suitable distribution because openSUSE is most friendly for Qt.

Friday, April 23, 2010

Mouse event on QML

How do we hook the call back event like mouse click to the QML applications? The most QML-ish way to do that is to set the element like XXXXArea. This sample shows changing the text colot when mouse buttons (left or right) are clickked with concrete element MouseArea.

At first, see the MouseArea and its parent element:
    Text {
        id: original
        x: 60
        y: 80
        text: qsTr("Hello World")
        MouseArea {
            /* inherit parent item area to handle click event
                because default area is none */
            anchors.fill: parent
            /* write acceptable buttons
                because there are no default button events*/
            acceptedButtons: Qt.LeftButton | Qt.RightButton
            onClicked: { // hooked event when mouse is clicked
                if (mouse.button == Qt.RightButton) {
                    parent.color = 'black';
                } else {
                    parent.color = 'red';
                }
            }
        }
    }

Tuesday, April 20, 2010

Rotate QML Text

Like this post, we can rotate text easily with Rotate element.
import Qt 4.7

Rectangle {
    width: 200
    height: 200
    Text {
        id: original
        x: 60
        y: 80
        text: qsTr("Hello World")
    }
    Text {
        x: original.x
        y: original.y + 16
        text: original.text + "!"
        font {
            family: "Helvetica"
            pointSize: 12
            italic: true
        }
        color: "blue"
        transform: Rotation {
            angle: 45
        } // rotate this text item
    }
}
And let's be smooth the text:
        transform: Rotation {
            angle: 45
        } // rotate this text item
        smooth: true // smooth the transformation of this text

Saturday, April 17, 2010

Change the scale of QML text

Using transform property and Scale element, we can change the scale of QML text.
import Qt 4.7

Rectangle {
    width: 200
    height: 200
    Text {
        id: original
        x: 60
        y: 80
        text: qsTr("Hello World")
    }
    Text {
        x: original.x
        y: original.y + 16
        text: original.text + "!"
        font {
            family: "Helvetica"
            pointSize: 12
            italic: true
        }
        color: "blue"
        transform: Scale {
            xScale: 1.25
            yScale: 5
        } // change the scale of this text item
    }
}
But this font is dirty. Then let's be smooth.
        transform: Scale {
            xScale: 1.25
            yScale: 5
        } // change the scale of this text item
        smooth: true // smooth the transformation of this text
Re-run the QML application:

Thursday, April 15, 2010

IronRuby 1.0 is FINALLY released!

A few days ago, IronRuby 1.0 has been released. I download and install IronRuby for .Net 2.0 because My windows environment does not have .NET 4.0.

And I run sample WinForms application from IronRuby console:
IronRuby 1.0.0.0 on .NET 2.0.50727.4927
Copyright (c) Microsoft Corporation. All rights reserved.

>>> require 'System.Windows.Forms'
=> true
>>> include System::Windows::Forms
=> Object
>>> f = Form.new
=> System.Windows.Forms.Form, Text:
>>> f.text = 'Hello World'
=> "Hello World"
>>> Application.run(f)

Monday, April 12, 2010

RubyKaigi2010 starts many callings and lookings

RubyKaigi2010 starts many callings and lookings in the site.

(1) Call for presentations

(2) Call for sub events

(3) Look for sponsors

(4) Look for illustrations

For instance, "(2) Call for sub events" is like JRubyConf at RubyConf2009, and "(4) Look for illustrations" is calling an key illustration for RubyKaigi2010.

Friday, April 9, 2010

Change font and color of QML text

It's easy than normal QT applications:
import Qt 4.7

Rectangle {
    width: 200
    height: 200
    Text {
        id: original
        x: 60
        y: 80
        text: qsTr("Hello World")
    }
    Text {
        x: original.x
        y: original.y + 16
        text: original.text + "!"
        font {
            family: "Helvetica"
            pointSize: 12
            italic: true
        } // change the font of this text item
        color: "blue" // change the color of this text item
    }
}

Tuesday, April 6, 2010

Reuse QML item

In normal Qt application, we use variable to refer same object. But in QML, we refer the object from the other one with identifying QML item in id. For example:
import Qt 4.7

Rectangle {
    width: 200
    height: 200
    Text {
        id: original // identify this item as "original"
        x: 60
        y: 80
        text: qsTr("Hello World")
    }
    Text {
        x: original.x // refer original
        y: original.y + 16 // refer original and calculate
        text: original.text + "!" // refer original and concatenate
    }
}

Saturday, April 3, 2010

QML i18n

Like as this article, we can do i18n for QML applications.

(1) Wrap all characters with qsTr() like below:
import Qt 4.7

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

Thursday, April 1, 2010

iRally - rally computer sophisticated

APPLE announces the new product for the motorsport domain. The product named iRally is brand-new rally computer.

It has WVGA display with multi-touch gesture, bluetooth module and SIM module to communicate with service or HQ. In different with APPLE's other products, it becomes unlocked SIM product because rally cars go many countries. So crews can board their own SIM card. And it can download rally computing applications and rally bulletins from App Store and iBook Store.

But it DOES NOT have any GPSs, gyroscopes and accelerometers. Because WMSC refuses these technologies that help logging reconnaissance(recce) information and help making pace notes, and APPLE accept it.

APPLE will release it in 3Q/2010, and WMSC will confirm to use this product in 2011 season.

In the other side, GOOGLE is also preparing to launch alternatives. It will include the rest of all that are not in iRally.