-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathoperatewidget.cpp
63 lines (51 loc) · 1.51 KB
/
operatewidget.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
54
55
56
57
58
59
60
61
62
63
#include "StdAfx.h"
#include "operatewidget.h"
#include "playwindow.h"
#include "messagewindow.h"
OperateWidget::OperateWidget(QWidget *parent)
: QWidget(parent)
{
InitControl();
}
OperateWidget::~OperateWidget()
{
}
void OperateWidget::InitControl()
{
m_pPlayPushButton = new QPushButton();
m_pPlayPushButton->setObjectName("blueButton");
m_pPlayPushButton->setText(tr("Play"));
m_pPlayPushButton->setFixedWidth(50);
m_pPlayPushButton->setCursor(Qt::PointingHandCursor);
connect(m_pPlayPushButton, SIGNAL(clicked()), this, SLOT(on_playPushButton_clicked()));
m_pDownloadPushButton = new QPushButton();
m_pDownloadPushButton->setObjectName("blueButton");
m_pDownloadPushButton->setText(tr("Download"));
m_pDownloadPushButton->setFixedWidth(50);
m_pDownloadPushButton->setCursor(Qt::PointingHandCursor);
connect(m_pDownloadPushButton, SIGNAL(clicked()), this, SLOT(on_downloadPushButton_clicked()));
QHBoxLayout *layout = new QHBoxLayout();
layout->setSpacing(0);
layout->setContentsMargins(10, 0, 10, 0);
layout->addWidget(m_pPlayPushButton);
layout->addStretch();
layout->addWidget(m_pDownloadPushButton);
setLayout(layout);
}
void OperateWidget::SetInfo(const KadResult& kadResult, bool isVideo)
{
m_kadResult = kadResult;
m_pPlayPushButton->setVisible(isVideo);
}
void OperateWidget::on_playPushButton_clicked()
{
QStringList list;
list << m_kadResult.Ed2k;
emit playLink(list);
}
void OperateWidget::on_downloadPushButton_clicked()
{
QStringList list;
list << m_kadResult.Ed2k;
emit downloadLink(list);
}