Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to detect text is changed in label ?
Label is editable.How do I detect after text is changed.
QLabels are not meant to be editable, what you want is probably a QLineEdit
I want to use label.Is it not possible with the label?
I want to use label
Can I ask why?
this is not possible.
The (internal) QTextControl is only connected with the 2 link signals.
In normally I can set the label to use the line edit and push buttons.But buttons and linedit taking up places in the window.So I don't want to use them.
I want to change the value directly on the label.
@asttekin What is the difference between label and line edit? Both need space.
@asttekin why not replacing the label with a line edit entirely?
When you use that flag with a Label it does allow to edit text.
However, no signals are emitted so its not possible to know when edit is finished.
As the others points out, you should use a lineedit and maybe this signal
User must then press enter to end editing.
karti gesar last edited by
use textchage()..when you change the text it will shown in qlabel also
Ni.Sumi last edited by Ni.Sumi
use textchage()..when you change the text it will shown in qlabel also.
http://doc.qt.io/qt-4.8/qlabel.html#text-prop If you are talking about this, its the slot . If some one connected the lineEdit / some other editable component to the QLabel, then this slot takes the takes the text from the lineEdit to display it on the label, But not from the Label to other component .
Any how, both label and line Edit takes place in the GUI and LineEdit more powerful than the Label in your case. So could you please let us know, what's stopping you to shift to lineEdit from the Label ?