#include "mainwindow.h"
MainWindow
::MainWindow(QWidget *parent
){
//set the main window geometry
setGeometry(25,25,800,600);
p.
setColor(QPalette::Background, Qt
::red);
//put a widget out there for contrast
q->setAutoFillBackground(true);
q->setPalette(p);
q->setGeometry(50,50, 400,400);
//put another widget out there for further contrast
p.
setColor(QPalette::Background, Qt
::blue);
q2->setAutoFillBackground(true);
q2->setPalette(p);
q2->setGeometry(75,75,200,200);
//this is a QWebView defined in .h
mWebView = new QWebView(q2);
p.
setColor(QPalette::Background, Qt
::green);
mWebView->setAutoFillBackground(true);
mWebView->setPalette(p);
//configure the web view
mWebView->page()->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
mWebView->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
mWebView->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
//read in the resource file that contains the flash
mWebView
->setUrl
(QUrl("qrc:/html/flashwrapper.html"));
mWebView
->page
()->mainFrame
()->load
(QUrl("qrc:/html/flashwrapper.html"));
//***** RESIZE AND MOVE DID NOT WORK ******//
//mWebView->resize(100,100);
//mWebView->move(20,20);
//ALSO TRIED THE SETGEOMETRY
mWebView->setGeometry(20,20,100,100);
}
MainWindow::~MainWindow()
{
}
#include "mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
//set the main window geometry
setGeometry(25,25,800,600);
QPalette p(palette());
p.setColor(QPalette::Background, Qt::red);
//put a widget out there for contrast
QWidget * q = new QWidget(this);
q->setAutoFillBackground(true);
q->setPalette(p);
q->setGeometry(50,50, 400,400);
//put another widget out there for further contrast
QWidget * q2 = new QWidget(q);
p.setColor(QPalette::Background, Qt::blue);
q2->setAutoFillBackground(true);
q2->setPalette(p);
q2->setGeometry(75,75,200,200);
//this is a QWebView defined in .h
mWebView = new QWebView(q2);
p.setColor(QPalette::Background, Qt::green);
mWebView->setAutoFillBackground(true);
mWebView->setPalette(p);
//configure the web view
mWebView->page()->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
mWebView->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
mWebView->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
//read in the resource file that contains the flash
mWebView->setUrl(QUrl("qrc:/html/flashwrapper.html"));
mWebView->page()->mainFrame()->load(QUrl("qrc:/html/flashwrapper.html"));
//***** RESIZE AND MOVE DID NOT WORK ******//
//mWebView->resize(100,100);
//mWebView->move(20,20);
//ALSO TRIED THE SETGEOMETRY
mWebView->setGeometry(20,20,100,100);
}
MainWindow::~MainWindow()
{
}
To copy to clipboard, switch view to plain text mode
Bookmarks