-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathitem.cpp
48 lines (44 loc) · 903 Bytes
/
item.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
//This folder file is used to create the Item widget for the to-do-list
#include "item.h"
#include "ui_item.h"
#include "mainwindow.h"
Item::Item(QWidget *parent) :
QWidget(parent),
ui(new Ui::Item)
{
ui->setupUi(this);
ui->horizontalSlider->setMaximum(100);
connect(ui->horizontalSlider,SIGNAL(sliderReleased()),this,SLOT(func()));
}
void Item::func()
{
emit changeVal(getText(),getProgress());
}
Item::~Item()
{
delete ui;
}
void Item::on_pushButton_clicked()
{
if(ui->progressBar->value()==100){
emit itemdeleted(getText());
delete this;
}
}
void Item::setText(QString str)
{
ui->label->setText(str);
}
void Item::setProgress(int num)
{
ui->progressBar->setValue(num);
ui->horizontalSlider->setValue(num);
}
QString Item:: getText()
{
return ui->label->text();
}
int Item::getProgress()
{
return ui->progressBar->value();
}