Replies: 1 comment
-
In Java, you check an object's classtype with
QMouseEvent is only used for certain event types (
I suggest to use
I also wonder if your code isn't actually better placed in the object's |
Beta Was this translation helpful? Give feedback.
0 replies
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
Hi, long time no see. Recently I've been trying to dynamically load.ui files using QtJambi's traditional Widget style. This is all very well. I want to set the borderless movement of this form. So I rewrote the eventFilter method. Because no border requires mouse event related operations. The result is the following code.
This code implements borderless movement, but I think the way it does it is a little unsatisfying. When forced to convert an event to a QMouseEvent. If the event is not related to the QMouseEvent. Casting throws an exception. To do this I used a try catch surround to solve this problem. In C++ I can use static_cast to convert the event type. But in Java it seems like you can only cast, and that's the problem. Is there a more elegant way?
Beta Was this translation helpful? Give feedback.
All reactions