Skip to content

Commit c868ff1

Browse files
committed
Merge branch 'yunfzhan-master'
2 parents ce41627 + 9ca6c5f commit c868ff1

File tree

3 files changed

+119
-39
lines changed

3 files changed

+119
-39
lines changed

src/MainWindow.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,16 @@ void MainWindow::navigateNext()
534534
selectTableLine(curRow);
535535
}
536536

537+
void MainWindow::navigateBegin()
538+
{
539+
selectTableLine(0);
540+
}
541+
542+
void MainWindow::navigateEnd()
543+
{
544+
selectTableLine(m_browseTableModel->totalRowCount()-1);
545+
}
546+
537547

538548
void MainWindow::navigateGoto()
539549
{
@@ -1088,6 +1098,8 @@ void MainWindow::activateFields(bool enable)
10881098
ui->editCreateIndexAction->setEnabled(enable);
10891099
ui->buttonNext->setEnabled(enable);
10901100
ui->buttonPrevious->setEnabled(enable);
1101+
ui->buttonBegin->setEnabled(enable);
1102+
ui->buttonEnd->setEnabled(enable);
10911103
ui->scrollAreaWidgetContents->setEnabled(enable);
10921104
ui->buttonBoxPragmas->setEnabled(enable);
10931105
ui->buttonGoto->setEnabled(enable);

src/MainWindow.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ private slots:
129129
void selectTableLine( int lineToSelect );
130130
void navigatePrevious();
131131
void navigateNext();
132+
void navigateBegin();
133+
void navigateEnd();
132134
void navigateGoto();
133135
void setRecordsetLabel();
134136
void createTable();

src/MainWindow.ui

Lines changed: 105 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,22 @@
181181
</item>
182182
<item>
183183
<layout class="QHBoxLayout" name="horizontalLayout_2">
184+
<item>
185+
<widget class="QToolButton" name="buttonBegin">
186+
<property name="enabled">
187+
<bool>false</bool>
188+
</property>
189+
<property name="toolTip">
190+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Scroll to the beginning&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
191+
</property>
192+
<property name="whatsThis">
193+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Clicking this button navigates to the beginning in the table view above.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
194+
</property>
195+
<property name="text">
196+
<string>&lt;&lt;</string>
197+
</property>
198+
</widget>
199+
</item>
184200
<item>
185201
<widget class="QToolButton" name="buttonPrevious">
186202
<property name="enabled">
@@ -220,6 +236,22 @@
220236
</property>
221237
</widget>
222238
</item>
239+
<item>
240+
<widget class="QToolButton" name="buttonEnd">
241+
<property name="enabled">
242+
<bool>false</bool>
243+
</property>
244+
<property name="toolTip">
245+
<string>Scroll to the end</string>
246+
</property>
247+
<property name="whatsThis">
248+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&amp;lt;html&amp;gt;&amp;lt;head/&amp;gt;&amp;lt;body&amp;gt;&amp;lt;p&amp;gt;Clicking this button navigates up to the end in the table view above.&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
249+
</property>
250+
<property name="text">
251+
<string>&gt;&gt;</string>
252+
</property>
253+
</widget>
254+
</item>
223255
<item>
224256
<spacer name="horizontalSpacer_2">
225257
<property name="orientation">
@@ -278,8 +310,8 @@
278310
<rect>
279311
<x>0</x>
280312
<y>0</y>
281-
<width>575</width>
282-
<height>458</height>
313+
<width>311</width>
314+
<height>531</height>
283315
</rect>
284316
</property>
285317
<layout class="QFormLayout" name="formLayout">
@@ -764,7 +796,7 @@
764796
<x>0</x>
765797
<y>0</y>
766798
<width>1000</width>
767-
<height>19</height>
799+
<height>25</height>
768800
</rect>
769801
</property>
770802
<widget class="QMenu" name="fileMenu">
@@ -1683,8 +1715,8 @@
16831715
<slot>populateTable(QString)</slot>
16841716
<hints>
16851717
<hint type="sourcelabel">
1686-
<x>59</x>
1687-
<y>82</y>
1718+
<x>118</x>
1719+
<y>141</y>
16881720
</hint>
16891721
<hint type="destinationlabel">
16901722
<x>399</x>
@@ -1699,8 +1731,8 @@
16991731
<slot>addRecord()</slot>
17001732
<hints>
17011733
<hint type="sourcelabel">
1702-
<x>584</x>
1703-
<y>82</y>
1734+
<x>443</x>
1735+
<y>141</y>
17041736
</hint>
17051737
<hint type="destinationlabel">
17061738
<x>399</x>
@@ -1715,8 +1747,8 @@
17151747
<slot>deleteRecord()</slot>
17161748
<hints>
17171749
<hint type="sourcelabel">
1718-
<x>687</x>
1719-
<y>82</y>
1750+
<x>565</x>
1751+
<y>141</y>
17201752
</hint>
17211753
<hint type="destinationlabel">
17221754
<x>399</x>
@@ -1731,8 +1763,8 @@
17311763
<slot>navigatePrevious()</slot>
17321764
<hints>
17331765
<hint type="sourcelabel">
1734-
<x>27</x>
1735-
<y>380</y>
1766+
<x>74</x>
1767+
<y>585</y>
17361768
</hint>
17371769
<hint type="destinationlabel">
17381770
<x>399</x>
@@ -1747,8 +1779,8 @@
17471779
<slot>navigateNext()</slot>
17481780
<hints>
17491781
<hint type="sourcelabel">
1750-
<x>128</x>
1751-
<y>380</y>
1782+
<x>168</x>
1783+
<y>585</y>
17521784
</hint>
17531785
<hint type="destinationlabel">
17541786
<x>399</x>
@@ -1763,8 +1795,8 @@
17631795
<slot>navigateGoto()</slot>
17641796
<hints>
17651797
<hint type="sourcelabel">
1766-
<x>493</x>
1767-
<y>380</y>
1798+
<x>413</x>
1799+
<y>586</y>
17681800
</hint>
17691801
<hint type="destinationlabel">
17701802
<x>399</x>
@@ -1779,8 +1811,8 @@
17791811
<slot>navigateGoto()</slot>
17801812
<hints>
17811813
<hint type="sourcelabel">
1782-
<x>790</x>
1783-
<y>379</y>
1814+
<x>565</x>
1815+
<y>586</y>
17841816
</hint>
17851817
<hint type="destinationlabel">
17861818
<x>399</x>
@@ -1795,8 +1827,8 @@
17951827
<slot>browseRefresh()</slot>
17961828
<hints>
17971829
<hint type="sourcelabel">
1798-
<x>265</x>
1799-
<y>103</y>
1830+
<x>245</x>
1831+
<y>139</y>
18001832
</hint>
18011833
<hint type="destinationlabel">
18021834
<x>399</x>
@@ -2035,8 +2067,8 @@
20352067
<slot>createTreeContextMenu(QPoint)</slot>
20362068
<hints>
20372069
<hint type="sourcelabel">
2038-
<x>399</x>
2039-
<y>341</y>
2070+
<x>101</x>
2071+
<y>125</y>
20402072
</hint>
20412073
<hint type="destinationlabel">
20422074
<x>399</x>
@@ -2083,8 +2115,8 @@
20832115
<slot>loadPragmas()</slot>
20842116
<hints>
20852117
<hint type="sourcelabel">
2086-
<x>251</x>
2087-
<y>381</y>
2118+
<x>101</x>
2119+
<y>125</y>
20882120
</hint>
20892121
<hint type="destinationlabel">
20902122
<x>-1</x>
@@ -2099,8 +2131,8 @@
20992131
<slot>savePragmas()</slot>
21002132
<hints>
21012133
<hint type="sourcelabel">
2102-
<x>364</x>
2103-
<y>381</y>
2134+
<x>101</x>
2135+
<y>125</y>
21042136
</hint>
21052137
<hint type="destinationlabel">
21062138
<x>802</x>
@@ -2115,12 +2147,12 @@
21152147
<slot>clear()</slot>
21162148
<hints>
21172149
<hint type="sourcelabel">
2118-
<x>794</x>
2119-
<y>441</y>
2150+
<x>989</x>
2151+
<y>126</y>
21202152
</hint>
21212153
<hint type="destinationlabel">
2122-
<x>103</x>
2123-
<y>476</y>
2154+
<x>691</x>
2155+
<y>163</y>
21242156
</hint>
21252157
</hints>
21262158
</connection>
@@ -2131,12 +2163,12 @@
21312163
<slot>clear()</slot>
21322164
<hints>
21332165
<hint type="sourcelabel">
2134-
<x>794</x>
2135-
<y>441</y>
2166+
<x>989</x>
2167+
<y>126</y>
21362168
</hint>
21372169
<hint type="destinationlabel">
2138-
<x>611</x>
2139-
<y>576</y>
2170+
<x>990</x>
2171+
<y>240</y>
21402172
</hint>
21412173
</hints>
21422174
</connection>
@@ -2147,12 +2179,12 @@
21472179
<slot>setCurrentIndex(int)</slot>
21482180
<hints>
21492181
<hint type="sourcelabel">
2150-
<x>258</x>
2151-
<y>441</y>
2182+
<x>872</x>
2183+
<y>126</y>
21522184
</hint>
21532185
<hint type="destinationlabel">
2154-
<x>399</x>
2155-
<y>492</y>
2186+
<x>987</x>
2187+
<y>240</y>
21562188
</hint>
21572189
</hints>
21582190
</connection>
@@ -2179,8 +2211,8 @@
21792211
<slot>closeSqlTab(int)</slot>
21802212
<hints>
21812213
<hint type="sourcelabel">
2182-
<x>48</x>
2183-
<y>90</y>
2214+
<x>81</x>
2215+
<y>125</y>
21842216
</hint>
21852217
<hint type="destinationlabel">
21862218
<x>-1</x>
@@ -2396,6 +2428,38 @@
23962428
</hint>
23972429
</hints>
23982430
</connection>
2431+
<connection>
2432+
<sender>buttonEnd</sender>
2433+
<signal>clicked()</signal>
2434+
<receiver>MainWindow</receiver>
2435+
<slot>navigateEnd()</slot>
2436+
<hints>
2437+
<hint type="sourcelabel">
2438+
<x>189</x>
2439+
<y>573</y>
2440+
</hint>
2441+
<hint type="destinationlabel">
2442+
<x>499</x>
2443+
<y>314</y>
2444+
</hint>
2445+
</hints>
2446+
</connection>
2447+
<connection>
2448+
<sender>buttonBegin</sender>
2449+
<signal>clicked()</signal>
2450+
<receiver>MainWindow</receiver>
2451+
<slot>navigateBegin()</slot>
2452+
<hints>
2453+
<hint type="sourcelabel">
2454+
<x>69</x>
2455+
<y>140</y>
2456+
</hint>
2457+
<hint type="destinationlabel">
2458+
<x>499</x>
2459+
<y>314</y>
2460+
</hint>
2461+
</hints>
2462+
</connection>
23992463
</connections>
24002464
<slots>
24012465
<slot>fileOpen()</slot>
@@ -2405,6 +2469,8 @@
24052469
<slot>deleteRecord()</slot>
24062470
<slot>navigatePrevious()</slot>
24072471
<slot>navigateNext()</slot>
2472+
<slot>navigateBegin()</slot>
2473+
<slot>navigateEnd()</slot>
24082474
<slot>navigateGoto()</slot>
24092475
<slot>browseFind(bool)</slot>
24102476
<slot>browseRefresh()</slot>

0 commit comments

Comments
 (0)