Enable Plugins in QWebView: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(Add "cleanup" tag)
m (Wieland moved page Enabling Plugins to Enable Plugins in QWebView: underscores)
(No difference)

Revision as of 17:37, 28 June 2015

This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine.
Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean.

So your here to learn how to enable plugins in the QWebView that you've added to your .ui file, so without a further ado, here you go:

#include <QtWebKit> //make sure the correct headers are included so you can use globalSettings.

  1. include "widget.h"
  2. include "ui_widget.h"

Widget::Widget(QWidget *parent) :

QWidget(parent),
ui(new Ui::Widget)

{

ui->setupUi(this);

//Create the ui.

QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true);

//And, just enable plug-ins globally. }

Widget::~Widget() {

delete ui;