PDA

View Full Version : Creating UI elements with Codes



zellwwf
16th August 2011, 21:27
I have read and watch numerous, ALOT, of tutorial certified qt videos.
i have a general idea of how to create UI elements with code, but the ONE and i believe most important thing they don't mention, is where do you place that piece of code...
Let's say i want to create a LineEdit in a form called LOLApp.UI
where DO i place this code


//this is an example not a real code... writing it on the fly
void LOLapp::createAButton() {
QPushButton *newButton ...... etc etc
}


now where do i place this code? LOLApp.cpp, LOLApp.h, main.cpp?
if u need more info tell me...

wysota
16th August 2011, 23:13
Eeeem.... you put the code in a place where you want to create the object. You should be the one to decide where that should be. However another question is why do you want to create objects in code if you are using UI files.