Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About the resize of the image window #1610

Open
HankWong-guangdong opened this issue Apr 8, 2021 · 3 comments
Open

About the resize of the image window #1610

HankWong-guangdong opened this issue Apr 8, 2021 · 3 comments

Comments

@HankWong-guangdong
Copy link

RenderPanel* render_panel_;

image

In the image window, the drag on the lower left corner and the lower right corner to resize the window is more difficult than the drag on the upper left corner and upper right corner。I find that the class RenderPanel override the mouseMoveEvent 、mousePressEvent and mouseReleaseEvent。But only the render panel in the central of the main window responds to mouseEvent, the render area of the Image window dose not respond to mouseEvent. For the image window, why not write a new class to inherit the class RenderPanel and override the mouseMoveEvent 、mousePressEvent and mouseReleaseEvent. In all the three functions, use the corresponding functions QWidget::mouseMoveEvent 、QWidget::mousePressEvent 、and QWidget::mouseReleaseEvent in QWidget to process the mouseEvent. That will resolve the dragging issues.

@rhaschke
Copy link
Contributor

rhaschke commented Apr 8, 2021

I agree that the RenderPanel used for the ImageDisplay doesn't need its specific mouse handling in onRenderWindowMouseEvents(). However, I'm not convinced yet that resorting to the default QWidget behavior will resolve the described issue. I think, the root cause are very thin window borders.
Nevertheless, you are very welcome to file a PR implementing a satisfactory solution.

@HankWong-guangdong
Copy link
Author

I agree that the RenderPanel used for the ImageDisplay doesn't need its specific mouse handling in onRenderWindowMouseEvents(). However, I'm not convinced yet that resorting to the default QWidget behavior will resolve the described issue. I think, the root cause are very thin window borders.
Nevertheless, you are very welcome to file a PR implementing a satisfactory solution.

I have tried to create a new class inheriting the class RenderPanel for the image window. In the new class, I override the mouseMoveEvent 、mousePressEvent and mouseReleaseEvent. In all the three functions, I use the corresponding functions QWidget::mouseMoveEvent 、QWidget::mousePressEvent 、and QWidget::mouseReleaseEvent in QWidget to process the mouseEvent. Then, the drag on the lower left corner and the lower right corner to resize the window becomes as convenient as the drag on the upper left corner and upper right corner。You can have a try。

@rhaschke
Copy link
Contributor

rhaschke commented Apr 8, 2021

Good. If you already implemented this, please file a corresponding PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants