ColinDuquesnoy / QDarkStyleSheet

A dark style sheet for QtWidgets application
Other
2.76k stars 726 forks source link

QGroupBox: text overlaping by another widget #295

Open Jihadist opened 2 years ago

Jihadist commented 2 years ago

Language

C++

Description / Steps to Reproduce [if necessary]

  1. Install style sheet

Actual Result

Linux Ubuntu 20.10 image Windows 7 image

Expected Results / Proposed Result

Text is not overlapped by another widget

Jihadist commented 2 years ago

If I change it https://github.com/ColinDuquesnoy/QDarkStyleSheet/blob/master/qdarkstyle/dark/style.qss#L217 to

QGroupBox {
  font-weight: bold;
  border: 1px solid #455364;
  border-radius: 4px;
  padding: 2px;
  margin-top: 14px;
  margin-bottom: 4px;
}

QGroupBox::title {
  subcontrol-origin: margin;
  subcontrol-position: top left;
  left: 4px;
  padding-left: 2px;
  padding-right: 4px;
  padding-top: -8px;
}

it looks better on Linux image but worse on Windows image I dont know how to pass correct top-padding for both platforms.

dpizetta commented 2 years ago

@Jihadist these numbers are a little trick. Something that will help us a lot is: Could you reproduce this in other versions of our qdarkstyle? 2.8.X and 3.0.X, Also with other Qt like 12.3. We have changed this code recently, so we can revert. Tks

Jihadist commented 2 years ago

Look at font. Windows by default uses one font, Linux uses another, so these numbers cannot work ok on both platforms. I tried to explicitly specify font and then played with this numbers. It was ok but we need one font on qss level. I don't have any other ideas.