00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00024
00025 #ifndef QVAPPLICATION_H
00026 #define QVAPPLICATION_H
00027
00028 #include <QSet>
00029 #include <QList>
00030 #include <QString>
00031 #include <QStringList>
00032 #include <QApplication>
00033 #include <qvcore/qvdefines.h>
00034
00035 class QVGUI;
00036 class QVPropertyContainer;
00037
00038 #define qvApp ((QVApplication*) qApp)
00039
00049 class QVApplication : public QApplication
00050 {
00051 Q_OBJECT
00052 public:
00066 QVApplication (int &argc, char **argv,
00067 QString info = QString(), bool GUIenabled = TRUE);
00068
00084 int exec();
00085
00093 void setTerminateOnLastWorker(bool terminate) { terminateOnLastWorker=terminate; };
00094
00107 void setArgumentAsUsed(QString argument);
00108
00118 QStringList getUnusedArguments();
00119
00122 bool isRunning() { return isRunningFlag; };
00123
00126 bool forHelp() { return forHelpFlag; };
00127
00130 static QVApplication* instance() { return dynamic_cast<QVApplication*>(qApp); }
00131
00132 #ifndef DOXYGEN_IGNORE_THIS
00133 void registerQVPropertyContainer(QVPropertyContainer *qvp);
00134 void deregisterQVPropertyContainer(QVPropertyContainer *qvp);
00135 void registerGUI(QVGUI *visionInterface);
00136 QSet<QVPropertyContainer *> getQVPropertyContainers() { return qvps; };
00137
00138 signals:
00139 void inited();
00140
00141 private slots:
00142 void initWorkers();
00143 #endif
00144
00145 public slots:
00151 void quit();
00152
00153 private slots:
00154 void workerFinished();
00155
00156 private:
00157 QString info;
00158 QStringList unusedArguments;
00159 QSet<QVPropertyContainer *> qvps;
00160 QVGUI *visionInterface;
00161 bool isRunningFlag;
00162 int workerCount;
00163 bool terminateOnLastWorker, forHelpFlag;
00164
00165 void printHelp() const;
00166 };
00167 #endif // QVAPPLICATION_H