title: How to convert Q_ENUM to QString for QT > 5.11 most efficient way?
body: <p>I read several advices how to get an actual <code>QString</code> from a <code>Q_ENUM</code> value.</p>
  
  <p>Below are 3 possible ways, I came up with, that are compilable constructs in QT5.11.1</p>
  
  <p>What of them should one prefer and why?</p>
  
  <pre><code>void MainWindow::setErrorText(QCanBusDevice::CanBusError error)
  {
      QString errorString;
      QDebug(&amp;errorString) &lt;&lt; error;
      ui-&gt;statusBar-&gt;showMessage("Error occured: " + errorString);
  
      // QT4 ?
      const QMetaObject&amp; mo = QCanBusDevice::staticMetaObject;
      QMetaEnum me = mo.enumerator(mo.indexOfEnumerator("CanBusError"));
      QString errorStr(me.valueToKey(QCanBusDevice::UnconnectedState));
      ui-&gt;statusBar-&gt;showMessage("Error occured: " + errorStr);
  
     // From QT5?
     QString errorS(QMetaEnum::fromType&lt;QCanBusDevice::CanBusError&gt;().valueToKey(error));
     ui-&gt;statusBar-&gt;showMessage("Error occured: " + errorS);
  }
  </code></pre>