mouserelease and move events of QWidget is not working

后端 未结 3 1629
傲寒
傲寒 2020-12-12 06:05

Here i develoed a custom widget to print some shape. But here my MouseRelease and MouseMove event are not working.wh t is the problem of my code. As well as some Asserts ar

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-12 06:25

    In QWidget mouse tracking (when no mouse button is pressed) is not enable by default. To enable it add the following code :

    painter->setMouseTracking(true);
    

提交回复
热议问题