Monday, June 14, 2010

Release schedule of Qt 4.7.0 has been changed

In five days ago, Qt community announced the change of release schedule of Qt 4.7.0 and its related products. According to this article, Qt 4.7.0 will be released during this summer. And QtCreator will be released at the same time, but its version is changed from 2.0 to 2.1. What's happened? See the matrix below:

Former release plan
QtQtCreator
Qt 4.6.xQtCreator 1.x
Qt 4.7.0QtCreator 2.0
Nokia Qt SDK
Nokia Qt SDK 1.0
↓  ↓  ↓
Current release plan
QtQtCreatorNokia Qt SDK
Qt 4.6.xQtCreator 1.x
Nokia Qt SDK 1.0(with QtCreator 2.0)
Qt 4.7.0QtCreator 2.1

And now, Nokia Qt SDK 1.0 RC and QtCreator 2.0 RC are available.

Friday, June 11, 2010

QML opacity

It's easy to change the opacity to child QML elements. It's only setting opacity property between 0(full transparency) to 1(full opacity).

import Qt 4.7
import org.webkit 1.0

Rectangle {
    width: webView.width
    height: webView.height
    Text {
        x: 300
        y: 200
        text: "hidden text"
        smooth: true
    }
    WebView {
        id: webView
        width: 640
        height: 480
        opacity: 0.5
        url: 'http://html5demos.com/canvas-grad'
    }
}

This sample(opacity is 0.5) seems like below:

And if opacity is 0, above sample seems like below:

Tuesday, June 8, 2010

Ruby 1.9.2 preview 3 is able on Windows using MinGW

As you see these article(#1, #2), installing ruby 1.9.1 on Windows using MinGW a little hurt. But in ruby 1.9.2 preview 3, there is all okay. You just do CMMI instructions on your MSYS terminal like below:

Youhei@3935-CF61 ~ $ tar -jxvf ruby-1.9.2-preview3.tar.bz2
Youhei@3935-CF61 ~ $ cd ruby-1.9.2-preview3
Youhei@3935-CF61 ~/ruby-1.9.2-preview3 $ ./configure --prefix=c:/ruby-1.9.1 --enable-shared
Youhei@3935-CF61 ~/ruby-1.9.2-preview3 $ make
Youhei@3935-CF61 ~/ruby-1.9.2-preview3 $ make install

Saturday, June 5, 2010

Ruby 1.9.2 preview 3 was released

One week ago, ruby 1.9.2 preview 3 was also released. So I download from here and install its package like this entry. Let's check.

>/opt/ruby-1.9.1/bin/ruby --version
ruby 1.9.2dev (2010-05-31 revision 28117) [i686-linux]

In ruby 1.9.2 preview 3, there are 2 notable changes. 1st, LD_LIBRARY_PATH never includes current directory. 2nd, Japanese encoding deals "emoji" for Japanese phone carriers, these are NOT equal with Unicode emoji.

Wednesday, June 2, 2010

State management for QML

In 2 samples(phosphorescence: Change the scale of QML text and phosphorescence: Rotate QML Text), I implement the change of QML element with transform property. And there is one another and more smart approach: using State elements.

1st, naming id for the element to manage states. 2nd, implement the event to change to one another state. 3rd, implement State elements. Each State element is a couple of state name and behavior. See the sample below:
import Qt 4.7

Rectangle {
    width: 200
    height: 200
    Text {
        id: message // naming this to manage states
        x: 60
        y: 80
        text: "changable"
        smooth: true
        states: [
            State {
                name: "right"
                PropertyChanges { target: message; color: "#0000FF"; font.pointSize: 12; font.italic: true }
            }, // couple of state:right and its behavior
            State {
                name: "left"
                PropertyChanges { target: message; color: "#000000"; font.pointSize: 10; font.italic: false }
            } // couple of state:left and its behavior
        ] // state elements
    }
    MouseArea {
        anchors.fill: parent
        acceptedButtons: Qt.LeftButton | Qt.RightButton
        onClicked: {
            if (mouse.button == Qt.RightButton) {
                message.state = "right"; // change the state to "right"
            } else {
                message.state = "left"; // change the state to "left"
            }
        }
    }
}

Let's launch, and click with right button.


And with left button.