Declare global variables in any .h file in the Qt project
例:extern int a;
Defined in the first .cpp interface
main.cpp
int a;
intmain(intargc,char*argv[])
{
}
Callable from any function in any .cpp file
Changeable global variable value
Just assign it directly
a=1;