biometrics/openbr — pull request #34 by jklontz (2013-03-22 20:06:42+00:00)
Title: initialization changes

There are two changes in this patch that both affect `br::Context::initialize()`

The first is the realization that `QCoreApplication::instance()` provides a mechanism for testing if a QCoreApplication/QApplication has already been created. This eliminates the need for a separate `br::Context::initializeQt()` and instead Qt users should simply call `br::Context::initialize` after creating their QApplication. @sklum this probably a minor API break for you.

The second is that initializing QApplication instead of QCoreApplication in `br::Context::initialize()` is not an acceptable default behavior as it initializes the windowing system in each operating system for what is generally a console application. I was hoping we could make this a runtime switch between the two with `br -gui` indicating the windowing system should be initialized. This is how it was implemented in this patch. The annoyance is that certain classes like QLabel or QPixmap can't be created without QApplication being created first, and so extra code had to be changed to `Show2Transform` to prevent it from segfaulting during a call to `br -objects`. @caotto The other option is that we can make the QApplication/QCoreApplication a compile time switch, though I suspect we'd all prefer to see it as a runtime flag if doing so doesn't increase the code complexity too much.