Ignore:
Timestamp:
Jul 29, 2016, 3:14:55 PM (5 years ago)
Author:
Thomas Fuhrmann
Message:

Improve ListWidget? + code cleanup + doxygen comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/mavlink/tools/FlairGCS/src/ListWidget.h

    r56 r60  
    33// CECILL-C License, Version 1.0.
    44// %flair:license}
     5/*!
     6 * \file ListWidget.h
     7 * \brief Class displaying a QListWidget on the ground station
     8 * \author Thomas Fuhrmann, Copyright Heudiasyc UMR UTC/CNRS 7253
     9 * \date 2016/07/26
     10 * \version 1.0
     11 */
    512#ifndef LISTWIDGET_H
    613#define LISTWIDGET_H
     
    1421class QPalette;
    1522
     23/*! \class ListWidget
     24 *
     25 * \brief Class displaying a QListWidget on the ground station
     26 *
     27 */
    1628class ListWidget : public FormLayout {
    1729  Q_OBJECT
    1830
    1931public:
     32  /**
     33   * \brief      Default constructor
     34   *
     35   * \param      parent  The parent widget
     36   * \param[in]  row     The row where to position the widget
     37   * \param[in]  col     The col where to position the widget
     38   * \param[in]  name    The name of the widget
     39   */
    2040  ListWidget(Layout *parent, int row, int col, QString name);
    21   ListWidget(Layout *parent, int row, int col, QString name, QStringList& items);
     41  /**
     42   * \brief      Constructor with a list of default items
     43   *
     44   * \param      parent  The parent widget
     45   * \param[in]  row     The row where to position the widget
     46   * \param[in]  col     The col where to position the widget
     47   * \param[in]  name    The name of the widget
     48   * \param      items   List of items to display at creation
     49   */
     50  ListWidget(Layout *parent, int row, int col, QString name,
     51             QStringList &items);
     52  /**
     53   * \brief      Destructor
     54   */
    2255  ~ListWidget();
    2356
    2457private:
    25   QListWidget* listwidget;
    26   int current_item_row;
    27   bool is_up_to_date;
    28   QPalette list_red_pal;
    29   QPalette list_black_pal;
     58  /**
     59   * \brief      Check if the widget is up to date.
     60   *
     61   * \return     True if uptodate, False otherwise.
     62   */
     63  bool IsUptodate(void);
     64  /**
     65   * \brief      Sets the isUpToDate internal flag.
     66   */
     67  void SetUptodate(void);
     68  /**
     69   * \brief      Handler to process a new xml file.
     70   *
     71   * \param[in]  dom   The dom containing the xml file.
     72   */
    3073  void XmlEvent(QDomElement dom);
    31   void SetUptodate(void);
     74  /**
     75   * \brief      Reset the widget, load the internal parameters.
     76   */
     77
    3278  void Reset(void);
     79  /**
     80   * \brief      Handler to process the loading of the internal xml file.
     81   *
     82   * \param[in]  dom   The dom containing the xml file.
     83   */
    3384  void LoadEvent(QDomElement dom);
    34   bool IsUptodate(void);
    35 
     85  /**
     86   * \brief      Save the user interface variables state in the internal members.
     87   */
    3688  void ui_to_var(void);
     89  /**
     90   * \brief      Save the user interface variables state in the internal xml file.
     91   */
    3792  void ui_to_xml(void);
     93  /**
     94   * Pointer to the managed QListWidget widget.
     95   */
     96  QListWidget *listwidget;
     97  /**
     98   * The row of the currently selected item.
     99   */
     100  int currentItemRow;
     101  /**
     102   * Flag to know if the widget is up to date.
     103   */
     104  bool isUpToDate;
     105  /**
     106   * Redefined color palette.
     107   * The highlight item's text appears in red.
     108   */
     109  QPalette palListRed;
     110  /**
     111   * Redefined color palette.
     112   * The highlight item's text appears in white (default).
     113   */
     114  QPalette palListDefault;
    38115
    39116private slots:
     117  /**
     118   * \brief      Handle the change of the selected item.
     119   *
     120   * When the selected item has changed, the text of the newly selected item appears in red,
     121   * to notify the user to apply the modification.
     122   *
     123   * \param[in]  current_row  The row of the currently selected item.
     124   */
    40125  void SelectedItemChanged(int current_row);
    41126};
Note: See TracChangeset for help on using the changeset viewer.