I now how to set value(number) but can i read that label in some variable. if can't read, in which similar widgets can i put value and read it. Any help would be halpful or someone has an other idea. Maybe like LCD number, spin box
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Like this?
QString text = someLabel->text();
回答2:
Here is the documentation. QLabel.text()
EDIT:
QString text = theLabel.text();
//or with pointer
QString text = theLabel->text();
回答3:
have you tried :
QString s = YourQLabel->text();
This should work, I guess.
回答4:
// Thelepaty mode on
You need to use editor widgets, for example QLineEdit
or QTextEdit
. You may customize it via QSS to look like a QLabel
.
P.S. try to improve your English. It is hard to understand, what you are asking.
// Thelepaty mode off