玉兔远程控制 0.1.0-bate11
载入中...
搜索中...
未找到
CFrmViewer类 参考

用于显示从 CConnectDesktop 输出的图像,和向 CConnectDesktop 发送键盘、鼠标事件。 更多...

#include <FrmViewer.h>

类 CFrmViewer 继承关系图:
CFrmViewer 的协作图:

Public 类型

enum class  ADAPT_WINDOWS {
  Disable = 0 , Auto = 1 , Original = 2 , OriginalCenter = 3 ,
  Zoom = 4 , ZoomToWindow = 5 , KeepAspectRationToWindow = 6
}
 窗口适配枚举常量 更多...
enum  LED_STATE { Unknown = -1 , ScrollLock = 1 , NumLock = 1 << 1 , CapsLock = 1 << 2 }

Public 槽

void slotSetAdaptWindows (CFrmViewer::ADAPT_WINDOWS aw=ADAPT_WINDOWS::Original)
int slotSetZoomFactor (double newZoomFactor)
void slotSetDesktopSize (int width, int height)
 Update desktop size
void slotSetName (const QString &szName)
 Update desktop name
void slotUpdateRect (const QRect &r, const QImage &image)
 Update image
void slotUpdateRect (const QImage &image)
void slotUpdateCursor (const QCursor &cursor)
 Update cursor
void slotUpdateCursorPosition (const QPoint &pos)
 Update cursor position
void slotUpdateLedState (unsigned int state)
void slotRunning ()
 Enable mouse and keyboard
void slotEnableInputMethod (bool bEnable)
 Enable input method
void slotRecordVideo (bool bRecord, qreal nRate=0)
void slotRecordVideo ()

信号

void sigMousePressEvent (QMouseEvent *event, QPoint pos)
void sigMouseReleaseEvent (QMouseEvent *event, QPoint pos)
void sigMouseMoveEvent (QMouseEvent *event, QPoint pos)
void sigMouseMoveEvent (QMouseEvent *event)
void sigWheelEvent (QWheelEvent *event, QPoint pos)
void sigKeyPressEvent (QKeyEvent *event)
void sigKeyReleaseEvent (QKeyEvent *event)
void sigInputMethodEvent (QInputMethodEvent *event)
void sigServerName (const QString &szName)
void sigViewerFocusIn (QWidget *pView)
 视图获得焦点
void sigRecordVideo (const QImage &img)

Public 成员函数

 CFrmViewer (QWidget *parent=nullptr)
ADAPT_WINDOWS GetAdaptWindows ()
double GetZoomFactor () const
 调整缩放系数。 调整完成后需要调用 SetAdaptWindows(FrmViewer::Zoom) 缩放窗口大小。
QSize GetDesktopSize ()
virtual QImage GrabImage (int x=0, int y=0, int w=-1, int h=-1)

Protected 成员函数

virtual void paintEvent (QPaintEvent *event) override
virtual void focusInEvent (QFocusEvent *event) override
virtual void focusOutEvent (QFocusEvent *event) override
virtual void mousePressEvent (QMouseEvent *event) override
virtual void mouseReleaseEvent (QMouseEvent *event) override
virtual void mouseMoveEvent (QMouseEvent *event) override
virtual void wheelEvent (QWheelEvent *event) override
virtual void keyPressEvent (QKeyEvent *event) override
virtual void keyReleaseEvent (QKeyEvent *event) override
virtual void inputMethodEvent (QInputMethodEvent *event) override
virtual QVariant inputMethodQuery (Qt::InputMethodQuery query) const override

属性

double ZoomFactor

Private 成员函数

int ReSize (int width, int height)
void paintDesktop ()
int PointToRemote (const QPointF &inPos, QPointF &outPos)
int PointFromRemote (const QPointF &inPos, QPointF &outPos)
QRectF GetAspectRationRect ()

Private 属性

QImage m_Desktop
QSize m_DesktopSize
ADAPT_WINDOWS m_AdaptWindows
double m_dbZoomFactor
QTimer m_TimerRecordVideo
bool m_bRecordVideo

详细描述

用于显示从 CConnectDesktop 输出的图像,和向 CConnectDesktop 发送键盘、鼠标事件。

参见
CConnecter CConnectDesktop

在文件 FrmViewer.h47 行定义.

