Files
musrfit/musredit/html/classPFindDialog.html
T
2026-07-31 18:47:29 +00:00

381 lines
22 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.13.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>musredit: PFindDialog Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">musredit<span id="projectnumber">&#160;1.0.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.13.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',false);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-slots">Protected Slots</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="classPFindDialog-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">PFindDialog Class Reference</div></div>
</div><!--header-->
<div class="contents">
<p>Dialog for searching text in the editor.
<a href="#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="PFindDialog_8h_source.html">PFindDialog.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for PFindDialog:</div>
<div class="dyncontent">
<div class="center"><img src="classPFindDialog__inherit__graph.png" border="0" usemap="#aPFindDialog_inherit__map" alt="Inheritance graph"/></div>
<map name="aPFindDialog_inherit__map" id="aPFindDialog_inherit__map">
<area shape="rect" title="Dialog for searching text in the editor." alt="" coords="50,81,146,109"/>
<area shape="rect" title=" " alt="" coords="5,5,76,33"/>
<area shape="poly" title=" " alt="" coords="62,44,90,79,86,82,58,47"/>
<area shape="rect" title=" " alt="" coords="100,5,213,33"/>
<area shape="poly" title=" " alt="" coords="139,47,110,82,106,79,134,44"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for PFindDialog:</div>
<div class="dyncontent">
<div class="center"><img src="classPFindDialog__coll__graph.png" border="0" usemap="#aPFindDialog_coll__map" alt="Collaboration graph"/></div>
<map name="aPFindDialog_coll__map" id="aPFindDialog_coll__map">
<area shape="rect" title="Dialog for searching text in the editor." alt="" coords="109,98,204,126"/>
<area shape="rect" title=" " alt="" coords="5,5,76,33"/>
<area shape="poly" title=" " alt="" coords="71,41,141,95,138,99,67,45"/>
<area shape="rect" title=" " alt="" coords="100,5,213,33"/>
<area shape="poly" title=" " alt="" coords="159,48,159,98,154,98,154,48"/>
<area shape="rect" href="structPFindReplaceData.html" title="Configuration structure for find and replace operations." alt="" coords="238,5,369,33"/>
<area shape="poly" title=" " alt="" coords="271,44,179,100,177,95,268,39"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a5ef5b8d057ca2fe310ecdf8e72717e40" id="r_a5ef5b8d057ca2fe310ecdf8e72717e40"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a5ef5b8d057ca2fe310ecdf8e72717e40">PFindDialog</a> (<a class="el" href="structPFindReplaceData.html">PFindReplaceData</a> *data, const bool selection, QWidget *parent=nullptr)</td></tr>
<tr class="memdesc:a5ef5b8d057ca2fe310ecdf8e72717e40"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs and initializes the find dialog. <br /></td></tr>
<tr class="separator:a5ef5b8d057ca2fe310ecdf8e72717e40"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae7a5613acf22178b469e64e5dc02d629" id="r_ae7a5613acf22178b469e64e5dc02d629"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae7a5613acf22178b469e64e5dc02d629">~PFindDialog</a> ()</td></tr>
<tr class="memdesc:ae7a5613acf22178b469e64e5dc02d629"><td class="mdescLeft">&#160;</td><td class="mdescRight">Virtual destructor. <br /></td></tr>
<tr class="separator:ae7a5613acf22178b469e64e5dc02d629"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa247177f3e8bce9fef9fd166db7a35d0" id="r_aa247177f3e8bce9fef9fd166db7a35d0"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="structPFindReplaceData.html">PFindReplaceData</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa247177f3e8bce9fef9fd166db7a35d0">getData</a> ()</td></tr>
<tr class="memdesc:aa247177f3e8bce9fef9fd166db7a35d0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves the search parameters from the dialog. <br /></td></tr>
<tr class="separator:aa247177f3e8bce9fef9fd166db7a35d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-slots" name="pro-slots"></a>
Protected Slots</h2></td></tr>
<tr class="memitem:a5771dccfb6e8888ad5a5c0b9bc7e318f" id="r_a5771dccfb6e8888ad5a5c0b9bc7e318f"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a5771dccfb6e8888ad5a5c0b9bc7e318f">onFindTextAvailable</a> (const QString &amp;text)</td></tr>
<tr class="memdesc:a5771dccfb6e8888ad5a5c0b9bc7e318f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Slot called when the find text changes. <br /></td></tr>
<tr class="separator:a5771dccfb6e8888ad5a5c0b9bc7e318f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-attribs" name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:ab77b77601bf23d1242686e592a89d1b9" id="r_ab77b77601bf23d1242686e592a89d1b9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structPFindReplaceData.html">PFindReplaceData</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab77b77601bf23d1242686e592a89d1b9">fData</a></td></tr>
<tr class="memdesc:ab77b77601bf23d1242686e592a89d1b9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to the find/replace data structure for storing search parameters. <br /></td></tr>
<tr class="separator:ab77b77601bf23d1242686e592a89d1b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Dialog for searching text in the editor. </p>
<p>This class implements a modal dialog that allows users to search for text within the current msr file. The dialog provides various search options and stores the search parameters in a <a class="el" href="structPFindReplaceData.html" title="Configuration structure for find and replace operations.">PFindReplaceData</a> structure.</p>
<dl class="section user"><dt>Search Options:</dt><dd><ul>
<li>Case sensitive matching</li>
<li>Whole words only matching</li>
<li>Search from cursor position or document start</li>
<li>Forward or backward search direction</li>
<li>Search within selected text only (when text is selected)</li>
</ul>
</dd></dl>
<dl class="section user"><dt>UI Elements:</dt><dd>The dialog UI is defined in PFindDialog.ui and includes:<ul>
<li>A combo box (fFind_comboBox) for entering and selecting search text</li>
<li>Checkboxes for search options</li>
<li>Find and Cancel buttons</li>
</ul>
</dd></dl>
<dl class="section user"><dt>Usage:</dt><dd><div class="fragment"><div class="line"><a class="code hl_struct" href="structPFindReplaceData.html">PFindReplaceData</a> data;</div>
<div class="line">data.<a class="code hl_variable" href="structPFindReplaceData.html#a921d0043ebbea474d0e29e2da284e45d">findText</a> = <span class="stringliteral">&quot;searchterm&quot;</span>;</div>
<div class="line"><a class="code hl_function" href="#a5ef5b8d057ca2fe310ecdf8e72717e40">PFindDialog</a> dialog(&amp;data, hasSelection, <span class="keyword">this</span>);</div>
<div class="line"><span class="keywordflow">if</span> (dialog.exec() == QDialog::Accepted) {</div>
<div class="line"> <a class="code hl_struct" href="structPFindReplaceData.html">PFindReplaceData</a> *result = dialog.getData();</div>
<div class="line"> <span class="comment">// Perform search with result-&gt;findText</span></div>
<div class="line">}</div>
<div class="ttc" id="aclassPFindDialog_html_a5ef5b8d057ca2fe310ecdf8e72717e40"><div class="ttname"><a href="#a5ef5b8d057ca2fe310ecdf8e72717e40">PFindDialog::PFindDialog</a></div><div class="ttdeci">PFindDialog(PFindReplaceData *data, const bool selection, QWidget *parent=nullptr)</div><div class="ttdoc">Constructs and initializes the find dialog.</div><div class="ttdef"><b>Definition</b> <a href="PFindDialog_8cpp_source.html#l00071">PFindDialog.cpp:71</a></div></div>
<div class="ttc" id="astructPFindReplaceData_html"><div class="ttname"><a href="structPFindReplaceData.html">PFindReplaceData</a></div><div class="ttdoc">Configuration structure for find and replace operations.</div><div class="ttdef"><b>Definition</b> <a href="musredit_8h_source.html#l00109">musredit.h:109</a></div></div>
<div class="ttc" id="astructPFindReplaceData_html_a921d0043ebbea474d0e29e2da284e45d"><div class="ttname"><a href="structPFindReplaceData.html#a921d0043ebbea474d0e29e2da284e45d">PFindReplaceData::findText</a></div><div class="ttdeci">QString findText</div><div class="ttdoc">Text pattern to search for in the document.</div><div class="ttdef"><b>Definition</b> <a href="musredit_8h_source.html#l00110">musredit.h:110</a></div></div>
</div><!-- fragment --></dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classPReplaceDialog.html" title="Find and replace dialog for text editing operations.">PReplaceDialog</a> For combined find and replace functionality </dd>
<dd>
<a class="el" href="structPFindReplaceData.html" title="Configuration structure for find and replace operations.">PFindReplaceData</a> For the structure storing search parameters </dd></dl>
<p class="definition">Definition at line <a class="el" href="PFindDialog_8h_source.html#l00088">88</a> of file <a class="el" href="PFindDialog_8h_source.html">PFindDialog.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a5ef5b8d057ca2fe310ecdf8e72717e40" name="a5ef5b8d057ca2fe310ecdf8e72717e40"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5ef5b8d057ca2fe310ecdf8e72717e40">&#9670;&#160;</a></span>PFindDialog()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">PFindDialog::PFindDialog </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structPFindReplaceData.html">PFindReplaceData</a> *</td> <td class="paramname"><span class="paramname"><em>data</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const bool</td> <td class="paramname"><span class="paramname"><em>selection</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">QWidget *</td> <td class="paramname"><span class="paramname"><em>parent</em></span><span class="paramdefsep"> = </span><span class="paramdefval">nullptr</span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructs and initializes the find dialog. </p>
<p>Sets up the find dialog UI and initializes all controls with values from the provided data structure. The dialog is created as modal.</p>
<p>The constructor performs the following initialization:</p><ol type="1">
<li>Sets up the UI from the .ui file</li>
<li>Disables the Find button if no search text is provided</li>
<li>Disables the "Selected text" option if no text is selected in the editor</li>
<li>Populates all controls with values from the data structure</li>
</ol>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">data</td><td>Pointer to a <a class="el" href="structPFindReplaceData.html" title="Configuration structure for find and replace operations.">PFindReplaceData</a> structure containing initial search parameters and receiving the user's selections on dialog close. </td></tr>
<tr><td class="paramname">selection</td><td>If true, text is currently selected in the editor and the "search in selection" option is enabled; if false, the option is disabled and unchecked. </td></tr>
<tr><td class="paramname">parent</td><td>Pointer to the parent widget (typically the main editor window). </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="PFindDialog_8cpp_source.html#l00071">71</a> of file <a class="el" href="PFindDialog_8cpp_source.html">PFindDialog.cpp</a>.</p>
</div>
</div>
<a id="ae7a5613acf22178b469e64e5dc02d629" name="ae7a5613acf22178b469e64e5dc02d629"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae7a5613acf22178b469e64e5dc02d629">&#9670;&#160;</a></span>~PFindDialog()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual PFindDialog::~PFindDialog </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel virtual">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Virtual destructor. </p>
<p class="definition">Definition at line <a class="el" href="PFindDialog_8h_source.html#l00098">98</a> of file <a class="el" href="PFindDialog_8h_source.html">PFindDialog.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="aa247177f3e8bce9fef9fd166db7a35d0" name="aa247177f3e8bce9fef9fd166db7a35d0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa247177f3e8bce9fef9fd166db7a35d0">&#9670;&#160;</a></span>getData()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structPFindReplaceData.html">PFindReplaceData</a> * PFindDialog::getData </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel virtual">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieves the search parameters from the dialog. </p>
<p>Extracts the current values from all dialog controls and updates the <a class="el" href="structPFindReplaceData.html" title="Configuration structure for find and replace operations.">PFindReplaceData</a> structure. This method should be called after the dialog is accepted to retrieve the user's search settings.</p>
<p>The following values are extracted:</p><ul>
<li>findText: The text to search for</li>
<li>caseSensitive: Whether to match case</li>
<li>wholeWordsOnly: Whether to match whole words only</li>
<li>fromCursor: Whether to start search from cursor position</li>
<li>findBackwards: Whether to search backwards</li>
<li>selectedText: Whether to search only within selected text (if enabled)</li>
</ul>
<dl class="section return"><dt>Returns</dt><dd>Pointer to the updated <a class="el" href="structPFindReplaceData.html" title="Configuration structure for find and replace operations.">PFindReplaceData</a> structure containing all search parameters as set by the user. </dd></dl>
<p class="definition">Definition at line <a class="el" href="PFindDialog_8cpp_source.html#l00119">119</a> of file <a class="el" href="PFindDialog_8cpp_source.html">PFindDialog.cpp</a>.</p>
</div>
</div>
<a id="a5771dccfb6e8888ad5a5c0b9bc7e318f" name="a5771dccfb6e8888ad5a5c0b9bc7e318f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5771dccfb6e8888ad5a5c0b9bc7e318f">&#9670;&#160;</a></span>onFindTextAvailable</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void PFindDialog::onFindTextAvailable </td>
<td>(</td>
<td class="paramtype">const QString &amp;</td> <td class="paramname"><span class="paramname"><em>text</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel protected">protected</span><span class="mlabel virtual">virtual</span><span class="mlabel slot">slot</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Slot called when the find text changes. </p>
<p>Slot to enable/disable the Find button based on search text availability.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">text</td><td>The current text in the find combo box (unused, reads from widget directly).</td></tr>
</table>
</dd>
</dl>
<p>This slot is connected to the text changed signal of the find combo box. It enables the Find button only when there is text to search for, preventing empty searches.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">text</td><td>The current text in the combo box (parameter unused; the method reads directly from the widget to handle all input scenarios). </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="PFindDialog_8cpp_source.html#l00143">143</a> of file <a class="el" href="PFindDialog_8cpp_source.html">PFindDialog.cpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="ab77b77601bf23d1242686e592a89d1b9" name="ab77b77601bf23d1242686e592a89d1b9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab77b77601bf23d1242686e592a89d1b9">&#9670;&#160;</a></span>fData</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structPFindReplaceData.html">PFindReplaceData</a>* PFindDialog::fData</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Pointer to the find/replace data structure for storing search parameters. </p>
<p class="definition">Definition at line <a class="el" href="PFindDialog_8h_source.html#l00110">110</a> of file <a class="el" href="PFindDialog_8h_source.html">PFindDialog.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/workspace/LMU/musrfit/src/musredit_qt6/musredit/<a class="el" href="PFindDialog_8h_source.html">PFindDialog.h</a></li>
<li>/workspace/LMU/musrfit/src/musredit_qt6/musredit/<a class="el" href="PFindDialog_8cpp_source.html">PFindDialog.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2
</small></address>
</div><!-- doc-content -->
</body>
</html>