📄 gtktreemodelfilter.html
字号:
<p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>filter</code></em> :</span></p></td><td> A <a class="link" href="GtkTreeModelFilter.html" title="GtkTreeModelFilter"><span class="type">GtkTreeModelFilter</span></a>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> A pointer to a <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>.</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3811191"></a><h3><a name="gtk-tree-model-filter-convert-child-iter-to-iter"></a>gtk_tree_model_filter_convert_child_iter_to_iter ()</h3><a class="indexterm" name="id3811208"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> gtk_tree_model_filter_convert_child_iter_to_iter (<a class="link" href="GtkTreeModelFilter.html" title="GtkTreeModelFilter">GtkTreeModelFilter</a> *filter, <a class="link" href="GtkTreeModel.html#GtkTreeIter">GtkTreeIter</a> *filter_iter, <a class="link" href="GtkTreeModel.html#GtkTreeIter">GtkTreeIter</a> *child_iter);</pre><p>Sets <em class="parameter"><code>filter_iter</code></em> to point to the row in <em class="parameter"><code>filter</code></em> that corresponds to therow pointed at by <em class="parameter"><code>child_iter</code></em>. If <em class="parameter"><code>filter_iter</code></em> was not set, <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> isreturned.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>filter</code></em> :</span></p></td><td> A <a class="link" href="GtkTreeModelFilter.html" title="GtkTreeModelFilter"><span class="type">GtkTreeModelFilter</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>filter_iter</code></em> :</span></p></td><td> An uninitialized <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>child_iter</code></em> :</span></p></td><td> A valid <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> pointing to a row on the child model.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, if <em class="parameter"><code>filter_iter</code></em> was set, i.e. if <em class="parameter"><code>child_iter</code></em> is avalid iterator pointing to a visible row in child model.</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3811403"></a><h3><a name="gtk-tree-model-filter-convert-iter-to-child-iter"></a>gtk_tree_model_filter_convert_iter_to_child_iter ()</h3><a class="indexterm" name="id3811420"></a><pre class="programlisting">void gtk_tree_model_filter_convert_iter_to_child_iter (<a class="link" href="GtkTreeModelFilter.html" title="GtkTreeModelFilter">GtkTreeModelFilter</a> *filter, <a class="link" href="GtkTreeModel.html#GtkTreeIter">GtkTreeIter</a> *child_iter, <a class="link" href="GtkTreeModel.html#GtkTreeIter">GtkTreeIter</a> *filter_iter);</pre><p>Sets <em class="parameter"><code>child_iter</code></em> to point to the row pointed to by <em class="parameter"><code>filter_iter</code></em>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>filter</code></em> :</span></p></td><td> A <a class="link" href="GtkTreeModelFilter.html" title="GtkTreeModelFilter"><span class="type">GtkTreeModelFilter</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>child_iter</code></em> :</span></p></td><td> An uninitialized <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>filter_iter</code></em> :</span></p></td><td> A valid <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> pointing to a row on <em class="parameter"><code>filter</code></em>.</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3811564"></a><h3><a name="gtk-tree-model-filter-convert-child-path-to-path"></a>gtk_tree_model_filter_convert_child_path_to_path ()</h3><a class="indexterm" name="id3811581"></a><pre class="programlisting"><a class="link" href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a>* gtk_tree_model_filter_convert_child_path_to_path (<a class="link" href="GtkTreeModelFilter.html" title="GtkTreeModelFilter">GtkTreeModelFilter</a> *filter, <a class="link" href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> *child_path);</pre><p>Converts <em class="parameter"><code>child_path</code></em> to a path relative to <em class="parameter"><code>filter</code></em>. That is, <em class="parameter"><code>child_path</code></em>points to a path in the child model. The rerturned path will point to thesame row in the filtered model. If <em class="parameter"><code>child_path</code></em> isn't a valid path on thechild model or points to a row which is not visible in <em class="parameter"><code>filter</code></em>, then <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>is returned.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>filter</code></em> :</span></p></td><td> A <a class="link" href="GtkTreeModelFilter.html" title="GtkTreeModelFilter"><span class="type">GtkTreeModelFilter</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>child_path</code></em> :</span></p></td><td> A <a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> to convert.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> A newly allocated <a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a>, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3811749"></a><h3><a name="gtk-tree-model-filter-convert-path-to-child-path"></a>gtk_tree_model_filter_convert_path_to_child_path ()</h3><a class="indexterm" name="id3811765"></a><pre class="programlisting"><a class="link" href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a>* gtk_tree_model_filter_convert_path_to_child_path (<a class="link" href="GtkTreeModelFilter.html" title="GtkTreeModelFilter">GtkTreeModelFilter</a> *filter, <a class="link" href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> *filter_path);</pre><p>Converts <em class="parameter"><code>filter_path</code></em> to a path on the child model of <em class="parameter"><code>filter</code></em>. That is,<em class="parameter"><code>filter_path</code></em> points to a location in <em class="parameter"><code>filter</code></em>. The returned path willpoint to the same location in the model not being filtered. If <em class="parameter"><code>filter_path</code></em>does not point to a location in the child model, <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>filter</code></em> :</span></p></td><td> A <a class="link" href="GtkTreeModelFilter.html" title="GtkTreeModelFilter"><span class="type">GtkTreeModelFilter</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>filter_path</code></em> :</span></p></td><td> A <a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> to convert.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> A newly allocated <a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a>, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3811933"></a><h3><a name="gtk-tree-model-filter-refilter"></a>gtk_tree_model_filter_refilter ()</h3><a class="indexterm" name="id3811949"></a><pre class="programlisting">void gtk_tree_model_filter_refilter (<a class="link" href="GtkTreeModelFilter.html" title="GtkTreeModelFilter">GtkTreeModelFilter</a> *filter);</pre><p>Emits ::row_changed for each row in the child model, which causesthe filter to re-evaluate whether a row is visible or not.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>filter</code></em> :</span></p></td><td> A <a class="link" href="GtkTreeModelFilter.html" title="GtkTreeModelFilter"><span class="type">GtkTreeModelFilter</span></a>.</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3812016"></a><h3><a name="gtk-tree-model-filter-clear-cache"></a>gtk_tree_model_filter_clear_cache ()</h3><a class="indexterm" name="id3812033"></a><pre class="programlisting">void gtk_tree_model_filter_clear_cache (<a class="link" href="GtkTreeModelFilter.html" title="GtkTreeModelFilter">GtkTreeModelFilter</a> *filter);</pre><p>This function should almost never be called. It clears the <em class="parameter"><code>filter</code></em>of any cached iterators that haven't been reffed with<a class="link" href="GtkTreeModel.html#gtk-tree-model-ref-node"><code class="function">gtk_tree_model_ref_node()</code></a>. This might be useful if the child modelbeing filtered is static (and doesn't change often) and there has beena lot of unreffed access to nodes. As a side effect of this function,all unreffed iters will be invalid.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>filter</code></em> :</span></p></td><td> A <a class="link" href="GtkTreeModelFilter.html" title="GtkTreeModelFilter"><span class="type">GtkTreeModelFilter</span></a>.</td></tr></tbody></table></div><p class="since">Since 2.4</p></div></div><div class="refsect1" lang="en"><a name="id3812120"></a><h2>Property Details</h2><div class="refsect2" lang="en"><a name="id3812131"></a><h3><a name="GtkTreeModelFilter--child-model"></a>The <code class="literal">"child-model"</code> property</h3><a class="indexterm" name="id3812148"></a><pre class="programlisting"> "child-model" <a class="link" href="GtkTreeModel.html" title="GtkTreeModel">GtkTreeModel</a> : Read / Write / Construct Only</pre><p>The model for the filtermodel to filter.</p></div><hr><div class="refsect2" lang="en"><a name="id3812172"></a><h3><a name="GtkTreeModelFilter--virtual-root"></a>The <code class="literal">"virtual-root"</code> property</h3><a class="indexterm" name="id3812188"></a><pre class="programlisting"> "virtual-root" <a class="link" href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> : Read / Write / Construct Only</pre><p>The virtual root (relative to the child model) for this filtermodel.</p></div></div><div class="refsect1" lang="en"><a name="id3812213"></a><h2>See Also</h2><p><a class="link" href="GtkTreeModelSort.html" title="GtkTreeModelSort"><span class="type">GtkTreeModelSort</span></a></p></div><div class="refsect1" lang="en"><a name="id3812231"></a><div class="refsect2" lang="en"><a name="id3812232"></a></div><hr><div class="refsect2" lang="en"><a name="id3812233"></a></div></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -