[qt] fix crash when CSS widows are specified

This fixes #1507 which was caused due to a later revision not
being backported into the original commit.