Hi people,

I've been given the task to port a relatively complex Win32 MFC based application to Qt4 which is supposed to be able to run on both Linux (32/64-bit) and Win32. I personally have never programmed under Windows and therefore have trouble identifying possible improvements that I could do instead of copying the old code as far as I can.

The application will drive (or presently drives) a robot. We want to get better control over the timing, integrate OpenGL simulation/visualization, and a networked client. The current implementation has a shared memory segment, and multiple threads. Most of the constants interesting to the robot (e.g. gear ratios, etc.) are "#define"s, and the SHM is implemented as a bunch of structures accumulated in one large structure and accessed via pointer like this:
Qt Code:
  1. m_pSharedData=::MapViewOfFile(m_hMap, FILE_MAP_WRITE, 0, 0, 0);
To copy to clipboard, switch view to plain text mode 

Now I wonder if anyone here has some good tips in porting the software to Qt4. It is supposed to have a GUI interface. In terms of Software Design, does it make sense to separate the GUI functions (e.g. QApplication) from the actual drivers/low-level programming? Because in the current version, the event called from a, say, button, directly interacts with the electronics. In my opinion, this leads to the fact that the control code is distributed all over the code base and right now it's pretty hard to discern what function does what. Would it be clearer if I created some "robot" class that contains all the driving code, etc.?

I am really open to suggestions and if Qt has a really cool class that does exactly what I want or provides means to make life so much easier without me having to re-invent the wheel, I would be very thankful. For example, I've read that there is something called QtConcurrent, which seems to be an easier choice that QThread, but I don't know...

Thank you very much in advance.

Stephan