-
Notifications
You must be signed in to change notification settings - Fork 4
/
webaxwidget.cpp
66 lines (52 loc) · 1.22 KB
/
webaxwidget.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
64
65
66
#include "stdafx.h"
#include "webaxwidget.h"
#include "windows.h"
WebAxWidget::WebAxWidget(QWidget* parent, Qt::WindowFlags f)
: QAxWidget(parent, f)
{
setControl("{8856F961-340A-11D0-A96B-00C04FD705A2}");
//setFocusPolicy(Qt::StrongFocus);
dynamicCall("SetSilent(bool)", true);
}
WebAxWidget::~WebAxWidget()
{
}
bool WebAxWidget::translateKeyEvent(int message, int keycode) const
{
if (message >= WM_KEYFIRST && message <= WM_KEYLAST)
{
return true;
}
else
{
return QAxWidget::translateKeyEvent(message, keycode);
}
}
bool WebAxWidget::eventFilter(QObject *obj, QEvent *event)
{
return QAxWidget::eventFilter(obj, event);
}
bool WebAxWidget::nativeEvent(const QByteArray &eventType, void *message, long *result)
{
//MSG* msg = reinterpret_cast<MSG*>(message);
//qDebug() << msg->message;
//switch(msg->message)
//{
//case WM_NCACTIVATE:
//case WM_SETFOCUS:
//case WM_KILLFOCUS:
//}
return QAxWidget::nativeEvent(eventType, message, result);
}
void WebAxWidget::cppCall(const QString& key, const QString& value)
{
qDebug() << key << value;
if(key == "SearchKey")
{
m_signaler.EmitSearchKey(value);
}
else if(key == "openVodClientWindow")
{
dynamicCall("Navigate(const QString&)", value);
}
}