Skip to content

Commit e42bf81

Browse files
author
vijesh
committed
added the code for UI
1 parent 8a077a3 commit e42bf81

File tree

99 files changed

+26537
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+26537
-0
lines changed

UI/Reco.pro

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#-------------------------------------------------
2+
#
3+
# Project created by QtCreator 2013-05-02T12:46:55
4+
#
5+
#-------------------------------------------------
6+
7+
QT += core gui
8+
9+
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
10+
11+
TARGET = Reco
12+
TEMPLATE = app
13+
14+
15+
SOURCES += main.cpp\
16+
mainwindow.cpp \
17+
upload.cpp \
18+
firstwindow.cpp \
19+
userprofile.cpp \
20+
reducedimension.cpp \
21+
computesimilarity.cpp \
22+
clusterusers.cpp \
23+
recommend.cpp \
24+
whythiswindow.cpp \
25+
movielisty1.cpp \
26+
userproflisty2.cpp \
27+
displayy3.cpp \
28+
imageview.cpp \
29+
image.cpp
30+
31+
HEADERS += mainwindow.h \
32+
upload.h \
33+
firstwindow.h \
34+
userprofile.h \
35+
reducedimension.h \
36+
computesimilarity.h \
37+
clusterusers.h \
38+
recommend.h \
39+
whythiswindow.h \
40+
movielisty1.h \
41+
userproflisty2.h \
42+
displayy3.h \
43+
imageview.h \
44+
image.h
45+
46+
FORMS += mainwindow.ui \
47+
upload.ui \
48+
firstwindow.ui \
49+
userprofile.ui \
50+
reducedimension.ui \
51+
computesimilarity.ui \
52+
clusterusers.ui \
53+
recommend.ui \
54+
whythiswindow.ui \
55+
movielisty1.ui \
56+
userproflisty2.ui \
57+
displayy3.ui \
58+
image.ui

UI/Reco.pro.user

+239
Large diffs are not rendered by default.

UI/Reco.pro.user.08a826b

+239
Large diffs are not rendered by default.

UI/clusterusers.cpp

