QLineEdit怎么设置靠右显示
在lineEdit框中怎么靠右显示啊?
[解决办法]
方法:
setAlignment(Qt::AlignRight);
其实文档上都有说的,这种问题差文档最好不过了:
voidsetAlignment ( Qt::Alignment flag )
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.