Hi
I have the following code defining a template class
Qt Code:
  1. template<class T>
  2. class TemplateClass
  3. {
  4. public:
  5. TemplateClass();
  6. virtual ~TemplateClass() {}
  7. void add (T key, QString value);
  8. void get(QStringList &theStrings) const;
  9.  
  10. private:
  11. QMap<T,QString> m_strings;
  12.  
  13. };
  14.  
  15. template<class T> TemplateClass<T>::TemplateClass()
  16. {
  17.  
  18. }
  19.  
  20. template<class T> void TemplateClass<T>::add (T key, QString value)
  21. {
  22. m_strings[key] = value;
  23. }
  24.  
  25. template<class T> void TemplateClass<T>::getComboBoxStrings(QStringList &theStrings) const
  26. {
  27. QMap<T,QString>::iterator it;
To copy to clipboard, switch view to plain text mode 

When compiled I get the following error regarding the declaration of the iterator

Qt Code:
  1. MyClass.h: In member function 'void TemplateClass<T>::getComboBoxStrings(QStringList&) const':
  2. MyClass.h:74: error: expected ';' before 'it'
To copy to clipboard, switch view to plain text mode 

Could someone tell me why this is and error