Calling variables declared through Qt designer
-
Hi,
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
@ui->@ -
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.
-
And yet.
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!
-
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.
-
freecamellia
it’s heavy for writing code? -
Yes, for me!
-
It's not clear for me, from where do you want to access this variable?