-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Make sure the text is not croped #2850
base: master
Are you sure you want to change the base?
Conversation
I agree that this is an issue, but I'm not sure this is the fix we want... I generally try and avoid hard-coding pixels to oversize fields and instead try and set the margins correctly. As we can see, the height/width is set based on the https://github.com/pyqtgraph/pyqtgraph/blob/master/pyqtgraph/widgets/VerticalLabel.py#L52 ...but looking at the Qt documentation, I'm really confused, |
I agree with your comment but somehow something seems to be wrong on the qt side. I think the sizehint is often wrong as many times the labels within a widget are not properly visible. As for the QPainter::drawTest thing, it is because of pyqt mechanism: You see that the overloaded method:
take as third argument a pointer to a QRectF. In the usual pyqt5/6 wrapper this translates into a returned value being this QRectF. This is why the hint has been set as the returned value. Did you see another possible fix? |
running this minimal example reproduce the result:
while this is working fine:
|
Allright I found out the bug, |
well it seems however that the styling in the DockLabel is messing up things also, there is a border width (bottom) in there that is hard coded to 2pxl and this is also explaining why the bottom of the writing are wrong. Using the darkstyling adds an even bigger border (by default) so things get worse... |
@j9ac9k could you have a look at what I dug out? |
@@ -60,14 +60,17 @@ | |||
self.setMinimumHeight(self.hint.width()) | |||
else: | |||
self.setMinimumHeight(0) | |||
size = QtCore.QSize(self.hint.height(), size.height()) |
Check notice
Code scanning / CodeQL
Unused local variable Note
self.setMinimumHeight(0) | ||
self.setMaximumWidth(16777215) | ||
if self.forceWidth: | ||
self.setMinimumWidth(self.hint.width()) | ||
else: | ||
self.setMinimumWidth(0) | ||
size = QtCore.QSize(size.width(), self.hint.height()+5) |
Check notice
Code scanning / CodeQL
Unused local variable Note
Detail the reasoning behind the code change. If there is an associated issue that this PR will resolve add
Fixes #2849
I just added a fixed number (6) to the MaximumWidth or Height of the VerticalLabel with respect to the label size hint.
Other Tasks
Bump Dependency Versions
Files that need updates
Confirm the following files have been either updated or there has been a determination that no update is needed.
README.md
setup.py
tox.ini
.github/workflows/main.yml
and associatedrequirements.txt
and condaenvironemt.yml
filespyproject.toml
binder/requirements.txt
Pre-Release Checklist
Pre Release Checklist
__init__.py
CHANGELOG
primarily using contents from automated changelog generation in GitHub release pagePost-Release Checklist
Steps To Complete
.dev0
to__version__
in__init__.py