-
Notifications
You must be signed in to change notification settings - Fork 0
/
friendsearch.cpp
53 lines (39 loc) · 1.18 KB
/
friendsearch.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
46
47
48
49
50
51
52
53
#include "friendsearch.h"
#include "ui_friendsearch.h"
friendsearch::friendsearch(QWidget *parent) :
QDialog(parent),
ui(new Ui::friendsearch)
{
ui->setupUi(this);
}
friendsearch::~friendsearch()
{
delete ui;
}
void friendsearch::on_lineEdit_returnPressed()
{
if(ui->lineEdit->text()!="" || ui->lineEdit->text()==" "){
ui->listWidget->clear();
// qDebug("hard return");
emit search_keyout(ui->lineEdit->text());
}
}
void friendsearch::name_in(QString name){
if(!namelister.contains(name)){
ui->listWidget->addItem(name);
}
}
void friendsearch::on_listWidget_clicked(const QModelIndex &index)
{
}
void friendsearch::on_listWidget_doubleClicked(const QModelIndex &index)
{
QMessageBox::StandardButton reply;
reply = QMessageBox::question(this, "Add Friend", "Send a Friend Request to "+ui->listWidget->currentItem()->text()+" ?",
QMessageBox::Yes|QMessageBox::No);
if (reply == QMessageBox::Yes) {
emit friend_request(ui->listWidget->currentItem()->text());
ui->listWidget->takeItem(ui->listWidget->row(ui->listWidget->currentItem()));
} else {
}
}