#include "friend.h" #include "friendlist.h" #include QList FriendList::friendList; Friend* FriendList::addFriend(int friendId, QString userId) { Friend* newfriend = new Friend(friendId, userId); friendList.append(newfriend); return newfriend; } Friend* FriendList::findFriend(int friendId) { for (Friend* f : friendList) if (f->friendId == friendId) return f; return nullptr; } void FriendList::removeFriend(int friendId) { for (int i=0; ifriendId == friendId) { friendList.removeAt(i); return; } } }