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
00034 #include <qvdefines.h>
00035
00036 class QVGUI;
00037 class QVPropertyContainer;
00038 class QVImageCanvas;
00039
00040 #define qvApp ((QVApplication*) qApp)
00041
00051 class QVApplication : public QApplication
00052 {
00053 Q_OBJECT
00054 public:
00068 QVApplication (int &argc, char **argv,
00069 QString info = QString(), bool GUIenabled = TRUE);
00070
00086 int exec();
00087
00095 void setTerminateOnLastWorker(bool terminate) { terminateOnLastWorker=terminate; };
00096
00109 void setArgumentAsUsed(QString argument);
00110
00120 QStringList getUnusedArguments();
00121
00124 bool isRunning() { return isRunningFlag; };
00125
00128 bool forHelp() { return forHelpFlag; };
00129
00132 static QVApplication* instance() { return dynamic_cast<QVApplication*>(qApp); }
00133
00134 #ifndef DOXYGEN_IGNORE_THIS
00135 void registerQVPropertyContainer(QVPropertyContainer *qvp);
00136 void deregisterQVPropertyContainer(QVPropertyContainer *qvp);
00137 void registerGUI(QVGUI *visionInterface);
00138 void deregisterGUI();
00139 QSet<QVPropertyContainer *> getQVPropertyContainers() { return qvps; };
00140 #endif
00141
00142 public slots:
00146 bool startItems();
00147
00153 void quitItems();
00154
00159 void quit();
00160
00161 private slots:
00162 void workerFinished();
00163
00164 private:
00165 QString info;
00166 QStringList unusedArguments;
00167 QSet<QVPropertyContainer *> qvps;
00168 QVGUI *visionInterface;
00169 bool isRunningFlag;
00170 int workerCount;
00171 bool terminateOnLastWorker, forHelpFlag;
00172
00173 void printHelp() const;
00174 };
00175 #endif // QVAPPLICATION_H