Calling variables declared through Qt designer
-
wrote on 26 Nov 2011, 09:49 last edited by
Hi,
In .cpp file, how can I call variables declared through Qt designer without put @ui->@ before them.
Sorry for the english I speak. -
wrote on 26 Nov 2011, 09:56 last edited by
Why you do not like
@ui->@ -
wrote on 26 Nov 2011, 09:58 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.
-
wrote on 26 Nov 2011, 10:07 last edited by
And yet.
Sorry for the molestation, I it's just interesting for me, where it might be useful? -
wrote on 26 Nov 2011, 10:11 last edited by
-
wrote on 26 Nov 2011, 10:20 last edited by
[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!
-
wrote on 26 Nov 2011, 10:22 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.
-
wrote on 26 Nov 2011, 15:29 last edited by
freecamellia
it’s heavy for writing code? -
wrote on 26 Nov 2011, 17:18 last edited by
Yes, for me!
-
wrote on 28 Nov 2011, 16:32 last edited by
It's not clear for me, from where do you want to access this variable?
1/10