[Interest] padding around a QTextEdit/QTextBrowser viewport

André Somers andre at familiesomers.nl
Thu Jul 18 09:20:00 CEST 2013


Op 18-7-2013 9:10, Hamish Moffatt schreef:
> Hi,
>
> I have a QTextBrowser I'm using to display some documents. I want to add
> some padding around the edges, which means between the text (viewport)
> and the scroll bar on the right/bottom edges, and I'm not having much luck.
>
> I tried adding padding to the QTextBrowser widget via the Qt stylesheet,
> which works but the padding is to the right of the vertical scroll bar
> on the right hand edge. I want the scroll bar to stay on the far edge.
>
> I tried to add padding to the left of the scroll bar instead, which
> works but then if there is no scroll bar (I'm using scroll bars only
> when needed), there's no padding and text can go very close to the edge.
>
> I tried adding padding to the document itself via its CSS, but that
> applies to the whole document and not just the viewport, so text can
> still get right up to the scroll bar.
>
> Any ideas?
You could try if adding the padding to the QTextBrowsers' viewport 
widget helps.
If not, I'd probably modify the style sheet when the vertical scroll bar 
is shown or hidden.

André

-- 
You like Qt?
I am looking for collegues to join me at i-Optics!




More information about the Interest mailing list