After messing with this for most of today, I'm realizing I don't really understand how Qt applications work at all.

FrontEnd::SysInitialize() inits some I/O devices that are connected to serial ports. There should be a finite delay of four seconds for the whole thing to run. Here's the contents of the function.

Qt Code:
  1. coupleAxial = new Axis("Translation");
  2. coupleAxial->StartSensor();
  3. coupleAxial->StartMover();
To copy to clipboard, switch view to plain text mode 

The problem is the GUI seems to block for a random amount of time. It'll recover, but takes a very long time. So I call processEvents() after each line of code, and it works. But I'm pretty sure this is the wrong way of going about it?

I have some generic questions

* What does the final app.exec(); call do in main.cpp? Main.cpp sets up the window, shows it, and then calls exec on the application. I'm guessing this throws it in some infinite loop that waits for events?

* What's the correct way to use processEvents()? Why should I have to use it at all? In the example with the three above function calls in the SysInitialize() function, I know that it takes a finite amount of time to execute, based on the command line version of my program. I don't care if my GUI blocks for roughly this amount of time, but this isn't what happens--the three lines aren't executed one after another

* What's the correct way to program new commands and functions? I'm assuming based on tutorials on the Qt site that main.cpp stays pretty much the same as when Qt Creator generates it. Then you populate your main class with member functions, slots, etc (in my case, FrontEnd). You call these member functions based on events (timers, button presses)...is that right?