designer-manual-12.html

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

HTML
416
字号
</p><blockquote><p align="center"><em>Create Template</em></p></blockquote><a name="dialog-file-create-template"></a><h4><a name="2-4"></a>Create Template Dialog</h4><p>Click <b>File|Create Template</b> to invoke the <em>Create Template</em> dialog. Use this dialog to create templates.</p><p>The 'Template Name' line edit defaults to 'New Template'. To change the name to a different name, type it in the line edit. Click the 'Baseclass for Template' scroll bar to choose a base class for the template.</p><p>Click <b>Create</b> to create the template. Click <b>Cancel</b> to leave the dialog without creating a template.</p><p>If you create a template it will appear in the <a href="designer-manual-12.html#2-1">New File Dialog</a>. Templates are useful when you have to produce a large number of similar forms, or where you want to 'brand' your forms.</p><h3><a name="3"></a>The Edit Dialogs</h3><p align="center"><img align="middle" src="qd-editslots1.png" width="692" height="407"></p><blockquote><p align="center"><em>Edit Slots</em></p></blockquote><a name="dialog-edit-slots"></a><h4><a name="3-1"></a>Edit Slots Dialog</h4><p>Click <b>Edit|Slots</b> to invoke the <em>Edit Slots</em> dialog. Use this dialog to edit or create slots which are used in conjunction with signals to provide communication between objects.</p><p>When this dialog is invoked, all existing slots are shown in the 'Slot' listbox. The column headers Slot, Type, Specifier, Access, and In-Use provide details about each slot that is listed. Click on any of the column headers to sort the slots. To create a new slot, click the <b>New Slot</b> button. The new slot has a default name that you should replace by typing the new name in the 'Slot' line edit. The 'Return Type' is also a default that can be changed by typing in the line edit. To change the 'Specifier' or 'Access', click the combobox and choose the required specifier or access. To remove a slot, click the slot you want to delete, and then click the <b>Delete Slot</b> button.</p><p>Click <b>OK</b> to save all changes made to slots. Click <b>Cancel</b> to leave the dialog without making any changes to slots.</p><p align="center"><img align="middle" src="qd-viewconnections.png" width="580" height="341"></p><blockquote><p align="center"><em>View Connections</em></p></blockquote><a name="dialog-view-connections"></a><h4><a name="3-2"></a>View Connections Dialog</h4><p>Click <b>Edit|Connections</b> to invoke the <em>View Connections</em> dialog. This dialog displays the current signals and slots connections.</p><p>When this dialog is invoked, all existing connections are shown in the listbox. The column headers Sender, Signal, Receiver, and Slot provide details about each connection. Click the column headers to sort the connections. To remove a connection from the listbox, click the connection you want to disconnect and then click <b>Disconnect</b>. To edit a connection, click the <b>Edit...</b> button to invoke the <em>Edit Connections Dialog</em>.</p><p>Changes made in this dialog take immediate effect. Click the <b>Close</b> button to leave the dialog.</p><p align="center"><img align="middle" src="qd-editformsettings.png" width="505" height="452"></p><blockquote><p align="center"><em>Form Settings</em></p></blockquote><a name="dialog-edit-form-settings"></a><h4><a name="3-3"></a>Form Settings Dialog</h4><p>Click <b>Edit|Form Settings</b> to invoke the <em>Form Settings</em> dialog. Use this dialog to save the form's settings, pixmap, and layout properties.</p><h5><a name="3-3-1"></a>Settings</h5><p>In the Settings section, you can change or add the name of the class that will be created by typing in the 'Class Name' line edit. Note that the default name is the form name, but it can be changed. You can also enter text to the 'Comment' and 'Author' line edits or leave them blank, since they are not required.</p><h5><a name="3-3-2"></a>Pixmaps</h5><p>The default (for projects) is 'Project Imagefile'. This is the recommended option. Images are handled automatically, with <em>Qt Designer</em> storing the images in a subdirectory, and <tt>uic</tt> producing code that contains the images and the necessary supporting code. Each image is stored just once, no matter how many forms it is used in.</p><p>If you do not want <em>Qt Designer</em> to handle the images, (or are not using a project) choose either 'Save Inline' or 'Use Function'. 'Save Inline' saves the pixmaps in the <tt>.ui</tt> files. The disadvantage of this approach is that it stores images in the forms in which they're used, meaning that images cannot be shared across forms. Click 'Use Function' to use your own icon-loader function for loading pixmaps. Type the function's name (with no signature) in the 'Use Function' line edit. This function will be used in the generated code for loading pixmaps. Your function will be called with the text you put in the pixmap property (e.g. the image name) whenever an image is required.</p><h5><a name="3-3-3"></a>Layouts</h5><p>Click the 'Default Margin' spinbox or the 'Default Spacing' spinbox to change the default layout of the current form.</p><p>Click <b>OK</b> to accept changes to the form settings. Click <b>Cancel</b> to leave the dialog without making any changes.</p><a name="dialog-edit-preferences"></a><h4><a name="3-4"></a>Preferences Dialog</h4><p>Click <b>Edit|Preferences</b> to invoke the <em>Preferences</em> dialog. This dialog has a tab for 'General' preferences. If you have the C++ Editor plugin, the dialog will also have a tab for the C++ Editor.</p><p align="center"><img align="middle" src="qd-editpreferencesgeneral.png" width="522" height="444"></p><blockquote><p align="center"><em>Preferences- General Tab</em></p></blockquote><h5><a name="3-4-1"></a>General Tab</h5><p>The 'General' tab has sections for Background, Grid, General, and Toolbars.</p><p>The Background section defaults to 'Pixmap'. To change the default, click the <b>Select a Pixmap</b> button next to the 'Pixmap' radio button to invoke the <em>Choose a Pixmap... Dialog</em>. Click the 'Color' radio button to change the background to a color instead of a pixmap. Click the <b>Choose a Color</b> button located to the right of the 'Color' radio button to invoke the <em>Select Color Dialog</em>.</p><p>The 'General' section of the General tab has three checkboxes that are checked by default. Click the 'Restore last workspace on startup' checkbox to save the size and positions of the windows and toolbars of <em>Qt Designer</em>. The next time you start up <em>Qt Designer</em>, the windows and toolbars are restored to their last positions. Click the 'Show Splash Screen on startup' checkbox to display the <em>Qt Designer</em> splash screen when you start up the application. Click the 'Disable Database Auto-Edit in Preview' checkbox to disable the ability to update or delete data in the database to which you are connected when working with database widgets. To change the path <em>Qt Designer</em> uses to find it's online documentation, click the 'Documentation Path' line edit and type a new path. It would be unlikely to have to change this path. Another way to change the path is to click the <b>(ellipsis)</b> button located to the right of the line edit. This invokes the <em>Find Directory Dialog</em>.</p><p>The 'Grid' section has options for customizing the grid on the form. The 'Show Grid' checkbox located above the 'Grid' section is checked by default. Developers using <em>Qt Designer</em> almost always use Qt's layouts to design their forms and rarely make any use of the grid. The grid is provided for the rare occasions when a form is created using widgets with fixed sizes and positions. When 'Show Grid' is checked, you can customize the grid's appearance. When it is unchecked, the 'Grid' section is disabled. The 'Snap to Grid' checkbox is also checked by default. When it is checked, widgets are placed on a dot (snap to the grid) using the X|Y resolution. When it is unchecked, the 'Grid-X' and 'Grid-Y' spin boxes are disabled. Click the 'Grid X' and 'Grid Y' spinboxes to customize the grid settings for all forms.</p><p>The 'Toolbars' section has a 'Show Text Labels' checkbox. Click the checkbox to display the text labels for each icon shown in the <em>Qt Designer</em> toolbar.</p><p align="center"><img align="middle" src="qd-editpreferencesc++.png" width="522" height="444"></p><blockquote><p align="center"><em>Preferences- C++ Editor Tab</em></p></blockquote><h5><a name="3-4-2"></a>C++ Editor Tab</h5><p>The C++ Editor tab provides options for customizing the editor. The 'Syntax Highlighting' section lets you change the way the syntax is viewed in the editor. Click the 'Element' listbox and choose an element. Click the 'Family' listbox to change the font style for that element. Click the 'Size' spinbox to choose a font size. You can change the font to Bold, Italic, or Underline by clicking the corresponding checkbox. Note, that all the fonts used derive from the 'Standard' element, so if you want to change the font used for everything, change the 'Standard' element. Click the <b>Color</b> button to invoke the <em>Select Color Dialog</em>. As you make changes to each element, you can view the changes in the 'Preview' line edit.</p><p>The 'Options' section has the Wordwrap, Completion, and Parentheses Matching checkboxes checked by default. Click the checkboxes to de-select them.</p><p>Click <b>OK</b> to accept changes to <em>Preferences</em> dialog. Click <b>Cancel</b> to leave the dialog without making any changes.</p><h3><a name="4"></a>The Project Dialogs</h3><p align="center"><img align="middle" src="qd-projectaddfile.png" width="597" height="367"></p><blockquote><p align="center"><em>Add Dialog</em></p></blockquote><a name="dialog-add"></a><h4><a name="4-1"></a>Add Dialog</h4><p>Click <b>Project|Add File</b> to invoke the <em>Add</em> dialog. Use this dialog to add files to the current project.</p><p>The <em>Add</em> dialog defaults the directory and file type. To choose a different directory, click the 'Look In' combobox. Choose a file and the name will appear in the 'File Name' combobox. To choose a different file type, click the 'File Type' combobox. Click the 'Create New Folder' toolbar button to create a new directory. Click the 'List View' toolbar button to view folders and files in a list with only the names showing. Click the 'Details' toolbar button to view the folders and file names along with their size, type, date, and attributes. Click the Size, Type, Date, or Attributes column headers to sort the folders or files.</p><p>Click <b>Open</b> to open the selected file. Click <b>Cancel</b> to leave the dialog without opening a file.</p><p align="center"><img align="middle" src="qd-projectimages.png" width="463" height="286"></p><blockquote><p align="center"><em>Manage Image Collection</em></p></blockquote><a name="dialog-image-collection"></a><h4><a name="4-2"></a>Image Collection Dialog</h4><p>Click <b>Project|Image Collection</b> to invoke the <em>Manage Image Collection Dialog</em>. Use this dialog to view the project's images, add new images, or delete images.</p><p>To add an image, click the <b>Add</b> button to invoke the <em>Choose Images... Dialog</em>. To delete an image from from the iconview, click the image and then click the <b>Delete</b> button.</p><p>Changes made to the image collection are applied immediately. Click the <b>Close</b> button to leave the dialog.</p><p align="center"><img align="middle" src="qd-projectdbaseconnections.png" width="528" height="374"></p><blockquote><p align="center"><em>Edit Database Connections</em></p></blockquote><a name="dialog-edit-database-connections"></a><h4><a name="4-3"></a>Edit Database Connections Dialog</h4><p>Click <b>Project|Database Connections</b> to invoke the <em>Edit Database Connections Dialog</em>. Use this dialog to connect your project to a database or to edit the current connections.</p><p>Click <b>New Connection</b> to create a new database connection. For applications that use a single database it will probably be most convenient to use the default connection name of '(default)'. If you use more than one database then each one must be given a unique name. A driver must be chosen from the Driver combo box. The database name may be available in the Database Name combo box or may have to be typed in. The database name, username, password and hostname should be provided by your database system administrator. When the Connection information has been completed click Connect. If the connection is made the connection name will appear in the list box on the left hand side of the dialog.</p><p>To remove a connection, click the connection in the listbox and then click the <b>Delete Connection</b> button.</p><p>Click <b>Close</b> to leave the <em>Database Connections</em> dialog.</p><a name="dialog-project-settings"></a><h4><a name="4-4"></a>Project Settings Dialog</h4><p>Click <b>Project|Project Settings</b> to invoke the <em>Project Settings Dialog</em>. Use this dialog to make changes to the project settings.</p><p align="center"><img align="middle" src="qd-projectsettingsdialog.png" width="459" height="335"></p><blockquote><p align="center"><em>Project Settings- Settings Tab</em></p></blockquote><h5><a name="4-4-1"></a>Settings Tab</h5><p>The 'Settings' tab shows information about the project. The Project File line edit defaults the project name. To change the name, type a new name in the line edit. To save the project, click the <b>(ellipsis)</b> button located next to Project File to invoke the <em>Save As Dialog</em>. The 'Language' combobox is disabled. Click the 'Description' line edit if you want to add additional information about the project.</p><p align="center"><img align="middle" src="qd-projectsettingsfilestabdialog.png" width="459" height="335">

⌨️ 快捷键说明

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