#include "BrowserWindow.h" #include "DVDPluginWebPage.h" #include #include #include #include BrowserWindow::BrowserWindow(QWidget *parent) : QWidget(parent) { QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); m_urlBox = new QLineEdit; layout->addWidget(m_urlBox); m_browser = new QWebView; layout->addWidget(m_browser); connect(m_browser, SIGNAL(urlChanged(QUrl)), this, SLOT(updateUrlBox(QUrl))); connect(m_urlBox, SIGNAL(returnPressed()), this, SLOT(navigateToPage())); m_browser->setPage(new DVDPluginWebPage(m_browser)); m_browser->load(QString("file:///home/zx2c4/Projects/AnyClipBrowser/Test.html")); } void BrowserWindow::updateUrlBox(const QUrl &url) { m_urlBox->setText(url.toString()); } void BrowserWindow::navigateToPage() { m_browser->load(m_urlBox->text()); }