-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCProjectPushButton.cpp
More file actions
35 lines (31 loc) · 1.03 KB
/
CProjectPushButton.cpp
File metadata and controls
35 lines (31 loc) · 1.03 KB
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
#include "CProjectPushButton.h"
#include <QFileInfo>
CProjectPushButton::CProjectPushButton(QString a_sPath, QWidget *parent) :
QPushButton(parent),
m_sPath(a_sPath)
{
QFileInfo tempFileinfo(m_sPath);
QString ProjectName = tempFileinfo.baseName();
this->setText(ProjectName + "\n" + m_sPath);
this->setFlat(true);
this->setStyleSheet("QPushButton{"
"background-color : rgb(65,65,65);"
"color : white;"
"text-align : left;"
"border : none;"
"}"
"QPushButton:hover{"
"background-color : rgb(75,75,75);"
"color : rgb(255, 170, 0);"
"text-align : left;"
"border : none;"
"}");
connect(this, SIGNAL(clicked(bool)), this, SLOT(onClick(bool)));
}
CProjectPushButton::~CProjectPushButton()
{
}
void CProjectPushButton::onClick(bool)
{
emit onClick(m_sPath);
}