Structural differences between TnFOX and Qt

More about Qt can be found at http://www.trolltech.com/

Firstly, there exist API compatible classes for the following Qt classes:

FX::QBuffer (QBuffer) FX::QBlkSocket (QSocketDevice) FX::QDir (QDir)
FX::QFile (QFile) FX::QFileInfo (QFileInfo) FX::QHostAddress (QHostAddress)
FX::QIODevice (QIODevice) FX::QMutex (QMutex) FX::FXStream (QDataStream)
FX::FXString (QString) FX::QThread (QThread) FX::QTrans (tr())
FX::QWaitCondition (QWaitCondition)FX::QByteArray FX::QCache
FX::QCacheIterator FX::QDict FX::QDictIterator
FX::QFileInfoList FX::QIntCache FX::QIntCacheIterator
FX::QIntDict FX::QIntDictIterator FX::QPtrList
FX::QPtrListIterator FX::QMemArray FX::QValueList
FX::QPtrDict FX::QPtrDictIterator FX::QPtrVector
FX::QPtrVectorIterator FX::QStringList FX::QValueListIterator
FX::QValueListConstIterator

With the above, you can port most non-GUI related Qt code with very little rewriting. However, there are a number of structural changes to the API's which have been done because (a) FOX constraints demanded a different approach (b) Qt's solution was substantially below optimal and (c) Qt's approach makes multi-threaded code hard.

The first most obvious change is the complete absence of reference counting because it is fundamentally non-thread-safe - thus there is no implicit nor explicit sharing. This has two knock-on effects:

The second less obvious change is that FXString is currently ASCII. When normal FOX finalises its support for unicode, I'll replace normal FX::FXString with FX::FXWString - however, QString is currently two-byte unicode whereas FXWString will be four-byte unicode. Most string processing using the API's won't need to know, but your code might.

Some API's have been slightly altered, whether to provide spelling corrections, remove irrelevent arguments etc. Generally speaking I've provided deprecated overloads to maintain old behaviour. Any Qt API's marked as deprecated in the documentation should be treated as such - do not use them in new code. Furthermore since the API semantics are different, how you wrote efficient code for Qt will not always be the same for TnFOX.

Lastly, TnFOX is fully exception-aware when Qt most certainly is not. Any line is assumed to be able to throw an exception at any time! - thus again your code may break in subtle ways - most likely being resource & memory leaks or causing your internal data structure to become corrupted or inconsistent. Look into TnFOX's transaction support which permits rollback actions to be undertaken when an error arises.

Note:
TnFOX was written to port a substantial Qt project written for Qt v2.x and v3.0. Hence later API additions or revisions may not be reflected here.

(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:36 2009 for TnFOX by doxygen v1.4.7