开发者

How to make Qt widgets do not react on mouse click

开发者 https://www.devze.com 2023-01-09 10:20 出处:网络
I need on my form ordinary widgets (e.g. buttons开发者_开发知识库) do not react on mouse clicks but NOT to be disabled (it change look to grayed one -- not good).

I need on my form ordinary widgets (e.g. buttons开发者_开发知识库) do not react on mouse clicks but NOT to be disabled (it change look to grayed one -- not good).

I wonder is there some neat small hack for this?


You could stick in an event filter and filter out the mouse events before passing the remaining events on for processing, but I'm not sure that not giving the user a visual clue that certain elements are effectively disabled is such a good idea.


You could try using style sheets to control how the disabled mode of the buttons in your form get styled. Unfortunately I'm not sure exactly how to do that but you could have a look at the style sheet docs to get you started.

0

精彩评论

暂无评论...
验证码 换一张
取 消