Thursday, November 1, 2012

Why Qt, anyway?

adapted from the IsItPrime Wiki

Why re-write the entire application using the same basic language but a different framework?

Qt is a cross-platform application development framework by Nokia. It is great for graphically-enabled applications that need to be deployed on multiple operating systems in different environments with little to no intrinsic change.

Qt is great for applications such as IsItPrime and other NCPrime projects because it is simple, straightforward, and allows for the look and feel to stay more or less the same on different OSs. Currently, IsItPrime for OS X and Windows not only look different, but actually are different.

With the creation of a Qt codebase, this will change. Soon, IsItPrime will be consistent on many different platforms, including (eventually) Linux.

The Windows version of IsItPrime Qt (2.0.0) has been re-written from the ground up to use absolutely no Windows-specific code - that is, it no longer uses the Win32 API whatsoever.
This is both a good thing and a bit of a hurdle. Qt luckily includes functionality identical or at least similar to what can be done with the Windows API. If it doesn't, there is usually a workaround for emulation.

The OS X version, while it may still be Qt-enabled, will also include several OS X-specific features like Twitter and Facebook integration, as that exists with OS X Mountain Lion (10.8.2) and above. For backwards compatibility, a version will be released with different workarounds for these features (or with them removed).

Linux will be tricky as I haven't ever actually programmed for/on Linux. I do have a LinuxBook Pro now (read: MacBook Pro running Ubuntu), so that should definitely help. The idea is to take the current Visual Studio 2010 solution and convert the whole thing to a qmake project that can then be compiled cross-platform on any system with Qt installed.

Currently, the Qt version of IsItPrime must be distributed with two DLLs included in the application directory (and the DLLs cannot be moved); if I wanted to write an installer, that would remove the need for the DLLs to be packaged in the application directory but would also be a lot of work and an unneccesary extra step.

I really like portable applications - that is, no installation. So I intend to keep all NCPrime applications working out-of-the-box with no installation necessary.

Soon, I will also be re-writing GJSieve to use Qt. Most likely, it will be IsItPrime with a few things changed in the UI and behind the scenes (ie to calculate the Proth number). Then, in the not-too-distant-but-still-distant future, MuPuPriNT will get a nice Qt makeover as well!

For now, I suppose Windows users will just have to settle for the current versions of GJSieve and MuPuPriNT.

By the way, if you currently cannot get to the MuPuPriNT, GJSieve, or IsItPrime, it's SourceForge having some technical difficulties.

No comments:

Post a Comment