-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuserlist.cpp
45 lines (38 loc) · 851 Bytes
/
userlist.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "userlist.h"
UserList::UserList(UserList *userList)
{
*this = *userList;
}
UserList::UserList(QVector<QVariant> model)
{
// init QVector
this->list = new QVector<User*>();
// generate user and add to list
// user has 7 propertys so i = i + 7
if(model.size()>1){
for (int i = 0; i<model.size(); i=i+7)
{
// create new Level
User* temp = new User(model.mid(i, 7));
// add pointer to list
this->userEintragen(temp);
}
}
}
int UserList::userZaehlen()
{
return this->list->size();
}
User* UserList::userHolen(int index)
{
return this->list->at(index);
}
void UserList::userEntfernen(int index)
{
delete this->list->at(index);
this->list->remove(index);
}
void UserList::userEintragen(User* u)
{
this->list->append(u);
}