Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Calling variables declared through Qt designer
In .cpp file, how can I call variables declared through Qt designer without put @ui->@ before them.
Sorry for the english I speak.
Why you do not like
Eddy last edited by
In case you need to use the same variable a lot through ui-> you could pass it to another variable first. And use that new variable instead.
Sorry for the molestation, I it's just interesting for me, where it might be useful?
[quote author="qxoz" date="1322302074"]And yet.
Sorry for the molestation, I it's just interesting for me, where it might be useful?[/quote]
No problem, we learn together!
andre last edited by
If you really want, you can also make your class inherit the ui class: the "multiple inheritance approach":http://doc.qt.nokia.com/4.7/designer-using-a-ui-file.html#the-multiple-inheritance-approach . That will get rid of the ui-> dereference as well.
it’s heavy for writing code?
Yes, for me!
fguimaraes last edited by
It's not clear for me, from where do you want to access this variable?