QVApplication Class Reference

Main class for QVision applications. 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)
 Creates a QVApplication object.
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 ()
 Gets a pointer to the only QVApplication instance.


Detailed Description

Main class for QVision applications.

This is a class that should be used to create a unique application object in every QVision application, generally in the main() function.

It should exist before creating any QVWorker, QVCamera, QVImageCanvas, or the QVisionInterface object. This objects opens the cameras and sets worker parameters from the command line, and has similar responsabilities as the QApplication object in Qt applications not based on QVision.

Definition at line 48 of file qvapplication.h.


Constructor & Destructor Documentation

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

Creates a QVApplication object.

This constructor should receive command line arguments array from the main() function parameters, in the parameters argc and argv.

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 112 of file qvapplication.h.

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

Gets a pointer to the only QVApplication instance.

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

Definition at line 116 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.

References QVWorker::finish().


The documentation for this class was generated from the following files:
Generated on Wed Jan 16 18:41:29 2008 for QVision by  doxygen 1.5.3