Documentation/Source/eric6.WebBrowser.Tools.WebHitTestResult.html

Tue, 24 Oct 2017 19:09:09 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 24 Oct 2017 19:09:09 +0200
changeset 5928
a3809f75ca07
parent 5532
3a7c5deab9b7
permissions
-rw-r--r--

Changed the logic of the two web browsers in order to put new downloads at the top of the list of downloads and add the download date and time to the shown info.

<!DOCTYPE html>
<html><head>
<title>eric6.WebBrowser.Tools.WebHitTestResult</title>
<meta charset="UTF-8">
<style>
body {
    background: #EDECE6;
    margin: 0em 1em 10em 1em;
    color: black;
}

h1 { color: white; background: #85774A; }
h2 { color: white; background: #85774A; }
h3 { color: white; background: #9D936E; }
h4 { color: white; background: #9D936E; }
    
a { color: #BA6D36; }

</style>
</head>
<body><a NAME="top" ID="top"></a>
<h1>eric6.WebBrowser.Tools.WebHitTestResult</h1>
<p>
Module implementing an object for testing certain aspects of a web page.
</p>
<h3>Global Attributes</h3>
<table>
<tr><td>None</td></tr>
</table>
<h3>Classes</h3>
<table>
<tr>
<td><a href="#WebHitTestResult">WebHitTestResult</a></td>
<td>Class implementing an object for testing certain aspects of a web page.</td>
</tr>
</table>
<h3>Functions</h3>
<table>
<tr><td>None</td></tr>
</table>
<hr /><hr />
<a NAME="WebHitTestResult" ID="WebHitTestResult"></a>
<h2>WebHitTestResult</h2>
<p>
    Class implementing an object for testing certain aspects of a web page.
</p>
<h3>Derived from</h3>
object
<h3>Class Attributes</h3>
<table>
<tr><td>None</td></tr>
</table>
<h3>Class Methods</h3>
<table>
<tr><td>None</td></tr>
</table>
<h3>Methods</h3>
<table>
<tr>
<td><a href="#WebHitTestResult.__init__">WebHitTestResult</a></td>
<td>Constructor</td>
</tr><tr>
<td><a href="#WebHitTestResult.__populate">__populate</a></td>
<td>Private method to populate the object.</td>
</tr><tr>
<td><a href="#WebHitTestResult.alternateText">alternateText</a></td>
<td>Public method to get the alternate text.</td>
</tr><tr>
<td><a href="#WebHitTestResult.baseUrl">baseUrl</a></td>
<td>Public method to get the base URL of the page.</td>
</tr><tr>
<td><a href="#WebHitTestResult.boundingRect">boundingRect</a></td>
<td>Public method to get the bounding rectangle.</td>
</tr><tr>
<td><a href="#WebHitTestResult.imageUrl">imageUrl</a></td>
<td>Public method to get the URL of an image.</td>
</tr><tr>
<td><a href="#WebHitTestResult.isContentEditable">isContentEditable</a></td>
<td>Public method to check for editable content.</td>
</tr><tr>
<td><a href="#WebHitTestResult.isContentSelected">isContentSelected</a></td>
<td>Public method to check for selected content.</td>
</tr><tr>
<td><a href="#WebHitTestResult.isNull">isNull</a></td>
<td>Public method to test, if the hit test is empty.</td>
</tr><tr>
<td><a href="#WebHitTestResult.linkTitle">linkTitle</a></td>
<td>Public method to get the title for a link element.</td>
</tr><tr>
<td><a href="#WebHitTestResult.linkUrl">linkUrl</a></td>
<td>Public method to get the URL for a link element.</td>
</tr><tr>
<td><a href="#WebHitTestResult.mediaMuted">mediaMuted</a></td>
<td>Public method to check, if a media element is muted.</td>
</tr><tr>
<td><a href="#WebHitTestResult.mediaPaused">mediaPaused</a></td>
<td>Public method to check, if a media element is paused.</td>
</tr><tr>
<td><a href="#WebHitTestResult.mediaUrl">mediaUrl</a></td>
<td>Public method to get the URL for a media element.</td>
</tr><tr>
<td><a href="#WebHitTestResult.pos">pos</a></td>
<td>Public method to get the position of the hit test.</td>
</tr><tr>
<td><a href="#WebHitTestResult.tagName">tagName</a></td>
<td>Public method to get the name of the tested tag.</td>
</tr><tr>
<td><a href="#WebHitTestResult.updateWithContextMenuData">updateWithContextMenuData</a></td>
<td>Public method to update the hit test data with data from the context menu event.</td>
</tr><tr>
<td><a href="#WebHitTestResult.viewportPos">viewportPos</a></td>
<td>Public method to get the viewport position.</td>
</tr>
</table>
<h3>Static Methods</h3>
<table>
<tr><td>None</td></tr>
</table>
<a NAME="WebHitTestResult.__init__" ID="WebHitTestResult.__init__"></a>
<h4>WebHitTestResult (Constructor)</h4>
<b>WebHitTestResult</b>(<i>page, pos</i>)
<p>
        Constructor
</p><dl>
<dt><i>page</i> (WebBrowserPage)</dt>
<dd>
reference to the web page
</dd><dt><i>pos</i> (QPoint)</dt>
<dd>
position to be tested
</dd>
</dl><a NAME="WebHitTestResult.__populate" ID="WebHitTestResult.__populate"></a>
<h4>WebHitTestResult.__populate</h4>
<b>__populate</b>(<i>url, res</i>)
<p>
        Private method to populate the object.
</p><dl>
<dt><i>url</i> (QUrl)</dt>
<dd>
URL of the tested page
</dd><dt><i>res</i> (dict)</dt>
<dd>
dictionary with result data from JavaScript
</dd>
</dl><a NAME="WebHitTestResult.alternateText" ID="WebHitTestResult.alternateText"></a>
<h4>WebHitTestResult.alternateText</h4>
<b>alternateText</b>(<i></i>)
<p>
        Public method to get the alternate text.
</p><dl>
<dt>Returns:</dt>
<dd>
alternate text
</dd>
</dl><dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl><a NAME="WebHitTestResult.baseUrl" ID="WebHitTestResult.baseUrl"></a>
<h4>WebHitTestResult.baseUrl</h4>
<b>baseUrl</b>(<i></i>)
<p>
        Public method to get the base URL of the page.
</p><dl>
<dt>Returns:</dt>
<dd>
base URL
</dd>
</dl><dl>
<dt>Return Type:</dt>
<dd>
QUrl
</dd>
</dl><a NAME="WebHitTestResult.boundingRect" ID="WebHitTestResult.boundingRect"></a>
<h4>WebHitTestResult.boundingRect</h4>
<b>boundingRect</b>(<i></i>)
<p>
        Public method to get the bounding rectangle.
</p><dl>
<dt>Returns:</dt>
<dd>
bounding rectangle
</dd>
</dl><dl>
<dt>Return Type:</dt>
<dd>
QRect
</dd>
</dl><a NAME="WebHitTestResult.imageUrl" ID="WebHitTestResult.imageUrl"></a>
<h4>WebHitTestResult.imageUrl</h4>
<b>imageUrl</b>(<i></i>)
<p>
        Public method to get the URL of an image.
</p><dl>
<dt>Returns:</dt>
<dd>
image URL
</dd>
</dl><dl>
<dt>Return Type:</dt>
<dd>
QUrl
</dd>
</dl><a NAME="WebHitTestResult.isContentEditable" ID="WebHitTestResult.isContentEditable"></a>
<h4>WebHitTestResult.isContentEditable</h4>
<b>isContentEditable</b>(<i></i>)
<p>
        Public method to check for editable content.
</p><dl>
<dt>Returns:</dt>
<dd>
flag indicating editable content
</dd>
</dl><dl>
<dt>Return Type:</dt>
<dd>
bool
</dd>
</dl><a NAME="WebHitTestResult.isContentSelected" ID="WebHitTestResult.isContentSelected"></a>
<h4>WebHitTestResult.isContentSelected</h4>
<b>isContentSelected</b>(<i></i>)
<p>
        Public method to check for selected content.
</p><dl>
<dt>Returns:</dt>
<dd>
flag indicating selected content
</dd>
</dl><dl>
<dt>Return Type:</dt>
<dd>
bool
</dd>
</dl><a NAME="WebHitTestResult.isNull" ID="WebHitTestResult.isNull"></a>
<h4>WebHitTestResult.isNull</h4>
<b>isNull</b>(<i></i>)
<p>
        Public method to test, if the hit test is empty.
</p><dl>
<dt>Returns:</dt>
<dd>
flag indicating an empty object
</dd>
</dl><dl>
<dt>Return Type:</dt>
<dd>
bool
</dd>
</dl><a NAME="WebHitTestResult.linkTitle" ID="WebHitTestResult.linkTitle"></a>
<h4>WebHitTestResult.linkTitle</h4>
<b>linkTitle</b>(<i></i>)
<p>
        Public method to get the title for a link element.
</p><dl>
<dt>Returns:</dt>
<dd>
title for a link element
</dd>
</dl><dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl><a NAME="WebHitTestResult.linkUrl" ID="WebHitTestResult.linkUrl"></a>
<h4>WebHitTestResult.linkUrl</h4>
<b>linkUrl</b>(<i></i>)
<p>
        Public method to get the URL for a link element.
</p><dl>
<dt>Returns:</dt>
<dd>
URL for a link element
</dd>
</dl><dl>
<dt>Return Type:</dt>
<dd>
QUrl
</dd>
</dl><a NAME="WebHitTestResult.mediaMuted" ID="WebHitTestResult.mediaMuted"></a>
<h4>WebHitTestResult.mediaMuted</h4>
<b>mediaMuted</b>(<i></i>)
<p>
        Public method to check, if a media element is muted.
</p><dl>
<dt>Returns:</dt>
<dd>
flag indicating a muted media element
</dd>
</dl><dl>
<dt>Return Type:</dt>
<dd>
bool
</dd>
</dl><a NAME="WebHitTestResult.mediaPaused" ID="WebHitTestResult.mediaPaused"></a>
<h4>WebHitTestResult.mediaPaused</h4>
<b>mediaPaused</b>(<i></i>)
<p>
        Public method to check, if a media element is paused.
</p><dl>
<dt>Returns:</dt>
<dd>
flag indicating a paused media element
</dd>
</dl><dl>
<dt>Return Type:</dt>
<dd>
bool
</dd>
</dl><a NAME="WebHitTestResult.mediaUrl" ID="WebHitTestResult.mediaUrl"></a>
<h4>WebHitTestResult.mediaUrl</h4>
<b>mediaUrl</b>(<i></i>)
<p>
        Public method to get the URL for a media element.
</p><dl>
<dt>Returns:</dt>
<dd>
URL for a media element
</dd>
</dl><dl>
<dt>Return Type:</dt>
<dd>
QUrl
</dd>
</dl><a NAME="WebHitTestResult.pos" ID="WebHitTestResult.pos"></a>
<h4>WebHitTestResult.pos</h4>
<b>pos</b>(<i></i>)
<p>
        Public method to get the position of the hit test.
</p><dl>
<dt>Returns:</dt>
<dd>
position of hit test
</dd>
</dl><dl>
<dt>Return Type:</dt>
<dd>
QPoint
</dd>
</dl><a NAME="WebHitTestResult.tagName" ID="WebHitTestResult.tagName"></a>
<h4>WebHitTestResult.tagName</h4>
<b>tagName</b>(<i></i>)
<p>
        Public method to get the name of the tested tag.
</p><dl>
<dt>Returns:</dt>
<dd>
name of the tested tag
</dd>
</dl><dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl><a NAME="WebHitTestResult.updateWithContextMenuData" ID="WebHitTestResult.updateWithContextMenuData"></a>
<h4>WebHitTestResult.updateWithContextMenuData</h4>
<b>updateWithContextMenuData</b>(<i>data</i>)
<p>
        Public method to update the hit test data with data from the context
        menu event.
</p><p>
        Note: This works for Qt >= 5.7.0.
</p><dl>
<dt><i>data</i> (QWebEngineContextMenuData)</dt>
<dd>
context menu data
</dd>
</dl><a NAME="WebHitTestResult.viewportPos" ID="WebHitTestResult.viewportPos"></a>
<h4>WebHitTestResult.viewportPos</h4>
<b>viewportPos</b>(<i></i>)
<p>
        Public method to get the viewport position.
</p><dl>
<dt>Returns:</dt>
<dd>
viewport position
</dd>
</dl><dl>
<dt>Return Type:</dt>
<dd>
QPoint
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
</body></html>

eric ide

mercurial