成员枚举类型说明

◆ ADAPT_WINDOWS

enum class CFrmViewer::ADAPT_WINDOWS
strong

窗口适配枚举常量

枚举值
Disable 

禁用适配窗口

Original 

原始桌面大小,桌面的左上点与窗口的左上点对齐

OriginalCenter 

原始桌面大小,桌面中心点与窗口中心点对齐

Zoom 

缩放窗口大小等于桌面大小 * 系数

ZoomToWindow 

桌面缩放到窗口大小,窗口是固定的

KeepAspectRationToWindow 

保持长宽比缩放到窗口大小,窗口是固定的

在文件 FrmViewer.h60 行定义.

◆ LED_STATE

enum CFrmViewer::LED_STATE

在文件 FrmViewer.h89 行定义.

构造及析构函数说明

◆ CFrmViewer()

Client FrmViewer static Key Client FrmViewer InputMethod CFrmViewer::CFrmViewer ( QWidget * parent = nullptr)
explicit

在文件 FrmViewer.cpp27 行定义.

◆ ~CFrmViewer()

CFrmViewer::~CFrmViewer ( )
overridevirtual

在文件 FrmViewer.cpp56 行定义.

成员函数说明

◆ focusInEvent()

void CFrmViewer::focusInEvent ( QFocusEvent * event)
overrideprotectedvirtual

在文件 FrmViewer.cpp651 行定义.

◆ focusOutEvent()

void CFrmViewer::focusOutEvent ( QFocusEvent * event)
overrideprotectedvirtual

在文件 FrmViewer.cpp657 行定义.

◆ GetAdaptWindows()

CFrmViewer::ADAPT_WINDOWS CFrmViewer::GetAdaptWindows ( )

在文件 FrmViewer.cpp392 行定义.

◆ GetAspectRationRect()

QRectF CFrmViewer::GetAspectRationRect ( )
private

在文件 FrmViewer.cpp61 行定义.

◆ GetDesktopSize()

QSize CFrmViewer::GetDesktopSize ( )

在文件 FrmViewer.cpp345 行定义.

◆ GetZoomFactor()

double CFrmViewer::GetZoomFactor ( ) const

调整缩放系数。 调整完成后需要调用 SetAdaptWindows(FrmViewer::Zoom) 缩放窗口大小。

在文件 FrmViewer.cpp350 行定义.

◆ GrabImage()

QImage CFrmViewer::GrabImage ( int x = 0,
int y = 0,
int w = -1,
int h = -1 )
virtual

在文件 FrmViewer.cpp615 行定义.

◆ inputMethodEvent()

void CFrmViewer::inputMethodEvent ( QInputMethodEvent * event)
overrideprotectedvirtual

在文件 FrmViewer.cpp300 行定义.

◆ inputMethodQuery()

QVariant CFrmViewer::inputMethodQuery ( Qt::InputMethodQuery query) const
overrideprotectedvirtual

在文件 FrmViewer.cpp314 行定义.

◆ keyPressEvent()

void CFrmViewer::keyPressEvent ( QKeyEvent * event)
overrideprotectedvirtual

在文件 FrmViewer.cpp286 行定义.

◆ keyReleaseEvent()

void CFrmViewer::keyReleaseEvent ( QKeyEvent * event)
overrideprotectedvirtual

在文件 FrmViewer.cpp293 行定义.

◆ mouseMoveEvent()

void CFrmViewer::mouseMoveEvent ( QMouseEvent * event)
overrideprotectedvirtual

在文件 FrmViewer.cpp250 行定义.

◆ mousePressEvent()

void CFrmViewer::mousePressEvent ( QMouseEvent * event)
overrideprotectedvirtual

在文件 FrmViewer.cpp210 行定义.

◆ mouseReleaseEvent()

void CFrmViewer::mouseReleaseEvent ( QMouseEvent * event)
overrideprotectedvirtual

在文件 FrmViewer.cpp233 行定义.

◆ paintDesktop()

void CFrmViewer::paintDesktop ( )
private

在文件 FrmViewer.cpp89 行定义.

◆ paintEvent()

void CFrmViewer::paintEvent ( QPaintEvent * event)
overrideprotectedvirtual

在文件 FrmViewer.cpp133 行定义.

◆ PointFromRemote()

