Tuesday, 26 May 2015

Today I learned about signals and slots and how you can connect things, here is an example of some simple code that I wrote today that lets you interact with the program instead of just printing text onto your screen and you not being able to interact. Here is the code QObject::connect(button, SIGNAL(clicked()), &app,SLOT()); it may seem complex but the ::connect is connecting SIGNAL(clicked()) with SLOT(quit())); so when ever you click it will quit the program here is an example. Its just a small gif of my clicking quit the program and it actually responding

No comments:

Post a Comment