2 ******************************************************************************
4 * @file widgetdelegates.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
6 * @addtogroup GCSPlugins GCS Plugins
8 * @addtogroup OPMapPlugin OpenPilot Map Plugin
10 * @brief The OpenPilot Map plugin
11 *****************************************************************************/
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #ifndef WIDGETDELEGATES_H
29 #define WIDGETDELEGATES_H
30 #include <QItemDelegate>
32 #include "flightdatamodel.h"
34 class MapDataDelegate
: public QItemDelegate
{
38 typedef enum { MODE_GOTOENDPOINT
= 0, MODE_FOLLOWVECTOR
= 1, MODE_CIRCLERIGHT
= 2, MODE_CIRCLELEFT
= 3,
39 MODE_FIXEDATTITUDE
= 4, MODE_SETACCESSORY
= 5, MODE_DISARMALARM
= 6, MODE_LAND
= 7,
40 MODE_BRAKE
= 8, MODE_VELOCITY
= 9, MODE_AUTOTAKEOFF
= 10 } ModeOptions
;
42 typedef enum { ENDCONDITION_NONE
= 0, ENDCONDITION_TIMEOUT
= 1, ENDCONDITION_DISTANCETOTARGET
= 2,
43 ENDCONDITION_LEGREMAINING
= 3, ENDCONDITION_BELOWERROR
= 4, ENDCONDITION_ABOVEALTITUDE
= 5,
44 ENDCONDITION_ABOVESPEED
= 6, ENDCONDITION_POINTINGTOWARDSNEXT
= 7, ENDCONDITION_PYTHONSCRIPT
= 8,
45 ENDCONDITION_IMMEDIATE
= 9 } EndConditionOptions
;
47 typedef enum { COMMAND_ONCONDITIONNEXTWAYPOINT
= 0, COMMAND_ONNOTCONDITIONNEXTWAYPOINT
= 1,
48 COMMAND_ONCONDITIONJUMPWAYPOINT
= 2, COMMAND_ONNOTCONDITIONJUMPWAYPOINT
= 3,
49 COMMAND_IFCONDITIONJUMPWAYPOINTELSENEXTWAYPOINT
= 4 } CommandOptions
;
51 MapDataDelegate(QObject
*parent
= 0);
53 QWidget
*createEditor(QWidget
*parent
, const QStyleOptionViewItem
&option
,
54 const QModelIndex
&index
) const;
56 void setEditorData(QWidget
*editor
, const QModelIndex
&index
) const;
57 void setModelData(QWidget
*editor
, QAbstractItemModel
*model
,
58 const QModelIndex
&index
) const;
60 void updateEditorGeometry(QWidget
*editor
,
61 const QStyleOptionViewItem
&option
, const QModelIndex
&index
) const;
62 static void loadComboBox(QComboBox
*combo
, flightDataModel::pathPlanDataEnum type
);
65 #endif // WIDGETDELEGATES_H