/usr/share/qt5/doc/qtdesigner/qdesignerwidgetboxinterface.html is in qttools5-doc-html 5.2.1-8build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- abstractwidgetbox.cpp -->
<title>QDesignerWidgetBoxInterface Class | QtDesigner </title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="main">
<div class="main-rounded">
<div class="navigationbar">
<ul>
<li>Qt 5.2</li>
<li><a href="qtdesigner-manual.html">Qt Designer Manual</a></li>
<li><a href="qtdesigner-module.html">C++ Classes</a></li>
<li>QDesignerWidgetBoxInterface</li>
<li id="buildversion">
Qt 5.2.1 Reference Documentation</li>
</ul>
</div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QDesignerWidgetBoxInterface Class</h1>
<!-- $$$QDesignerWidgetBoxInterface-brief -->
<p>The QDesignerWidgetBoxInterface class allows you to control the contents of Qt Designer's widget box. <a href="#details">More...</a></p>
<!-- @@@QDesignerWidgetBoxInterface -->
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> </b><tt><span class="preprocessor">#include <QDesignerWidgetBoxInterface></span>
</tt></td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> <tt>QT += designer</tt></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="../qtwidgets/qwidget.html">QWidget</a>.</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p></p>
</td></tr></table><ul>
<li><a href="qdesignerwidgetboxinterface-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdesignerwidgetboxinterface.html#QDesignerWidgetBoxInterface">QDesignerWidgetBoxInterface</a></b>(QWidget *<i> parent</i> = 0, Qt::WindowFlags<i> flags</i> = 0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qdesignerwidgetboxinterface.html#dtor.QDesignerWidgetBoxInterface">~QDesignerWidgetBoxInterface</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QString </td><td class="memItemRight bottomAlign"><b><a href="qdesignerwidgetboxinterface.html#fileName">fileName</a></b>() const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qdesignerwidgetboxinterface.html#load">load</a></b>() = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qdesignerwidgetboxinterface.html#save">save</a></b>() = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qdesignerwidgetboxinterface.html#setFileName">setFileName</a></b>(const QString &<i> fileName</i>) = 0</td></tr>
</table>
<ul>
<li class="fn">217 public functions inherited from <a href="../qtwidgets/qwidget.html#public-functions">QWidget</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">59 properties inherited from <a href="../qtwidgets/qwidget.html#properties">QWidget</a></li>
<li class="fn">19 public slots inherited from <a href="../qtwidgets/qwidget.html#public-slots">QWidget</a></li>
<li class="fn">4 signals inherited from <a href="../qtwidgets/qwidget.html#signals">QWidget</a></li>
<li class="fn">5 static public members inherited from <a href="../qtwidgets/qwidget.html#static-public-members">QWidget</a></li>
<li class="fn">37 protected functions inherited from <a href="../qtwidgets/qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">1 protected slot inherited from <a href="../qtwidgets/qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<!-- $$$QDesignerWidgetBoxInterface-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QDesignerWidgetBoxInterface class allows you to control the contents of Qt Designer's widget box.</p>
<p>QDesignerWidgetBoxInterface contains a collection of functions that is typically used to manipulate the contents of <i>Qt Designer</i>'s widget box.</p>
<p><i>Qt Designer</i> uses an XML file to populate its widget box. The name of that file is one of the widget box's properties, and you can retrieve it using the <a href="qdesignerwidgetboxinterface.html#fileName">fileName</a>() function.</p>
<p>QDesignerWidgetBoxInterface also provides the <a href="qdesignerwidgetboxinterface.html#save">save</a>() function that saves the contents of the widget box in the file specified by the widget box's file name property. If you have made changes to the widget box, for example by dropping a widget into the widget box, without calling the <a href="qdesignerwidgetboxinterface.html#save">save</a>() function, the original content can be restored by a simple invocation of the <a href="qdesignerwidgetboxinterface.html#load">load</a>() function:</p>
<pre class="cpp"> <span class="type">QDesignerWidgetBoxInterface</span> <span class="operator">*</span>widgetBox <span class="operator">=</span> <span class="number">0</span>:
widgetBox <span class="operator">=</span> formEditor<span class="operator">-</span><span class="operator">></span>widgetBox();
widgetBox<span class="operator">-</span><span class="operator">></span><a href="qdesignerwidgetboxinterface.html#load">load</a>();</pre>
<p>The QDesignerWidgetBoxInterface class is not intended to be instantiated directly. You can retrieve an interface to Qt Designer's widget box using the <a href="qdesignerformeditorinterface.html#widgetBox">QDesignerFormEditorInterface::widgetBox</a>() function. A pointer to <i>Qt Designer</i>'s current <a href="qdesignerformeditorinterface.html">QDesignerFormEditorInterface</a> object (<tt>formEditor</tt> in the example above) is provided by the <a href="qdesignercustomwidgetinterface.html#initialize">QDesignerCustomWidgetInterface::initialize</a>() function's parameter. When implementing a custom widget plugin, you must subclass the <a href="qdesignercustomwidgetinterface.html">QDesignerCustomWidgetInterface</a> to expose your plugin to <i>Qt Designer</i>.</p>
<p>If you want to save your changes, and at the same time preserve the original contents, you can use the <a href="qdesignerwidgetboxinterface.html#save">save</a>() function combined with the <a href="qdesignerwidgetboxinterface.html#setFileName">setFileName</a>() function to save your changes into another file. Remember to store the name of the original file first:</p>
<pre class="cpp"> <span class="type"><a href="../qtcore/qstring.html">QString</a></span> originalFile <span class="operator">=</span> widgetBox<span class="operator">-</span><span class="operator">></span><a href="qdesignerwidgetboxinterface.html#fileName">fileName</a>();
widgetBox<span class="operator">-</span><span class="operator">></span><a href="qdesignerwidgetboxinterface.html#setFileName">setFileName</a>(<span class="string">"myWidgetBox.xml"</span>);
widgetBox<span class="operator">-</span><span class="operator">></span><a href="qdesignerwidgetboxinterface.html#save">save</a>();</pre>
<p>Then you can restore the original contents of the widget box by resetting the file name to the original file and calling <a href="qdesignerwidgetboxinterface.html#load">load</a>():</p>
<pre class="cpp"> widgetBox<span class="operator">-</span><span class="operator">></span><a href="qdesignerwidgetboxinterface.html#setFileName">setFileName</a>(originalFile);
widgetBox<span class="operator">-</span><span class="operator">></span><a href="qdesignerwidgetboxinterface.html#load">load</a>();</pre>
<p>In a similar way, you can later use your customized XML file:</p>
<pre class="cpp"> <span class="keyword">if</span> (widgetBox<span class="operator">-</span><span class="operator">></span>filename() <span class="operator">!</span><span class="operator">=</span> <span class="string">"myWidgetBox.xml"</span>) {
widgetBox<span class="operator">-</span><span class="operator">></span>setFileName(<span class="string">"myWidgetBox.xml"</span>);
widgetBox<span class="operator">-</span><span class="operator">></span>load();
}</pre>
</div>
<p><b>See also </b><a href="qdesignerformeditorinterface.html">QDesignerFormEditorInterface</a>.</p>
<!-- @@@QDesignerWidgetBoxInterface -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QDesignerWidgetBoxInterface[overload1]$$$QDesignerWidgetBoxInterfaceQWidget*Qt::WindowFlags -->
<h3 class="fn"><a name="QDesignerWidgetBoxInterface"></a>QDesignerWidgetBoxInterface::<span class="name">QDesignerWidgetBoxInterface</span>(<span class="type"><a href="../qtwidgets/qwidget.html">QWidget</a></span> *<i> parent</i> = 0, <span class="type"><a href="../qtcore/qt.html#WindowType-enum">Qt::WindowFlags</a></span><i> flags</i> = 0)</h3>
<p>Constructs a widget box interface with the given <i>parent</i> and the specified window <i>flags</i>.</p>
<!-- @@@QDesignerWidgetBoxInterface -->
<!-- $$$~QDesignerWidgetBoxInterface[overload1]$$$~QDesignerWidgetBoxInterface -->
<h3 class="fn"><a name="dtor.QDesignerWidgetBoxInterface"></a>QDesignerWidgetBoxInterface::<span class="name">~QDesignerWidgetBoxInterface</span>()<tt> [virtual]</tt></h3>
<p>Destroys the widget box interface.</p>
<!-- @@@~QDesignerWidgetBoxInterface -->
<!-- $$$fileName[overload1]$$$fileName -->
<h3 class="fn"><a name="fileName"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QDesignerWidgetBoxInterface::<span class="name">fileName</span>() const<tt> [pure virtual]</tt></h3>
<p>Returns the name of the XML file <i>Qt Designer</i> is currently using to populate its widget box.</p>
<p><b>See also </b><a href="qdesignerwidgetboxinterface.html#setFileName">setFileName</a>().</p>
<!-- @@@fileName -->
<!-- $$$load[overload1]$$$load -->
<h3 class="fn"><a name="load"></a><span class="type">bool</span> QDesignerWidgetBoxInterface::<span class="name">load</span>()<tt> [pure virtual]</tt></h3>
<p>Populates <i>Qt Designer</i>'s widget box by loading (or reloading) the currently specified XML file. Returns true if the file is successfully loaded; otherwise false.</p>
<p><b>See also </b><a href="qdesignerwidgetboxinterface.html#setFileName">setFileName</a>().</p>
<!-- @@@load -->
<!-- $$$save[overload1]$$$save -->
<h3 class="fn"><a name="save"></a><span class="type">bool</span> QDesignerWidgetBoxInterface::<span class="name">save</span>()<tt> [pure virtual]</tt></h3>
<p>Saves the contents of <i>Qt Designer</i>'s widget box in the file specified by the <a href="qdesignerwidgetboxinterface.html#fileName">fileName</a>() function. Returns true if the content is successfully saved; otherwise false.</p>
<p><b>See also </b><a href="qdesignerwidgetboxinterface.html#fileName">fileName</a>() and <a href="qdesignerwidgetboxinterface.html#setFileName">setFileName</a>().</p>
<!-- @@@save -->
<!-- $$$setFileName[overload1]$$$setFileNameconstQString& -->
<h3 class="fn"><a name="setFileName"></a><span class="type">void</span> QDesignerWidgetBoxInterface::<span class="name">setFileName</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i> fileName</i>)<tt> [pure virtual]</tt></h3>
<p>Sets the XML file that <i>Qt Designer</i> will use to populate its widget box, to <i>fileName</i>. You must call <a href="qdesignerwidgetboxinterface.html#load">load</a>() to update the widget box with the new XML file.</p>
<p><b>See also </b><a href="qdesignerwidgetboxinterface.html#fileName">fileName</a>() and <a href="qdesignerwidgetboxinterface.html#load">load</a>().</p>
<!-- @@@setFileName -->
</div>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2013 Digia Plc and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.<br> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br> Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. </p>
</div>
</body>
</html>
|