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 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 00097 void setArgumentAsUsed(QString argument); 00098 00108 QStringList getUnusedArguments(); 00109 00112 bool isRunning() { return isRunningFlag; }; 00113 00116 static QVApplication* instance() { return dynamic_cast<QVApplication*>(qApp); } 00117 00120 void registerQVPropertyHolder(QVPropertyHolder *qvp); 00121 void deregisterQVPropertyHolder(QVPropertyHolder *qvp); 00122 void registerGUI(QVisionInterface *visionInterface); 00123 QSet<QVPropertyHolder *> getQVPropertyHolders() { return qvps; }; 00125 00127 signals: 00128 void inited(); 00129 00130 private slots: 00131 void initWorkers(); 00133 00134 public slots: 00140 void quit(); 00141 00142 private: 00143 QString info; 00144 QStringList unusedArguments; 00145 QSet<QVPropertyHolder *> qvps; 00146 QVisionInterface *visionInterface; 00147 bool isRunningFlag; 00148 00149 void printHelp() const; 00150 }; 00151 #endif // QVAPPLICATION_H