Mohamed Jihed Jaouadi
Mohamed Jihed Jaouadi

Reputation: 1517

How can add an user agent to my browser?

I'm developping a blackberry 10 mobile application using the momentics IDE (BB native SDK).

I want to add an user agent to my web browser like below which is described in this link : blackberry-10-user-agent-string

Mozilla/5.0 (BB10; <Device Model>) AppleWebKit/<WebKit Version> (KHTML, like Gecko) Version/<BB Version #> Mobile Safari/<WebKit Version>

What I want is, how can I detect the device model, webkit version and the BB version using code (C++) to put them in the using agent string?

Thanks for any help on this.

Upvotes: 0

Views: 294

Answers (1)

Rudolfs Bundulis
Rudolfs Bundulis

Reputation: 11944

Add the header value to the request object by calling QNetworkRequest::setHeader() with QNetworkRequest::UserAgentHeader as the header type and the actual string as as the value.

EDIT:

This shows hot to get the WebKit version from Qt.

This class should provide all the information about the device.

This class should provide the actual os version.

Upvotes: 1

Related Questions