I wouldnt go my self for a global variable , just use signals and slots.
but why are you avoiding signal and slots ? and insisting instead on a global variable ?
Listen to wysota , i always do and get the job done correctly.
good luck.