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

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # QGraphicsAnchorLayout Class Reference ## [[QtGui](index.htm) module] 該QGraphicsAnchorLayout類提供了一個布局,其中一個可以停泊的部件一起在圖形視圖。[More...](#details) 繼承[QGraphicsLayout](qgraphicslayout.html)。 ### Methods * `__init__ (self, QGraphicsLayoutItem?parent?=?None)` * `QGraphicsAnchor addAnchor (self, QGraphicsLayoutItem?firstItem, Qt.AnchorPoint?firstEdge, QGraphicsLayoutItem?secondItem, Qt.AnchorPoint?secondEdge)` * `addAnchors (self, QGraphicsLayoutItem?firstItem, QGraphicsLayoutItem?secondItem, Qt.Orientations?orientations?=?Qt.Horizontal|Qt.Vertical)` * `addCornerAnchors (self, QGraphicsLayoutItem?firstItem, Qt.Corner?firstCorner, QGraphicsLayoutItem?secondItem, Qt.Corner?secondCorner)` * `QGraphicsAnchor anchor (self, QGraphicsLayoutItem?firstItem, Qt.AnchorPoint?firstEdge, QGraphicsLayoutItem?secondItem, Qt.AnchorPoint?secondEdge)` * `int count (self)` * `float horizontalSpacing (self)` * `invalidate (self)` * `QGraphicsLayoutItem itemAt (self, int?index)` * `removeAt (self, int?index)` * `setGeometry (self, QRectF?rect)` * `setHorizontalSpacing (self, float?spacing)` * `setSpacing (self, float?spacing)` * `setVerticalSpacing (self, float?spacing)` * `QSizeF sizeHint (self, Qt.SizeHint?which, QSizeF?constraint?=?QSizeF())` * `float verticalSpacing (self)` * * * ## Detailed Description 該QGraphicsAnchorLayout類提供了一個布局,其中一個可以停泊的部件一起在圖形視圖。 錨布局允許開發人員指定的部件應如何放置彼此相對,并且布局本身。本說明書是由通過添加錨的布局通過調用[addAnchor](qgraphicsanchorlayout.html#addAnchor)( )[addAnchors](qgraphicsanchorlayout.html#addAnchors)()或[addCornerAnchors](qgraphicsanchorlayout.html#addCornerAnchors)( ) 。 在布局中現有的錨可以與被訪問[anchor](qgraphicsanchorlayout.html#anchor)()函數。被錨定項目自動添加到布局,如果項目被移除,所有的錨將被自動刪除。 ![Using an anchor layout to align simple colored widgets.](https://img.kancloud.cn/a4/95/a49578ea6a1e6af55b0cfc7b89a6e0e5_258x216.png) 錨總是成立的項目,其中的“中心”也被認為是邊緣的邊緣之間。請看下面的例子: ``` layout->addAnchor(b, [Qt](qt.html).AnchorLeft, a, [Qt](qt.html).AnchorRight); layout->addAnchor(b, [Qt](qt.html).AnchorTop, a, [Qt](qt.html).AnchorBottom); ``` 這里,項目的右邊緣`a`被錨定到項目的左邊緣`b`和產品的底部邊緣`a`被錨定到產品的上邊緣`b`,其結果是產品`b`將對角線放置在右邊和下邊項目`b`。 該[addCornerAnchors](qgraphicsanchorlayout.html#addCornerAnchors)()函數提供固定的兩個小部件的邊角比兩個單獨的調用的一個簡單的方法[addAnchor](qgraphicsanchorlayout.html#addAnchor)( )顯示在上面的代碼中。在這里,我們看到了一個小工具,可以錨定到封閉布局的左上角: ``` layout->addCornerAnchors(a, [Qt](qt.html).TopLeftCorner, layout, [Qt](qt.html).TopLeftCorner); ``` 在錨定器被用來匹配部件的寬度或高度的情況下,可以很方便地使用[addAnchors](qgraphicsanchorlayout.html#addAnchors)()函數。與其它功能用于指定錨,它也可以用于固定一個部件的布局。 ### Size Hints and Size Policies in an Anchor Layout QGraphicsAnchorLayout尊重每個項目的大小提示和大小政策。請注意,有一些特性[QSizePolicy](qsizepolicy.html)是[not respected](index.htm)。 ### Spacing within an Anchor Layout 布局可以分發的項目之間的一些空間。如果間距沒有被明確指定,空間的實際金額通常是0 。 然而,如果在第一邊緣是_opposite_第二邊緣(例如,第一部件的右邊緣被固定到第二部件的左邊緣)的,錨的尺寸將會從樣式通過查詢一個像素度量:[PM_LayoutHorizontalSpacing](qstyle.html#PixelMetric-enum)水平和錨[PM_LayoutVerticalSpacing](qstyle.html#PixelMetric-enum)垂直錨。 如果該間距為負,則物品將重疊到某種程度。 ### Known issues 有跡象表明, QGraphicsAnchorLayout目前不支持某些功能。這可能會改變未來,因此要避免使用這些功能,如果你想避免任何行為將來回歸: * Stretch factors are not respected. * [QSizePolicy.ExpandFlag](qsizepolicy.html#PolicyFlag-enum) is not respected. * Height for width is not respected. * * * ## Method Documentation ``` QGraphicsAnchorLayout.__init__ (self, QGraphicsLayoutItem?parent?=?None) ``` 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 構造一個[QGraphicsAnchorLayout](qgraphicsanchorlayout.html)實例。_parent_被傳遞給[QGraphicsLayout](qgraphicslayout.html)的構造。 ``` QGraphicsAnchor QGraphicsAnchorLayout.addAnchor (self, QGraphicsLayoutItem?firstItem, Qt.AnchorPoint?firstEdge, QGraphicsLayoutItem?secondItem, Qt.AnchorPoint?secondEdge) ``` [ 該_firstItem_說法有它的所有權轉移給Qt的。 該_secondItem_說法有它的所有權轉移給Qt的。 創建邊緣之間的錨定_firstEdge_項目_firstItem_和邊緣_secondEdge_項目_secondItem_。錨的間距是從式拾取。布局邊緣和產品邊緣之間的錨將具有為0的大小。如果已經有邊緣之間的錨,在新的錨定將取代舊的。 ](qgraphicsanchor.html) [_firstItem_和_secondItem_會自動添加到布局,如果他們不是布局的一部分。這意味著](qgraphicsanchor.html)[count](qgraphicsanchorlayout.html#count)( )可以通過最多2增加。 間隔的錨定會得到依賴于錨定的類型。例如,錨從一個項目的右邊緣到另一個(或反之亦然)的左邊緣將使用默認的水平間距。同樣的行為適用于從下到上的錨, (但他們會使用默認的垂直間距) 。對于所有其它的組合錨,間距為0。所有的錨定功能將遵循這個規則。 的間隔也可以通過使用手動設置[QGraphicsAnchor.setSpacing](qgraphicsanchor.html#spacing-prop)()方法。 調用此函數,其中_firstItem_ or _secondItem_正在布局的祖先未定義的行為。 **See also** [addAnchors](qgraphicsanchorlayout.html#addAnchors)()和[addCornerAnchors](qgraphicsanchorlayout.html#addCornerAnchors)( ) 。 ``` QGraphicsAnchorLayout.addAnchors (self, QGraphicsLayoutItem?firstItem, QGraphicsLayoutItem?secondItem, Qt.Orientations?orientations?=?Qt.Horizontal|Qt.Vertical) ``` 該_firstItem_說法有它的所有權轉移給Qt的。 該_secondItem_說法有它的所有權轉移給Qt的。 錨定件的兩個或四個邊_firstItem_同的對應邊緣_secondItem_,使_firstItem_具有相同的尺寸_secondItem_在所指定的尺寸_orientations_。 例如,下面的例子錨的兩個項目的左,右邊緣,以配合它們的寬度: ``` layout->addAnchor(b, Qt.AnchorLeft, c, Qt.AnchorLeft); layout->addAnchor(b, Qt.AnchorRight, c, Qt.AnchorRight); ``` 這也可以使用下面的代碼行來實現: ``` layout->addAnchors(b, c, [Qt](qt.html).Horizontal); ``` **See also** [addAnchor](qgraphicsanchorlayout.html#addAnchor)()和[addCornerAnchors](qgraphicsanchorlayout.html#addCornerAnchors)( ) 。 ``` QGraphicsAnchorLayout.addCornerAnchors (self, QGraphicsLayoutItem?firstItem, Qt.Corner?firstCorner, QGraphicsLayoutItem?secondItem, Qt.Corner?secondCorner) ``` 該_firstItem_說法有它的所有權轉移給Qt的。 該_secondItem_說法有它的所有權轉移給Qt的。 建立在兩個錨_firstItem_和_secondItem_由指定的邊角,_firstCorner_和_secondCorner_其中之一是對水平方向的邊緣,另一個為垂直方向的邊緣。 這是一個方便的功能,由于錨定角可以表示為錨定兩條邊。例如: ``` layout->addAnchor(a, Qt.AnchorTop, layout, Qt.AnchorTop); layout->addAnchor(a, Qt.AnchorLeft, layout, Qt.AnchorLeft); ``` 這也可以達到與下面一行代碼: ``` layout->addCornerAnchors(a, [Qt](qt.html).TopLeftCorner, layout, [Qt](qt.html).TopLeftCorner); ``` 如果已經有一個邊緣對之間的錨定,它將由錨被替換,該函數指定。 _firstItem_和_secondItem_會自動添加到布局,如果他們不是布局的一部分。這意味著[count](qgraphicsanchorlayout.html#count)( )可以通過最多2增加。 **See also** [addAnchor](qgraphicsanchorlayout.html#addAnchor)()和[addAnchors](qgraphicsanchorlayout.html#addAnchors)( ) 。 ``` QGraphicsAnchor QGraphicsAnchorLayout.anchor (self, QGraphicsLayoutItem?firstItem, Qt.AnchorPoint?firstEdge, QGraphicsLayoutItem?secondItem, Qt.AnchorPoint?secondEdge) ``` [ 返回由所定義的錨點之間的錨_firstItem_和_firstEdge_和_secondItem_和_secondEdge_。如果不存在這樣的錨,該函數將返回0。 ``` int QGraphicsAnchorLayout.count (self) ``` ](qgraphicsanchor.html) [從重新實現](qgraphicsanchor.html)[QGraphicsLayout.count](qgraphicslayout.html#count)( ) 。 ``` float QGraphicsAnchorLayout.horizontalSpacing (self) ``` 返回默認的水平間距為錨的布局。 **See also** [verticalSpacing](qgraphicsanchorlayout.html#verticalSpacing)()和[setHorizontalSpacing](qgraphicsanchorlayout.html#setHorizontalSpacing)( ) 。 ``` QGraphicsAnchorLayout.invalidate (self) ``` 從重新實現[QGraphicsLayout.invalidate](qgraphicslayout.html#invalidate)( ) 。 ``` QGraphicsLayoutItem QGraphicsAnchorLayout.itemAt (self, int?index) ``` [](qgraphicslayoutitem.html) [從重新實現](qgraphicslayoutitem.html)[QGraphicsLayout.itemAt](qgraphicslayout.html#itemAt)( ) 。 ``` QGraphicsAnchorLayout.removeAt (self, int?index) ``` 從重新實現[QGraphicsLayout.removeAt](qgraphicslayout.html#removeAt)( ) 。 刪除的項目布局_index_不破壞它。該項目的所有權轉移給調用者。 刪除一個項目也將刪除與此日志關聯的錨。 **See also** [itemAt](qgraphicsanchorlayout.html#itemAt)()和[count](qgraphicsanchorlayout.html#count)( ) 。 ``` QGraphicsAnchorLayout.setGeometry (self, QRectF?rect) ``` 從重新實現[QGraphicsLayoutItem.setGeometry](qgraphicslayoutitem.html#setGeometry)( ) 。 ``` QGraphicsAnchorLayout.setHorizontalSpacing (self, float?spacing) ``` 設置默認的水平間距為錨布局_spacing_。 **See also** [horizontalSpacing](qgraphicsanchorlayout.html#horizontalSpacing)( )[setVerticalSpacing](qgraphicsanchorlayout.html#setVerticalSpacing)()和[setSpacing](qgraphicsanchorlayout.html#setSpacing)( ) 。 ``` QGraphicsAnchorLayout.setSpacing (self, float?spacing) ``` 設置默認的水平和用于錨定布局的默認垂直間距_spacing_。 如果一個項目是掛靠,沒有與相關的錨間距,它會使用默認的間距。 [QGraphicsAnchorLayout](qgraphicsanchorlayout.html)不支持負的間距。設置一個負值將取消設置之前的間距,使布局使用由當前控件的樣式所提供的空間。 **See also** [setHorizontalSpacing](qgraphicsanchorlayout.html#setHorizontalSpacing)()和[setVerticalSpacing](qgraphicsanchorlayout.html#setVerticalSpacing)( ) 。 ``` QGraphicsAnchorLayout.setVerticalSpacing (self, float?spacing) ``` 設置為錨布局為默認的垂直間距_spacing_。 **See also** [verticalSpacing](qgraphicsanchorlayout.html#verticalSpacing)( )[setHorizontalSpacing](qgraphicsanchorlayout.html#setHorizontalSpacing)()和[setSpacing](qgraphicsanchorlayout.html#setSpacing)( ) 。 ``` QSizeF QGraphicsAnchorLayout.sizeHint (self, Qt.SizeHint?which, QSizeF?constraint?=?QSizeF()) ``` [](qsizef.html) [從重新實現](qsizef.html)[QGraphicsLayoutItem.sizeHint](qgraphicslayoutitem.html#sizeHint)( ) 。 ``` float QGraphicsAnchorLayout.verticalSpacing (self) ``` 返回錨布局默認的垂直間距。 **See also** [horizontalSpacing](qgraphicsanchorlayout.html#horizontalSpacing)()和[setVerticalSpacing](qgraphicsanchorlayout.html#setVerticalSpacing)( ) 。
                  <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>

                              哎呀哎呀视频在线观看