Guest User

Untitled

a guest
Oct 19th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. class Field : public QAbstractListModel
  2. {
  3. Q_OBJECT
  4. public:
  5. Field(int width = 0, int height = 0);
  6.  
  7. QVector<int>& operator[](int n) {return (v_field.begin()[n]);}
  8.  
  9. private:
  10. int width, height;
  11. QVector< QVector<int> > v_field;
  12.  
  13. };
  14.  
  15. field[0][0] = 0; // Экземпляр класса Field
  16.  
  17. qDebug() << "<<<<<<<<<<" << this->field[0][0];
  18.  
  19. QVector<int>& operator[](int n) {return v_field[n];}
  20. const QVector<int>& operator[](int n) const {return v_field[n];}
Add Comment
Please, Sign In to add comment