src/qvcore/qvapplication.h

Go to the documentation of this file.
00001 /*
00002  *      Copyright (C) 2007. PARP Research Group.
00003  *      <http://perception.inf.um.es>
00004  *      University of Murcia, Spain.
00005  *
00006  *      This file is part of the QVision library.
00007  *
00008  *      QVision is free software: you can redistribute it and/or modify
00009  *      it under the terms of the GNU Lesser General Public License as
00010  *      published by the Free Software Foundation, version 3 of the License.
00011  *
00012  *      QVision is distributed in the hope that it will be useful,
00013  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *      GNU Lesser General Public License for more details.
00016  *
00017  *      You should have received a copy of the GNU Lesser General Public
00018  *      License along with QVision. If not, see <http://www.gnu.org/licenses/>.
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 class QVGUI;
00035 class QVPropertyContainer;
00036 
00037 #define qvApp ((QVApplication*) qApp)
00038 
00048 class QVApplication : public QApplication
00049 {
00050         Q_OBJECT
00051 public:
00065         QVApplication (int &argc, char **argv,
00066                                    QString info = QString(), bool GUIenabled = TRUE);
00067 
00083         int exec();
00084 
00092         void setTerminateOnLastWorker(bool terminate) { terminateOnLastWorker=terminate; };
00093 
00106         void setArgumentAsUsed(QString argument);
00107 
00117         QStringList getUnusedArguments();
00118 
00121         bool isRunning() { return isRunningFlag; };
00122 
00125         static QVApplication* instance() { return dynamic_cast<QVApplication*>(qApp); }
00126 
00129         void registerQVPropertyContainer(QVPropertyContainer *qvp);
00130         void deregisterQVPropertyContainer(QVPropertyContainer *qvp);
00131         void registerGUI(QVGUI *visionInterface);
00132         QSet<QVPropertyContainer *> getQVPropertyContainers() { return qvps; };
00134 
00136 signals:
00137         void inited();
00138 
00139 private slots:
00140         void initWorkers();
00142 
00143 public slots:
00149         void quit();
00150 
00151 private slots:
00152         void workerFinished();
00153 
00154 private:
00155         QString info;
00156         QStringList unusedArguments;
00157         QSet<QVPropertyContainer *> qvps;
00158         QVGUI *visionInterface;
00159         bool isRunningFlag;
00160         int workerCount;
00161         bool terminateOnLastWorker;
00162 
00163         void printHelp() const;
00164 };
00165 #endif // QVAPPLICATION_H

Generated on Thu Mar 13 19:18:16 2008 for QVision by  doxygen 1.5.3