后端接口。它由协议插件实现。 它默认启动一个定时器来开启一个非 Qt 事件循环(就是普通的循环处理)。 详见: Start()、 slotTimeOut()、 OnProcess() 。 当然,它仍然支持 Qt 事件(QObject 的 信号 - 槽 机制)。
更多...
#include <Backend.h>
|
void | sigRunning () |
| 当插件开始成功后触发。仅由插件触发
|
|
void | sigStop () |
| 需要通知用户停止时触发。仅由插件触发。 当从插件中需要停止时触发。例如:对端断开连接、重置连接或者连接出错。
|
|
void | sigFinished () |
| 停止成功信号。仅由插件触发
|
|
void | sigError (const int nError, const QString &szError=QString()) |
| 当有错误产生时触发
|
|
void | sigInformation (const QString &szInfo) |
| 从后台线程中触发在主线程中显示信息,不阻塞后台线程
|
|
void | sigShowMessageBox (const QString &szTitle, const QString &szMessage, const QMessageBox::Icon &icon=QMessageBox::Information) |
| 从后台线程中触发在主线程中显示消息对话框(QMessageBox),不阻塞后台线程
|
|
void | sigBlockShowMessageBox (const QString &szTitle, const QString &szMessage, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton &nRet, bool &checkBox, QString checkBoxContext=QString()) |
| 阻塞后台线程,并在前台线程中显示消息对话框(QMessageBox)
|
|
void | sigBlockInputDialog (const QString &szTitle, const QString &szLable, const QString &szMessage, QString &szText) |
| 阻塞后台线程,并在前台线程中显示输入对话框 (QInputDialog)
|
|
void | sigBlockShowWidget (const QString &className, int &nRet, void *pContext) |
| 阻塞后台线程,并在前台线程中显示窗口。
|
|
|
| CBackend (COperate *pOperate=nullptr) |
|
virtual int | Start () |
| 开始。根据 OnInit() 返回值来决定是否开始定时器来支持非 qt 事件
|
|
virtual int | Stop () |
| 停止
|
|
virtual int | WakeUp () |
| Wake up.
|
|
|
enum class | OnInitReturnValue { Fail = -1
, Success = 0
, UseOnProcess = Success
, NotUseOnProcess = 1
} |
|
后端接口。它由协议插件实现。 它默认启动一个定时器来开启一个非 Qt 事件循环(就是普通的循环处理)。 详见: Start()、 slotTimeOut()、 OnProcess() 。 当然,它仍然支持 Qt 事件(QObject 的 信号 - 槽 机制)。
- 注解
- 这个接口仅由插件实现。
- 如果是异步的(有后台线程),它的实例在后台线程中。
- 具体的插件需要实现下面接口:
- 参见
- CBackendThread::run() CFrmViewer
在文件 Backend.h 第 41 行定义.
◆ OnInitReturnValue
enum class CBackend::OnInitReturnValue |
|
strongprotected |
◆ ~CBackend()
◆ OnClean()
virtual int CBackend::OnClean |
( |
| ) |
|
|
protectedpure virtual |
◆ OnInit()
virtual OnInitReturnValue CBackend::OnInit |
( |
| ) |
|
|
protectedpure virtual |
◆ OnProcess()
int CBackend::OnProcess |
( |
| ) |
|
|
protectedvirtual |
◆ SetConnect()
int CBackend::SetConnect |
( |
COperate * |
pOperate | ) |
|
|
private |
◆ sigBlockInputDialog
void CBackend::sigBlockInputDialog |
( |
const QString & |
szTitle, |
|
|
const QString & |
szLable, |
|
|
const QString & |
szMessage, |
|
|
QString & |
szText |
|
) |
| |
|
signal |
◆ sigBlockShowMessageBox
void CBackend::sigBlockShowMessageBox |
( |
const QString & |
szTitle, |
|
|
const QString & |
szMessage, |
|
|
QMessageBox::StandardButtons |
buttons, |
|
|
QMessageBox::StandardButton & |
nRet, |
|
|
bool & |
checkBox, |
|
|
QString |
checkBoxContext = QString() |
|
) |
| |
|
signal |
◆ sigBlockShowWidget
void CBackend::sigBlockShowWidget |
( |
const QString & |
className, |
|
|
int & |
nRet, |
|
|
void * |
pContext |
|
) |
| |
|
signal |
◆ sigFinished
void CBackend::sigFinished |
( |
| ) |
|
|
signal |
◆ sigInformation
void CBackend::sigInformation |
( |
const QString & |
szInfo | ) |
|
|
signal |
◆ sigShowMessageBox
void CBackend::sigShowMessageBox |
( |
const QString & |
szTitle, |
|
|
const QString & |
szMessage, |
|
|
const QMessageBox::Icon & |
icon = QMessageBox::Information |
|
) |
| |
|
signal |
◆ slotTimeOut
void CBackend::slotTimeOut |
( |
| ) |
|
|
protectedvirtualslot |
◆ Start()
◆ Stop()
◆ WakeUp()
该类的文档由以下文件生成:
- /home/runner/work/RabbitRemoteControl/RabbitRemoteControl/Src/Backend.h
- /home/runner/work/RabbitRemoteControl/RabbitRemoteControl/Src/Backend.cpp