+149
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
#include "clusterusers.h"
2+
#include "ui_clusterusers.h"
3+
#include <QDebug>
4+
#include <QFile>
5+
#include <QTextStream>
6+
#include <QListWidget>
7+
#include <QListWidgetItem>
8+
9+
clusterusers::clusterusers(QWidget *parent) :
10+
QWidget(parent),
11+
ui(new Ui::clusterusers)
12+
{
13+
ui->setupUi(this);
14+
proc=new QProcess();
15+
showproc=new QProcess();
16+
connect(ui->next,SIGNAL(clicked()),this,SLOT(movenext()));
17+
connect(ui->back,SIGNAL(clicked()),this,SLOT(moveback()));
18+
connect(ui->clusteruser,SIGNAL(clicked()),this,SLOT(clusterclick()));
19+
connect(ui->show,SIGNAL(clicked()),this,SLOT(showclick()));
20+
connect(proc,SIGNAL(finished(int)),this,SLOT(clusterended()));
21+
connect(showproc,SIGNAL(finished(int)),this,SLOT(showprocended()));
22+
23+
24+
25+
26+
QFile file("/home/rakesh/Qt/Reco/python/db.txt");
27+
file.open(QIODevice::ReadOnly | QIODevice::Text);
28+
29+
QString path;
30+
31+
QTextStream in1(&file);
32+
path= in1.readLine();
33+
path=path+"/movielens_1m_userlist.json";
34+
qDebug()<<path;
35+
QFile fileopen(path);
36+
fileopen.open(QIODevice::ReadOnly | QIODevice::Text);
37+
QTextStream in(&fileopen);
38+
ui->userid->clear();
39+
while(!in.atEnd()) {
40+
QString item = in.readLine();
41+
ui->userid->addItem(item);
42+
qDebug()<<item;
43+
44+
45+
46+
}
47+
}
48+
49+
clusterusers::~clusterusers()
50+
{
51+
delete ui;
52+
}
53+
54+
void clusterusers::movenext()
55+
{
56+
57+
emit movetorecommend();
58+
}
59+
60+
void clusterusers::moveback()
61+
{
62+
emit movebacktocommputesimilarity();
63+
}
64+
65+
void clusterusers::clusterclick()
66+
{
67+
68+
QFile file("/home/rakesh/Qt/Reco/python/db.txt");
69+
file.open(QIODevice::ReadOnly | QIODevice::Text);
70+
71+
QString path;
72+
QTextStream in(&file);
73+
path= in.readLine();
74+
75+
76+
QFile file1("/home/rakesh/Qt/Reco/filename.txt");
77+
file1.open(QIODevice::ReadOnly | QIODevice::Text);
78+
QTextStream in1(&file1);
79+
80+
QString item = in1.readLine();
81+
82+
83+
path="python "+path+"/6_clusterUsers.py "+item;
84+
qDebug()<<path;
85+
proc->start(path);
86+
87+
ui->status_scrollarea->setWidget(new QLabel("running..."));
88+
89+
90+
}
91+
92+
void clusterusers::showclick()
93+
{
94+
QFile file("/home/rakesh/Qt/Reco/python/db.txt");
95+
file.open(QIODevice::ReadOnly | QIODevice::Text);
96+
97+
QString path;
98+
QTextStream in(&file);
99+
path= in.readLine();
100+
101+
102+
QFile file1("/home/rakesh/Qt/Reco/filename.txt");
103+
file1.open(QIODevice::ReadOnly | QIODevice::Text);
104+
QTextStream in1(&file1);
105+
106+
QString item = in1.readLine();
107+
108+
109+
path="python "+path+"/6_userCluster.py "+item+" "+ui->userid->currentText();
110+
qDebug()<<path;
111+
showproc->start(path);
112+
113+
ui->status_scrollarea->setWidget(new QLabel("running..."));
114+
}
115+
116+
void clusterusers::showprocended()
117+
{
118+
ui->status_scrollarea->setWidget(new QLabel("ended"));
119+
QFile file("/home/rakesh/Qt/Reco/python/db.txt");
120+
file.open(QIODevice::ReadOnly | QIODevice::Text);
121+
122+
QString path;
123+
124+
QTextStream in1(&file);
125+
path= in1.readLine();
126+
path=path+"/movielens_1m_userClusters.json";
127+
qDebug()<<path;
128+
QFile fileopen(path);
129+
fileopen.open(QIODevice::ReadOnly | QIODevice::Text);
130+
QTextStream in(&fileopen);
131+
QListWidget *list=new QListWidget();
132+
ui->scrollArea->setWidget(list);
133+
while(!in.atEnd()) {
134+
QString item = in.readLine();
135+
QListWidgetItem *t=new QListWidgetItem(item,list);
136+
137+
qDebug()<<item;
138+
139+
140+
141+
}
142+
143+
144+
}
145+
146+
void clusterusers::clusterended()
147+
{
148+
ui->status_scrollarea->setWidget(new QLabel("completed...press show to display image"));
149+
}

UI/clusterusers.h

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#ifndef CLUSTERUSERS_H
2+
#define CLUSTERUSERS_H
3+
4+
#include <QWidget>
5+
#include <QProcess>
6+
7+
namespace Ui {
8+
class clusterusers;
9+
}
10+
11+
class clusterusers : public QWidget
12+
{
13+
Q_OBJECT
14+
15+
public:
16+
QProcess *proc;
17+
QProcess *showproc;
18+
explicit clusterusers(QWidget *parent = 0);
19+
~clusterusers();
20+
21+
private:
22+
Ui::clusterusers *ui;
23+
24+
public slots:
25+
void movenext();
26+
void moveback();
27+
void clusterclick();
28+
void showclick();
29+
void showprocended();
30+
void clusterended();
31+
32+
signals:
33+
void movetorecommend();
34+
void movebacktocommputesimilarity();
35+
36+
};
37+
38+
#endif // CLUSTERUSERS_H

0 commit comments

Comments
 (0)