Thread: rookie tutorial
View Single Post
Posts: 52 | Thanked: 8 times | Joined on Apr 2010
#12
Originally Posted by Qrchack View Post
ok, looking into exaples helps...

But why they made it so difficult. Why one need to access ui to access items? Eh...
You are thinking too much in terms of Visual Studio. Microsoft have made it extremely easy for you add events to buttons. In the world of QT, it is different. Instead of EVENTS you have SIGNALS. Instead of HANDLERS you have SLOTS.

In Visual Studio, you have your window which also acts as your main class, where you do all of the coding, that's why you can access the controls directly through the code without a preceding class name. If you were to have your main form class separate from your main code class, you would have to access it exactly like you would in QT. In QT, 'ui' is in its own separate class, which is why you need to specify it when accessing the widgets (Visual Studio equivalent of 'widgets' is 'controls').