Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Independent scroll areas for separate vertical horizontal scrolling
Forum Updated to NodeBB v4.3 + New Features

Independent scroll areas for separate vertical horizontal scrolling

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 509 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SarenT
    wrote on last edited by SarenT
    #1

    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.

    4c449b14-314d-49bc-887d-97b288c898f4-image.png

    Here is the layout:
    9e10a812-8be7-4ac3-b8c3-46d109e2f5bb-image.png

    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:
    1a363a5a-50f3-400b-a1e1-3feb062ea362-image.png

    Now my problem is that the horizontal scroll bar disappears when I scroll up:
    6795a5b5-5de5-440c-b846-f727e705fe92-image.png

    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?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • S Offline
        S Offline
        SarenT
        wrote on last edited by
        #3

        @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)
        7bb04598-61ab-4b5b-8f6c-e455c9a3b378-image.png

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved