Changeset View
Changeset View
Standalone View
Standalone View
src/lib/marble/TinyWebBrowser.cpp
Context not available. | |||||
45 | } | 45 | } | ||
---|---|---|---|---|---|
46 | 46 | | |||
47 | TinyWebBrowser::TinyWebBrowser( QWidget* parent ) | 47 | TinyWebBrowser::TinyWebBrowser( QWidget* parent ) | ||
48 | : QWebView( parent ), | 48 | : QWebEngineView( parent ), | ||
49 | d( 0 ) | 49 | d( 0 ) | ||
50 | { | 50 | { | ||
51 | connect( this, SIGNAL(statusBarMessage(QString)), | 51 | connect( this, SIGNAL(statusBarMessage(QString)), | ||
52 | this, SIGNAL(statusMessage(QString)) ); | 52 | this, SIGNAL(statusMessage(QString)) ); | ||
53 | 53 | | |||
54 | page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks ); | 54 | //TODO: No easy way to delegate links | ||
55 | connect( this, SIGNAL(linkClicked(QUrl)), | 55 | // page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks ); | ||
56 | connect( this, SIGNAL(urlChanged(QUrl)), | ||||
56 | this, SLOT(openExternalLink(QUrl)) ); | 57 | this, SLOT(openExternalLink(QUrl)) ); | ||
58 | | ||||
57 | connect( this, SIGNAL(titleChanged(QString)), | 59 | connect( this, SIGNAL(titleChanged(QString)), | ||
58 | this, SLOT(setWindowTitle(QString)) ); | 60 | this, SLOT(setWindowTitle(QString)) ); | ||
59 | 61 | | |||
60 | pageAction( QWebPage::OpenLinkInNewWindow )->setEnabled( false ); | 62 | //TODO: | ||
61 | pageAction( QWebPage::OpenLinkInNewWindow )->setVisible( false ); | 63 | //pageAction( QWebEnginePage::OpenLinkInNewWindow )->setEnabled( false ); | ||
64 | //pageAction( QWebEnginePage::OpenLinkInNewWindow )->setVisible( false ); | ||||
62 | } | 65 | } | ||
63 | 66 | | |||
64 | TinyWebBrowser::~TinyWebBrowser() | 67 | TinyWebBrowser::~TinyWebBrowser() | ||
Context not available. | |||||
72 | QUrl url = relativeUrl; | 75 | QUrl url = relativeUrl; | ||
73 | if ( url.isRelative() ) | 76 | if ( url.isRelative() ) | ||
74 | url = QUrl( guessWikipediaDomain() ).resolved( url ); | 77 | url = QUrl( guessWikipediaDomain() ).resolved( url ); | ||
78 | qDebug() << "setWikipediaPath()"; | ||||
75 | load( url ); | 79 | load( url ); | ||
76 | } | 80 | } | ||
77 | 81 | | |||
Context not available. | |||||
82 | 86 | | |||
83 | QPointer<QPrintDialog> dlg = new QPrintDialog( &printer, this ); | 87 | QPointer<QPrintDialog> dlg = new QPrintDialog( &printer, this ); | ||
84 | if ( dlg->exec() ) | 88 | if ( dlg->exec() ) | ||
85 | QWebView::print( &printer ); | 89 | //TODO: | ||
90 | //QWebEngineView::print( &printer ); | ||||
86 | delete dlg; | 91 | delete dlg; | ||
87 | #endif | 92 | #endif | ||
88 | } | 93 | } | ||
89 | 94 | | |||
90 | QWebView *TinyWebBrowser::createWindow( QWebPage::WebWindowType type ) | 95 | QWebEngineView *TinyWebBrowser::createWindow( QWebEnginePage::WebWindowType type ) | ||
91 | { | 96 | { | ||
92 | TinyWebBrowser *view = new TinyWebBrowser( this ); | 97 | TinyWebBrowser *view = new TinyWebBrowser( this ); | ||
93 | 98 | | |||
94 | if ( type == QWebPage::WebModalDialog ) { | 99 | //TODO: | ||
95 | view->setWindowModality( Qt::WindowModal ); | 100 | // if ( type == QWebEnginePage::WebModalDialog ) { | ||
96 | } | 101 | // view->setWindowModality( Qt::WindowModal ); | ||
102 | // } | ||||
97 | 103 | | |||
98 | return view; | 104 | return view; | ||
99 | } | 105 | } | ||
Context not available. |