-
Notifications
You must be signed in to change notification settings - Fork 0
/
youreventlabel.cpp
33 lines (29 loc) · 972 Bytes
/
youreventlabel.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
#include "youreventlabel.h"
YourEventLabel::YourEventLabel(QWidget* parent, Event* _event) : EventLabel(parent)
{
currEvent = _event;
this->setStyleSheet("background-color: rgba(240, 54, 60, 50);text-align: center; ");
QFont font = this->font();
font.setPointSize(8);
this->setFont(font);
this->setAlignment(Qt::AlignCenter);
this->show();
QObject::connect(this, SIGNAL(showDetailSignal(Event*)), (MainWindow*)this->parent(), SLOT(showDetail(Event*)));
}
//点击一次
void YourEventLabel::mousePressEvent(QMouseEvent *event) {
//左键,显示高亮
if(event->button() == Qt::LeftButton)
{
((MainWindow*)parent())->eventsLoseFocus();
this->setStyleSheet(((MainWindow*)this->parent())->yourColorFocus);
emit showDetailSignal(currEvent);
event->accept();
}
// 无修改权限
}
//点击两次
void YourEventLabel::mouseDoubleClickEvent(QMouseEvent *event)
{
// 无修改权限
}