QDarkStyleSheet icon indicating copy to clipboard operation
QDarkStyleSheet copied to clipboard

QGroupBox: text overlaping by another widget

Open Jihadist opened this issue 2 years ago • 3 comments

  • QDarkStyle: 26c3878fff742c535058bf5d08643d0135cde2af QDarkStyleSheet (v3.0.2)
  • Python: Python 3.8.10 Linux
  • QT_API: 5.15.2

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 avatar Oct 28 '21 11:10 Jihadist

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.

Jihadist avatar Oct 28 '21 12:10 Jihadist

@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

dpizetta avatar Nov 29 '21 13:11 dpizetta

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.

Jihadist avatar Nov 29 '21 13:11 Jihadist