--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Documentation/Source/eric5.Helpviewer.History.HistoryCompleter.html Sat Jan 02 18:19:35 2010 +0000 @@ -0,0 +1,325 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' +'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> +<html><head> +<title>eric5.Helpviewer.History.HistoryCompleter</title> +<style> +b'body {\n background:white;\n margin: 0em 1em 10em 1em;\n color: black;\n}\n\nh1 { color: white; background: #4FA4FF; }\nh2 { color: white; background: #4FA4FF; }\nh3 { color: white; background: #00557F; }\nh4 { color: white; background: #00557F; }\n \na { color: #AA5500; }\n' +</style> +</head> +<body><a NAME="top" ID="top"></a> +<h1>eric5.Helpviewer.History.HistoryCompleter</h1> +<p> +Module implementing a special completer for the history. +</p> +<h3>Global Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Classes</h3> +<table> +<tr> +<td><a href="#HistoryCompleter">HistoryCompleter</a></td> +<td></td> +</tr><tr> +<td><a href="#HistoryCompletionModel">HistoryCompletionModel</a></td> +<td>Class implementing a special model for history based completions.</td> +</tr><tr> +<td><a href="#HistoryCompletionView">HistoryCompletionView</a></td> +<td>Class implementing a special completer view for history based completions.</td> +</tr> +</table> +<h3>Functions</h3> +<table> +<tr><td>None</td></tr> +</table> +<hr /><hr /> +<a NAME="HistoryCompleter" ID="HistoryCompleter"></a> +<h2>HistoryCompleter</h2> + +<h3>Derived from</h3> +QCompleter +<h3>Class Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr> +<td><a href="#HistoryCompleter.__init__">HistoryCompleter</a></td> +<td>Constructor</td> +</tr><tr> +<td><a href="#HistoryCompleter.__updateFilter">__updateFilter</a></td> +<td>Private slot to update the search string.</td> +</tr><tr> +<td><a href="#HistoryCompleter.pathFromIndex">pathFromIndex</a></td> +<td>Public method to get a path for a given index.</td> +</tr><tr> +<td><a href="#HistoryCompleter.splitPath">splitPath</a></td> +<td>Public method to split the given path into strings, that are used to match at each level in the model.</td> +</tr> +</table> +<a NAME="HistoryCompleter.__init__" ID="HistoryCompleter.__init__"></a> +<h4>HistoryCompleter (Constructor)</h4> +<b>HistoryCompleter</b>(<i>model, parent = None</i>) +<p> + Constructor +</p><dl> +<dt><i>model</i></dt> +<dd> +reference to the model (QAbstractItemModel) +</dd><dt><i>parent</i></dt> +<dd> +reference to the parent object (QObject) +</dd> +</dl><a NAME="HistoryCompleter.__updateFilter" ID="HistoryCompleter.__updateFilter"></a> +<h4>HistoryCompleter.__updateFilter</h4> +<b>__updateFilter</b>(<i></i>) +<p> + Private slot to update the search string. +</p><a NAME="HistoryCompleter.pathFromIndex" ID="HistoryCompleter.pathFromIndex"></a> +<h4>HistoryCompleter.pathFromIndex</h4> +<b>pathFromIndex</b>(<i>idx</i>) +<p> + Public method to get a path for a given index. +</p><dl> +<dt><i>idx</i></dt> +<dd> +reference to the index (QModelIndex) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +the actual URL from the history (string) +</dd> +</dl><a NAME="HistoryCompleter.splitPath" ID="HistoryCompleter.splitPath"></a> +<h4>HistoryCompleter.splitPath</h4> +<b>splitPath</b>(<i>path</i>) +<p> + Public method to split the given path into strings, that are used to match + at each level in the model. +</p><dl> +<dt><i>path</i></dt> +<dd> +path to be split (string) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +list of path elements (list of strings) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="HistoryCompletionModel" ID="HistoryCompletionModel"></a> +<h2>HistoryCompletionModel</h2> +<p> + Class implementing a special model for history based completions. +</p> +<h3>Derived from</h3> +QSortFilterProxyModel +<h3>Class Attributes</h3> +<table> +<tr><td>HistoryCompletionRole</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr> +<td><a href="#HistoryCompletionModel.__init__">HistoryCompletionModel</a></td> +<td>Constructor</td> +</tr><tr> +<td><a href="#HistoryCompletionModel.data">data</a></td> +<td>Public method to get data from the model.</td> +</tr><tr> +<td><a href="#HistoryCompletionModel.filterAcceptsRow">filterAcceptsRow</a></td> +<td>Protected method to determine, if the row is acceptable.</td> +</tr><tr> +<td><a href="#HistoryCompletionModel.isValid">isValid</a></td> +<td>Public method to check the model for validity.</td> +</tr><tr> +<td><a href="#HistoryCompletionModel.lessThan">lessThan</a></td> +<td>Protected method used to sort the displayed items.</td> +</tr><tr> +<td><a href="#HistoryCompletionModel.searchString">searchString</a></td> +<td>Public method to get the current search string.</td> +</tr><tr> +<td><a href="#HistoryCompletionModel.setSearchString">setSearchString</a></td> +<td>Public method to set the current search string.</td> +</tr><tr> +<td><a href="#HistoryCompletionModel.setValid">setValid</a></td> +<td>Public method to set the model's validity.</td> +</tr> +</table> +<a NAME="HistoryCompletionModel.__init__" ID="HistoryCompletionModel.__init__"></a> +<h4>HistoryCompletionModel (Constructor)</h4> +<b>HistoryCompletionModel</b>(<i>parent = None</i>) +<p> + Constructor +</p><dl> +<dt><i>parent</i></dt> +<dd> +reference to the parent object (QObject) +</dd> +</dl><a NAME="HistoryCompletionModel.data" ID="HistoryCompletionModel.data"></a> +<h4>HistoryCompletionModel.data</h4> +<b>data</b>(<i>index, role = Qt.DisplayRole</i>) +<p> + Public method to get data from the model. +</p><dl> +<dt><i>index</i></dt> +<dd> +index of history entry to get data for (QModelIndex) +</dd><dt><i>role</i></dt> +<dd> +data role (integer) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +history entry data +</dd> +</dl><a NAME="HistoryCompletionModel.filterAcceptsRow" ID="HistoryCompletionModel.filterAcceptsRow"></a> +<h4>HistoryCompletionModel.filterAcceptsRow</h4> +<b>filterAcceptsRow</b>(<i>sourceRow, sourceParent</i>) +<p> + Protected method to determine, if the row is acceptable. +</p><dl> +<dt><i>sourceRow</i></dt> +<dd> +row number in the source model (integer) +</dd><dt><i>sourceParent</i></dt> +<dd> +index of the source item (QModelIndex) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +flag indicating acceptance (boolean) +</dd> +</dl><a NAME="HistoryCompletionModel.isValid" ID="HistoryCompletionModel.isValid"></a> +<h4>HistoryCompletionModel.isValid</h4> +<b>isValid</b>(<i></i>) +<p> + Public method to check the model for validity. +</p><dl> +<dt><i>flag</i></dt> +<dd> +indicating a valid status (boolean) +</dd> +</dl><a NAME="HistoryCompletionModel.lessThan" ID="HistoryCompletionModel.lessThan"></a> +<h4>HistoryCompletionModel.lessThan</h4> +<b>lessThan</b>(<i>left, right</i>) +<p> + Protected method used to sort the displayed items. +</p><p> + It implements a special sorting function based on the history entry's + frequency giving a bonus to hits that match on a word boundary so that + e.g. "dot.python-projects.org" is a better result for typing "dot" than + "slashdot.org". However, it only looks for the string in the host name, + not the entire URL, since while it makes sense to e.g. give + "www.phoronix.com" a bonus for "ph", it does NOT make sense to give + "www.yadda.com/foo.php" the bonus. +</p><dl> +<dt><i>left</i></dt> +<dd> +index of left item (QModelIndex) +</dd><dt><i>right</i></dt> +<dd> +index of right item (QModelIndex) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +true, if left is less than right (boolean) +</dd> +</dl><a NAME="HistoryCompletionModel.searchString" ID="HistoryCompletionModel.searchString"></a> +<h4>HistoryCompletionModel.searchString</h4> +<b>searchString</b>(<i></i>) +<p> + Public method to get the current search string. +</p><dl> +<dt>Returns:</dt> +<dd> +current search string (string) +</dd> +</dl><a NAME="HistoryCompletionModel.setSearchString" ID="HistoryCompletionModel.setSearchString"></a> +<h4>HistoryCompletionModel.setSearchString</h4> +<b>setSearchString</b>(<i>string</i>) +<p> + Public method to set the current search string. +</p><dl> +<dt><i>string</i></dt> +<dd> +new search string (string) +</dd> +</dl><a NAME="HistoryCompletionModel.setValid" ID="HistoryCompletionModel.setValid"></a> +<h4>HistoryCompletionModel.setValid</h4> +<b>setValid</b>(<i>valid</i>) +<p> + Public method to set the model's validity. +</p><dl> +<dt><i>valid</i></dt> +<dd> +flag indicating the new valid status (boolean) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="HistoryCompletionView" ID="HistoryCompletionView"></a> +<h2>HistoryCompletionView</h2> +<p> + Class implementing a special completer view for history based completions. +</p> +<h3>Derived from</h3> +QTableView +<h3>Class Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr> +<td><a href="#HistoryCompletionView.__init__">HistoryCompletionView</a></td> +<td>Constructor</td> +</tr><tr> +<td><a href="#HistoryCompletionView.resizeEvent">resizeEvent</a></td> +<td>Protected method handling resize events.</td> +</tr><tr> +<td><a href="#HistoryCompletionView.sizeHintForRow">sizeHintForRow</a></td> +<td>Public method to give a size hint for rows.</td> +</tr> +</table> +<a NAME="HistoryCompletionView.__init__" ID="HistoryCompletionView.__init__"></a> +<h4>HistoryCompletionView (Constructor)</h4> +<b>HistoryCompletionView</b>(<i>parent = None</i>) +<p> + Constructor +</p><dl> +<dt><i>parent</i></dt> +<dd> +reference to the parent widget (QWidget) +</dd> +</dl><a NAME="HistoryCompletionView.resizeEvent" ID="HistoryCompletionView.resizeEvent"></a> +<h4>HistoryCompletionView.resizeEvent</h4> +<b>resizeEvent</b>(<i>evt</i>) +<p> + Protected method handling resize events. +</p><dl> +<dt><i>evt</i></dt> +<dd> +reference to the resize event (QResizeEvent) +</dd> +</dl><a NAME="HistoryCompletionView.sizeHintForRow" ID="HistoryCompletionView.sizeHintForRow"></a> +<h4>HistoryCompletionView.sizeHintForRow</h4> +<b>sizeHintForRow</b>(<i>row</i>) +<p> + Public method to give a size hint for rows. +</p><dl> +<dt><i>row</i></dt> +<dd> +row number (integer) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +</body></html> \ No newline at end of file