I am learning how to use QGLviewer and I'm having a little trouble with a fairly simple concept. I want to give my program a file name as a command line argument. All of the sample programs I find have a main.cpp file like this:
int main(int argc, char *argv)
QApplication app(argc, argv);
Then the Window class, which is derived from QGLViewer, does all the program's actual work. If I want access to argc and argv, for example, to open and read a file that's passed as an argument, what would handle that? Is there a built-in way to get the arg variables to the window class, or do I need to just write a loadfile function and pass them? That seems a little clumsy to me, I feel like there's a better way, since this seems like a common task.