You forgot to #include <QApplication>
Correct.Thanks now i came to know what actually happens when this function gets called. It checks for any pending event during the execution in do_something(); so that if user clicks any button or does something it will also be executed as:-
Qt Code:
Void Square::do_something() { for(i=o;i<100000000;i++) { qapp->processEvents(); ... ....} }To copy to clipboard, switch view to plain text mode
As you already noticed processEvents is a static method, so you can use it anywhere you want, just include the class' headers.But sir how can i use qapp created in main.cpp in the outer .cpp class? Those are separate files. I have only included its header in sample.cpp where all slots are implemented. qapp is not even detected in Sample.cpp, giving same error. Or do i have to include any file in Square.cpp?
Bookmarks