Solved Independent scroll areas for separate vertical horizontal scrolling
-
Hi,
I would like to create a user interface with a time scale (hours of the day from 00:00 to 23:59) and a variable number of columns on the right side for certain type information.
Here is the layout:
I separated into 2 scrollAreas (one parent with vertical scrolling for all the times and another one for horizontal scrolling for the columns).
The reason for this layout is to make time scale always visible even though one scrolls to right. Otherwise, timeScale disappears.
Like this:
Now my problem is that the horizontal scroll bar disappears when I scroll up:
I was wondering if there is there any way to solve this problem?
Edit: Here are some ideas I had but couldn't implement yet:
-
Can I take the horizontal scroll bar outside of scroll area?
-
Can I create a new separate scroll bar outside of scroll area and assign it to the scroll area?
-
-
Hi,
You might want to check the frozen column example to get some ideas.
One quick idea that comes to mind is to put the time scale in its own scroll area and sync it with the "main" one. Keep the scroll bars invisible for the time scale. And use only on area for the your "main" part.
-
Hi,
You might want to check the frozen column example to get some ideas.
One quick idea that comes to mind is to put the time scale in its own scroll area and sync it with the "main" one. Keep the scroll bars invisible for the time scale. And use only on area for the your "main" part.
-
@SGaist
I looked at the code and there was a connect() function, which got my attention. So I looked into it and found PyQt (I didn't mention this before) equivalent. So basically by adding an external scrollbar and connecting to the hidden scrollbar of the scrollArea did the trick. Thanks a lot!
self.horizontalScrollBar.valueChanged.connect(self.scrollArea.horizontalScrollBar().setValue)