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

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # QLayout Class Reference ## [[QtGui](index.htm) module] The QLayout class is the base class of geometry managers. [More...](#details) Inherits [QObject](qobject.html) and [QLayoutItem](qlayoutitem.html). Inherited by [QBoxLayout](qboxlayout.html), [QFormLayout](qformlayout.html), [QGridLayout](qgridlayout.html) and [QStackedLayout](qstackedlayout.html). ### Types * `enum SizeConstraint { SetDefaultConstraint, SetNoConstraint, SetMinimumSize, SetFixedSize, SetMaximumSize, SetMinAndMaxSize }` ### Methods * `__init__ (self, QWidget?parent)` * `__init__ (self)` * `bool activate (self)` * `addChildLayout (self, QLayout?l)` * `addChildWidget (self, QWidget?w)` * `addItem (self, QLayoutItem)` * `addWidget (self, QWidget?w)` * `QRect alignmentRect (self, QRect)` * `childEvent (self, QChildEvent?e)` * `QMargins contentsMargins (self)` * `QRect contentsRect (self)` * `int count (self)` * `Qt.Orientations expandingDirections (self)` * `QRect geometry (self)` * `(int?left, int?top, int?right, int?bottom) getContentsMargins (self)` * `int indexOf (self, QWidget)` * `invalidate (self)` * `bool isEmpty (self)` * `bool isEnabled (self)` * `QLayoutItem itemAt (self, int?index)` * `QLayout layout (self)` * `int margin (self)` * `QSize maximumSize (self)` * `QWidget menuBar (self)` * `QSize minimumSize (self)` * `QWidget parentWidget (self)` * `removeItem (self, QLayoutItem)` * `removeWidget (self, QWidget?w)` * `bool setAlignment (self, QWidget?w, Qt.Alignment?alignment)` * `bool setAlignment (self, QLayout?l, Qt.Alignment?alignment)` * `setAlignment (self, Qt.Alignment?alignment)` * `setContentsMargins (self, int?left, int?top, int?right, int?bottom)` * `setContentsMargins (self, QMargins?margins)` * `setEnabled (self, bool)` * `setGeometry (self, QRect)` * `setMargin (self, int)` * `setMenuBar (self, QWidget?w)` * `setSizeConstraint (self, SizeConstraint)` * `setSpacing (self, int)` * `SizeConstraint sizeConstraint (self)` * `int spacing (self)` * `QLayoutItem takeAt (self, int?index)` * `int totalHeightForWidth (self, int?w)` * `QSize totalMaximumSize (self)` * `QSize totalMinimumSize (self)` * `QSize totalSizeHint (self)` * `update (self)` * `widgetEvent (self, QEvent)` ### Static Methods * `QSize closestAcceptableSize (QWidget?w, QSize?s)` ### Special Methods * `__len__ (self)` * * * ## Detailed Description 該QLayout類是幾何管理者的基類。 這是繼承的具體類的抽象基類[QBoxLayout](qboxlayout.html),[QGridLayout](qgridlayout.html),[QFormLayout](qformlayout.html)和[QStackedLayout](qstackedlayout.html)。 有關的QLayout子類或用戶[QMainWindow](qmainwindow.html)里面很少有任何需要使用由QLayout提供的基本功能,如[setSizeConstraint](qlayout.html#sizeConstraint-prop)()或[setMenuBar](qlayout.html#setMenuBar)( ) 。看[Layout Management](index.htm)了解更多信息。 為了使自己的布局管理器,實現功能[addItem](qlayout.html#addItem)( )[sizeHint](qlayoutitem.html#sizeHint)( )[setGeometry](qlayout.html#setGeometry)( )[itemAt](qlayout.html#itemAt)()和[takeAt](qlayout.html#takeAt)( ) 。你也應該實施[minimumSize](qlayout.html#minimumSize)( ),以確保你的布局是不是調整到零尺寸,如果有空間太少。為了支持兒童,其高度依賴于它們的寬度,實施[hasHeightForWidth](qlayoutitem.html#hasHeightForWidth)()和[heightForWidth](qlayoutitem.html#heightForWidth)( ) 。請參閱[Border Layout](index.htm)和[Flow Layout](index.htm)示例有關實現自定義布局管理器的更多信息。 當布局管理器被刪除幾何管理停止。 * * * ## Type Documentation ``` QLayout.SizeConstraint ``` 可能的值有: | Constant | Value | Description | | --- | --- | --- | | `QLayout.SetDefaultConstraint` | `0` | 主窗口部件的最小大小設置為[minimumSize](qlayout.html#minimumSize)()中,除插件已經具有的最小尺寸。 | | `QLayout.SetFixedSize` | `3` | 主窗口部件的大小設置為[sizeHint](qlayoutitem.html#sizeHint)();它不能在所有的調整大小。 | | `QLayout.SetMinimumSize` | `2` | 主窗口部件的最小大小設置為[minimumSize](qlayout.html#minimumSize)();它不能是較小的。 | | `QLayout.SetMaximumSize` | `4` | 主窗口部件的最大大小設置為[maximumSize](qlayout.html#maximumSize)();它不能大。 | | `QLayout.SetMinAndMaxSize` | `5` | 主窗口部件的最小大小設置為[minimumSize](qlayout.html#minimumSize)() ,其最大尺寸設定為[maximumSize](qlayout.html#maximumSize)( ) 。 | | `QLayout.SetNoConstraint` | `1` | 窗口小部件不受限。 | **See also** [setSizeConstraint](qlayout.html#sizeConstraint-prop)( ) 。 * * * ## Method Documentation ``` QLayout.__init__ (self, QWidget?parent) ``` 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 構造一個新的頂級[QLayout](qlayout.html),與父_parent_。_parent_可能不是0 。 只能有一個是一個小部件的頂層布局。它是由返回[QWidget.layout](qwidget.html#layout)( ) 。 ``` QLayout.__init__ (self) ``` 構造一個新的子[QLayout](qlayout.html)。 這種布局有被插入到另一個布局之前幾何管理將工作。 ``` bool QLayout.activate (self) ``` 重做的布局[parentWidget](qlayout.html#parentWidget)()如果需要的話。 你通常應該不需要調用這個,因為它是自動調用在最適當的時候。如果布局被再做它返回True 。 **See also** [update](qlayout.html#update)()和[QWidget.updateGeometry](qwidget.html#updateGeometry)( ) 。 ``` QLayout.addChildLayout (self, QLayout?l) ``` 該_l_說法有它的所有權轉移給Qt的。 此功能是從所謂的`addLayout()` or `insertLayout()`在子類的功能來添加布局_l_作為子布局。 在其中你需要把它直接調用的唯一情況是,如果你執行一個支持嵌套的布局自定義布局。 **See also** [QBoxLayout.addLayout](qboxlayout.html#addLayout)( )[QBoxLayout.insertLayout](qboxlayout.html#insertLayout)()和[QGridLayout.addLayout](qgridlayout.html#addLayout)( ) 。 ``` QLayout.addChildWidget (self, QWidget?w) ``` 該_w_說法有它的所有權轉移給Qt的。 此功能是從所謂的`addWidget()`在子類中添加功能_w_作為布局的一個管理部件。 If _w_已通過布局管理,此功能將給予警告并刪除_w_從布局。這個功能,因此必須加入之前調用_w_到布局的數據結構。 ``` QLayout.addItem (self, QLayoutItem) ``` 這種方法是抽象的,應在任何子類中重新實現。 該_QLayoutItem_說法有它的所有權轉移給Qt的。 實現在子類中添加一個_item_。它是如何添加特定于每個子類。 這個功能并不是通常所說的應用程序代碼。以一個小部件添加到布局,使用[addWidget](qlayout.html#addWidget)( )函數;有關規定增加一個子布局,使用addLayout ( )函數[QLayout](qlayout.html)子類。 **Note:**所有權_item_被轉移到布局,它的布局的責任將其刪除。 **See also** [addWidget](qlayout.html#addWidget)( )[QBoxLayout.addLayout](qboxlayout.html#addLayout)()和[QGridLayout.addLayout](qgridlayout.html#addLayout)( ) 。 ``` QLayout.addWidget (self, QWidget?w) ``` 該_w_說法有它的所有權轉移給Qt的。 添加小工具_w_在特定的布局方式這樣的布局。此函數使用[addItem](qlayout.html#addItem)( ) 。 ``` QRect QLayout.alignmentRect (self, QRect) ``` [](qrect.html) [返回時,此布局的幾何形狀被設置為應涵蓋的矩形_r_,但前提是這個布局支持](qrect.html)[setAlignment](qlayout.html#setAlignment)( ) 。 其結果是衍生自[sizeHint](qlayoutitem.html#sizeHint)( )和擴展( ) 。這是從來沒有大于_r_。 ``` QLayout.childEvent (self, QChildEvent?e) ``` 從重新實現[QObject.childEvent](qobject.html#childEvent)( ) 。 ``` QSize QLayout.closestAcceptableSize (QWidget?w, QSize?s) ``` [](qsize.html) [返回一個大小滿足所有尺寸的限制_widget_包括](qsize.html)[heightForWidth](qlayoutitem.html#heightForWidth)( ),并且是盡可能接近到_size_。 ``` QMargins QLayout.contentsMargins (self) ``` [ 返回周圍的布局中使用的利潤。 ](qmargins.html) [默認情況下,](qmargins.html)[QLayout](qlayout.html)使用由式所提供的值。在大多數平臺上,保證金是在所有方向11像素。 此功能被引入Qt的4.6 。 **See also** [setContentsMargins](qlayout.html#setContentsMargins)( ) 。 ``` QRect QLayout.contentsRect (self) ``` [](qrect.html) [返回布局的](qrect.html)[geometry](qlayout.html#geometry)( )的矩形,但考慮到內容的利潤率。 此功能被引入Qt的4.3 。 **See also** [setContentsMargins](qlayout.html#setContentsMargins)()和[getContentsMargins](qlayout.html#getContentsMargins)( ) 。 ``` int QLayout.count (self) ``` 這種方法是抽象的,應在任何子類中重新實現。 必須在子類中實現返回布局的項目數。 **See also** [itemAt](qlayout.html#itemAt)( ) 。 ``` Qt.Orientations QLayout.expandingDirections (self) ``` [](index.htm) [從重新實現](index.htm)[QLayoutItem.expandingDirections](qlayoutitem.html#expandingDirections)( ) 。 返回此布局是否可以使更多的空間比使用[sizeHint](qlayoutitem.html#sizeHint)( ) 。的值[Qt.Vertical](qt.html#Orientation-enum) or [Qt.Horizontal](qt.html#Orientation-enum)意味著它要在只有一維增長,而[Qt.Vertical](qt.html#Orientation-enum)|[Qt.Horizontal](qt.html#Orientation-enum)也就是說,它要在這兩個方面的增長。 默認實現返回[Qt.Horizontal](qt.html#Orientation-enum)|[Qt.Vertical](qt.html#Orientation-enum)。子類重新實現它返回基于其子控件的一個有意義的值[size policies](qsizepolicy.html)。 **See also** [sizeHint](qlayoutitem.html#sizeHint)( ) 。 ``` QRect QLayout.geometry (self) ``` [](qrect.html) [從重新實現](qrect.html)[QLayoutItem.geometry](qlayoutitem.html#geometry)( ) 。 **See also** [setGeometry](qlayout.html#setGeometry)( ) 。 ``` (int?left, int?top, int?right, int?bottom) QLayout.getContentsMargins (self) ``` 提取左,上,右,和周圍的布局中使用上下邊界,并為它們分配到*_left_*_top_*_right_和*_bottom_(除非他們是空指針) 。 默認情況下,[QLayout](qlayout.html)使用由式所提供的值。在大多數平臺上,保證金是在所有方向11像素。 此功能被引入Qt的4.3 。 **See also** [setContentsMargins](qlayout.html#setContentsMargins)( )[QStyle.pixelMetric](qstyle.html#pixelMetric)( )[PM_LayoutLeftMargin](qstyle.html#PixelMetric-enum),[PM_LayoutTopMargin](qstyle.html#PixelMetric-enum),[PM_LayoutRightMargin](qstyle.html#PixelMetric-enum)和[PM_LayoutBottomMargin](qstyle.html#PixelMetric-enum)。 ``` int QLayout.indexOf (self, QWidget) ``` 搜索小工具_widget_在這種布局(不包括子布局) 。 返回的索引_widget_,或-1,如果_widget_是沒有找到。 對所有項目使用默認的實現迭代[itemAt](qlayout.html#itemAt)( ) ``` QLayout.invalidate (self) ``` 從重新實現[QLayoutItem.invalidate](qlayoutitem.html#invalidate)( ) 。 ``` bool QLayout.isEmpty (self) ``` 從重新實現[QLayoutItem.isEmpty](qlayoutitem.html#isEmpty)( ) 。 ``` bool QLayout.isEnabled (self) ``` 返回True如果啟用了布局,否則返回False 。 **See also** [setEnabled](qlayout.html#setEnabled)( ) 。 ``` QLayoutItem QLayout.itemAt (self, int?index) ``` [ 這種方法是抽象的,應在任何子類中重新實現。 必須在子類中實現,以在返回版面項目_index_。如果不存在這樣的產品,該函數必須返回0。項目從0連續編號。如果一個項目被刪除,其他項目將被重新編號。 此功能可用于迭代的布局。下面的代碼將繪制在小部件的布局結構為每個布局項目的矩形。 ](qlayoutitem.html) ``` static void paintLayout(QPainter *painter, [QLayoutItem](qlayoutitem.html) *item) { [QLayout](qlayout.html) *layout = item->layout(); if (layout) { for (int i = 0; i < layout->count(); ++i) paintLayout(painter, layout->itemAt(i)); } painter->drawRect(item->geometry()); } void MyWidget.paintEvent([QPaintEvent](qpaintevent.html) *) { [QPainter](qpainter.html) painter(this); if (layout()) paintLayout(&painter, layout()); } ``` **See also** [count](qlayout.html#count)()和[takeAt](qlayout.html#takeAt)( ) 。 ``` QLayout QLayout.layout (self) ``` [](qlayout.html) [從重新實現](qlayout.html)[QLayoutItem.layout](qlayoutitem.html#layout)( ) 。 ``` int QLayout.margin (self) ``` ``` QSize QLayout.maximumSize (self) ``` [](qsize.html) [從重新實現](qsize.html)[QLayoutItem.maximumSize](qlayoutitem.html#maximumSize)( ) 。 返回此布局的最大尺寸。這是該布局可以有同時仍尊重規格的最大尺寸。 返回值不包括所需的空間[QWidget.setContentsMargins](qwidget.html#setContentsMargins)()或[menuBar](qlayout.html#menuBar)( ) 。 默認實現允許無限制調整大小。 ``` QWidget QLayout.menuBar (self) ``` [ 返回菜單欄設置此布局,或者0,如果沒有菜單欄設置。 ](qwidget.html) [**See also**](qwidget.html) [setMenuBar](qlayout.html#setMenuBar)( ) 。 ``` QSize QLayout.minimumSize (self) ``` [](qsize.html) [從重新實現](qsize.html)[QLayoutItem.minimumSize](qlayoutitem.html#minimumSize)( ) 。 返回此布局的最小尺寸。這是該布局可以有同時仍尊重的規格的最小尺寸。 返回值不包括所需的空間[QWidget.setContentsMargins](qwidget.html#setContentsMargins)()或[menuBar](qlayout.html#menuBar)( ) 。 默認實現允許無限制調整大小。 ``` QWidget QLayout.parentWidget (self) ``` [ 返回此布局,或0的父控件,如果這個布局上沒有任何部件安裝。 如果布局是一個子布局,該函數返回父布局的父控件。 ](qwidget.html) [**See also**](qwidget.html) [parent](qobject.html#parent)( ) 。 ``` QLayout.removeItem (self, QLayoutItem) ``` 該_QLayoutItem_爭論 刪除布局項目_item_從布局。它是調用者的責任要刪除的項目。 請注意,_item_可以是一個布局(自[QLayout](qlayout.html)繼承[QLayoutItem](qlayoutitem.html)) 。 **See also** [removeWidget](qlayout.html#removeWidget)()和[addItem](qlayout.html#addItem)( ) 。 ``` QLayout.removeWidget (self, QWidget?w) ``` 刪除小工具_widget_從布局。此調用后,它是調用者的責任給小部件合理的幾何形狀或把小工具放回布局。 **Note:**所有權_widget_保持不變它被加入時相同。 **See also** [removeItem](qlayout.html#removeItem)( )[QWidget.setGeometry](qwidget.html#geometry-prop)()和[addWidget](qlayout.html#addWidget)( ) 。 ``` bool QLayout.setAlignment (self, QWidget?w, Qt.Alignment?alignment) ``` 設置對齊部件_w_至_alignment_并返回True ,如果_w_在這種布局(不包括子布局)被發現,否則返回False 。 ``` bool QLayout.setAlignment (self, QLayout?l, Qt.Alignment?alignment) ``` 設置此項目的對齊方式_alignment_。 **See also** [QLayoutItem.setAlignment](qlayoutitem.html#setAlignment)( ) 。 ``` QLayout.setAlignment (self, Qt.Alignment?alignment) ``` 這是一個重載函數。 設置對齊布局_l_至_alignment_并返回True ,如果_l_在這種布局(不包括子布局)被發現,否則返回False 。 ``` QLayout.setContentsMargins (self, int?left, int?top, int?right, int?bottom) ``` 設置_left_,_top_,_right_和_bottom_利潤使用周圍的布局。 默認情況下,[QLayout](qlayout.html)使用由式所提供的值。在大多數平臺上,保證金是在所有方向11像素。 此功能被引入Qt的4.3 。 **See also** [contentsMargins](qlayout.html#contentsMargins)( )[getContentsMargins](qlayout.html#getContentsMargins)( )[QStyle.pixelMetric](qstyle.html#pixelMetric)( )[PM_LayoutLeftMargin](qstyle.html#PixelMetric-enum),[PM_LayoutTopMargin](qstyle.html#PixelMetric-enum),[PM_LayoutRightMargin](qstyle.html#PixelMetric-enum)和[PM_LayoutBottomMargin](qstyle.html#PixelMetric-enum)。 ``` QLayout.setContentsMargins (self, QMargins?margins) ``` 設置_margins_使用周圍的布局。 默認情況下,[QLayout](qlayout.html)使用由式所提供的值。在大多數平臺上,保證金是在所有方向11像素。 此功能被引入Qt的4.6 。 **See also** [contentsMargins](qlayout.html#contentsMargins)( ) 。 ``` QLayout.setEnabled (self, bool) ``` 啟用此布局,如果_enable_是真,否則禁用它。 已啟用的布局動態調整??的變化,而停用的布局行為,就好像它不存在。 默認情況下所有版面已啟用。 **See also** [isEnabled](qlayout.html#isEnabled)( ) 。 ``` QLayout.setGeometry (self, QRect) ``` 從重新實現[QLayoutItem.setGeometry](qlayoutitem.html#setGeometry)( ) 。 **See also** [geometry](qlayout.html#geometry)( ) 。 ``` QLayout.setMargin (self, int) ``` ``` QLayout.setMenuBar (self, QWidget?w) ``` 該_w_說法有它的所有權轉移給Qt的。 告訴幾何管理器放置在菜單欄_widget_在頂部[parentWidget](qlayout.html#parentWidget)( ) ,外[QWidget.contentsMargins](qwidget.html#contentsMargins)( ) 。所有子控件放置在菜單欄的底部邊緣下方。 **See also** [menuBar](qlayout.html#menuBar)( ) 。 ``` QLayout.setSizeConstraint (self, SizeConstraint) ``` ``` QLayout.setSpacing (self, int) ``` ``` SizeConstraint QLayout.sizeConstraint (self) ``` [ ``` int QLayout.spacing (self) ``` ](qlayout.html#SizeConstraint-enum) ``` QLayoutItem QLayout.takeAt (self, int?index) ``` [ 這種方法是抽象的,應在任何子類中重新實現。 該_QLayoutItem_結果 必須在子類中實現以除去布局項目_index_從布局,并返回該項目。如果沒有這樣的項目,該函數必須什么也不做,返回0 。項目從0連續編號。如果一個項目被刪除,其他項目將被重新編號。 下面的代碼片段顯示了一個安全的方式從布局中刪除的所有項目: ](qlayoutitem.html) ``` QLayoutItem *child; while ((child = layout->takeAt(0)) != 0) { ... delete child; } ``` **See also** [itemAt](qlayout.html#itemAt)()和[count](qlayout.html#count)( ) 。 ``` int QLayout.totalHeightForWidth (self, int?w) ``` ``` QSize QLayout.totalMaximumSize (self) ``` [](qsize.html) ``` QSize QLayout.totalMinimumSize (self) ``` [](qsize.html) ``` QSize QLayout.totalSizeHint (self) ``` [ ``` QLayout.update (self) ``` ](qsize.html) [更新的布局](qsize.html)[parentWidget](qlayout.html#parentWidget)( ) 。 你通常應該不需要調用這個,因為它是自動調用在最適當的時候。 **See also** [activate](qlayout.html#activate)()和[invalidate](qlayout.html#invalidate)( ) 。 ``` QLayout.widgetEvent (self, QEvent) ``` ``` QLayout.__len__ (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>

                              哎呀哎呀视频在线观看