Qt Designer and OpenGL

June 16, 2006 on 9:35 pm | In Computer, General, Graphics, Linux | No Comments

I designed a GUI for an OpenGL application using Qt Designer, and encountered some glitches. First, you have to subclass QGLWidget class, say MyGLWidget, and put OpenGL stuff there. Then open Qt Designer and place a some container widget in a window as a place folder for MyGLWidget. You should use QWidget because QGLWidget inherits directly from it. However, QWidget is not available in Qt Designer. So you are forced to use QFrame as a place folder and promote it to a custom widget class and specify MyGLWidget. Now save the GUI layout to a .ui file, and hand edit it and delete the lines which declares some of QFrame properties. You also need to rename QFrame in the custom widget section to QWidget. Now you should be able to compile your code.

Actually I found a ML thread about this and a Trolltech engineer said that they would add QWidget in Qt Designer. Apparently it’s not fixed yet. I really want the fix!

New Kernel Feature

May 4, 2006 on 1:54 pm | In Computer, Linux | No Comments

I stumbled on the KernelNewbies Wiki about a new feature in kernel 2.6.16:

Add /proc/sys/vm/drop_caches. Writing to this will cause the kernel to drop clean caches, dentries and inodes from memory, causing that memory to become free. This is mainly useful for benchmarking, for getting consistent results between filesystem benchmarks without rebooting. To free pagecache: “echo 1 > /proc/sys/vm/drop_caches”, to free dentries and inodes: “echo 2 > /proc/sys/vm/drop_caches”, to free pagecache, dentries and inodes: “echo 3 > /proc/sys/vm/drop_caches”. As this is a non-destructive operation and dirty objects are not freeable, the user should run `sync’ first.

It’s sweet.

Hard Drive Crash

May 2, 2006 on 4:18 pm | In Computer, Linux | No Comments

Last week, my dual core Athlon 64 box crashed. I was converting a movie to mpeg2 to burn a DVD video on Windows when it happened. Then the weird things happened and eventually I had to repartition the hard drives. The only good side was that I managed to recover the partition table from the corrupted one. However, almost all data on / and /home went to the lost+found directory when I did xfs_repair. I recovered most of important data since I had one-week old backup of /home, but it was the worst nightmare. I don’t know what causes the problem.

Leap second

January 3, 2006 on 2:14 am | In Computer, Linux | No Comments

Looking the syslog of my Linux box, I found the following entry:

Clock: inserting leap second 23:59:60 UTC

Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds. Valid XHTML and CSS. ^Top^