My blog has been moved to

Wednesday, March 22, 2006

The Redemption of Mr. Payne

Can't wait for 2007-planned Max Payne? Then keep an eye on Max Payne: Payne & Redemption (see also the interview). The trailer is so far very interesting! :-P

Monday, March 20, 2006


This is the most interesting thing I read today:

Are there any plans to include K3B into KDE 4? Would it change to K4B, or maybe a more user-friendly name?

See if we can persuade Sebastian to rename it to K4B :-)

Wednesday, March 15, 2006

Resize Pop-up List of A Combo Box

You want to be able to resize the pop-up list of a combo box. Normally, this pop-up list has always the same width as the combo box. However, in certain cases the width of the combo box needs to be fixed. But if the pop-up list does not expand itself, then only part of the items on the list is visible as illustrated here:

In this particular situation, the look of the pop-up list will be better if it can be resized independently from the combo box itself.

QComboBox unfortunately does not provide public functions to access its pop-up list. Also, the pop-up list widget itself is not accessible. It is possible to create a subclass of QComboBox and reuse its private members (in header file qcombobox_p.h), but this would have required a quite amount of effort.

By looking at the source of QComboBox, we find out that the pop-up widget is QComboBoxPrivateContainer. It is also constructed as a child widget of the combo box. Using run-time introspection feature of Qt, it is very easy to find this widget and change its size:

void resizeComboBoxPopup(QComboBox* comboBox, int width, int height)
  if(!comboBox) return;
  // force the construction of QComboBoxViewContainer

  // iterate to find QComboBoxPrivateContainer
  QWidget* popup = 0;
  QObjectList objects = comboBox->children();
  for(int i = 0; i < objects.size(); ++i)
      QObject* obj =;
          popup = qobject_cast<QWidget*>(obj);
    popup->resize(width, height);

Of course, this cheap trick is only a workaround and only works as long as the implementation of QComboBox does not change too much. It can also be considered as a crime to Qt. So, kids, don't try this at home...

Monday, March 13, 2006

Numeric Entry with Pop-up Slider

Although typically I like slider, sometimes it is not practical to use because of space constraint. When a horizontal slider, for example becomes, narrow and narrower, it is difficult to get a fine tune movement.

The solution that I am still experimenting with is to use a pop-up slider. This is mostly seen in the volume applet, but, hey, let us try it somewhere else:

So by clicking on the down button (forget about the ugly pixmap), a slider will pop-up and let the user adjust the value by moving the slider handle. The slider will automagically disappear if the user clicks anywhere else, just like typical pop-up menu.

I am not really surprised if usability-wise, this kind of pop-up slider is not usable at all. However, if there is interest, I'll put the code online (it's only couple of hundred lines anyway).


Siegfried: every minute is just hilarious.

Friday, March 10, 2006

Wednesday, March 08, 2006

XGL Live

I should have written all my wishes in this blog. Just hours after this, Koroora (Gentoo-based) Live CD for demonstrating XGL is available (thanks for Roman Khimov for pointing it out, thanks also for SlippJigg for mentioning PC LinuxOS).

I quickly downloaded the ISO, burned into a CD, and gave it a try on a GeForce4-armed desktop. It works out of the box. I even showed it to couple of friends and they seem all like it so far. Kudos for the Koroora team!

Now, I still need to make some more copies...

Tuesday, March 07, 2006

The Glass Experience

Using Slackware-based Looking Glass Live CD, it was very interesting to watch the expression of some guys when I booted a fairly modern NVidia-equipped desktop with it. I even still considered burning some more CDs and give them to people that I know.

Now came XLG XGL and AIGL. Wouldn't be beautiful if we have a working Live CD which just can be handed to any average Joe Sixpack? I'm not the only one who is looking for it, and I'm sure there are many. Though there is possibility of using Dapper Flight (I still need to give it a try), a simple ready-to-burn-and-boot ISO file would really please me since I can as well point the URL to others.

Monday, March 06, 2006

Sunday, March 05, 2006

Background and Backing Store

Whoever moved from Qt 4.0 to 4.1 typically realized that for some widgets, the background is not what it is supposed to be. In the latest Qt Quarterly article Transparent Backgrounds in Qt 4.1, Andreas Hanssen explained this feature in details. He also elaborated a bit about backing store, also a new thing in Qt 4.1 .

Still related to backing store, Trenton Schulz showed how to create Fading Effects with Qt 4.1.

Friday, March 03, 2006

Savin' Me

Is it just me, or listening to the first few seconds of Savin' Me also reminds you of How You Remind Me (yes, I'm aware of that Someday) ?

In all cases, I just like it.

Thursday, March 02, 2006

Euros vs Features

Recently I wanted a mini music centre. I tried to search for what I need, but still could not find the best compromise between the features and the amount of money I have to spend.

Finally there was a special offer from a discount market. I carefully checked the flyer to see whether it fulfills my requirement. For example, sleep mode and remote control are necessary because I just like listening to radio just when I am about to fall asleep. Auxiliary input is also a must since I want to connect it to the DVD player. Seems everything is fine, so I showed up in the store minutes after it was opened and bought it.

Because the price is half of typical music centre found in electronic shops, I was ready to be surprised if there are some catches. Fortunately, it is all just as good as I imagine. Sub woofer is included, which I did not really need but why not. There are even USB port and MMC slot, nice to plug-in the portable player or card containing music files.

Few design decisions seem strange to me. The power supply is inside the sub woofer box, probably to reduce the space in the main unit. That means I can't use the system without sub woofer at all, but that's not so bad. Speakers are small, yet the output is loud enough anyway for my small apartment. I can't judge the quality because my ears have close to zero sensitivity to tones. As for the FM receiver, I doubt that it tunes to all stations but there are few good strong stations so I could not care more. For playing CD, I must placed it from the top which is not so interesting because I put everything in the shelf. A normal CD tray would have been better. Since I have limited music collection, that's not a big deal at all.

I could say that I'm really happy with it. I would have spent twice the amount of money if I want the common mini music centre, which has more features that what I really need anyway. So why waste more euros.

I wish we had such choice also for mobile phone. Unfortunately, I still can not find a phone which fully fits my requirements: no camera at all, maximum battery duration, sturdy case, easy-to-use menu, and good reception. I'm old fashioned, I'd like to use it only to make phone calls, so if possible I'd like to avoid extra euros, time, distraction, headache because the phone has music player, camera, wireless connectivity, browser, and other extra baggage.

But I can see here that I'm dreaming. Or maybe I'm just the most selfish (potential) customer.