designer-manual-13.html

来自「QT 下载资料仅供参考」· HTML 代码 · 共 145 行 · 第 1/2 页

HTML
145
字号
<p>The 'Finish' wizard page is used to select auto-editing and to leave the wizard. If you want user edits, e.g. inserts and updates, to be automatically applied when the user navigates to another record, check the 'AutoEditing' checkbox. If 'AutoEditing' is unchecked, users must press <b>Enter</b> to confirm their edit before moving to another record, or their edit will be lost.</p><p>Click <b>Finish</b> to create the datatable widget with all of the options you selected in the wizard. Click <b>Back</b> if you want to return to the 'SQL' wizard page. Click <b>Cancel</b> on any of the wizard pages to leave the wizard without making any changes.</p><h3><a name="4"></a>Data Browser Wizard</h3><p>The Data Browser wizard is automatically invoked by clicking the DataBrowser widget and placing it on the form. The DataBrowser widget is used to create a form view of database data.</p><p align="center"><img align="middle" src="qd-databrowserwzd.png" width="585" height="421"></p><h4><a name="4-1"></a>Choose the Database and Table</h4><p>The 'Choose the Database and Table' wizard page appears first. The available databases are displayed in the 'Database Connection' listbox. Choose a connection by clicking it. If there are no connections listed in the listbox, click <b>Setup Database Connections</b> to invoke the <a href="designer-manual-12.html#4-3">Edit Database Connections Dialog</a>. The 'Table' listbox shows all the tables and views that are available through the selected database connection. Select a table or view by clicking it.</p><p>Click <b>Next</b> to move on to the next wizard page.</p><p align="center"><img align="middle" src="qd-databrowserwzdpage2.png" width="585" height="421"></p><h4><a name="4-2"></a>Displayed Fields</h4><p>The 'Displayed Fields' wizard page is used to select fields that will be displayed in the table. Click the blue left and right arrow buttons to move fields from the 'Available Fields' listbox and into or out of the 'Displayed Fields' listbox. Click the blue up and down arrow buttons to move fields up and down within the 'Displayed Fields' listbox.</p><p>Click <b>Next</b> to move on to the next wizard page. Click <b>Back</b> if you want to return to the 'Choose the Database and Table' wizard page.</p><p align="center"><img align="middle" src="qd-databrowserwzdpage3.png" width="585" height="421"></p><h4><a name="4-3"></a>Navigation and Editing</h4><p>The 'Navigation and Editing' wizard page is used to create navigation and editing buttons.</p><p>Check the 'Include Navigation Buttons' checkbox to include navigation buttons. In the 'Navigation section, click 'Previous' to display the 'Previous' button on the form. This option allows you to navigate to the previous record in the table. Click 'Next' to display the 'next' button on the form. This button allows you to navigate to the next record in the table. Click 'First' to display the 'First' button on the form. This option allows you to navigate to the first record in the table. Click 'Last' to display the 'Last' button on the form. This button allows you to navigate to the last record in the table.</p><p>Click the 'Include Edit Buttons' checkbox to include editing buttons. In the 'Editing' section, check the 'Insert' checkbox to create an 'Insert' button for adding new records. Check the 'Update' checkbox to create an 'Update' button for updating existing records. Check the 'Delete' checkbox to create a 'Delete' button for deleting records.</p><p>The navigation buttons, and 'Update' and 'Delete' buttons will work without requiring any code. Since most database designs expect new records to be created with a unique key the 'Insert' button will not work. This can easily be fixed by generating the key in a slot connected to the <tt>QDataBrowser::beforeInsert()</tt> signal.</p><p>Click <b>Next</b> to move on to the next wizard page. Click <b>Back</b> if you want to return to the 'Displayed Fields' wizard page.</p><p align="center"><img align="middle" src="qd-databrowserwzdpage4.png" width="585" height="456"></p><h4><a name="4-4"></a>SQL</h4><p>The 'SQL' wizard page is used to apply filters and sorts to the data in the table. Click the 'Filter' line edit and type a valid SQL <tt>WHERE</tt> clause without the WHERE keyword. The filter applies to the data shown in the table.</p><p>To sort the available fields in the table, click the blue left and right arrow buttons to move fields from the 'Available Fields' listbox into or out of the 'Sort By' listbox. Click the blue up and down arrow buttons to move fields up and down within the 'Sort By' listbox. Click the <b>A-Z</b> button to change the sort order of the selected field in the 'Sort By' listbox from ascending to descending and vice versa.</p><p>Click <b>Next</b> to move on to the next wizard page. Click <b>Back</b> if you want to return to the 'Navigation and Editing' wizard page.</p><p align="center"><img align="middle" src="qd-databrowserwzdpage5.png" width="585" height="421"></p><h4><a name="4-5"></a>Layout</h4><p>The 'Layout' wizard page is used to design the layout of the database browser. To choose the number of columns the form will use, click the 'Number of Columns' spinbox. To make labels appear to the left of the data entry fields, click the 'Labels to left' radio button. To make labels appear above the data entry fields, click the 'Labels on top' radio button.</p><p>Click the 'Create layout for fields' checkbox to arrange all fields inside of a box layout. Click the 'Create layout for buttons' checkbox to arrange all buttons inside of a box layout. Click 'Create layout for all' to create a box layout for the whole widget.</p><p>You can always break the layouts and redo them later if you change your mind.</p><p>Click <b>Next</b> to move on to the next wizard page. Click <b>Back</b> if you want to return to the 'SQL' wizard page.</p><p align="center"><img align="middle" src="qd-databrowserwzdpage6.png" width="585" height="421"></p><h4><a name="4-6"></a>Finish</h4><p>The 'Finish' wizard page is used to select auto-editing and to leave the wizard. If you want user edits, e.g. inserts and updates, to be automatically applied when the user navigates to another record, check the 'AutoEditing' checkbox. If 'AutoEditing' is unchecked, users must press <b>Enter</b> to confirm their edit before moving to another record, or their edit will be lost. This property can be changed later if desired.</p><p>Click <b>Finish</b> to create the databrowser widget with all of the options you selected in the wizard. Click <b>Back</b> if you want to return to the 'Layout' wizard page. Click <b>Cancel</b> on any of the wizard pages to leave the wizard without making any changes.</p><h3><a name="5"></a>Data View Wizard</h3><p>The Data View wizard is automatically invoked by clicking the dataview widget and placing it on the form. The Dataview widget is used to create a read-only form view of database data.</p><p align="center"><img align="middle" src="qd-dataviewwzd.png" width="585" height="421"></p><h4><a name="5-1"></a>Choose the Database and Table</h4><p>The 'Choose the Database and Table' wizard page appears first. The available databases are displayed in the 'Database Connection' listbox. Choose a connection by clicking it. If there are no connections listed in the listbox, click <b>Setup Database Connections</b> to invoke the <a href="designer-manual-12.html#4-3">Edit Database Connections Dialog</a>. The 'Table' listbox shows all the tables and views that are available through the selected database connection. Select a table or view by clicking it.</p><p>Click <b>Next</b> to move on to the next wizard page.</p><p align="center"><img align="middle" src="qd-dataviewwzdpage2.png" width="585" height="421"></p><h4><a name="5-2"></a>Displayed Fields</h4><p>The 'Displayed Fields' wizard page is used to select fields that will be displayed in the table. Click the blue left and right arrow buttons to move fields from the 'Available Fields' listbox and into or out of the 'Displayed Fields' listbox. Click the blue up and down arrow buttons to move fields up and down within the 'Displayed Fields' listbox.</p><p>Click <b>Next</b> to move on to the next wizard page. Click <b>Back</b> if you want to return to the 'Choose the Database and Table' wizard page.</p><p align="center"><img align="middle" src="qd-dataviewwzdpage3.png" width="585" height="421"></p><h4><a name="5-3"></a>Layout</h4><p>The 'Layout' wizard page is used to design the layout of the data view. To choose the number of columns the form will use, click the 'Number of Columns' spinbox. To make labels appear to the left of the data entry fields, click the 'Labels to left' radio button. To make labels appear above the data entry fields, click the 'Labels on top' radio button.</p><p>Click <b>Next</b> to move on to the next wizard page. Click <b>Back</b> if you want to return to the 'Displayed Fields' wizard page.</p><p align="center"><img align="middle" src="qd-dataviewwzdpage4.png" width="585" height="421"></p><h4><a name="5-4"></a>Finish</h4><p>The 'Finish' wizard page is used to create the wizard once you have selected all the option you want on the previous wizard pages.</p><p>Click <b>Finish</b> to create the databrowser widget with all of the options you selected in the wizard. Click <b>Back</b> if you want to return to the 'Layout' wizard page. Click <b>Cancel</b> on any of the wizard pages to leave the wizard without making any changes.</p><!-- eof --><p align="right">[<a href="designer-manual-12.html">Prev: Reference: Dialogs</a>] [<a href="designer-manual.html">Home</a>] [<a href="designer-manual-14.html">Next: Reference: Windows</a>]</p><p><address><hr><div align=center><table width=100% cellspacing=0 border=0><tr><td>Copyright &copy; 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?