Declare them outside of main() or put them in a header file
but it is best not to use them where they can be avoided.
#include <QtGui/QApplication>
#include "mainwindow.h"
#include "myglobals.h"
// globals here
int aInteger;
int main(int argc, char *argv[])
{
MainWindow w;
w.show();
return a.exec();
}
#include <QtGui/QApplication>
#include "mainwindow.h"
#include "myglobals.h"
// globals here
int aInteger;
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks