QVApplication Class Reference

The only instance of this class manages the GUI of a QVision application. More...

#include <qvcore/qvapplication.h>

List of all members.

Public Slots

void quit ()
 Not documented.

Public Member Functions

 QVApplication (int &argc, char **argv, QString info=QString(), bool GUIenabled=TRUE)
 Constructs the QVApplication, using the user command line arguments.
int exec ()
 Starts execution of the QVApplication.
void setArgumentAsUsed (QString argument)
 Marks a given command line argument as used.
QStringList getUnusedArguments ()
 Gets the list of unprocessed arguments.
bool isRunning ()
 Tells if a QVApplication is already in the exec() loop.
void registerQVPropertyHolder (QVPropertyHolder *qvp)
void deregisterQVPropertyHolder (QVPropertyHolder *qvp)
void registerGUI (QVisionInterface *visionInterface)
QSet
< QVPropertyHolder * > 
getQVPropertyHolders ()

Static Public Member Functions

static QVApplicationinstance ()
 Get a pointer to the only QVApplication instance.


Detailed Description

The only instance of this class manages the GUI of a QVision application.

Singleton class, whose only instance will manage the GUI of a QVision application. It inherits directly from QApplication. Just as a normal QApplication, must be instantiated in the main() function, and its main method is QVApplication::exec().

Definition at line 46 of file qvapplication.h.


Constructor & Destructor Documentation

QVApplication::QVApplication ( int &  argc,
char **  argv,
QString  info = QString(),
bool  GUIenabled = TRUE 
)

Constructs the QVApplication, using the user command line arguments.

Parameters:
argc Number of command line arguments.
argv Array of arrays of chars containing command line arguments.
info Optional QString containing an informational message for the application (shown when asked for help).
GUIEnabled If FALSE, the application will run in a terminal without graphics. Note that in this case you will not be able to use any kind of graphical user interface (including the QVisionInterface).

Definition at line 33 of file qvapplication.cpp.


Member Function Documentation

int QVApplication::exec (  ) 

Starts execution of the QVApplication.

Before starting the application, this method checks if the user asked for help with the command line option "--help", and in that case it shows help on the application and on all the input parameters of every QVPropertyHolder created until now, and exits. Otherwise, it checks for any possible error on any QVPropertyHolder, and if finds any, shows an adequate error message and exits. Any unused command line argument will also lead to an error and the corresponding error message. This function also opens any possibly created QVCameras, letting them ready for being read by adequately linked QVWorkers's. Finally, if everything was initialized OK, the GUI main loop starts executing, showing every graphical element, and finally all the created QVWorkers also start their executions.

Returns:
The int code returned by the QVApplication.

Definition at line 49 of file qvapplication.cpp.

References QVPropertyHolder::getLastError(), and QVPropertyHolder::getName().

void QVApplication::setArgumentAsUsed ( QString  argument  ) 

Marks a given command line argument as used.

This function is useful if the programmer wish to process manually a command line argument (which is not intended to initialize any property of a QVPropertyHolder). In that case, he should call this function when the argument has been adequately processed, in order to avoid the QVApplication::exec() early termination with an "unused argument" message. Use in conjunction with QVApplication::getUnusedArguments().

Parameters:
argument QString with the argument to mark as used. Must be exactly as contained in the corresponding argv[i] (including hyphens and/or equal characters, if present).

Definition at line 121 of file qvapplication.cpp.

QStringList QVApplication::getUnusedArguments (  ) 

Gets the list of unprocessed arguments.

This function is useful if the programmer wish to process manually a command line argument (which is not intended to initialize any property of a QVPropertyHolder). In that case, he should call this function to obtain the list of unprocessed arguments, in order to process them adequately. Use in conjunction with QVApplication::setArgumentAsUsed().

Parameters:
returns List of unused arguments as a QStringList.

Definition at line 118 of file qvapplication.cpp.

bool QVApplication::isRunning (  )  [inline]

Tells if a QVApplication is already in the exec() loop.

Returns:
TRUE if the QVApplication is already in the exec() loop.

Definition at line 107 of file qvapplication.h.

static QVApplication* QVApplication::instance (  )  [inline, static]

Get a pointer to the only QVApplication instance.

Returns:
Pointer to the only QVApplication instance (equivalent to qvApp).

Definition at line 111 of file qvapplication.h.

void QVApplication::registerQVPropertyHolder ( QVPropertyHolder qvp  ) 

Not documented (to be used only by constructors of QVPropertyHolder and QVisionInterface.

Definition at line 130 of file qvapplication.cpp.

void QVApplication::quit (  )  [slot]

Not documented.

Terminates an application.

This slot, when called, provokes the termination of the QVApplication. Previously, it cleanly finishes all the QVWorkers and closes all the open QVCameras.

Definition at line 168 of file qvapplication.cpp.


The documentation for this class was generated from the following files:
Generated on Fri Dec 7 12:20:59 2007 for QVision by  doxygen 1.5.3