| QCefView 1.0.7 A QWidget-based WebView Component Integrated with CEF

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
QCefQuery

Represents the query request sent from the web content(Javascript) More...

`#include <QCefQuery.h>`

## Public Member Functions
| QCefQuery ()
| Constructs a query instance.
| ~QCefQuery ()
| Destructs a query instance.
const QString | request () const
| Gets the query content.
const qint64 | id () const
| Gets the query id.
const QString | response () const
| Gets the response content string.
const bool | result () const
| Gets the response result.
const int | error () const
| Gets the response error.
void | setResponseResult (bool success, const QString &response, int error=0) const
| Sets the response.
void | reply (bool success, const QString &response, int error=0) const
| Replies the query.

## Protected Member Functions
| QCefQuery (QCefViewPrivate *source, const QString &req, const int64_t query)
| Constructs a query instance with request context and query id.
void | markAsReplied () const
| Marks the query as replied (for internal use only)

## Detailed Description

Represents the query request sent from the web content(Javascript)

## Constructor & Destructor Documentation

## ◆ QCefQuery() [1/2]

QCefQuery::QCefQuery | ( | QCefViewPrivate * | source,
|  | const QString & | req,
|  | const int64_t | query )
| protected

Constructs a query instance with request context and query id.

Parameters

  source | The source CefView
  req | The request context
  query | The query id

## ◆ QCefQuery() [2/2]

QCefQuery::QCefQuery | ( |  | ) |

Constructs a query instance.

## ◆ ~QCefQuery()

QCefQuery::~QCefQuery | ( |  | ) |

Destructs a query instance.

## Member Function Documentation

## ◆ markAsReplied()

void QCefQuery::markAsReplied | ( |  | ) | const
| protected

Marks the query as replied (for internal use only)

## ◆ request()

const QString QCefQuery::request | ( |  | ) | const

Gets the query content.

Returns
  The content string

## ◆ id()

const qint64 QCefQuery::id | ( |  | ) | const

Gets the query id.

Returns
  The query id

## ◆ response()

const QString QCefQuery::response | ( |  | ) | const

Gets the response content string.

Returns
  The response content string

## ◆ result()

const bool QCefQuery::result | ( |  | ) | const

Gets the response result.

Returns
  The respone result

## ◆ error()

const int QCefQuery::error | ( |  | ) | const

Gets the response error.

Returns
  The response error

## ◆ setResponseResult()

void QCefQuery::setResponseResult | ( | bool | success,
|  | const QString & | response,
|  | int | error = 0 ) const

Sets the response.

Parameters

  success | True if the query is successful; otherwise false
  response | The response content string
  error | The response error

## ◆ reply()

void QCefQuery::reply | ( | bool | success,
|  | const QString & | response,
|  | int | error = 0 ) const

Replies the query.

Parameters

  success | The result
  response | The response data
  error | The error code