Hello everybody,
i have an xml file which i read during start-up and write when the programm is quit.
The dataset is read into a qmap during parsing. Two parameters i read through the process are form typ enum.


Qt Code:
  1. ///*! Enum for xxx names*/
  2. typedef enum {
  3. x1 = 0, /***/
  4. x3, /***/
  5. x8, /***/
  6. undefined_xxNames /***/
  7. }EnumxxNames;
  8. QString getEnumxxNames(EnumxxNames element);
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. QString graphicsEnum::getEnumxxNames(EnumxxNames element)
  2. {
  3. switch(element)
  4. {
  5. case x1:
  6. return QString("x1");
  7. case x3:
  8. return QString("x3");
  9. case x8:
  10. return QString("x8");
  11. default:
  12. return QString::number(element);
  13. }
  14. }
To copy to clipboard, switch view to plain text mode 

in xml parser

Qt Code:
  1. qDebug()<<readItem(xx,getStringXMLItem(Properties),getStringXMLItemProperties(xxName));
To copy to clipboard, switch view to plain text mode 
Note readItem gives back a Qstring -->
reads out x1, x3,x8

if i want to conert that back to the enum using static cast

Qt Code:
  1. qDebug()<<getEnumxxNames(static_cast<EnumxxNames>(readItem(xx,getStringXMLItem(Properties),getStringXMLItemProperties(xxName)));
To copy to clipboard, switch view to plain text mode 
reads out x8

why is that...what is wrong here....
Is there a other way to get this done ?