<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # QDesignerCustomWidgetCollectionInterface Class Reference ## [[QtDesigner](index.htm) module] 該QDesignerCustomWidgetCollectionInterface類,可以包含多個自定義部件在一個單一的庫。[More...](#details) 通過繼承[QPyDesignerCustomWidgetCollectionPlugin](qpydesignercustomwidgetcollectionplugin.html)。 ### Methods * `__init__ (self)` * `__init__ (self, QDesignerCustomWidgetCollectionInterface)` * `list-of-QDesignerCustomWidgetInterface customWidgets (self)` * * * ## Detailed Description 該QDesignerCustomWidgetCollectionInterface類,可以包含多個自定義部件在一個單一的庫。 當實現一個自定義的widget插件,你把它做成一個單獨的庫。如果你想包括幾個自定義的widget插件在同一個庫中,你必須在另外的子類QDesignerCustomWidgetCollectionInterface 。 QDesignerCustomWidgetCollectionInterface包含一個單一的函數返回集合的列表[QDesignerCustomWidgetInterface](qdesignercustomwidgetinterface.html)對象。例如,如果你有多個自定義部件`CustomWidgetOne`,`CustomWidgetTwo`和`CustomWidgetThree`,類的定義可能看起來像這樣: ``` #include customwidgetoneinterface.h #include customwidgettwointerface.h #include customwidgetthreeinterface.h #include <QtDesigner/QtDesigner> #include <QtCore/qplugin.h> class MyCustomWidgets: public [QObject](qobject.html), public QDesignerCustomWidgetCollectionInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetCollectionInterface) public: MyCustomWidgets([QObject](qobject.html) *parent = 0); virtual [QList](index.htm)<[QDesignerCustomWidgetInterface](qdesignercustomwidgetinterface.html)*> customWidgets() const; private: [QList](index.htm)<[QDesignerCustomWidgetInterface](qdesignercustomwidgetinterface.html)*> widgets; }; ``` 在類的構造函數時,將接口加入您的自定義窗口小部件,您在返回列表[customWidgets](qdesignercustomwidgetcollectioninterface.html#customWidgets)( )函數: ``` MyCustomWidgets.MyCustomWidgets([QObject](qobject.html) *parent) : [QObject](qobject.html)(parent) { widgets.append(new CustomWidgetOneInterface(this)); widgets.append(new CustomWidgetTwoInterface(this)); widgets.append(new CustomWidgetThreeInterface(this)); } [QList](index.htm)<[QDesignerCustomWidgetInterface](qdesignercustomwidgetinterface.html)*> MyCustomWidgets.customWidgets() const { return widgets; } Q_EXPORT_PLUGIN2(customwidgetsplugin, MyCustomWidgets) ``` 請注意,而不是使用導出的每個自定義窗口小部件插件的[Q_EXPORT_PLUGIN2](index.htm#Q_EXPORT_PLUGIN2)()宏,你導出整個集合。該[Q_EXPORT_PLUGIN2](index.htm#Q_EXPORT_PLUGIN2)( )宏可確保_Qt Designer_可以訪問和構建自定義部件。如果沒有這個宏,是沒有辦法的_Qt Designer_使用它們。 * * * ## Method Documentation ``` QDesignerCustomWidgetCollectionInterface.__init__ (self) ``` ``` QDesignerCustomWidgetCollectionInterface.__init__ (self, QDesignerCustomWidgetCollectionInterface) ``` ``` list-of-QDesignerCustomWidgetInterface QDesignerCustomWidgetCollectionInterface.customWidgets (self) ``` 這種方法是抽象的,應在任何子類中重新實現。 返回接口列表,以集合的自定義部件。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看