qt gui: Handle history forward/backward