First, you always need int main( int argc, char *argv[] ) because you need to pass argc and argv to QApplication. Next (seeing a Linux programmer), there are no __argc and __argv in Linux so that you need to catch argc and argv yourself when they pass by. Therefore:
(1) Derive a class MyApplication from QApplication. Give MyApplication data items argc and argv.
(2) In the MyApplication ctor, copy argc and argv to your data items. Now:
int main( int argc, char *argv[] )
{
MyApplication app(argc, argv);
// etc...
}
int main( int argc, char *argv[] )
{
MyApplication app(argc, argv);
// etc...
}
To copy to clipboard, switch view to plain text mode
Bookmarks