简体   繁体   English

如何在延伸的QPushbutton上放置QLabel?

[英]How to put a QLabel on a stretched QPushbutton?

Firstly, look at the following: 首先,请看以下内容:

I want to put the label_3 on the FontColor_btn at the yellow rectangle, but the problem is that the label_3 can't move it over the FontColor_btn because everything is stretchable even label_3 not in fixed size. 我想把label_3FontColor_btn的黄色矩形,但问题是, label_3不能移动它在FontColor_btn因为一切都伸展甚至label_3没有固定的大小。

Again, I want to put the label_3 on the FontColor_btn at the yellow rectangle ? 同样, 我想把label_3FontColor_btn的黄色矩形

I don't know if it's possible in designer, in code you just need to set the button as parent of the label and then move it: 我不知道在设计器中是否可行,在代码中,您只需要将按钮设置为标签的父级,然后将其移动即可:

QLabel* label3 =new QLabel(ui->fontColor_btn);
label3->setGeometry(/*move it where you want it*/);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM