[英]How to place the checkbox of a QCheckBox widget on the right, and text left-justified
Does Qt offer a way to configure the layout of a QCheckBox with Qt Stylesheets so that the text remains aligned to the right but the checkbox is placed on the far right? Qt 是否提供了一种使用 Qt 样式表配置 QCheckBox 布局的方法,以便文本保持与右侧对齐但复选框位于最右侧?
You can use QCheckBox::setLayoutDirection(Qt::LayoutDirection direction)
:您可以使用
QCheckBox::setLayoutDirection(Qt::LayoutDirection direction)
:
auto chkB = new QCheckBox("some example");
chkB->setLayoutDirection(Qt::RightToLeft);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.