title: Qt: using enums with QComboBox
body: <p>I have a set of parameters that I need to edit, some of which are enums.</p>
  
  <p>As of today, I use the raw value of the enum in a QSpinBox, which is not friendly at all. You have to remember the values by yourself and set the good one:</p>
  
  <p><img src="https://i.stack.imgur.com/mpj59.png" alt="my parameter editor"></p>
  
  <p>For instance, E_Range could be presenting a combobox with these:</p>
  
  <pre><code>typedef enum {
      ERANGE_2_5  = 0, /*!&lt; +/- 2.5 V */
      ERANGE_5    = 1, /*!&lt; +/- 5 V */
      ERANGE_10   = 2, /*!&lt; +/- 10 V */
      ERANGE_AUTO = 3  /*!&lt; Auto range */
  } TVoltageRange_e;
  </code></pre>
  
  <p>I didn't find anything about using an enum in a QComboBox. Is it possible?<br>
  If yes, what are the steps?</p>
  
  <p>I mean, I guess I'll have to declare the enum through Qt so that it is "enumerable" with the Qt metaobject. But from there, I'm not sure.</p>