Using okular in a Python application: hiding the sidebar

I am developing a program ( TeXamator ) in Python for working with exercise databases in LaTeX. Following this answer , I was able to successfully implement okular in my Qt application.

The problem is that I cannot find access to the sidebar and hide it. If I open okular, press F7 to hide / show the sidebar and then return to my application, after which the sidebar will be hidden / shown depending on its status when okular is closed.

I tried to look at the "okularpart" code, but I can not find anything useful.

Can someone point me in the right direction?

Thanks in advance.

Editing: after going through the source code, I understand that I have to set the visibility of "m_toolbar" to False, but I don’t know in which namespace (and even if it is available). I tried to hide every child of okupart.widget () (one by one), it hid a few things, but not the sidebar.

+7
okular pythonqt
source share
1 answer

I would expect to find it in the configuration list (since it is accessible via Settings-> Navigation panel), so it will not be widgets. An alternative solution would also be to make it as small as possible.

Try using something like

okupart.sidebar().setSidebarVisibility(false) 

Check the Sidebar :: setSidebarVisibility and this corresponding call.

0
source share

All Articles