-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcvideodlg.cpp
More file actions
46 lines (34 loc) · 865 Bytes
/
Copy pathcvideodlg.cpp
File metadata and controls
46 lines (34 loc) · 865 Bytes
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
#include <QPainter>
#include "cvideodlg.h"
#include "qtphonedlg.h"
CVideoDlg::CVideoDlg(QtPhoneDlg *dlg)
: QDialog(0)
{
ui.setupUi(this);
installEventFilter(this);
setWindowFlags(windowFlags() | Qt::WindowMinMaxButtonsHint);
p_dlg = dlg;
}
CVideoDlg::~CVideoDlg()
{
}
void CVideoDlg::closeEvent(QCloseEvent *ev)
{
p_dlg->slot_ShowVideoPanels(false);
}
bool CVideoDlg::eventFilter(QObject *obj, QEvent *event)
{
if (event->type() == QEvent::Paint)
{
QPainter painter(this);
QRect tRect = geometry();
painter.fillRect(tRect, Qt::black);
m_mutex.lock();
if(!m_image.isNull())
painter.drawImage(0, 0, m_image.scaled(tRect.width(), tRect.height(), Qt::KeepAspectRatio));
//painter.drawImage(0,0, m_image);
m_mutex.unlock();
return true;
}
return QObject::eventFilter(obj, event);
}