designer-manual-12.html
来自「QT 下载资料仅供参考」· HTML 代码 · 共 416 行 · 第 1/5 页
HTML
416 行
<p>The <em>Choose a Pixmap</em> dialog shows the current directory and the 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. View a sample of the pixmap file you select in the preview box located on the right side of the dialog.</p><p>Click <b>OK</b> to accept the pixmap file. Click <b>Cancel</b> to leave the dialog without choosing a pixmap file.</p><a name="dialog-edit-custom-widgets"></a><h3><a name="14"></a>Edit Custom Widgets Dialog</h3><p>Invoke this dialog by clicking <b>Tools|Custom|Edit Custom Widgets</b>. Use this dialog to create custom widgets.</p><p>Custom widgets are created in code. They may contain a combination of existing widgets but with additional functionality, slots and signals, or they may be written from scratch, or a mixture of both. A custom widget is often a specialization (subclass) of another widget or a combination of widgets working together or a blend of both these approaches. If you simply want a collection of widgets in a particular configuration it is easiest to create them, select them as a group, and copy and paste them as required within <em>Qt Designer</em>. Custom widgets are generally created when you need to add new functionality to existing widgets or groups of widgets. To add create a new widget, click the <b>New Widget</b> button. You will find more information about adding new widgets in the 'Definitions Section'. To load a file which contains descriptions of custom widgets, click the <b>Load Descriptions</b> button. Clicking this button invokes the <em>Open Dialog</em>. To save the descriptions of the listed custom widgets, click the <b>Save Descriptions</b> button, which invokes the <em>Save As Dialog</em>. To delete a widget, click the widget in the listbox and then click the <b>Delete Widget</b> button.</p><p>Click <b>Close</b> to leave the Edit Custom Widgets dialog.</p><p align="center"><img align="middle" src="qd-custwiddeftab.png" width="745" height="412"></p><blockquote><p align="center"><em>Edit Custom Widgets- Definition Tab</em></p></blockquote><h4><a name="14-1"></a>The Definition Tab</h4><p>To create a custom widget, click <b>New Widget</b>. Click the Definition tab if you are not already there. You should change the 'Class' name from 'MyCustomWidget' to a unique name by typing in the line edit. Type in the 'Headerfile' line edit to change the name or type the name of a header file you want to use. To search for a saved header file in a directory, click the <b>(ellipsis)</b> button to the right of the Headerfile line edit to invoke the <em>Open Dialog</em>. Click the 'Select Access' combobox to choose how the file will be included. Global include files will be included using angle brackets (<>). Local files will be included using quotation marks. If you have a pixmap that you want to use to identify your widget on the toolbar, click the <b>(ellipsis)</b> button to the right of the 'Pixmap' label. This invokes the <em>Choose a Pixmap Dialog</em>. Click the 'Size Hint' spin boxes to select the recommended size for the widget. If you do not want to have a recommended size, enter -1/-1 in the spinboxes. Click the 'Size Policy' comboboxes to select the vertical size properties of the widget. Click the 'Container Widget' checkbox if the custom widget you are creating should be able to contain other widgets (children).</p><p align="center"><img align="middle" src="qd-editcustwidsigtab.png" width="745" height="412"></p><blockquote><p align="center"><em>Edit Custom Widgets- Signals Tab</em></p></blockquote><h4><a name="14-2"></a>The Signals Tab</h4><p>Click the Signals tab to view a list of all the signals the selected custom widget can emit. To add a new signal, click the <b>New Signal</b> button. Click the 'Signal' line edit and provide an argument for the signal and give the signal a unique name. To delete a signal from the listbox, click the signal to choose it and then click the <b>Delete Signal</b> button.</p><p align="center"><img align="middle" src="qd-custwidslotstab.png" width="745" height="412"></p><blockquote><p align="center"><em>Edit Custom Widgets- Slots Tab</em></p></blockquote><h4><a name="14-3"></a>The Slots Tab</h4><p>Click the Slots tab to view a list of all the slots for the selected custom widget. Click the 'Slot' or 'Access' cloumn headers to sort the slots in the listbox. To add a slot, click the <b>New Slot</b> button. Click the 'Slot' line edit and provide an argument for the slot and give the slot a unique name. Click the 'Access' combobox to choose between public or protected access for your widget. To delete a slot from the listbox, click the slot and then click <b>Delete Slot</b>.</p><p align="center"><img align="middle" src="qd-custwidproptab.png" width="745" height="412"></p><blockquote><p align="center"><em>Edit Custom Widgets- Properties Tab</em></p></blockquote><h4><a name="14-4"></a>The Properties Tab</h4><p>Click the Properties tab to view the list of properties for the selected widget. Click the 'Property' or 'Type' column headers to sort the properties in the listbox. To add a property, click the <b>New Property</b> button. Click the 'Property Name' line edit if you want to change the default name of the property. Note that properties must be implemented in the class using the property system of Qt. To choose a property type, click the 'Type' combobox. To delete a property from the listbox, click the property and then click the <b>Delete Property</b> button.</p><p>Click <b>Close</b> to leave the <em>Edit Custom Widgets</em> dialog.</p><p align="center"><img align="middle" src="qd-chooseimages.png" width="597" height="367"></p><blockquote><p align="center"><em>Choose Images</em></p></blockquote><a name="dialog-choose-images"></a><h3><a name="15"></a>Choose Images Dialog</h3><p>Invoke the <em>Choose Images</em> dialog to choose images to use in a project.</p><p>This dialog shows the current the directory and the 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. As you choose different files, you can preview the images in the window located on the right side of the dialog. 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-chooseanimage.png" width="463" height="286"></p><blockquote><p align="center"><em>Choose an Image</em></p></blockquote><a name="dialog-choose-an-image"></a><h3><a name="16"></a>Choose an Image Dialog</h3><p>The <em>Choose an Image</em> dialog is used to choose an image to use for a widget.</p><p>To choose an image from the listbox, click the image and then click <b>OK</b>. To add an image, click the <b>Add</b> button to invoke the <em>Choose Images... Dialog</em>. To delete an image, click the image in the listbox and then click the <b>Delete</b> button.</p><p>Click <b>Cancel</b> to leave the dialog without making any changes to images.</p><p align="center"><img align="middle" src="qd-selectcolordialog.png" width="490" height="398"></p><blockquote><p align="center"><em>Select Color</em></p></blockquote><a name="dialog-select-color"></a><h3><a name="17"></a>Select Color Dialog</h3><p>The <em>Select Color</em> dialog is used to select color preferences or to create color palettes.</p><p>Choose a color from the 'Basic Colors' section and a sample of the color will appear in the small preview box at the bottom of the dialog. To the right of the color sample, you will see line edits that have information about the location of the color in the color spectrum. In addition, the crosshairs in the larger color spectrum window show the location of the color. You can also create a palette of custom colors. There are two ways to do add custom colors. Click a color on the color spectrum window. When the color appears in the small box below the window, click the color and drag it to one of the blank boxes in the 'Custom Color' section of the dialog. You can also click and drag colors from the 'Basic Colors' section. Another way to add colors is to click the <b>Add to Custom Colors</b> when you have chosen a color.</p><p>Click <b>OK</b> to accept changes to the <em>Select Color</em> dialog. Click <b>Cancel</b> to exit the dialog without selecting a color or adding custom colors.</p><p align="center"><img align="middle" src="qd-editpalettedialog.png" width="457" height="469"></p><blockquote><p align="center"><em>Edit Palette</em></p></blockquote><a name="dialog-edit-palette"></a><h3><a name="18"></a>Edit Palette Dialog</h3><p>The <em>Edit Palette</em> dialog is used to change the palette of the current widget or form. You can use a generated palette, or select colors for each color group and each color role. The palette can be tested with different widget layouts in the preview section.</p><p>The 'Build Palette' section contains three buttons to help you build the palette. Click the <b>3-D Effects</b> button to invoke the <em>Select Color Dialog</em>. Click the <b>Background</b> to invoke the <em>Select Color Dialog</em>. Click the <b>Tune Palette</b> button to invoke the <em>Tune Palette Dialog</em>. Click the 'Select Palette' combobox in the 'Preview' section to choose a palette to preview.</p><p>Click <b>OK</b> to accept the changes to the palette. Click <b>Cancel</b> to leave the dialog without making changes to the palette.</p><p align="center"><img align="middle" src="qd-tunepalettedialog.png" width="362" height="381"></p><blockquote><p align="center"><em>Tune Palette</em></p></blockquote><a name="dialog-tune-palette"></a><h3><a name="19"></a>Tune Palette Dialog</h3><p>The <em>Tune Palette</em> dialog is used to choose options for a widget's palette.</p><p>Click the 'Select Palette' combobox to choose options for active, inactive, or disabled palettes. If you choose 'Active Palette', the dialog presents three categories used for designing the palette. The categories are the Auto, Central Color Roles, and 3-D Shadow Effects. If you choose 'Inactive Palette' or 'Disabled Palette', all categories are disabled except 'Auto'. Click the 'Auto' section checkboxes to build the inactive or disabled palettes from the active palette. For an active palette, click the 'Central color roles' combobox to select a color role for the palette. Click the <b>Choose Pixmap</b> button to invoke the <em>Choose a Pixmap Dialog</em>. Click the <b>Select Color</b> button to invoke the <em>Select Color Dialog</em>. Check the 'Build from button color' checkbox in the '3-D shadow effects' section to allow 3-D effects colors to be calculated from the button color. Uncheck the checkbox to enable the 'Choose 3-D effect color role' combobox. Click the combobox to select a color role for the 3-D effects. Click the <b>Select Color</b> button to invoke the <em>Select Color Dialog</em>.</p><p>Click <b>OK</b> to accept changes to the palette. Click <b>Cancel</b> to leave the dialog without making changes to the palette.</p><p align="center"><img align="middle" src="qd-selectfontdialog.png" width="508" height="386"></p><blockquote><p align="center"><em>Select Font</em></p></blockquote><a name="dialog-select-font"></a><h3><a name="20"></a>Select Font Dialog</h3><p>The <em>Select Font</em> dialog is used to make changes to the font size and style.</p><p>Click the 'Font' listbox to choose a font type. The current selected type appears in the line edit above the 'Font' listbox. Click the 'Font Style' listbox to choose a style for the font. The choices available in the listbox are limited to the type of font you choose. Not all fonts have all styles available. The selected style appears in the line edit above the 'Font Style' listbox. Click the 'Size' listbox to choose a size for the font. The current selected size appears in the line edit above the 'Size' line edit. Click the checkboxes in the 'Effects' section to create a 'Strikeout' or 'Underline' effect for the selected font. Click the 'Script' and choose a style of writing. View your font selections and styles in the 'Sample' listbox.</p><p>Click <b>OK</b> to accept changes to the font. Click <b>Cancel</b> to leave the dialog without making any changes to the font.</p><p align="center"><img align="middle" src="qd-textdialog.png" width="429" height="301"></p><blockquote><p align="center"><em>Text Dialog</em></p></blockquote><a name="dialog-text"></a><h3><a name="21"></a>Text Dialog</h3><p>The <em>Text</em> dialog is used to type text.</p><p>Click <b>OK</b> to accept the text. Click <b>Cancel</b> to leave the dialog without saving any text.</p><p align="center"><img align="middle" src="qd-title.png" width="408" height="120"></p><blockquote><p align="center"><em>Title Dialog</em></p></blockquote><a name="dialog-title"></a><h3><a name="22"></a>Title Dialog</h3><p>Use this dialog to change the title of a selected widget by typing the new title in the line edit.</p><p>Click <b>OK</b> to accept changes to the title. Click <b>Cancel</b> to leave the dialog without making changes to the title.</p><p align="center"><img align="middle" src="qd-pagetitle.png" width="408" height="120"></p><blockquote><p align="center"><em>Page Title Dialog</em></p></blockquote>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?