本页内容

Layouting Namespace

Layouting 命名空间包含用于在代码中便捷创建布局的类和函数。更多内容...

Header: #include <Layouting>

类

class Align
class Canvas
class CanvasWidget
class Column
class CompletingTextEdit
class Else
class Flow
class Form
class Grid
class GridCell
class Group
class If
class Label
class Layout
class LayoutItem
class LineEdit
class MarkdownBrowser
class PushButton
class Row
class ScrollArea
class Space
class Span
class SpanAll
class SpinBox
class Spinner
class Splitter
class Stack
class Stretch
class Tab
class TabWidget
class TextEdit
class Then
class ToolBar
class ToolButton
class Widget

函数

void br(Layouting::Layout *layout)
QWidget *createHr(QWidget *parent = nullptr)
void destroyLayout(QLayout *layout)
void empty(Layouting::Layout *layout)
void hr(Layouting::Layout *layout)
void ignoreDirtyHooks(Layouting::Widget *widget)
void noMargin(Layouting::Layout *layout)
void normalMargin(Layouting::Layout *layout)
Layouting::LayoutModifier spacing(int space)
void st(Layouting::Layout *layout)
Layouting::LayoutModifier stretch(int index, int stretch)
void tight(Layouting::Layout *layout)
void withFormAlignment(Layouting::Layout *layout)

详细说明

该命名空间中的类有助于创建从 `QLayout ` 或 `QWidget ` 派生的类。实例应在函数内部局部使用,切勿将其存储。

另请参阅 Layouting::Widget 和Layouting::Layout 。

类

classAlign

为被包装的构建器生成的所有项目设置Qt::Alignment 。更多...

classCanvas

提供一个用于布局构建器的自定义绘制小部件表面。更多...

类CanvasWidget

QWidget 的子类,将绘制操作委托给用户提供的函数。更多...

类Column

将项目垂直排列(QVBoxLayout )。更多...

类CompletingTextEdit

封装了Utils::CompletingTextEdit ,以便在布局构建器中使用。更多...

类Else

用于存储当 If 条件为 false 时需包含的项目列表。更多...

类Flow

将项目按从左到右的流式排列,当可用宽度被超过时自动换行。更多...

classForm

将标签-字段对以两栏表单布局排列(QFormLayout )。更多...

类Grid

将项目排列在二维网格中(QGridLayout )。更多...

类GridCell

将多个项目组合到单个网格单元格中,同时不增加列计数器。更多...

类Group

封装 `QGroupBox ` 以供在布局构建器中使用。更多...

类If

根据布尔条件有条件地包含布局项。更多...

Label类

封装了QLabel ,以便在布局构建器中使用。更多...

类Layout

布局构建器类的基类。更多...

类LayoutItem

类LineEdit

封装了Utils::FancyLineEdit ,以便在布局构建器中使用。更多...

类MarkdownBrowser

封装了 Utils::MarkdownBrowser,以便在布局构建器中使用。更多...

类PushButton

封装了QPushButton ,以便在布局构建器中使用。更多...

类Row

将项目水平排列(QHBoxLayout )。更多...

类ScrollArea

封装QScrollArea 以便在布局构建器中使用。更多...

类Space

Space 类表示布局中的某些空白区域。更多...

类Span

用于在网格布局中为单个项目设置列和/或行跨度。更多...

SpanAll类

为嵌套构建器添加的所有项目设置列跨和/或行跨。更多...

SpinBox类

封装QSpinBox 以便在布局构建器中使用。更多...

类Spinner

封装 SpinnerSolution::SpinnerWidget,以便在布局构建器中使用。更多...

类Splitter

封装了QSplitter ,以便在布局构建器中使用。更多...

类Stack

封装了QStackedWidget ,以便在布局构建器中使用。更多...

类Stretch

Stretch 类表示布局中的一定程度的拉伸。更多...

类Tab

表示一个用于TabWidget 构建器内的单个标签页。更多...

类TabWidget

将QTabWidget 封装起来,以便在Layouting构建器中使用。更多...

TextEdit类

封装QTextEdit ,以便在布局构建器中使用。更多...

类Then

用于存储当 If 条件为真时需包含的项目列表。更多...

类ToolBar

封装了QToolBar ,以便在布局构建器中使用。更多...

类ToolButton

封装了QToolButton ,以便在布局构建器中使用。更多...

类Widget

控件构建器类的基类。更多...

函数文档

void Layouting::br(Layouting::Layout *layout)

通过调用 flush() 在layout 中开始新行。在 Grid 和 Form 的初始化列表中使用该方法以结束当前行。

另请参阅 Layout::flush() 和Layout::addRow()。

QWidget *Layouting::createHr(QWidget *parent = nullptr)

创建并返回一个水平线控件(一个带有 HLine 形状的凹陷QFrame )。可选的parent 将传递给QFrame 构造函数。

另请参阅 Layouting::hr()。

void Layouting::destroyLayout(QLayout *layout)

递归地销毁layout 及其所有子项和嵌套布局。布局项所拥有的控件也会被删除。

void Layouting::empty(Layouting::Layout *layout)

向layout 中添加一个空的(无操作)占位项。在Grid或Form行中,当需要留空某个单元格时,此项可作为填充元素使用。

void Layouting::hr(Layouting::Layout *layout)

在layout 中添加一条水平线(一个内嵌的QFrame )。

另请参阅 Layouting::createHr()。

void Layouting::ignoreDirtyHooks(Layouting::Widget *widget)

将widget 标记为“dirty-state”,以便对其所做的更改不会触发“dirty-state”通知。这对于那些其值发生变化时不应将设置页面或文档标记为已修改的小部件非常有用。

void Layouting::noMargin(Layouting::Layout *layout)

将layout 的所有内容边距设置为零。

另请参阅 Layout::setNoMargins()、Layouting::normalMargin() 和Layouting::tight()。

void Layouting::normalMargin(Layouting::Layout *layout)

将layout 的所有内容边距设置为9像素。

另请参阅 Layout::setNormalMargins() 和Layouting::noMargin()。

Layouting::LayoutModifier Layouting::spacing(int space)

返回一个 LayoutModifier,用于将布局的间距设置为space 像素。

另请参阅 Layouting::stretch()。

void Layouting::st(Layouting::Layout *layout)

为layout 添加伸展因子1。仅在盒式(列/行)布局中生效。

另请参阅 Layouting::Stretch 和Layouting::spacing()。

Layouting::LayoutModifier Layouting::stretch(int index, int stretch)

返回一个 LayoutModifier,它将位于index 的项的拉伸因子设置为stretch 。

另请参阅 Layouting::spacing()。

void Layouting::tight(Layouting::Layout *layout)

将内容边距和layout 的间距均设置为零。相当于先调用noMargin(),然后调用spacing(0)。

另请参阅 Layouting::noMargin() 和Layouting::spacing()。

void Layouting::withFormAlignment(Layouting::Layout *layout)

旨在为layout 启用表单样式的标签对齐功能。尚未实现。

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.