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 QVisionInterface;
00035 class QVPropertyHolder;
00036 
00037 #define qvApp ((QVApplication*) qApp)
00038 
00046 class QVApplication : public QApplication
00047 {
00048         Q_OBJECT
00049 public:
00060         QVApplication (int &argc, char **argv,
00061                                    QString info = QString(), bool GUIenabled = TRUE);
00062 
00078         int exec();
00079 
00092         void setArgumentAsUsed(QString argument);
00093 
00103         QStringList getUnusedArguments();
00104 
00107         bool isRunning() { return isRunningFlag; };
00108 
00111         static QVApplication* instance() { return dynamic_cast<QVApplication*>(qApp); }
00112 
00115         void registerQVPropertyHolder(QVPropertyHolder *qvp);
00116         void deregisterQVPropertyHolder(QVPropertyHolder *qvp);
00117         void registerGUI(QVisionInterface *visionInterface);
00118         QSet<QVPropertyHolder *> getQVPropertyHolders() { return qvps; };
00120 
00122 signals:
00123         void inited();
00124 
00125 private slots:
00126         void initWorkers();
00128 
00129 public slots:
00135         void quit();
00136 
00137 private:
00138         QString info;
00139         QStringList unusedArguments;
00140         QSet<QVPropertyHolder *> qvps;
00141         QVisionInterface *visionInterface;
00142         bool isRunningFlag;
00143 
00144         void printHelp() const;
00145 };
00146 #endif // QVAPPLICATION_H

Generated on Fri Dec 7 12:20:59 2007 for QVision by  doxygen 1.5.3