Remove or change colour of window border?

Asked by Luke Thorburn on 2019-08-03

I have modified the background colour of my installation to be a very dark blue, but there is still a border around the window (and the background of the tabs) that is white or light gray, which I find quite distracting. An example screenshot is at the following link:

Is there a way to remove the border (excl. the tabs), or to change it to be the same colour as the user-specified background colour, or even just have a 'dark mode' so that it is black and blends into the background?

Thanks, Luke

Question information

English Edit question
qpdfview Edit question
No assignee Edit question
Last query:
Last reply:
Adam Reichold (adamreichold) said : #1

Hello Luke,

I think the only way to modify qpdfview's presentation short of changing code is using Qt style sheets [1], e.g. by changing the hidden "styleSheet" setting in section "mainWindow" as described in the man page.

Best regards,


Luke Thorburn (lukethorburn) said : #2

Okay, thank you!

Luke Thorburn (lukethorburn) said : #3

Hi Adam,

Could you please briefly explain (or point me to a resource that does explain) how to make use of the style sheets? I know CSS inside-out so have that intuition, but am having trouble getting the Qt stylesheet hooked up, and I can't find answers in the Qt documentation. Specifically, 3 sticking points:

1. What file extension does a Qt stylesheet take? I tried '.qt' but it seems that's for QuickTime videos.

2. What syntax do I use to link to the stylesheet in qpdfview.conf? I've tried just adding a row with 'styleSheet="style.qt"' (and with a .txt extension) but neither seem to work.

3. How can I work out which visual components of the pdfview GUI correspond to which Qt modules?

Thanks in advance, and apologies for the probably very-basic questions.


Adam Reichold (adamreichold) said : #4

Hello Luke,

ad 1.: The idea is to put the style sheet itself into the configuration file as a string, not as a file path that is loaded by the application. (QSettings which reads that configuration file does support multiline string literals.)

ad 2.: You find the section called "[mainWindow]" in qpdfview.conf and add a key with an inline style sheet "styleSheet = "QMainWindow {...}" directly there.

ad 3.: I guess from the source code is actually the easiest option. But if you want to inspect the UI elements at the runtime, I only know KDAB's GammaRay tool:

Best regards,

Adam Reichold (adamreichold) said : #5

> Thanks in advance, and apologies for the probably very-basic questions.

Please feel free to ask whatever you want to know. The worst thing that can happen is that I don't find the time to answer...

Can you help with this problem?

Provide an answer of your own, or ask Luke Thorburn for more information if necessary.

To post a message you must log in.