Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@shenlebantongying
Copy link
Contributor

@shenlebantongying shenlebantongying commented Jan 7, 2024

I was trying to fix highgui's statusbar got cropped.

image

However, none of my fixes by adjusting heights take any effect, and it reveals a deeper and actual problem.

The QBoxLayout myGlobalLayout -> addWidget's 2nd parameter is stretch rather than alignment, so the old code does nothing, and the layout does not work.

https://doc.qt.io/qt-6/qboxlayout.html#addWidget

myStatusBar->setFixedHeight(20); is a ad-hoc fix becuase when adding the statusbar, the author did not realize that the layout was not working.;

Since the layout is fixed, setting a fixed height is no longer needed (both statusbar & qlabel's default height is reasonably small, roughly text height).

After:

image

The statusbar text looks perfect now.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

Copy link
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Tested manually with Ubuntu 18.04.

@asmorkalov asmorkalov self-assigned this Jan 9, 2024
@asmorkalov asmorkalov merged commit 5c130b1 into opencv:4.x Jan 9, 2024
This was referenced Jan 19, 2024
@asmorkalov asmorkalov mentioned this pull request May 5, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants