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:

  1. #include <QtWebKit>    
  2. //make sure the correct headers are included so you can use globalSettings.
  3. #include "widget.h"
  4. #include "ui_widget.h"
  5.  
  6. Widget::Widget(QWidget *parent) :
  7.     QWidget(parent),
  8.     ui(new Ui::Widget)
  9. {
  10.     ui->setupUi(this);    
  11. //Create the ui.
  12.     QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true);    
  13. //And, just enable plug-ins globally.
  14. }
  15.  
  16. Widget::~Widget()
  17. {
  18.     delete ui;
  19. }