designer-manual-13.html
来自「QT 下载资料仅供参考」· HTML 代码 · 共 145 行 · 第 1/2 页
HTML
145 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- /home/reggie/tmp/qt-3.0-reggie-5401/qt-x11-commercial-3.0.5/tools/designer/book/chap-wizards.leaf:3 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Reference: Wizards</title><style type="text/css"><!--h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }a:link { color: #004faf; text-decoration: none }a:visited { color: #672967; text-decoration: none }body { background: #ffffff; color: black; }--></style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr bgcolor="#E5E5E5"><td valign=center> <a href="index.html"><font color="#004faf">Home</font></a> | <a href="classes.html"><font color="#004faf">All Classes</font></a> | <a href="mainclasses.html"><font color="#004faf">Main Classes</font></a> | <a href="annotated.html"><font color="#004faf">Annotated</font></a> | <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> | <a href="functions.html"><font color="#004faf">Functions</font></a></td><td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><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><h2 align="center">Reference: Wizards</h2><h3><a name="1"></a>Introduction</h3><p>In <em>Qt Designer</em>, some of the toolbars, menu options and templates invoke wizards to take you step-by-step through particular tasks. In this chapter we explain each <em>Qt Designer</em> wizard.</p><h3><a name="2"></a>Main Window Wizard</h3><p>The Main Window Wizard is invoked by clicking the Main Window form template in the <a href="designer-manual-12.html#2-1">New File Dialog</a>. This wizard helps you to create a main window with actions, menu options and toolbars.</p><p align="center"><img align="middle" src="qd-mainwinwzd.png" width="658" height="418"></p><h4><a name="2-1"></a>Choose Available Menus and Toolbars</h4><p>The 'Choose available menus and toolbars' wizard page appears first. It presents three categories of default actions, File Actions, Edit Actions and Help Actions. For each category you can choose to have <em>Qt Designer</em> create menu items, toolbar buttons and signal/slots connections for the relevant actions. You can always add or delete actions, menu items, toolbar buttons and connections later. Check or uncheck the checkboxes to reflect your preferences.</p><p>Click <b>Next</b> to move on to the next wizard page.</p><p align="center"><img align="middle" src="qd-mainwinwzdpage2.png" width="658" height="418"></p><h4><a name="2-2"></a>Setup Toolbar</h4><p>The 'Setup Toolbar' wizard page is used to populate a toolbar with actions from each of the default action categories. Click the Category combobox to select which set of actions you wish to work on. The Actions listbox lists the actions available for the current category. The Toolbar listbox lists the toolbar buttons you want to create. Click the blue left and right arrow buttons to move actions into or out of the Toolbar list box. Click the blue up and down arrow buttons to move actions up and down within the Toolbar list box. Note that the '<Separator>' item in the Actions list box may be moved to the Toolbar list box as often as required and will cause a separator to appear in the finished toolbar.</p><p>Click <b>Back</b> if you want to return to the 'Choose available menus and toolbars' wizard page. Click <b>Finish</b> to populate the main window and to exit the wizard. Click <b>Cancel</b> on any of the wizard pages to leave the wizard without making any changes.</p><h3><a name="3"></a>Data Table Wizard</h3><p>The Data Table Wizard is automatically invoked by clicking the datatable widget and placing it on the form. The datatable widget is used to create tabular views of database data.</p><p align="center"><img align="middle" src="qd-datatablewzd.png" width="585" height="421"></p><h4><a name="3-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-datatablewzdpage2.png" width="585" height="421"></p><h4><a name="3-2"></a>Displayed Fields</h4><p>The 'Displayed Fields' wizard page is used to select fields that will be displayed in the table. By default, every field except the table or view's primary key, is initially placed in the 'Displayed Fields' list. 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. The order in which fields appear in the 'Displayed Fields' listbox is the order they are shown in the Data Table, with the top-most field being in the left-most column.</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-datatablewzdpage3.png" width="585" height="421"></p><h4><a name="3-3"></a>Table Properties</h4><p>The 'Table Properties' wizard page is used to set the Data Table's initial editing options. Check the 'Read-Only' checkbox to prevent records from being edited, deleted or added. Check the checkboxes in the 'Confirmations' section to force the user to confirm their changes. By default users must confirm deletions. Click 'Allow column sorting' to allow the user to sort the data by clicking a column's header (which displays the field name).</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-datatablewzdpage4.png" width="585" height="456"></p><h4><a name="3-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 enter 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 'Table Properties' wizard page.</p><p align="center"><img align="middle" src="qd-datatablewzdpage5.png" width="585" height="421"></p><h4><a name="3-5"></a>Finish</h4>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?