designer-manual-12.html
来自「QT 下载资料仅供参考」· HTML 代码 · 共 416 行 · 第 1/5 页
HTML
416 行
<!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-mdialogs.leaf:3 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Reference: Dialogs</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-11.html">Prev: Reference: Toolbar Buttons</a>] [<a href="designer-manual.html">Home</a>] [<a href="designer-manual-13.html">Next: Reference: Wizards</a>]</p><h2 align="center">Reference: Dialogs</h2><h3><a name="1"></a>Introduction</h3><p>This chapter describes and explains every <em>Qt Designer</em> dialog.</p><h3><a name="2"></a>The File Dialogs</h3><p align="center"><img align="middle" src="qd-filenew2.png" width="565" height="462"></p><blockquote><p align="center"><em>New File Dialog</em></p></blockquote><a name="dialog-file-new"></a><h4><a name="2-1"></a>New File Dialog</h4><p>Click <b>File|New</b> (or press <b>Ctrl+N</b>) to invoke the <em>New File</em> dialog. This dialog offers four kinds of file to choose from: C++ Project, Forms, Source files, and Main files.</p><p>The 'Insert Into' drop-down combobox lists the open projects, defaulting to the current project. New files are added to the project displayed in this combobox. To add a new file to a different project, choose the project you want to use in the 'Insert Into' combobox.</p><p>The 'Dialog' file type is highlighted by default when the <em>New File</em> dialog pops up. Click on the file type you want to use and click <b>OK</b> to create it. Click <b>Cancel</b> to leave the dialog without creating a new file. Note that if you select C++ Project, the 'Insert Into' combobox will be disabled, since it is not possible to insert a new C++ Project into an existing project.</p><h5><a name="2-1-1"></a>C++ Project Files</h5><p>Click <b>C++ Project</b> to start a new project. This option invokes the <a href="designer-manual-12.html#4-4">Project Settings Dialog</a>. C++ projects are saved as <tt>.pro</tt> files, which include the information <em>Qt Designer</em> needs to manage projects. When you add a form to your project in <em>Qt Designer</em>, it is automatically added to the FORMS section of the project file. The <tt>.pro</tt> file contains the list of forms (<tt>.ui</tt> files) used in the project. <em>Qt Designer</em> reads and writes <tt>.ui</tt> files, e.g. form.ui. The uic (user interface compiler) creates both a header file, e.g. form.h, and an implementation file, e.g. form.cpp, from the <tt>.ui</tt> file.</p><h5><a name="2-1-2"></a>Dialog Forms</h5><p>Click <b>Dialog</b> to create a plain dialog form. Typically, this type of form is used to present the user with configuration options, or to present related sets of choices, for example, printer setting dialogs and find and replace dialogs.</p><h5><a name="2-1-3"></a>Wizard Forms</h5><p>Click <b>Wizard</b> to create a wizard form. A wizard is a special type of input dialog that consists of a sequence of dialog pages. A wizard's purpose is to assist a user by automating a task by walking the user through the process step by step. Wizards are useful for complex or infrequently occurring tasks that people may find difficult to learn or do. Initially the wizard form consists of a single dialog page. Use the right click context menu to add additional pages and to change page titles.</p><h5><a name="2-1-4"></a>Widget Forms</h5><p>Click <b>Widget</b> to create a form whose superclass is QWidget rather than QDialog.</p><h5><a name="2-1-5"></a>Main Window Form</h5><p>Click <b>Main Window</b> to invoke the <a href="designer-manual-13.html#2">Main Window Wizard</a>. This wizard is used to create actions, menu options and toolbars through which the user can invoke actions. This form is used to create typical main-window style applications.</p><h5><a name="2-1-6"></a>Configuration Dialog Form</h5><p>Click <b>Configuration Dialog</b> creates a form with a listbox on the left, and a tabwidget filling the body of the form, along with Help, OK and Cancel buttons.</p><h5><a name="2-1-7"></a>Dialog with Buttons (Bottom) Form</h5><p>The <b>Dialog with Buttons (Bottom)</b> form is a template with default buttons at the bottom of the form.</p><h5><a name="2-1-8"></a>Dialog with Buttons Form (Right)</h5><p>The <b>Dialog with Buttons (Right)</b> form is a template with default buttons at the right of the form.</p><h5><a name="2-1-9"></a>Tab Dialog Form</h5><p>The <b>Tab Dialog</b> form has a tab widget as its central widget, along with Help, OK and Cancel buttons along the bottom.</p><h5><a name="2-1-10"></a>C++ Source File</h5><p>Click <b>C++ Source File</b> to create a new empty C++ file. The file will automatically be added to the project when it is saved.</p><h5><a name="2-1-11"></a>C++ Header File</h5><p>Click <b>C++ Header File</b> to create a new empty C++ header file. The file will automatically be added to the project when it is saved.</p><h5><a name="2-1-12"></a>C++ Main File</h5><p>Click <b>C++ Main File</b> to invoke the <a href="designer-manual-12.html#7">Configure Main-File Dialog</a> which will create a basic <tt>main.cpp</tt> file automatically.</p><p align="center"><img align="middle" src="qd-fileopen.png" width="597" height="367"></p><blockquote><p align="center"><em>File Open Dialog</em></p></blockquote><a name="dialog-file-open"></a><h4><a name="2-2"></a>File Open Dialog</h4><p>Click <b>File|Open</b> (or press<b>Ctrl+O</b>) to invoke the <em>Open</em> dialog. Use this dialog to open existing files.</p><p>The <em>Open</em> dialog shows the current directory and default 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 new file.</p><p>Note: For Windows, the System File Dialogs are used.</p><p align="center"><img align="middle" src="qd-filesaveasdialog.png" width="597" height="367"></p><blockquote><p align="center"><em>Save As</em></p></blockquote><a name="dialog-file-save-as"></a><h4><a name="2-3"></a>Save As</h4><p>Click <b>File|Save As</b> to invoke the <em>Save As</em> dialog. Use this dialog to save files to a directory.</p><p>The <em>Save As</em> dialog shows the current directory and default 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>Save</b> to save the selected file. Click <b>Cancel</b> to leave the dialog without saving the file.</p><p>Note: For Windows, the System File Dialogs are used.</p><p align="center"><img align="middle" src="qd-createtemplate.png" width="361" height="274">
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?