/usr/share/qt5/doc/qtdesigner/qextensionmanager.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 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | <?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" />
<!-- qextensionmanager.cpp -->
<title>QExtensionManager 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>QExtensionManager</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="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#macros">Macros</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QExtensionManager Class</h1>
<!-- $$$QExtensionManager-brief -->
<p>The QExtensionManager class provides extension management facilities for Qt Designer. <a href="#details">More...</a></p>
<!-- @@@QExtensionManager -->
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> </b><tt><span class="preprocessor">#include <QExtensionManager></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="../qtcore/qobject.html">QObject</a> and <a href="qabstractextensionmanager.html">QAbstractExtensionManager</a>.</td></tr></table><ul>
<li><a href="qextensionmanager-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="qextensionmanager.html#QExtensionManager">QExtensionManager</a></b>(QObject *<i> parent</i> = 0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qextensionmanager.html#dtor.QExtensionManager">~QExtensionManager</a></b>()</td></tr>
</table>
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual QObject * </td><td class="memItemRight bottomAlign"><b><a href="qextensionmanager.html#extension">extension</a></b>(QObject *<i> object</i>, const QString &<i> iid</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qextensionmanager.html#registerExtensions">registerExtensions</a></b>(QAbstractExtensionFactory *<i> factory</i>, const QString &<i> iid</i> = QString())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qextensionmanager.html#unregisterExtensions">unregisterExtensions</a></b>(QAbstractExtensionFactory *<i> factory</i>, const QString &<i> iid</i> = QString())</td></tr>
</table>
<ul>
<li class="fn">31 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
<li class="fn">3 public functions inherited from <a href="qabstractextensionmanager.html#public-functions">QAbstractExtensionManager</a></li>
</ul>
<a name="related-non-members"></a>
<h2>Related Non-Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qextensionmanager.html#qt_extension">qt_extension</a></b>(QAbstractExtensionManager *<i> manager</i>, QObject *<i> object</i>)</td></tr>
</table>
<a name="macros"></a>
<h2>Macros</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qextensionmanager.html#Q_DECLARE_EXTENSION_INTERFACE">Q_DECLARE_EXTENSION_INTERFACE</a></b>(<i> ExtensionName</i>, <i> Identifier</i>)</td></tr>
</table>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
<li class="fn">1 public variable inherited from <a href="../qtcore/qobject.html#public-variables">QObject</a></li>
<li class="fn">10 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">2 protected variables inherited from <a href="../qtcore/qobject.html#protected-variables">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QExtensionManager-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QExtensionManager class provides extension management facilities for Qt Designer.</p>
<p>In <i>Qt Designer</i> the extensions are not created until they are required. For that reason, when implementing an extension, you must also create a <a href="qextensionfactory.html">QExtensionFactory</a>, i.e a class that is able to make an instance of your extension, and register it using <i>Qt Designer</i>'s extension manager.</p>
<p>The registration of an extension factory is typically made in the <a href="qdesignercustomwidgetinterface.html#initialize">QDesignerCustomWidgetInterface::initialize</a>() function:</p>
<pre class="cpp"> <span class="type">void</span> MyPlugin<span class="operator">::</span>initialize(<span class="type"><a href="qdesignerformeditorinterface.html">QDesignerFormEditorInterface</a></span> <span class="operator">*</span>formEditor)
{
<span class="keyword">if</span> (initialized)
<span class="keyword">return</span>;
<span class="type">QExtensionManager</span> <span class="operator">*</span>manager <span class="operator">=</span> formEditor<span class="operator">-</span><span class="operator">></span>extensionManager();
Q_ASSERT(manager <span class="operator">!</span><span class="operator">=</span> <span class="number">0</span>);
manager<span class="operator">-</span><span class="operator">></span>registerExtensions(<span class="keyword">new</span> MyExtensionFactory(manager)<span class="operator">,</span>
Q_TYPEID(<span class="type"><a href="qdesignertaskmenuextension.html">QDesignerTaskMenuExtension</a></span>));
initialized <span class="operator">=</span> <span class="keyword">true</span>;
}</pre>
<p>The QExtensionManager is not intended to be instantiated directly. You can retrieve an interface to <i>Qt Designer</i>'s extension manager using the <a href="qdesignerformeditorinterface.html#extensionManager">QDesignerFormEditorInterface::extensionManager</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>Then, when an extension is required, <i>Qt Designer</i>'s extension manager will run through all its registered factories calling <a href="qextensionfactory.html#createExtension">QExtensionFactory::createExtension</a>() for each until the first one that is able to create the requested extension for the selected object, is found. This factory will then make an instance of the extension.</p>
<p>There are four available types of extensions in <i>Qt Designer</i>: <a href="qdesignercontainerextension.html">QDesignerContainerExtension</a> , <a href="qdesignermembersheetextension.html">QDesignerMemberSheetExtension</a>, <a href="qdesignerpropertysheetextension.html">QDesignerPropertySheetExtension</a> and <a href="qdesignertaskmenuextension.html">QDesignerTaskMenuExtension</a>. <i>Qt Designer</i>'s behavior is the same whether the requested extension is associated with a container, a member sheet, a property sheet or a task menu.</p>
<p>For a complete example using the QExtensionManager class, see the <a href="qtdesigner-taskmenuextension-example.html">Task Menu Extension example</a>. The example shows how to create a custom widget plugin for Qt Designer, and how to to use the <a href="qdesignertaskmenuextension.html">QDesignerTaskMenuExtension</a> class to add custom items to <i>Qt Designer</i>'s task menu.</p>
</div>
<p><b>See also </b><a href="qextensionfactory.html">QExtensionFactory</a> and QAbstractExtensionManager.</p>
<!-- @@@QExtensionManager -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QExtensionManager[overload1]$$$QExtensionManagerQObject* -->
<h3 class="fn"><a name="QExtensionManager"></a>QExtensionManager::<span class="name">QExtensionManager</span>(<span class="type"><a href="../qtcore/qobject.html">QObject</a></span> *<i> parent</i> = 0)</h3>
<p>Constructs an extension manager with the given <i>parent</i>.</p>
<!-- @@@QExtensionManager -->
<!-- $$$~QExtensionManager[overload1]$$$~QExtensionManager -->
<h3 class="fn"><a name="dtor.QExtensionManager"></a>QExtensionManager::<span class="name">~QExtensionManager</span>()</h3>
<p>Destroys the extension manager</p>
<!-- @@@~QExtensionManager -->
<!-- $$$extension[overload1]$$$extensionQObject*constQString& -->
<h3 class="fn"><a name="extension"></a><span class="type"><a href="../qtcore/qobject.html">QObject</a></span> * QExtensionManager::<span class="name">extension</span>(<span class="type"><a href="../qtcore/qobject.html">QObject</a></span> *<i> object</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i> iid</i>) const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractextensionmanager.html#extension">QAbstractExtensionManager::extension</a>().</p>
<p>Returns the extension specified by <i>iid</i>, for the given <i>object</i>.</p>
<!-- @@@extension -->
<!-- $$$registerExtensions[overload1]$$$registerExtensionsQAbstractExtensionFactory*constQString& -->
<h3 class="fn"><a name="registerExtensions"></a><span class="type">void</span> QExtensionManager::<span class="name">registerExtensions</span>(<span class="type">QAbstractExtensionFactory</span> *<i> factory</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i> iid</i> = QString())<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractextensionmanager.html#registerExtensions">QAbstractExtensionManager::registerExtensions</a>().</p>
<p>Register the extension specified by the given <i>factory</i> and extension identifier <i>iid</i>.</p>
<!-- @@@registerExtensions -->
<!-- $$$unregisterExtensions[overload1]$$$unregisterExtensionsQAbstractExtensionFactory*constQString& -->
<h3 class="fn"><a name="unregisterExtensions"></a><span class="type">void</span> QExtensionManager::<span class="name">unregisterExtensions</span>(<span class="type">QAbstractExtensionFactory</span> *<i> factory</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i> iid</i> = QString())<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractextensionmanager.html#unregisterExtensions">QAbstractExtensionManager::unregisterExtensions</a>().</p>
<p>Unregister the extension specified by the given <i>factory</i> and extension identifier <i>iid</i>.</p>
<!-- @@@unregisterExtensions -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$qt_extension[overload1]$$$qt_extensionQAbstractExtensionManager*QObject* -->
<h3 class="fn"><a name="qt_extension"></a><span class="type">T</span> <span class="name">qt_extension</span>(<span class="type">QAbstractExtensionManager</span> *<i> manager</i>, <span class="type"><a href="../qtcore/qobject.html">QObject</a></span> *<i> object</i>)</h3>
<p>Returns the extension of the given <i>object</i> cast to type T if the object is of type T (or of a subclass); otherwise returns 0. The extension is retrieved using the given extension <i>manager</i>.</p>
<pre class="cpp"> <span class="type"><a href="qdesignerpropertysheetextension.html">QDesignerPropertySheetExtension</a></span> <span class="operator">*</span>propertySheet;
<span class="type"><a href="qextensionmanager.html">QExtensionManager</a></span> manager <span class="operator">=</span> formEditor<span class="operator">-</span><span class="operator">></span>extensionManager();
propertySheet <span class="operator">=</span> qt_extension<span class="operator"><</span><span class="type"><a href="qdesignerpropertysheetextension.html">QDesignerPropertySheetExtension</a></span><span class="operator">*</span><span class="operator">></span>(manager<span class="operator">,</span> widget);
<span class="keyword">if</span>(propertySheet) {<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>}</pre>
<p>When implementing a custom widget plugin, a pointer to <i>Qt Designer</i>'s current <a href="qdesignerformeditorinterface.html">QDesignerFormEditorInterface</a> object (<tt>formEditor</tt>) is provided by the <a href="qdesignercustomwidgetinterface.html#initialize">QDesignerCustomWidgetInterface::initialize</a>() function's parameter.</p>
<p>If the widget in the example above doesn't have a defined <a href="qdesignerpropertysheetextension.html">QDesignerPropertySheetExtension</a>, <tt>propertySheet</tt> will be a null pointer.</p>
<!-- @@@qt_extension -->
</div>
<div class="macros">
<h2>Macro Documentation</h2>
<!-- $$$Q_DECLARE_EXTENSION_INTERFACE[overload1]$$$Q_DECLARE_EXTENSION_INTERFACE -->
<h3 class="fn"><a name="Q_DECLARE_EXTENSION_INTERFACE"></a><span class="name">Q_DECLARE_EXTENSION_INTERFACE</span>(<i> ExtensionName</i>, <i> Identifier</i>)</h3>
<p>Associates the given <i>Identifier</i> (a string literal) to the extension class called <i>ExtensionName</i>. The <i>Identifier</i> must be unique. For example:</p>
<pre class="cpp"> Q_DECLARE_EXTENSION_INTERFACE(MyExtension<span class="operator">,</span> <span class="string">"com.mycompany.myproduct.myextension"</span>)</pre>
<p>Using the company and product names is a good way to ensure uniqueness of the identifier.</p>
<p>When implementing a custom extension class, you must use Q_DECLARE_EXTENSION_INTERFACE() to enable usage of the <a href="qextensionmanager.html#qt_extension">qt_extension</a>() function. The macro is normally located right after the class definition for <i>ExtensionName</i>, in the associated header file.</p>
<p><b>See also </b><a href="../qtcore/qtplugin.html#Q_DECLARE_INTERFACE">Q_DECLARE_INTERFACE</a>().</p>
<!-- @@@Q_DECLARE_EXTENSION_INTERFACE -->
</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>
|