Fix #8587, show/hide labels tool throws Qt warning