I have two classes: "numberItem" and "numberLine".

The first is derived from QGraphicsRectItem. It works just fine by itself.

The other one is not really a class - more of a C-style struct - in the sense that all I would like to do is use it as a container for a bunch of related information. Among other things, I want it to contain an array of pointers to the first class.

Below is a simplified version of my code. Can anyone tell me what I'm doing wrong? Thanks so much!

First class:
Qt Code:
  1. class numberItem : public QGraphicsRectItem
  2. {
  3. public:
  4. numberItem(int cell_width);
  5. private:
  6. int cell_width;
  7. };
  8.  
  9. // Constructor for numberItem
  10. numberItem::numberItem(int w = 5)
  11. : cell_width(w)
  12. {
  13. }
To copy to clipboard, switch view to plain text mode 

Second class:
Qt Code:
  1. class numberLine
  2. {
  3. public:
  4. // IF I COMMENT OUT THIS LINE, IT COMPILES JUST FINE
  5. QList<numberItem> all_number_items;
  6.  
  7. QList<int> all_x;
  8. int num;
  9. };
To copy to clipboard, switch view to plain text mode 

An the rest of the code:
Qt Code:
  1. numberLine get_num_line();
  2.  
  3. int main(int argc, char **argv){
  4. QApplication app(argc, argv);
  5.  
  6. numberLine num_line;
  7. num_line = get_num_line();
  8.  
  9. return app.exec();
  10. }
  11.  
  12. numberLine get_num_line()
  13. {
  14. numberLine x;
  15. return x;
  16. }
To copy to clipboard, switch view to plain text mode 

When I try to compile, I get a whole litany of unintelligible errors:
instantiated from `void QList<T>::node_copy(QList<T>::Node*, QList<T>::Node*, QList<T>::Node*) [with T = numberItem]'
instantiated from `void QList<T>::detach_helper() [with T = numberItem]'
instantiated from `QList<T>::QList(const QList<T>&) [with T = numberItem]'
instantiated from here
error: `QGraphicsRectItem::QGraphicsRectItem(const QGraphicsRectItem&)' is private