Mercurial > projects > qtd
diff demos/browser/webview.d @ 85:5c8c9c5d9ee1
more porting
author | mandel |
---|---|
date | Mon, 25 May 2009 14:10:44 +0000 |
parents | 85c59c4e5f19 |
children | 87bb4e622f9e |
line wrap: on
line diff
--- a/demos/browser/webview.d Sun May 24 20:14:50 2009 +0000 +++ b/demos/browser/webview.d Mon May 25 14:10:44 2009 +0000 @@ -137,7 +137,7 @@ version(QT_NO_UITOOLS) {} else { - QObject createPlugin(string classId, QUrl url, string[] paramNames, string[] paramValues); + QObject createPlugin(string classId, QUrl url, string[] paramNames, string[] paramValues) { auto loader = new QUiLoader; return loader.createWidget(classId, view()); @@ -195,13 +195,13 @@ Qt.MouseButtons m_pressedButtons; bool m_openInNewTab; QUrl m_loadingUrl; -}; +} class WebView : public QWebView { public: - WebView(QWidget parent = null) + this(QWidget parent = null) { super(parent); m_progress = 0; @@ -236,7 +236,10 @@ return m_statusBarText; } - int progress() const { return m_progress; } + int progress() + { + return m_progress; + } protected: @@ -251,7 +254,7 @@ { QWebView.mouseReleaseEvent(event); if (!event.isAccepted() && (m_page.m_pressedButtons & Qt.MidButton)) { - QUrl url(QApplication.clipboard().text(QClipboard.Selection)); + auto url = new QUrl(QApplication.clipboard().text(QClipboard.Selection)); if (!url.isEmpty() && url.isValid() && !url.scheme().isEmpty()) { setUrl(url); } @@ -262,7 +265,7 @@ { QWebHitTestResult r = page().mainFrame().hitTestContent(event.pos()); if (!r.linkUrl().isEmpty()) { - QMenu menu(this); + auto menu = new QMenu(this); menu.addAction(pageAction(QWebPage.OpenLinkInNewWindow)); menu.addAction(tr("Open in New Tab"), this, SLOT(openLinkInNewTab())); menu.addSeparator();