Hi ,

when I compile my code, i have error :

ERROR Code:
  1. passing 'const QList<Element>' as 'this' argument of 'QList<T>& QList<T>::operator<<(const T&) [with T = Element]' discards qualifiers
To copy to clipboard, switch view to plain text mode 

My class "Element" :

Element Code:
  1. class Element
  2. {
  3. public:
  4. Element();
  5. Element(QString Aleja,QString Numer,QString Strona);
  6. QString Aleja;
  7. QString Numer;
  8. QString Strona;
  9. };
To copy to clipboard, switch view to plain text mode 


And class "Strona" :
Strona Code:
  1. class Strona
  2. {
  3. public:
  4. Strona();
  5. QList<Element> listElementow;
  6. Element pobierzElement(QString NumerElementu);
  7. Element pobierzElement(int Index);
  8. void dodajElement(QString NrAleji,QString NrElementu,QString NrStrony) const;
  9. };
To copy to clipboard, switch view to plain text mode 

and function where i have arror:
Strona::dodajElement Code:
  1. void Strona::dodajElement(QString NrAleji,QString NrElementu,QString NrStrony) const{
  2. listElementow << Element(NrAleji,NrElementu,NrStrony);
  3. }
To copy to clipboard, switch view to plain text mode 
So how a resolved this problem?