Hi, I'm new to QT and c++ and need some help. Im making a application for circuit board spesifications.

I have a class Panel which have a list of boards:QList<Board>, and in the Board class i have a Qlist of Layers, Qlist<Layer>. Im trying to modify my layer class values through two QLists, but the values wont budge. any idea?

Qt Code:
  1. //layer.h
  2. private:
  3. QString type;
  4. public:
  5. QString getType();
  6. void setType(QString newType);
  7.  
  8. //layer.cpp
  9. void layer::setType(QString newType){newType = type;}
  10. QString layer::getType(){return type;}
To copy to clipboard, switch view to plain text mode 


Qt Code:
  1. //board.h
  2. private:
  3. QList<layer> layers;
  4. public:
  5. void addLayer();
  6. QList<layer> getLayers();
  7.  
  8. //board.cpp
  9. QList<layer> Board::getLayers(){return layers;}
  10. void Board::addLayer(){
  11. layer new1;
  12. layers.append(new1);
  13. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. //panel.h
  2. QList<Board> b;
  3. Board testBoard;
  4.  
  5. //panel.cpp
  6. b.append(testBoard);
  7. b.operator [](0).addLayer(); //adding a layer is no problem
  8. b.operator [](0).getLayers().operator [](0).setType("nooo");
  9. //trying to set the value, but nothing happends.
  10. QString check = b.value(0).getLayers().value(0).getType();
  11. //the check value returns the initial value of type from the constructor.
To copy to clipboard, switch view to plain text mode 

I appreciate any help. Thx
Terje H