Can you post a small compilable example experiencing such a behaviour? Are you porting from Qt3? In the snippet you posted everything seems to be fine, the problem has to be elsewhere...