Newer
Older
lm
committed
#ifndef QGCTOOLWIDGET_H
#define QGCTOOLWIDGET_H
#include <QWidget>
#include <QAction>
lm
committed
#include <QVBoxLayout>
lm
committed
#include "UAS.h"
namespace Ui {
class QGCToolWidget;
}
class QGCToolWidget : public QWidget
{
Q_OBJECT
public:
explicit QGCToolWidget(const QString& title, QWidget *parent = 0);
lm
committed
~QGCToolWidget();
/** @brief Factory method to instantiate all tool widgets */
static QList<QGCToolWidget*> createWidgetsFromSettings(QWidget* parent);
/** @Give the tool widget a reference to its action in the main menu */
void setMainMenuAction(QAction* action);
/** @brief All instances of this class */
static QMap<QString, QGCToolWidget*>* instances();
lm
committed
public slots:
void addUAS(UASInterface* uas);
/** @brief Delete this widget */
void deleteWidget();
/** @brief Export this widget to a file */
void exportWidget();
/** @brief Import settings for this widget from a file */
void importWidget(const QString& fileName);
/** @brief Store all widgets of this type to QSettings */
static void storeWidgetsToSettings();
signals:
void titleChanged(QString);
lm
committed
protected:
QAction* addParamAction;
QAction* addButtonAction;
QAction* setTitleAction;
QAction* exportAction;
QAction* importAction;
lm
committed
QVBoxLayout* toolLayout;
UAS* mav;
lm
committed
void contextMenuEvent(QContextMenuEvent* event);
void createActions();
QList<QGCToolWidgetItem* >* itemList();
const QString getTitle();
/** @brief Add an existing tool widget */
void addToolWidget(QGCToolWidgetItem* widget);