自定义布局管理器,用于QwtFigureWidget,支持归一化坐标和网格布局
更多...
#include <qwt_figure_layout.h>
|
|
| QwtFigureLayout (QWidget *parent) |
| |
|
virtual void | addItem (QLayoutItem *item) override |
| |
|
virtual QLayoutItem * | itemAt (int index) const override |
| |
|
virtual QLayoutItem * | takeAt (int index) override |
| |
|
virtual int | count () const override |
| |
|
virtual QSize | sizeHint () const override |
| |
|
virtual QSize | minimumSize () const override |
| |
|
virtual void | setGeometry (const QRect &rect) override |
| |
| void | addAxes (QWidget *widget, const QRectF &rect) |
| | 使用归一化坐标添加窗口部件
|
| |
| void | addAxes (QWidget *widget, qreal left, qreal top, qreal width, qreal height) |
| | 使用分离参数和归一化坐标添加窗口部件
|
| |
| void | addGridAxes (QWidget *widget, int rowCnt, int colCnt, int row, int col, int rowSpan=1, int colSpan=1, qreal wspace=0.0, qreal hspace=0.0) |
| | 添加窗口部件到网格布局
|
| |
| void | setAxesNormPos (QWidget *widget, const QRectF &rect) |
| | 改变已经添加的窗口的位置占比
|
| |
| QRectF | widgetNormRect (QWidget *widget) const |
| | 获取窗口部件的归一化矩形
|
| |
| QRect | calcActualRect (const QRect &parentRect, const QRectF &normRect) |
| | 通过归一化矩形计算真实矩形
|
| |
|
| static QRectF | calcNormRect (const QRect &parentRect, const QRect &rect) |
| | 计算rect相对于parentRect的归一化坐标
|
| |
|
| QRectF | calcGridRect (int rowCnt, int colCnt, int row, int col, int rowSpan=1, int colSpan=1, qreal wspace=0.0, qreal hspace=0.0) const |
| | calc the normalized rectangle for a grid cell/获取网格单元格的归一化矩形
|
| |
自定义布局管理器,用于QwtFigureWidget,支持归一化坐标和网格布局
◆ addAxes() [1/2]
| void QwtFigureLayout::addAxes |
( |
QWidget * |
widget, |
|
|
const QRectF & |
rect |
|
) |
| |
◆ addAxes() [2/2]
| void QwtFigureLayout::addAxes |
( |
QWidget * |
widget, |
|
|
qreal |
left, |
|
|
qreal |
top, |
|
|
qreal |
width, |
|
|
qreal |
height |
|
) |
| |
◆ addGridAxes()
| void QwtFigureLayout::addGridAxes |
( |
QWidget * |
widget, |
|
|
int |
rowCnt, |
|
|
int |
colCnt, |
|
|
int |
row, |
|
|
int |
col, |
|
|
int |
rowSpan = 1, |
|
|
int |
colSpan = 1, |
|
|
qreal |
wspace = 0.0, |
|
|
qreal |
hspace = 0.0 |
|
) |
| |
◆ calcActualRect()
| QRect QwtFigureLayout::calcActualRect |
( |
const QRect & |
parentRect, |
|
|
const QRectF & |
normRect |
|
) |
| |
◆ calcGridRect()
| QRectF QwtFigureLayout::calcGridRect |
( |
int |
rowCnt, |
|
|
int |
colCnt, |
|
|
int |
row, |
|
|
int |
col, |
|
|
int |
rowSpan = 1, |
|
|
int |
colSpan = 1, |
|
|
qreal |
wspace = 0.0, |
|
|
qreal |
hspace = 0.0 |
|
) |
| const |
|
protected |
calc the normalized rectangle for a grid cell/获取网格单元格的归一化矩形
This method calculates the normalized coordinates for a specific grid cell based on the current layout parameters and grid configuration.
此方法根据当前布局参数和网格配置计算特定网格单元格的归一化坐标。
- 参数
-
| rowCnt | Total number of rows in the grid / 网格总行数 |
| colCnt | Total number of columns in the grid / 网格总列数 |
| row | Grid row position (0-based) / 网格行位置(从0开始) |
| col | Grid column position (0-based) / 网格列位置(从0开始) |
| rowSpan | Number of rows to span (default: 1) / 跨行数(默认:1) |
| colSpan | Number of columns to span (default: 1) / 跨列数(默认:1) |
- 返回
- Normalized coordinates [left, top, width, height] in range [0,1] 归一化坐标 [左, 上, 宽, 高],范围 [0,1]
QRectF rect = layout->calcGridRect(2, 2, 0, 0);
QRectF rect = layout->calcGridRect(3, 3, 1, 0, 1, 2);
◆ calcNormRect()
| QRectF QwtFigureLayout::calcNormRect |
( |
const QRect & |
parentRect, |
|
|
const QRect & |
rect |
|
) |
| |
|
static |
计算rect相对于parentRect的归一化坐标
◆ setAxesNormPos()
| void QwtFigureLayout::setAxesNormPos |
( |
QWidget * |
widget, |
|
|
const QRectF & |
rect |
|
) |
| |
◆ widgetNormRect()
| QRectF QwtFigureLayout::widgetNormRect |
( |
QWidget * |
widget | ) |
const |
该类的文档由以下文件生成:
- /home/runner/work/QWT/QWT/src/plot/qwt_figure_layout.h
- /home/runner/work/QWT/QWT/src/plot/qwt_figure_layout.cpp