Fix issue when used from qt designer