PDA

View Full Version : is the *ui Creator specific? Can it be avoided?



KlausKoe
11th June 2010, 16:47
Hi, as said in other thread I am completely new to Qt and UI programming as well.

I've seen some examples and mostly the widgets are put directly in the window class inherited from QMainWindow.
e.g.: window.lineEdit ...

I played around with the creator and it seems like it uses a additional *ui which points to ui_window and accessing those basic widgets is done by window.ui->lineEdit.

Is this *ui specific to applications created with the Creator? Is this some recent concept change? Can the Creator add the widgets directly in the window?

rgds
kk

wysota
11th June 2010, 16:58
You can decide which of the three standard approaches Creator takes when autogenerating widget implementation in Designer group of Creator's settings.

Zlatomir
11th June 2010, 19:11
The use of ui member pointer can be avoided,
but it's the most recommended way to "integrate" the auto-generated (by uic) class into your code, by that i mean:
1) it's easier to understand then multiple inheritance
2) it needs a few lines of code to write for keeping the pointer a private member (separate the UI and the code) and this means that you ensure that the UI can be changed without changing the code using it.