Resizable Application Windows in QT 4.5

One of the quirk with QT 4.5 is that in order to get your entire application to resize (all the elements within it), they have to be within a layout. However, the QT Designer won’t let you assign a layout to empty QWidgets, especially if they are inside the tab widget. So this is how I go about solving the problem.

  1. Add a vertical layout into each of the QWidget inside the tab. (You need this for the whole application to resize, anyway)
  2. Click on the QWidget (not in the hierarchy!), right click and add a Layout. By this time, the “no entry” icon next to that widget would disappear
  3. If you are dynamically adding widgets to the tab during run-time, you have to add to the vertical layout inside the QWidget of that tab.

If I have more time, I would put up a step by step tutoiral.


Tips for the Novice Freelancer #1 – Virtual PC and VMWare

Got Windows 7? If you are going to do applications development on it, makes sure you get the Professional one – this allows you to write an emulation of Windows XP. Don’t have Windows 7? You will have to go for VMWare server. Why these two programs. Testing for backward compatability. With the expactions of web-applications to work on IE6 (this is a big debate, but the sad fact is that IE6 isn’t going anywhere any-soon), you need to test your web-apps and applications on different type of machine builds.

One problem is IE6 – You need to a fresh install of Windows XP and SP2 to get IE6. Well, that’s troublesome – however, with Virtual PC and VMWare, you can run multiple copies of OS with different builds on your PC. Just make sure for Virtual PC, your intel/amd chip supports virtualization and that it is turned on in BIOS. And you need¬† a freaking amount of hard-disk space.

Installing QWT and getting it to work with QT 4.5 Windows

After much trial and error, here is how I have managed to get QWT working with QT 4.5

  1. Locate the QWT web-page at SourceForge
  2. Make sure that you download the QWT 5.1.2 version. For some reasons, SourceForge lists the older version 4 first
  3. Read the INSTALL file – that pretty much covers what you need to do, but for more control, generate the Visual Studio project files (qmake-msvc vc)
  4. Go find the project file in the \src\ folder
  5. Complie a release build from it

If all you need is a release build, then this is all fine and good. However, if you want a debug build…

  1. Go to project properties, select Debug
  2. Go to Linker, General, and add a “_d” to the end of the generated file
  3. Complie

Of course, you have to remember set up the input files to the examples (qwt5.lib_d instead of qwt5.lib) for them to work. Now for the goody – you can now complie the plugin (found in the \designer folder) using either release or debug, and even both, since you can have both verisons of QWT existing.

The fnal step is to place the two new dlls (the release one, and your own debug one) into the qt\bin folder. Place the plugin dlls into the \plugins\designer folder. Then this whole thing should work.



Opensource Turn-based Strategy Games

Writing a Turn-based strategy games can be quite a daunting process; there’s the map, the AI and the all-important GUI elements. Over at the Freeware Genius you can find 19 such games. Of particular interest to me is 8 Kingdoms, which reminds me of the Total War series, and PHP Diplomacy. I would be looking over them to see which one I could base my own game on. Hopefully I have luck!


2D Platformers are not dead! Take Trine, for example

Sometimes we think that old game genres like SHUMP, 2D platformers, beat’em up and such are gone, dead, replaced by fanciful 3D RPG, RTS and turb-baed games. Well, Trine isn’t one of them. It is an excellent 2D platformer, but uses 3d graphics for characters, backgrounds and the environment, and blend all those elements into a glorious looking game which is immersive and haunting. Here’s a link to a gameplay video.


Switching between languages

In daytime, I work with C++. When it comes to night, I have to struggle with PHP; meanwhile I am learning Actionscript 3 and Javascript scripting for Unity3D. It’s no wonder that I begin to write code like this:


public class MyClass : public MyInterface
  public function __construct($initialData : array)
     $this->initialData = $initialData;
     for (int i = 0; i < count($initialData); i++)

Someone help me, please!


Why you should consider learning XNA

If you are new to games development in general, and especially 3D, XNA is one good way to start out. Why so? For one, there is a large number of materials published on it and they cover quite large ground – terrain, shaders, cameras, 3d movement and the such. Second, it is using the right-handed coordinate system, which make its compatible with whatever mathematics you can find in textbooks and OpenGL tutorials.

The other advantage,¬† I have realised, is that Unity3D’s API shares quite a number of similarity with XNA’s Maths library. That will in handy if you are intending to pick up Unity3D later on.


Getting Started with XNA and such

First, you will have to get XNA and Visual Studio 2008. If you are a student, head off to DreamSpark to get the student’s editions. After the installation, here are some good sites to get started on the basic:

Of course, the Creator Club for XNA has some samples and tutorials worth looking through too.


Research: Doing a custom frontpage for WordPress

One of my challenges now, for a particularly difficult project, is to create a WordPress site, with a custom front-page. As it would be showing posts in different layouts, from different categories, I would need to create a custom WordPress loop. Looking at this, I realise I need to answer the following questions:

  1. How do I display a custom page as a WordPress Frontpage?
  2. How do I get multiple WordPress Loop?
  3. How do I select which posts to show and what not to show?

Read the rest of this entry »

Tags: ,

On Choosing a Template for WordPress

After installing WordPress 2.8.1, configuring it and deleting the default “Welcome to WordPress Message!” what’s the next order of the day? Choosing a template (or a theme, to use WordPress Jargon). While there are lots of good designs out there, the graphics are just first impressions for me, and it does not count. It’s the little things that count. Here’s what I will look for when choosing a theme.

Read the rest of this entry »

Tags: ,