SettingsGroup.h 1.23 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

#ifndef SettingsGroup_H
#define SettingsGroup_H

#include "QGCLoggingCategory.h"
#include "Joystick.h"
#include "MultiVehicleManager.h"
#include "QGCToolbox.h"

#include <QVariantList>

/// Provides access to group of settings. The group is named and has a visible property associated with which can control whether the group
/// is shows in the ui.
class SettingsGroup : public QObject
{
    Q_OBJECT
    
public:
    /// @param name Name for this Settings group
    /// @param settingsGroup Group to place settings in for QSettings::setGroup
    SettingsGroup(const QString& name, const QString& settingsGroup, QObject* parent = NULL);

    Q_PROPERTY(bool visible MEMBER _visible CONSTANT)

protected:
    SettingsFact* _createSettingsFact(const QString& name);

    QString _name;
    QString _settingsGroup;
    bool    _visible;

    QMap<QString, FactMetaData*> _nameToMetaDataMap;
};

#endif