QT Alignment 参数 文字对齐方式

QT Alignment参数用于描述对齐方式,包括水平和垂直方向的标志,可以组合使用以达到所需效果。TextElideMode枚举也能在很多情况下优化对齐文本的显示。其中,水平对齐标志有:1表示左对齐,2表示右对齐,3表示居中。例如:ui->tableWidgetLine->item(i,j)->setTextAlignment(4);" 136181956,14928496,CAN总线与FPGA设计:基于UVM的控制器验证,"['汽车电子', 'FPGA开发', 'CAN通信', '验证方法学']

his enum type is used to describe alignment. It contains horizontal and vertical flags that can be combined to produce the required effect.

The TextElideMode enum can also be used in many situations to fine-tune the appearance of aligned text.

The horizontal flags are:

 

ConstantValueDescription
Qt::AlignLeft0x0001Aligns with the left edge.
Qt::AlignRight0x0002Aligns with the right edge.
Qt::AlignHCenter0x0004Centers horizontally in the available space.
Qt::AlignJustify0x0008Justifies the text in the available space.

 

 

Alignment 参数为int型,1表示左对齐,2表示右对齐,3表示居中

 

示例:ui->tableWidgetLine->item(i,j)->setTextAlignment(4);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值