mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-08-02 13:58:37 +00:00
fix: remove some warning on win
This commit is contained in:
parent
5ed8aa24a2
commit
9bc73af895
4 changed files with 8 additions and 7 deletions
|
@ -36,7 +36,7 @@ void Controller::postControlMsg(ControlMsg *controlMsg)
|
||||||
void Controller::test(QRect rc)
|
void Controller::test(QRect rc)
|
||||||
{
|
{
|
||||||
ControlMsg *controlMsg = new ControlMsg(ControlMsg::CMT_INJECT_TOUCH);
|
ControlMsg *controlMsg = new ControlMsg(ControlMsg::CMT_INJECT_TOUCH);
|
||||||
controlMsg->setInjectTouchMsgData(POINTER_ID_MOUSE, AMOTION_EVENT_ACTION_DOWN, AMOTION_EVENT_BUTTON_PRIMARY, rc, 1.0f);
|
controlMsg->setInjectTouchMsgData(static_cast<quint64>(POINTER_ID_MOUSE), AMOTION_EVENT_ACTION_DOWN, AMOTION_EVENT_BUTTON_PRIMARY, rc, 1.0f);
|
||||||
postControlMsg(controlMsg);
|
postControlMsg(controlMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
#define CONTROL_MSG_TEXT_MAX_LENGTH 300
|
#define CONTROL_MSG_TEXT_MAX_LENGTH 300
|
||||||
#define CONTROL_MSG_CLIPBOARD_TEXT_MAX_LENGTH 4093
|
#define CONTROL_MSG_CLIPBOARD_TEXT_MAX_LENGTH 4093
|
||||||
#define POINTER_ID_MOUSE UINT64_C(-1)
|
#define POINTER_ID_MOUSE static_cast<quint64>(-1)
|
||||||
// ControlMsg
|
// ControlMsg
|
||||||
class ControlMsg : public QScrcpyEvent
|
class ControlMsg : public QScrcpyEvent
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,7 +43,8 @@ void InputConvertNormal::mouseEvent(const QMouseEvent *from, const QSize &frameS
|
||||||
if (!controlMsg) {
|
if (!controlMsg) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
controlMsg->setInjectTouchMsgData(POINTER_ID_MOUSE, action, convertMouseButtons(from->buttons()), QRect(pos.toPoint(), frameSize), 1.0f);
|
controlMsg->setInjectTouchMsgData(
|
||||||
|
static_cast<quint64>(POINTER_ID_MOUSE), action, convertMouseButtons(from->buttons()), QRect(pos.toPoint(), frameSize), 1.0f);
|
||||||
sendControlMsg(controlMsg);
|
sendControlMsg(controlMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,7 +135,7 @@ AndroidMotioneventButtons InputConvertNormal::convertMouseButtons(Qt::MouseButto
|
||||||
if (buttonState & Qt::XButton2) {
|
if (buttonState & Qt::XButton2) {
|
||||||
buttons |= AMOTION_EVENT_BUTTON_FORWARD;
|
buttons |= AMOTION_EVENT_BUTTON_FORWARD;
|
||||||
}
|
}
|
||||||
return (AndroidMotioneventButtons)buttons;
|
return static_cast<AndroidMotioneventButtons>(buttons);
|
||||||
}
|
}
|
||||||
|
|
||||||
AndroidKeycode InputConvertNormal::convertKeyCode(int key, Qt::KeyboardModifiers modifiers)
|
AndroidKeycode InputConvertNormal::convertKeyCode(int key, Qt::KeyboardModifiers modifiers)
|
||||||
|
@ -338,5 +339,5 @@ AndroidMetastate InputConvertNormal::convertMetastate(Qt::KeyboardModifiers modi
|
||||||
// no mapping?
|
// no mapping?
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return (AndroidMetastate)metastate;
|
return static_cast<AndroidMetastate>(metastate);
|
||||||
}
|
}
|
||||||
|
|
|
@ -230,7 +230,7 @@ bool Stream::recvPacket(AVPacket *packet)
|
||||||
|
|
||||||
quint64 pts = bufferRead64be(header);
|
quint64 pts = bufferRead64be(header);
|
||||||
quint32 len = bufferRead32be(&header[8]);
|
quint32 len = bufferRead32be(&header[8]);
|
||||||
Q_ASSERT(pts == NO_PTS || (pts & 0x8000000000000000) == 0);
|
Q_ASSERT(pts == static_cast<quint64>(NO_PTS) || (pts & 0x8000000000000000) == 0);
|
||||||
Q_ASSERT(len);
|
Q_ASSERT(len);
|
||||||
|
|
||||||
if (av_new_packet(packet, len)) {
|
if (av_new_packet(packet, len)) {
|
||||||
|
@ -244,7 +244,7 @@ bool Stream::recvPacket(AVPacket *packet)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
packet->pts = pts != NO_PTS ? (int64_t)pts : AV_NOPTS_VALUE;
|
packet->pts = pts != NO_PTS ? static_cast<int64_t>(pts) : static_cast<int64_t>(AV_NOPTS_VALUE);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue