Qt::​Alignment 设置对齐方式

enum Qt::​AlignmentFlag
flags Qt::​Alignment

设置文本的对齐方式,头文件#include <Qt>

This 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.       为可用空间的文本排版

The vertical flags are:

ConstantValueDescription
Qt::AlignTop0x0020Aligns with the top.
Qt::AlignBottom0x0040Aligns with the bottom.
Qt::AlignVCenter0x0080Centers vertically in the available space.
Qt::AlignBaseline0x0100Aligns with the baseline.

QTableWidgetItem *item = new QTableWidgetItem(operand1);
item->setTextAlignment(Qt::AlignRight);写入小部件的设置方式
tableWidget->setItem(row++,1,item);









   
   
   
   
   
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值