Saturday, January 30, 2010

"Visual Qml Editor" will be coming soon !?

In my past article, I said that QtCreator hasn't integrated Qt Declarative UI(e.g. QML) yet. But in Qt Labs' this article, they will include "Qml Text Editor" and "Visual Qml Editor" in a QtCreator branch. I hope it.

Thursday, January 28, 2010

QtRuby Debug Level

If you want to know QtRuby internal behavior, let's set the "QtRuby Debug Level". Just write one line in the beginning of QtRuby file.

# Defualt (Off)
Qt.debug_level = Qt::DebugLevel::Off
# Minimal
Qt.debug_level = Qt::DebugLevel::Minimal
# High
Qt.debug_level = Qt::DebugLevel::High
# Extensive
Qt.debug_level = Qt::DebugLevel::Extensive
Qt::DebugLevel::High is enough to know internal behavior.

But I could not find the way to be on the debug level from ruby interpreter (e.g. command line options).

Monday, January 25, 2010

Qt 4.6.1 was released

1 week ago, Qt 4.6.1 was released. I download and install Qt 4.6.1 SDK (LGPL) from here.

I have ever heard that Qt Declarative UI has been integrated into SDK release 4.6.1 in some news, but, Qt Declarative UI for 4.6.1 is not included and not released not yet. In this blog comment, it will be more 1 week.

Friday, January 22, 2010

Install Ruby 1.9.1 p378 on Windows using MinGW #2

(continued from phosphorescence: Install Ruby 1.9.1 p378 on Windows using MinGW #1)

Another error is like below:
win32/win32.c:4607: error: lvalue required as left operand of assignment
make: *** [win32.o] Error 1
Similar case was reported in ruby-core mailing list(27196, 27197), and solution is here.

See the corresponding code:
(const char *)buf += len;
And the type of buf is void*.

The message "lvalue required as left operand of assignment" means left operand must be mutable, and it seems buf is not because of void*. I googled with corresponding keywords, so I found the solution.
win32/win32.c
/*(const char *)buf += len;*/
buf = (void *) ( len + (const char *)buf );
Then I retry build and install, it succeeds.
Youhei@3935-CF61 ~/ruby-1.9.1-p378 $ ./configure --prefix=/opt/ruby-1.9.1 --enable-shared
Youhei@3935-CF61 ~/ruby-1.9.1-p378 $ make
Youhei@3935-CF61 ~/ruby-1.9.1-p378 $ make install
Youhei@3935-CF61 ~/ruby-1.9.1-p378 $ cd
Youhei@3935-CF61 ~ $ ruby -v
ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32]

Tuesday, January 19, 2010

Install Ruby 1.9.1 p378 on Windows using MinGW #1

In previous post, I install Ruby 1.9.1 p243 using MinGW one-click installer. And now, ruby 1.9.1 p378 was released. So I try to build and install ruby 1.9.1 p378 for windows with MinGW by myself.

At first, I try to build with same approach as in Linux.
Youhei@3935-CF61 ~ $ tar -jxvf ruby-1.9.1-p378.tar.bz2
Youhei@3935-CF61 ~ $ cd ruby-1.9.1-p378
Youhei@3935-CF61 ~/ruby-1.9.1-p378 $ ./configure --prefix=/opt/ruby-1.9.1 --enable-shared
Youhei@3935-CF61 ~/ruby-1.9.1-p378 $ make
But error like below occured in make process.
In file included from ../ruby_1_9/signal.c:531:
C:\Qt\2009.05\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../mingw32/include/pthread.h:307:
error: redefinition of 'struct timespec'

Similar error has already reported in ruby-core mailing list(23577, 23578).
It's the reason that struct timespec definition is duplicated at include/ruby/missing.h and C:\Qt\2009.05\mingw\mingw32\include\pthread.h
include/ruby/missing.h
#if !defined(HAVE_STRUCT_TIMESPEC)
struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};
#endif
C:\Qt\2009.05\mingw\mingw32\include\pthread.h
#ifndef HAVE_STRUCT_TIMESPEC
#define HAVE_STRUCT_TIMESPEC 1
struct timespec {
long tv_sec;
long tv_nsec;
};
#endif /* HAVE_STRUCT_TIMESPEC */
So I replace struct timespec definition in include/ruby/missing.h with one in C:\Qt\2009.05\mingw\mingw32\include\pthread.h, then I retry to build. Error of struct timespec definition has been solved, but another error occured. to be continued...

Saturday, January 16, 2010

Flickable color list

I add a sample program to my graphics-dojo clone repository - Flickable color list. It was difficult in 3 points.

Thursday, January 14, 2010

How to use git-completion on my openSUSE #2

(continued from phosphorescence: How to use git-completion on my openSUSE #1)

There are one more tips to use git-completion.bash conveniently. That is a PS1 hack. The way is written in git-completion.bash like below:
# 3) Consider changing your PS1 to also show the current branch:
# PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
#
# The argument to __git_ps1 will be displayed only if you
# are currently in a git repository. The %s token will be
# the name of the current branch.

So I rewrite /etc/bash.bashrc.local to rewrite PS1, using bash's regexp.
test -s /etc/git-completion.bash && . /etc/git-completion.bash
[[ "$PS1" =~ ^(.*)(>|#|\$)(.*?)$ ]] && PS1="${BASH_REMATCH[1]}\$(__git_ps1)${BASH_REMATCH[2]}${BASH_REMATCH[3]}"

Then command prompt becomes git-completion.bash ready.

Monday, January 11, 2010

Ruby 1.9.1 p378 was released

Ruby 1.9.1 p376 was released because of WEBrick's vulnerability. So I download from here, and re-install it like this entry. Let's check.
> /opt/ruby-1.9.1/bin/ruby --version
ruby 1.9.1p378 (2010-01-10 revision 26273) [i686-linux]

Then I re-build QtRuby like this entry.

Friday, January 8, 2010

How to use git-completion on my openSUSE #1

Default repositories of openSUSE don't contain git-completion.bash So I manually integrate it into my openSUSE like below:

  1. Download the latest git-completion.bash from here
  2. save git-completion.bash in local: e.g. /etc/git-completion.bash
  3. In the /etc/bash.bashrc.local, write test -s /etc/git-completion.bash && . /etc/git-completion.bash

Then I can use git completion - git commands, branches, remote sites and so on. to be continued...