#include #include #include #include #include #include int main(int argc, char *argv[]) { QApplication a(argc, argv); QMainWindow* w = new QMainWindow(); QGraphicsView* m_main_view = new QGraphicsView(w); w->setCentralWidget(m_main_view); QGraphicsScene* m_scene = new QGraphicsScene(w); /* If we set the main view to the scene *here*, everything works as it should. */ // m_main_view->setScene(m_scene); QDockWidget* m_dock = new QDockWidget(w); QGraphicsView* m_thumbnail = new QGraphicsView(m_dock); m_thumbnail->resize(QSize(400,300)); m_thumbnail->scale( 0.3, 0.3 ); m_thumbnail->setInteractive(false); m_thumbnail->setScene(m_scene); QGraphicsWebView* m_webview = new QGraphicsWebView(); m_webview->settings()->setAttribute(QWebSettings::PluginsEnabled, true); m_scene->addItem(m_webview); m_webview->setUrl(QUrl("http://www.adobe.com/devnet/archive/flash/articles/puzzle_game.html")); /* If we set the main view to the scene *here*, the flash object doesn't work properly. * Its events seem to be processed by the representation of it in the view 'm_thumbnail' * (ie. all mouse events seem to be scaled down to 0.3 times the original size.) * This can also be demonstrated by right-clicking over the flash object in the main window; * the popup menu will display over the flash object in the thumbnail. */ m_main_view->setScene(m_scene); w->addDockWidget(Qt::LeftDockWidgetArea, m_dock); m_dock->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); m_dock->resize(400,800); w->showMaximized(); return a.exec(); }