<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>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # QGraphicsProxyWidget Class Reference ## [[QtGui](index.htm) module] 該QGraphicsProxyWidget類提供了一個代理層嵌入[QWidget](qwidget.html)在[QGraphicsScene](qgraphicsscene.html)。[More...](#details) 繼承[QGraphicsWidget](qgraphicswidget.html)。 ### Methods * `__init__ (self, QGraphicsItem?parent?=?None, Qt.WindowFlags?flags?=?0)` * `contextMenuEvent (self, QGraphicsSceneContextMenuEvent?event)` * `QGraphicsProxyWidget createProxyForChildWidget (self, QWidget?child)` * `dragEnterEvent (self, QGraphicsSceneDragDropEvent?event)` * `dragLeaveEvent (self, QGraphicsSceneDragDropEvent?event)` * `dragMoveEvent (self, QGraphicsSceneDragDropEvent?event)` * `dropEvent (self, QGraphicsSceneDragDropEvent?event)` * `bool event (self, QEvent?event)` * `bool eventFilter (self, QObject?object, QEvent?event)` * `focusInEvent (self, QFocusEvent?event)` * `bool focusNextPrevChild (self, bool?next)` * `focusOutEvent (self, QFocusEvent?event)` * `grabMouseEvent (self, QEvent?event)` * `hideEvent (self, QHideEvent?event)` * `hoverEnterEvent (self, QGraphicsSceneHoverEvent?event)` * `hoverLeaveEvent (self, QGraphicsSceneHoverEvent?event)` * `hoverMoveEvent (self, QGraphicsSceneHoverEvent?event)` * `QVariant itemChange (self, QGraphicsItem.GraphicsItemChange?change, QVariant?value)` * `keyPressEvent (self, QKeyEvent?event)` * `keyReleaseEvent (self, QKeyEvent?event)` * `mouseDoubleClickEvent (self, QGraphicsSceneMouseEvent?event)` * `mouseMoveEvent (self, QGraphicsSceneMouseEvent?event)` * `mousePressEvent (self, QGraphicsSceneMouseEvent?event)` * `mouseReleaseEvent (self, QGraphicsSceneMouseEvent?event)` * `QGraphicsProxyWidget newProxyWidget (self, QWidget)` * `paint (self, QPainter?painter, QStyleOptionGraphicsItem?option, QWidget?widget)` * `resizeEvent (self, QGraphicsSceneResizeEvent?event)` * `setGeometry (self, QRectF?rect)` * `setWidget (self, QWidget?widget)` * `showEvent (self, QShowEvent?event)` * `QSizeF sizeHint (self, Qt.SizeHint?which, QSizeF?constraint?=?QSizeF())` * `QRectF subWidgetRect (self, QWidget?widget)` * `int type (self)` * `ungrabMouseEvent (self, QEvent?event)` * `wheelEvent (self, QGraphicsSceneWheelEvent?event)` * `QWidget widget (self)` * * * ## Detailed Description 該QGraphicsProxyWidget類提供了一個代理層嵌入[QWidget](qwidget.html)在[QGraphicsScene](qgraphicsscene.html)。 QGraphicsProxyWidget嵌入式播放器[QWidget](qwidget.html)基于窗口小部件,例如,一個[QPushButton](qpushbutton.html),[QFontComboBox](qfontcombobox.html)或什至[QFileDialog](qfiledialog.html),成[QGraphicsScene](qgraphicsscene.html)。轉發兩個對象之間的事件之間轉換[QWidget](qwidget.html)的整數為基礎的幾何形狀和[QGraphicsWidget](qgraphicswidget.html)的QREAL為基礎的幾何形狀。 QGraphicsProxyWidget支持的所有核心功能[QWidget](qwidget.html)包括標籤焦點,鍵盤輸入,拖放,和彈出窗口。您還可以嵌入復雜的部件,例如,小部件與subwidgets 。 例如: ``` int main(int argc, char **argv) { [QApplication](qapplication.html) app(argc, argv); [QTabWidget](qtabwidget.html) *tabWidget = new [QTabWidget](qtabwidget.html); [QGraphicsScene](qgraphicsscene.html) scene; QGraphicsProxyWidget *proxy = scene.addWidget(tabWidget); [QGraphicsView](qgraphicsview.html) view(&scene); view.show(); return app.exec(); } ``` QGraphicsProxyWidget需要通過創建為每個彈出一個子代理自動彈出嵌入嵌入部件的孩子照顧。這意味著,當一個嵌入式[QComboBox](qcombobox.html)顯示其彈出的列表中,一個新的QGraphicsProxyWidget會自動創建,嵌入彈出,正確定位它。這只有在彈出是嵌入式控件的子工程(例如[QToolButton.setMenu](qtoolbutton.html#setMenu)( )要求[QMenu](qmenu.html)實例是孩子[QToolButton](qtoolbutton.html)) 。 ### Embedding a Widget with QGraphicsProxyWidget 有兩種方式來嵌入使用QGraphicsProxyWidget一個小部件。最常見的方法是將一個部件指針傳遞給[QGraphicsScene.addWidget](qgraphicsscene.html#addWidget)( )連同任何相關[Qt.WindowFlags](qt.html#WindowType-enum)。這個函數返回一個指針,指向一個QGraphicsProxyWidget 。然后,您可以選擇reparent或位置無論是代理,或嵌入部件本身。 例如,下面的代碼片段中,我們嵌入一個組框入代理: ``` [QGroupBox](qgroupbox.html) *groupBox = new [QGroupBox](qgroupbox.html)("Contact Details"); [QLabel](qlabel.html) *numberLabel = new [QLabel](qlabel.html)("Telephone number"); [QLineEdit](qlineedit.html) *numberEdit = new [QLineEdit](qlineedit.html); [QFormLayout](qformlayout.html) *layout = new [QFormLayout](qformlayout.html); layout->addRow(numberLabel, numberEdit); groupBox->setLayout(layout); [QGraphicsScene](qgraphicsscene.html) scene; QGraphicsProxyWidget *proxy = scene.addWidget(groupBox); [QGraphicsView](qgraphicsview.html) view(&scene); view.show(); ``` 下面的圖片是其內容利潤率和內容獲得RECT標記輸出。 ![](https://img.kancloud.cn/90/58/9058e477ebcfac619ccf614e3b5ddfcc_433x209.png) 或者,您也可以通過創建一個新的QGraphicsProxyWidget項目開始,然后調用[setWidget](qgraphicsproxywidget.html#setWidget)( )嵌入[QWidget](qwidget.html)后來。該[widget](qgraphicsproxywidget.html#widget)( )函數返回一個指向嵌入部件。 QGraphicsProxyWidget股份擁有權[QWidget](qwidget.html),所以如果兩個部件被破壞,其他部件將被自動銷毀。 ### Synchronizing Widget States QGraphicsProxyWidget保持其狀態與嵌入式部件同步。例如,如果代理是隱藏或禁用,嵌入式部件將被隱藏或禁用為好,反之亦然。當插件被嵌入通過調用addWidget () , QGraphicsProxyWidget副本從窗口小部件的狀態到代理,并在這之后,兩個將保持同步,其中可能的。默認情況下,當你嵌入一個widget到一個代理,無論是部件和代理將是可見的,因為一[QGraphicsWidget](qgraphicswidget.html)創建時是可見的(你不必調用[show](qgraphicsitem.html#show)())。如果你明確地隱藏嵌入部件,代理也將成為無形的。 例如: ``` [QGraphicsScene](qgraphicsscene.html) scene; [QLineEdit](qlineedit.html) *edit = new [QLineEdit](qlineedit.html); QGraphicsProxyWidget *proxy = scene.addWidget(edit); edit->isVisible(); // returns true proxy->isVisible(); // also returns true edit->hide(); edit->isVisible(); // returns false proxy->isVisible(); // also returns false ``` QGraphicsProxyWidget保持對稱性以下國家: | [QWidget](qwidget.html) state | QGraphicsProxyWidget state | Notes | | --- | --- | --- | | [QWidget.enabled](qwidget.html#enabled-prop) | [QGraphicsProxyWidget.enabled](qgraphicsobject.html#enabled-prop) | | | [QWidget.visible](qwidget.html#visible-prop) | [QGraphicsProxyWidget.visible](qgraphicsobject.html#visible-prop) | The explicit state is also symmetric. | | [QWidget.geometry](qwidget.html#geometry-prop) | [QGraphicsProxyWidget.geometry](qgraphicswidget.html#geometry-prop) | Geometry is only guaranteed to be symmetric while the embedded widget is visible. | | [QWidget.layoutDirection](qwidget.html#layoutDirection-prop) | [QGraphicsProxyWidget.layoutDirection](qgraphicswidget.html#layoutDirection-prop) | | | QWidget.style | QGraphicsProxyWidget.style | | | [QWidget.palette](qwidget.html#palette-prop) | [QGraphicsProxyWidget.palette](qgraphicswidget.html#palette-prop) | | | [QWidget.font](qwidget.html#font-prop) | [QGraphicsProxyWidget.font](qgraphicswidget.html#font-prop) | | | [QWidget.cursor](qwidget.html#cursor-prop) | QGraphicsProxyWidget.cursor | The embedded widget overrides the proxy widget cursor. The proxy cursor changes depending on which embedded subwidget is currently under the mouse. | | [QWidget.sizeHint](qwidget.html#sizeHint-prop)() | [QGraphicsProxyWidget.sizeHint](qgraphicsproxywidget.html#sizeHint)() | All size hint functionality from the embedded widget is forwarded by the proxy. | | [QWidget.getContentsMargins](qwidget.html#getContentsMargins)() | [QGraphicsProxyWidget.getContentsMargins](qgraphicswidget.html#getContentsMargins)() | Updated once by [setWidget](qgraphicsproxywidget.html#setWidget)(). | | [QWidget.windowTitle](qwidget.html#windowTitle-prop) | [QGraphicsProxyWidget.windowTitle](qgraphicswidget.html#windowTitle-prop) | Updated once by [setWidget](qgraphicsproxywidget.html#setWidget)(). | **Note:** [QGraphicsScene](qgraphicsscene.html)保存在一個特殊的狀態,防止它干擾其他部件(包括嵌入式和不嵌入),而小部件嵌入嵌入部件。在這種狀態下,小部件可以略微在從行為時,它不是嵌入不同。 **Warning:**該類提供了方便,當橋接QWidgets和QGraphicsItems ,它不應該被用于高性能的場景。 * * * ## Method Documentation ``` QGraphicsProxyWidget.__init__ (self, QGraphicsItem?parent?=?None, Qt.WindowFlags?flags?=?0) ``` 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 構造一個新的QGraphicsProxy部件。_parent_和_wFlags_被傳遞到[QGraphicsItem](qgraphicsitem.html)的構造。 ``` QGraphicsProxyWidget.contextMenuEvent (self, QGraphicsSceneContextMenuEvent?event) ``` 從重新實現[QGraphicsItem.contextMenuEvent](qgraphicsitem.html#contextMenuEvent)( ) 。 ``` QGraphicsProxyWidget QGraphicsProxyWidget.createProxyForChildWidget (self, QWidget?child) ``` [ 創建一個代理部件給定的_child_包含在這個代理的小工具。 此功能使得它可以獲取代理非頂層窗口部件。例如,你可以嵌入一個對話框,然后只是它的小部件一個轉換。 如果部件已經嵌入,返回現有的代理部件。 此功能被引入Qt的4.5 。 ](qgraphicsproxywidget.html) [**See also**](qgraphicsproxywidget.html) [newProxyWidget](qgraphicsproxywidget.html#newProxyWidget)()和[QGraphicsScene.addWidget](qgraphicsscene.html#addWidget)( ) 。 ``` QGraphicsProxyWidget.dragEnterEvent (self, QGraphicsSceneDragDropEvent?event) ``` 從重新實現[QGraphicsItem.dragEnterEvent](qgraphicsitem.html#dragEnterEvent)( ) 。 ``` QGraphicsProxyWidget.dragLeaveEvent (self, QGraphicsSceneDragDropEvent?event) ``` 從重新實現[QGraphicsItem.dragLeaveEvent](qgraphicsitem.html#dragLeaveEvent)( ) 。 ``` QGraphicsProxyWidget.dragMoveEvent (self, QGraphicsSceneDragDropEvent?event) ``` 從重新實現[QGraphicsItem.dragMoveEvent](qgraphicsitem.html#dragMoveEvent)( ) 。 ``` QGraphicsProxyWidget.dropEvent (self, QGraphicsSceneDragDropEvent?event) ``` 從重新實現[QGraphicsItem.dropEvent](qgraphicsitem.html#dropEvent)( ) 。 ``` bool QGraphicsProxyWidget.event (self, QEvent?event) ``` 從重新實現[QObject.event](qobject.html#event)( ) 。 ``` bool QGraphicsProxyWidget.eventFilter (self, QObject?object, QEvent?event) ``` 從重新實現[QObject.eventFilter](qobject.html#eventFilter)( ) 。 ``` QGraphicsProxyWidget.focusInEvent (self, QFocusEvent?event) ``` 從重新實現[QGraphicsItem.focusInEvent](qgraphicsitem.html#focusInEvent)( ) 。 ``` bool QGraphicsProxyWidget.focusNextPrevChild (self, bool?next) ``` 從重新實現[QGraphicsWidget.focusNextPrevChild](qgraphicswidget.html#focusNextPrevChild)( ) 。 ``` QGraphicsProxyWidget.focusOutEvent (self, QFocusEvent?event) ``` 從重新實現[QGraphicsItem.focusOutEvent](qgraphicsitem.html#focusOutEvent)( ) 。 ``` QGraphicsProxyWidget.grabMouseEvent (self, QEvent?event) ``` 從重新實現[QGraphicsWidget.grabMouseEvent](qgraphicswidget.html#grabMouseEvent)( ) 。 ``` QGraphicsProxyWidget.hideEvent (self, QHideEvent?event) ``` 從重新實現[QGraphicsWidget.hideEvent](qgraphicswidget.html#hideEvent)( ) 。 ``` QGraphicsProxyWidget.hoverEnterEvent (self, QGraphicsSceneHoverEvent?event) ``` 從重新實現[QGraphicsItem.hoverEnterEvent](qgraphicsitem.html#hoverEnterEvent)( ) 。 ``` QGraphicsProxyWidget.hoverLeaveEvent (self, QGraphicsSceneHoverEvent?event) ``` 從重新實現[QGraphicsItem.hoverLeaveEvent](qgraphicsitem.html#hoverLeaveEvent)( ) 。 ``` QGraphicsProxyWidget.hoverMoveEvent (self, QGraphicsSceneHoverEvent?event) ``` 從重新實現[QGraphicsItem.hoverMoveEvent](qgraphicsitem.html#hoverMoveEvent)( ) 。 ``` QVariant QGraphicsProxyWidget.itemChange (self, QGraphicsItem.GraphicsItemChange?change, QVariant?value) ``` 從重新實現[QGraphicsItem.itemChange](qgraphicsitem.html#itemChange)( ) 。 ``` QGraphicsProxyWidget.keyPressEvent (self, QKeyEvent?event) ``` 從重新實現[QGraphicsItem.keyPressEvent](qgraphicsitem.html#keyPressEvent)( ) 。 ``` QGraphicsProxyWidget.keyReleaseEvent (self, QKeyEvent?event) ``` 從重新實現[QGraphicsItem.keyReleaseEvent](qgraphicsitem.html#keyReleaseEvent)( ) 。 ``` QGraphicsProxyWidget.mouseDoubleClickEvent (self, QGraphicsSceneMouseEvent?event) ``` 從重新實現[QGraphicsItem.mouseDoubleClickEvent](qgraphicsitem.html#mouseDoubleClickEvent)( ) 。 ``` QGraphicsProxyWidget.mouseMoveEvent (self, QGraphicsSceneMouseEvent?event) ``` 從重新實現[QGraphicsItem.mouseMoveEvent](qgraphicsitem.html#mouseMoveEvent)( ) 。 ``` QGraphicsProxyWidget.mousePressEvent (self, QGraphicsSceneMouseEvent?event) ``` 從重新實現[QGraphicsItem.mousePressEvent](qgraphicsitem.html#mousePressEvent)( ) 。 ``` QGraphicsProxyWidget.mouseReleaseEvent (self, QGraphicsSceneMouseEvent?event) ``` 從重新實現[QGraphicsItem.mouseReleaseEvent](qgraphicsitem.html#mouseReleaseEvent)( ) 。 ``` QGraphicsProxyWidget QGraphicsProxyWidget.newProxyWidget (self, QWidget) ``` [ 創建一個代理部件給定的_child_包含在這個代理的小工具。 ](qgraphicsproxywidget.html) [你不應該直接調用此函數;使用](qgraphicsproxywidget.html)[QGraphicsProxyWidget.createProxyForChildWidget](qgraphicsproxywidget.html#createProxyForChildWidget)( )來代替。 此功能是假的虛擬插槽,你可以在你的子類重新實現,以控制如何將新的代理部件被創建。默認實現返回與創建一個代理[QGraphicsProxyWidget](qgraphicsproxywidget.html#QGraphicsProxyWidget)( )構造函數與此代理插件作為父。 此功能被引入Qt的4.5 。 **See also** [createProxyForChildWidget](qgraphicsproxywidget.html#createProxyForChildWidget)( ) 。 ``` QGraphicsProxyWidget.paint (self, QPainter?painter, QStyleOptionGraphicsItem?option, QWidget?widget) ``` 從重新實現[QGraphicsItem.paint](qgraphicsitem.html#paint)( ) 。 ``` QGraphicsProxyWidget.resizeEvent (self, QGraphicsSceneResizeEvent?event) ``` 從重新實現[QGraphicsWidget.resizeEvent](qgraphicswidget.html#resizeEvent)( ) 。 ``` QGraphicsProxyWidget.setGeometry (self, QRectF?rect) ``` 從重新實現[QGraphicsLayoutItem.setGeometry](qgraphicslayoutitem.html#setGeometry)( ) 。 ``` QGraphicsProxyWidget.setWidget (self, QWidget?widget) ``` 該_widget_說法有它的所有權轉移給Qt的。 Embeds _widget_這個代理部件。嵌入式構件必須完全位于內部或圖形視圖之外。你不能嵌入一個小部件,只要它是在UI別處可見,在相同的時間。 _widget_必須是一個頂級窗口部件,其母公司為0 。 當小部件是嵌入式的,它的狀態(例如,可見,啟用,幾何形狀,大小的提示)復制到代理服務器控件。如果嵌入式部件被明確隱藏或禁用,代理部件將成為明確地隱藏或禁用嵌入完成后。類文檔有一個完整的概述共享狀態。 [QGraphicsProxyWidget](qgraphicsproxywidget.html)的窗口標志確定是否小部件,嵌入后,將獲得的窗口裝飾與否。 在此之后函數返回,[QGraphicsProxyWidget](qgraphicsproxywidget.html)將保持其狀態與同步_widget_只要有可能。 如果一個部件已經嵌入了這個代理,當這個函數被調用,即部件將首先自動未嵌入。傳遞0的_widget_爭吵只會解除嵌入的控件,和當前嵌入式部件的所有權將被傳遞給調用者。嵌入每個子部件也將被嵌入和他們的代理部件損壞。 需要注意的是小部件與[Qt.WA_PaintOnScreen](qt.html#WidgetAttribute-enum)部件屬性集和部件的包裝外部應用程序或控制器無法嵌入。例子是[QGLWidget](qglwidget.html)和[QAxWidget](index.htm)。 **See also** [widget](qgraphicsproxywidget.html#widget)( ) 。 ``` QGraphicsProxyWidget.showEvent (self, QShowEvent?event) ``` 從重新實現[QGraphicsWidget.showEvent](qgraphicswidget.html#showEvent)( ) 。 ``` QSizeF QGraphicsProxyWidget.sizeHint (self, Qt.SizeHint?which, QSizeF?constraint?=?QSizeF()) ``` [](qsizef.html) [從重新實現](qsizef.html)[QGraphicsLayoutItem.sizeHint](qgraphicslayoutitem.html#sizeHint)( ) 。 ``` QRectF QGraphicsProxyWidget.subWidgetRect (self, QWidget?widget) ``` [](qrectf.html) [返回矩形_widget_,它必須是一個后裔](qrectf.html)[widget](qgraphicsproxywidget.html#widget)() ,或[widget](qgraphicsproxywidget.html#widget)( )本身,這個代理項目的本地坐標。 如果沒有部件被嵌入_widget_為0,或_widget_是不是嵌入部件的后裔,這個函數返回一個空[QRectF](qrectf.html)。 **See also** [widget](qgraphicsproxywidget.html#widget)( ) 。 ``` int QGraphicsProxyWidget.type (self) ``` 從重新實現[QGraphicsItem.type](qgraphicsitem.html#type)( ) 。 ``` QGraphicsProxyWidget.ungrabMouseEvent (self, QEvent?event) ``` 從重新實現[QGraphicsWidget.ungrabMouseEvent](qgraphicswidget.html#ungrabMouseEvent)( ) 。 ``` QGraphicsProxyWidget.wheelEvent (self, QGraphicsSceneWheelEvent?event) ``` 從重新實現[QGraphicsItem.wheelEvent](qgraphicsitem.html#wheelEvent)( ) 。 ``` QWidget QGraphicsProxyWidget.widget (self) ``` [ 返回一個指向嵌入的部件。 ](qwidget.html) [**See also**](qwidget.html) [setWidget](qgraphicsproxywidget.html#setWidget)( ) 。
                  <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>

                              哎呀哎呀视频在线观看