Qt in LineEdit Reading text, numbers, etc , In fact, this is not limited to LineEdit Control in the text, numbers, etc , It can be SpinBox Reading of
, Now it works for two .
Before that, it was in LineEdit Read in the data I want , Now it is based on the needs of this project , Be able to UI
Make changes at any time , So it was used SpinBox, Read it , This time LineEdit To tell , Everything else is the same , It's just more functional
This is just a feature , We won't open up another slot function , The code is simple , I will tell you how to know that you have successfully read it .
1.ui Drag up LineEdit control
Define attribute name T_pix and T——pix1
Now I'm sure I'm curious about how that number came from ? In fact, it is changed in the property page , Default input
You should know by reading English , At that time, I was still thinking about how to let him acquiesce , Now it's all in here （ This principle is not limited to this control , Other controls also have corresponding default settings ）
With these foundations , Here is how to write the key code , I'll just take a screenshot , It will be more clear , The code is given below
See this label , Maybe you can see something , This is what I talked about in a blog about changing pixels , It's still flowers here T word , It's just easier to modify （ I'll talk about it next ）, It's more casual .
The code is also posted , Not all of them , Post the most important paragraph of the theme here , To be exact, it is a sentence , I'll add one more .
Here we should think about why there is one more sentence below . Yes, of course , It's not much here , That's a lot for the whole code , But for us to write , It's not much to do a verification , The following sentence is mainly to verify whether a read is successful . Automatically add after reading 1
Last blog content , Refer to