int CFrmViewer::PointFromRemote ( const QPointF & inPos,
QPointF & outPos )
private

在文件 FrmViewer.cpp179 行定义.

◆ PointToRemote()

int CFrmViewer::PointToRemote ( const QPointF & inPos,
QPointF & outPos )
private

在文件 FrmViewer.cpp141 行定义.

◆ ReSize()

int CFrmViewer::ReSize ( int width,
int height )
private

在文件 FrmViewer.cpp364 行定义.

◆ slotEnableInputMethod

void CFrmViewer::slotEnableInputMethod ( bool bEnable)
slot

Enable input method

在文件 FrmViewer.cpp339 行定义.

◆ slotRecordVideo [1/2]

void CFrmViewer::slotRecordVideo ( )
slot

在文件 FrmViewer.cpp646 行定义.

◆ slotRecordVideo [2/2]

void CFrmViewer::slotRecordVideo ( bool bRecord,
qreal nRate = 0 )
slot

在文件 FrmViewer.cpp625 行定义.

◆ slotRunning

void CFrmViewer::slotRunning ( )
slot

Enable mouse and keyboard

在文件 FrmViewer.cpp410 行定义.

◆ slotSetAdaptWindows

void CFrmViewer::slotSetAdaptWindows ( CFrmViewer::ADAPT_WINDOWS aw = ADAPT_WINDOWS::Original)
slot

在文件 FrmViewer.cpp372 行定义.

◆ slotSetDesktopSize

void CFrmViewer::slotSetDesktopSize ( int width,
int height )
slot

Update desktop size

参数
width
height
注解
The plugin is use CConnectDesktop::sigSetDesktopSize

在文件 FrmViewer.cpp397 行定义.

◆ slotSetName

void CFrmViewer::slotSetName ( const QString & szName)
slot

Update desktop name

参数
szName

在文件 FrmViewer.cpp415 行定义.

◆ slotSetZoomFactor

int CFrmViewer::slotSetZoomFactor ( double newZoomFactor)
slot

在文件 FrmViewer.cpp355 行定义.

◆ slotUpdateCursor

void CFrmViewer::slotUpdateCursor ( const QCursor & cursor)
slot

Update cursor

参数
cursor

在文件 FrmViewer.cpp458 行定义.

◆ slotUpdateCursorPosition

void CFrmViewer::slotUpdateCursorPosition ( const QPoint & pos)
slot

Update cursor position

参数
pos

在文件 FrmViewer.cpp469 行定义.

◆ slotUpdateLedState

void CFrmViewer::slotUpdateLedState ( unsigned int state)
slot

在文件 FrmViewer.cpp530 行定义.

◆ slotUpdateRect [1/2]

void CFrmViewer::slotUpdateRect ( const QImage & image)
slot

在文件 FrmViewer.cpp421 行定义.

◆ slotUpdateRect [2/2]

void CFrmViewer::slotUpdateRect ( const QRect & r,
const QImage & image )
slot

Update image

参数
rimage rect
imageimage

在文件 FrmViewer.cpp433 行定义.

◆ wheelEvent()

void CFrmViewer::wheelEvent ( QWheelEvent * event)
overrideprotectedvirtual

在文件 FrmViewer.cpp271 行定义.

类成员变量说明

◆ m_AdaptWindows

ADAPT_WINDOWS CFrmViewer::m_AdaptWindows
private

在文件 FrmViewer.h181 行定义.

◆ m_bRecordVideo

bool CFrmViewer::m_bRecordVideo
private

在文件 FrmViewer.h200 行定义.

◆ m_dbZoomFactor

double CFrmViewer::m_dbZoomFactor
private

在文件 FrmViewer.h182 行定义.

◆ m_Desktop

QImage CFrmViewer::m_Desktop
private

在文件 FrmViewer.h178 行定义.

◆ m_DesktopSize

QSize CFrmViewer::m_DesktopSize
private

在文件 FrmViewer.h179 行定义.

◆ m_TimerRecordVideo

QTimer CFrmViewer::m_TimerRecordVideo
private

在文件 FrmViewer.h199 行定义.

属性说明

◆ ZoomFactor

double CFrmViewer::ZoomFactor
readwrite

在文件 FrmViewer.h50 行定义.


该类的文档由以下文件生成: