Create a header with global definitions.

Example: my_globals.h
Qt Code:
  1. #ifndef MYGLOBALS
  2. #define MYGLOBALS
  3.  
  4. int variable1;
  5.  
  6. #endif
To copy to clipboard, switch view to plain text mode 

Include the header everywhere you want.