⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 designer-manual-15.html

📁 QT 下载资料仅供参考
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<p>Images are normally included by listing their filenames in project files. Images can also be included inline using the <a href="designer-manual-15.html#1-9">images</a> tag. Another way of dealing with images is to specify a function name. This function will be called, with the name (or 'key') of the relevant image, and is responsible for loading the appropriate image. To specify such a function the <tt>&lt;pixmapfunction&gt;</tt> tag is used.</p><pre>&lt;pixmapfunction&gt;splashScreen&lt;/pixmapfunction&gt;</pre><a name="pixmapinproject"></a><h4><a name="1-14"></a>pixmapinproject</h4><p>Most applications store their images as separate files listed in the application's project file. This can be signified by including the <tt>&lt;pixmapinproject&gt;</tt> tag.</p><pre>&lt;pixmapinproject/&gt;</pre><a name="signals"></a><h4><a name="1-15"></a>signals</h4><p>See <a href="designer-manual-15.html#1-5">connections</a>.</p><a name="slots"></a><h4><a name="1-16"></a>slots</h4><p>See <a href="designer-manual-15.html#1-5">connections</a>.</p><a name="tabstops"></a><h4><a name="1-17"></a>tabstops</h4><p>Tabstops indicate the widgets that get the focus as the user tabs through the form. The <tt>&lt;tabstops&gt;</tt> tag contains a list of tabstops, in order, each of which holds the name of a widget.</p><pre>&lt;tabstops&gt;    &lt;tabstop&gt;templateView&lt;/tabstop&gt;    &lt;tabstop&gt;helpButton&lt;/tabstop&gt;    &lt;tabstop&gt;buttonOk&lt;/tabstop&gt;    &lt;tabstop&gt;buttonCancel&lt;/tabstop&gt;&lt;/tabstops&gt;</pre><a name="toolbars"></a><h4><a name="1-18"></a>toolbars</h4><p>Forms that have toolbars (dock windows) use the <tt>&lt;toolbars&gt;</tt> tag to hold the details. These forms are normally <a href="qmainwindow.html">QMainWindow</a>s (or subclasses). Each toolbar has a dock attribute which identifies which dock window the toolbar initially belongs to. They also have both name and label properties. Each toolbar button is represented by an action. Toolbars can also hold other widgets, in which case the <tt>&lt;toolbar&gt;</tt> tag includes appropriate <tt>&lt;widget&gt;</tt> tags which give the class, name and any non-default property values for the relevant widget.</p><pre>&lt;toolbars&gt;    &lt;toolbar dock="2"&gt;        &lt;property name="name"&gt;            &lt;cstring&gt;toolBar&lt;/cstring&gt;        &lt;/property&gt;        &lt;property name="label"&gt;            &lt;string&gt;Tools&lt;/string&gt;        &lt;/property&gt;        &lt;action name="fileNewAction"/&gt;        &lt;action name="fileOpenAction"/&gt;        &lt;action name="fileSaveAction"/&gt;        &lt;separator/&gt;        &lt;action name="editUndoAction"/&gt;        &lt;action name="editRedoAction"/&gt;        &lt;action name="editCutAction"/&gt;        &lt;action name="editCopyAction"/&gt;        &lt;action name="editPasteAction"/&gt;    &lt;/toolbar&gt;    &lt;toolbar dock="2"&gt;        &lt;property name="name"&gt;            &lt;cstring&gt;Toolbar&lt;/cstring&gt;        &lt;/property&gt;        &lt;property name="label"&gt;            &lt;string&gt;Toolbar&lt;/string&gt;        &lt;/property&gt;        &lt;action name="leftAlignAction"/&gt;        &lt;action name="centerAlignAction"/&gt;        &lt;action name="rightAlignAction"/&gt;        &lt;separator/&gt;        &lt;action name="boldAction"/&gt;        &lt;action name="italicAction"/&gt;        &lt;action name="underlineAction"/&gt;        &lt;separator/&gt;        &lt;widget class="QComboBox"&gt;            &lt;property name="name"&gt;                &lt;cstring&gt;fontComboBox&lt;/cstring&gt;            &lt;/property&gt;        &lt;/widget&gt;        &lt;widget class="QSpinBox"&gt;            &lt;property name="name"&gt;                &lt;cstring&gt;SpinBox2&lt;/cstring&gt;            &lt;/property&gt;            &lt;property name="minValue"&gt;                &lt;number&gt;6&lt;/number&gt;            &lt;/property&gt;            &lt;property name="value"&gt;                &lt;number&gt;10&lt;/number&gt;            &lt;/property&gt;        &lt;/widget&gt;    &lt;/toolbar&gt;&lt;/toolbars&gt;</pre><a name="variables"></a><h4><a name="1-19"></a>variables</h4><p>Module variables are held in the <tt>&lt;variables&gt;</tt> tag. Variable type names often include &lt; and &gt;, which must be stored as entities.</p><pre>&lt;variables&gt;    &lt;variable&gt;SettingsDialog * settings;&lt;/variable&gt;    &lt;variable&gt;QMap&amp;lt;int, QString&amp;gt; bookmarks;&lt;/variable&gt;    &lt;variable&gt;HelpWindow *browser;&lt;/variable&gt;    &lt;variable&gt;HelpDialog *helpDock;&lt;/variable&gt;    &lt;variable&gt;QGuardedPtr&amp;lt;FindDialog&amp;gt; findDialog;&lt;/variable&gt;    &lt;variable&gt;static QPtrList&amp;lt;MainWindow&amp;gt; *windows;&lt;/variable&gt;&lt;/variables&gt;</pre><a name="widget"></a><h4><a name="1-20"></a>widget</h4><p>Widgets are used at multiple levels within a <tt>.ui</tt> file. The whole form itself is a widget, and it contains other widgets, usually within the context of layouts such as hboxes, vboxes and grids.</p><p>Below is an example of a complete <tt>.ui</tt> file. The form itself is a <a href="qwidget.html">QWidget</a> with various non-default properties set. This widget contains a single hbox, which also has some non-default properties, and which contains a single <a href="qtextbrowser.html">QTextBrowser</a> widget.</p><pre>&lt;!DOCTYPE UI&gt;&lt;UI version="3.0" stdsetdef="1"&gt;&lt;class&gt;WinIntroPage&lt;/class&gt;&lt;widget class="QWidget"&gt;    &lt;property name="name"&gt;        &lt;cstring&gt;WinIntroPage&lt;/cstring&gt;    &lt;/property&gt;    &lt;property name="geometry"&gt;        &lt;rect&gt;            &lt;x&gt;0&lt;/x&gt;            &lt;y&gt;0&lt;/y&gt;            &lt;width&gt;387&lt;/width&gt;            &lt;height&gt;228&lt;/height&gt;        &lt;/rect&gt;    &lt;/property&gt;    &lt;property name="caption"&gt;        &lt;string&gt;Form1&lt;/string&gt;    &lt;/property&gt;    &lt;hbox&gt;        &lt;property name="name"&gt;            &lt;cstring&gt;unnamed&lt;/cstring&gt;        &lt;/property&gt;        &lt;property name="margin"&gt;            &lt;number&gt;11&lt;/number&gt;        &lt;/property&gt;        &lt;property name="spacing"&gt;            &lt;number&gt;6&lt;/number&gt;        &lt;/property&gt;        &lt;widget class="QTextBrowser"&gt;            &lt;property name="name"&gt;                &lt;cstring&gt;TextBrowser1&lt;/cstring&gt;            &lt;/property&gt;            &lt;property name="text"&gt;                &lt;string&gt;This program installs Qt.&lt;/string&gt;            &lt;/property&gt;        &lt;/widget&gt;    &lt;/hbox&gt;&lt;/widget&gt;&lt;layoutdefaults spacing="6" margin="11"/&gt;&lt;/UI&gt;</pre><a name="forward"></a><h4><a name="1-21"></a>forward</h4><p><i> This tag is included for Qt 3.x beta backwards compatibility, and should not be used. Use <a href="designer-manual-15.html#1-8">forwards</a> instead. </i></p><a name="include"></a><h4><a name="1-22"></a>include</h4><p><i> This tag is included for Qt 2.x beta backwards compatibility, and should not be used. Use <a href="designer-manual-15.html#1-10">includes</a> instead. </i></p><a name="variable"></a><h4><a name="1-23"></a>variable</h4><p><i> This tag is included for Qt 3.x beta backwards compatibility, and should not be used. Use <a href="designer-manual-15.html#1-19">variables</a> instead. </i></p><a name="datatype"></a><h3><a name="2"></a>Datatype Elements</h3><a name="color"></a><ul><li><p><tt>bool</tt> - a boolean value (0 or 1), e.g. <tt>&lt;bool&gt;1&lt;/bool&gt;</tt></p><li><p><tt>color</tt> - a color, e.g. <tt>&lt;color&gt;&lt;red&gt;192&lt;/red&gt;&lt;green&gt;0&lt;/green&gt;&lt;blue&gt;255&lt;/blue&gt;&lt;/color&gt;</tt></p><li><p><tt>cstring</tt> - a C string value (8-bit), e.g. <tt>&lt;cstring&gt;Some text&lt;/cstring&gt;</tt></p><li><p><tt>cursor</tt> - an integer which indicates the cursor type, e.g. <tt>&lt;cursor&gt;4&lt;/cursor&gt;</tt>. The valid integers for the cursor type are:</p><ul><li><p>0 - ArrowCursor</p><li><p>1 - UpArrowCursor</p><li><p>2 - CrossCursor</p><li><p>3 - WaitCursor</p><li><p>4 - IbeamCursor</p><li><p>5 - SizeVerCursor</p><li><p>6 - SizeHorCursor</p><li><p>7 - SizeBDiagCursor</p><li><p>8 - SizeFDiagCursor</p><li><p>9 - SizeAllCursor</p><li><p>10 - BlankCursor</p><li><p>11 - SplitVCursor</p><li><p>12 - SplitHCursor</p><li><p>13 - PointingHandCursor</p><li><p>14 - ForbiddenCursor</p></ul><li><p><tt>enum</tt> - an enum name, e.g. <tt>&lt;enum&gt;StrongFocus&lt;/enum&gt;</tt></p><li><p><tt>font</tt> - a font description, e.g.</p><pre>&lt;font&gt;    &lt;family&gt;Helvetica&lt;/family&gt;    &lt;pointsize&gt;16&lt;/pointsize&gt;    &lt;weight&gt;50&lt;/weight&gt;    &lt;italic&gt;1&lt;/italic&gt;    &lt;underline&gt;0&lt;/underline&gt;    &lt;strikeout&gt;0&lt;/strikeout&gt;&lt;/font&gt;</pre><li><p><tt>iconset</tt> - an iconset (see <tt>pixmap</tt>), e.g. <tt>&lt;iconset&gt;filenew&lt;/iconset&gt;</tt></p><li><p><tt>number</tt> - an integer with an optional sign, e.g. <tt>&lt;number&gt;947&lt;/number&gt;</tt></p><li><p><tt>palette</tt> - a <a href="qwidget.html#palette-prop">palette</a></p><li><p><tt>pixmap</tt> - a pixmap, normally the name or "key" of the pixmap; the name is used if pixmaps are stored in the project, the key is used if a user defined function is used to access the pixmap. It is also possible for pixmaps to be included inline. Example: <tt>&lt;pixmap&gt;chair&lt;/pixmap&gt;</tt></p><li><p><tt>point</tt> - a point, e.g. <tt>&lt;point&gt;&lt;x&gt;15&lt;/x&gt;&lt;y&gt;95&lt;/y&gt;&lt;/point&gt;</tt></p><li><p><tt>rect</tt> - a rectangle, e.g.</p><pre>&lt;rect&gt;    &lt;x&gt;20&lt;/x&gt;    &lt;y&gt;35&lt;/y&gt;    &lt;width&gt;225&lt;/width&gt;    &lt;height&gt;45&lt;/height&gt;&lt;/rect&gt;</pre><li><p><tt>set</tt> - a list of names separated by |'s, e.g. <tt>&lt;set&gt;AlignLeft|AlignTop&lt;/set&gt;</tt></p><li><p><tt>size</tt> - a size, e.g. <tt>&lt;size&gt;&lt;width&gt;150&lt;/width&gt;&lt;height&gt;105&lt;/height&gt;&lt;/size&gt;</tt></p><li><p><tt>sizepolicy</tt> - an integer which indicates the size type, e.g. <tt>&lt;hsizetype&gt;5&lt;/hsizetype&gt;&lt;vsizetype&gt;4&lt;/vsizetype&gt;</tt>. The valid integers for the size type are:</p><ul><li><p>0 - Fixed</p><li><p>1 - Minimum</p><li><p>3 - MinimumExpanding</p><li><p>4 - Maximum</p><li><p>5 - Preferred</p><li><p>7 - Expanding</p></ul><li><p><tt>string</tt> - a Unicode string value (in UTF8), e.g. <tt>&lt;string&gt;Some text&lt;/string&gt;</tt></p></ul><h4><a name="2-1"></a>Complex Datatype Elements</h4><a name="palette"></a><h5><a name="2-1-1"></a>palette</h5><p>This element holds colors for user interface elements for each color group. For example:</p><pre>&lt;palette&gt;  &lt;active&gt;    &lt;color&gt; ... Foreground    ... &lt;/color&gt;    &lt;color&gt; ... Button        ... &lt;/color&gt;    &lt;color&gt; ... Light         ... &lt;/color&gt;    &lt;color&gt; ... Midlight      ... &lt;/color&gt;    &lt;color&gt; ... Dark	      ... &lt;/color&gt;    &lt;color&gt; ... Mid	      ... &lt;/color&gt;    &lt;color&gt; ... Text          ... &lt;/color&gt;    &lt;color&gt; ... BrightText    ... &lt;/color&gt;    &lt;color&gt; ... ButtonText    ... &lt;/color&gt;    &lt;color&gt; ... Base          ... &lt;/color&gt;    &lt;color&gt; ... Background    ... &lt;/color&gt;    &lt;color&gt; ... Shadow	      ... &lt;/color&gt;    &lt;color&gt; ... Highlight     ... &lt;/color&gt;    &lt;color&gt; ... HighlightText ... &lt;/color&gt;  &lt;/active&gt;  &lt;disabled&gt;    &lt;color&gt;&lt;red&gt;128&lt;/red&gt;&lt;green&gt;128&lt;/green&gt;&lt;blue&gt;128&lt;/blue&gt;&lt;/color&gt;    ...    &lt;color&gt;&lt;red&gt;255&lt;/red&gt;&lt;green&gt;255&lt;/green&gt;&lt;blue&gt;255&lt;/blue&gt;&lt;/color&gt;  &lt;/disabled&gt;  &lt;inactive&gt;    &lt;color&gt;&lt;red&gt;0&lt;/red&gt;&lt;green&gt;0&lt;/green&gt;&lt;blue&gt;0&lt;/blue&gt;&lt;/color&gt;    ...    &lt;color&gt;&lt;red&gt;255&lt;/red&gt;&lt;green&gt;255&lt;/green&gt;&lt;blue&gt;255&lt;/blue&gt;&lt;/color&gt;  &lt;/inactive&gt;&lt;/palette&gt;</pre><p>See <a href="designer-manual-15.html#color">color</a> for the format of the <tt>&lt;color&gt;</tt> element.</p><!-- eof --><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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -