reimplementation of replace all, and some minor cosmetics
This commit is contained in:
parent
13879aabd0
commit
96c78a0f02
@ -2215,32 +2215,23 @@ void PTextEdit::replaceAndClose()
|
||||
*/
|
||||
void PTextEdit::replaceAll()
|
||||
{
|
||||
// NEEDS TO BE REWRITTEN SINCE Qt4.6 IS FAR TOO DIFFERENT TO Qt3.x
|
||||
/*
|
||||
int currentPara, currentIndex;
|
||||
currentEditor()->getCursorPosition(¤tPara, ¤tIndex);
|
||||
// set the cursor to the start of the document
|
||||
currentEditor()->moveCursor(QTextCursor::Start);
|
||||
|
||||
currentEditor()->setCursorPosition(0,0);
|
||||
// construct search flags
|
||||
QTextDocument::FindFlags flags = 0;
|
||||
if (fFindReplaceData->caseSensitive)
|
||||
flags |= QTextDocument::FindCaseSensitively;
|
||||
else if (fFindReplaceData->findBackwards)
|
||||
flags |= QTextDocument::FindBackward;
|
||||
else if (fFindReplaceData->wholeWordsOnly)
|
||||
flags |= QTextDocument::FindWholeWords;
|
||||
|
||||
int para = 1, index = 1;
|
||||
while (currentEditor()->find(fFindReplaceData->findText,
|
||||
fFindReplaceData->caseSensitive,
|
||||
fFindReplaceData->wholeWordsOnly,
|
||||
true,
|
||||
¶, &index)) {
|
||||
// set cursor to the correct position
|
||||
currentEditor()->setCursorPosition(para, index);
|
||||
|
||||
// replace the text
|
||||
currentEditor()->insert(fFindReplaceData->replaceText);
|
||||
|
||||
index++;
|
||||
while (currentEditor()->find(fFindReplaceData->findText, flags)) {
|
||||
currentEditor()->insertPlainText(fFindReplaceData->replaceText);
|
||||
}
|
||||
|
||||
emit close();
|
||||
|
||||
currentEditor()->setCursorPosition(currentPara, currentIndex);
|
||||
*/
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
<width>367</width>
|
||||
<height>269</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -21,8 +21,8 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>260</y>
|
||||
<width>381</width>
|
||||
<y>230</y>
|
||||
<width>351</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -66,8 +66,8 @@
|
||||
<widget class="QLabel" name="fUnits_label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>20</y>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>61</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
@ -79,9 +79,9 @@
|
||||
<widget class="QLabel" name="fFourierPower_label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>40</y>
|
||||
<width>151</width>
|
||||
<x>10</x>
|
||||
<y>45</y>
|
||||
<width>91</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -92,8 +92,8 @@
|
||||
<widget class="QLabel" name="fApodization_label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>70</y>
|
||||
<x>10</x>
|
||||
<y>75</y>
|
||||
<width>141</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
@ -105,8 +105,8 @@
|
||||
<widget class="QLabel" name="fPlot_label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>100</y>
|
||||
<x>10</x>
|
||||
<y>110</y>
|
||||
<width>61</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
@ -118,7 +118,7 @@
|
||||
<widget class="QLabel" name="fPhase_label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<x>10</x>
|
||||
<y>140</y>
|
||||
<width>61</width>
|
||||
<height>17</height>
|
||||
@ -131,8 +131,8 @@
|
||||
<widget class="QLabel" name="fPhaseCorrectionRange_label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>170</y>
|
||||
<x>0</x>
|
||||
<y>160</y>
|
||||
<width>111</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
@ -149,8 +149,8 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QLabel" name="fRange_label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>220</y>
|
||||
<x>10</x>
|
||||
<y>200</y>
|
||||
<width>61</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
@ -162,8 +162,8 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QComboBox" name="fUnits_comboBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>170</x>
|
||||
<y>10</y>
|
||||
<x>130</x>
|
||||
<y>5</y>
|
||||
<width>111</width>
|
||||
<height>26</height>
|
||||
</rect>
|
||||
@ -187,7 +187,7 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QLineEdit" name="fFourierPower_lineEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>170</x>
|
||||
<x>130</x>
|
||||
<y>40</y>
|
||||
<width>113</width>
|
||||
<height>22</height>
|
||||
@ -197,7 +197,7 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QComboBox" name="fApodization_comboBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>170</x>
|
||||
<x>130</x>
|
||||
<y>70</y>
|
||||
<width>111</width>
|
||||
<height>26</height>
|
||||
@ -227,8 +227,8 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QComboBox" name="fPlot_comboBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>160</x>
|
||||
<y>100</y>
|
||||
<x>130</x>
|
||||
<y>105</y>
|
||||
<width>111</width>
|
||||
<height>26</height>
|
||||
</rect>
|
||||
@ -262,7 +262,7 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QLineEdit" name="fPhase_lineEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>160</x>
|
||||
<x>130</x>
|
||||
<y>140</y>
|
||||
<width>113</width>
|
||||
<height>22</height>
|
||||
@ -272,7 +272,7 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QLineEdit" name="fPhaseCorrectionRangeLow_lineEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>150</x>
|
||||
<x>130</x>
|
||||
<y>170</y>
|
||||
<width>113</width>
|
||||
<height>22</height>
|
||||
@ -282,7 +282,7 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QLineEdit" name="fPhaseCorrectionRangeUp_lineEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>270</x>
|
||||
<x>250</x>
|
||||
<y>170</y>
|
||||
<width>113</width>
|
||||
<height>22</height>
|
||||
@ -292,8 +292,8 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QLineEdit" name="fRangeLow_lineEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>150</x>
|
||||
<y>210</y>
|
||||
<x>130</x>
|
||||
<y>200</y>
|
||||
<width>113</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
@ -302,8 +302,8 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QLineEdit" name="fRangeUp_lineEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>280</x>
|
||||
<y>210</y>
|
||||
<x>250</x>
|
||||
<y>200</y>
|
||||
<width>113</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
|
@ -469,7 +469,7 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>410</y>
|
||||
<y>420</y>
|
||||
<width>421</width>
|
||||
<height>121</height>
|
||||
</rect>
|
||||
@ -543,7 +543,7 @@
|
||||
<x>0</x>
|
||||
<y>545</y>
|
||||
<width>421</width>
|
||||
<height>36</height>
|
||||
<height>39</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
|
Loading…
x
Reference in New Issue
Block a user