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. QT ScrollArea - Modifying clickable area
Forum Updated to NodeBB v4.3 + New Features

QT ScrollArea - Modifying clickable area

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 464 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.
  • R Offline
    R Offline
    Raureru
    wrote on last edited by
    #1

    I need some help / advice with scrollable areas in QT designer 5.

    For some background I did not know python, nor have access to any backend code for the widgets. I only have access to the UI file that Designer generates and of course the style sheets for the code.

    I'm using QT Scrollarea which contains a QT grid Layout. The scrollbar works, everything is good so far. However I need to modify this so that everything thing that is in the scrollable area can be clicked on to scroll its contents, and not just the scroll bar. (kind of like swiping on your mobile, how you can scroll by clicking and pressing anywheres on your screen) I'm not sure of the right terms, sorry. Coding is not my expertise, but I've been trying to find a way to make this work.

    I tried increasing the width of the vertical scrollbar with the plan to set the scrollbar opacity to 0 and overlay it above the grid contents, however I cannot get the scrollbar to overlay on top of the grid layout, it keeps adding the horizontal scrollbar and scaling the contents based on the width of the vertical bar. (even if i try disabling the horizontal scrollbar)
    I've been trying different css strings to change the positioning but it doesn't do anything.

    I tried setting up a signal/slot in QT designer with a vertical scroll bar and linking it to a 2nd scrollbar so that when one is pressed the other follows. One would be visible the other hidden essentally for this plan. It worked with the individual qt vertical scrollbars but not with the scrollarea. The scrollarea does not have the same inputs in the signal/slot. (sliderMovedInt.)

    I tried removing the scrollarea and linking a widget or frame (tried both) into a vertical scrollbar and then add the grid layout, but it never works. The scrollbar does not appear to control the contents.

    Im running out of ideas.
    If anyone has any suggestions, it would be very much appreciated. Maybe I'm making this more complicated than it needs to be, lol

    Pl45m4P 1 Reply Last reply
    0
    • R Raureru

      I need some help / advice with scrollable areas in QT designer 5.

      For some background I did not know python, nor have access to any backend code for the widgets. I only have access to the UI file that Designer generates and of course the style sheets for the code.

      I'm using QT Scrollarea which contains a QT grid Layout. The scrollbar works, everything is good so far. However I need to modify this so that everything thing that is in the scrollable area can be clicked on to scroll its contents, and not just the scroll bar. (kind of like swiping on your mobile, how you can scroll by clicking and pressing anywheres on your screen) I'm not sure of the right terms, sorry. Coding is not my expertise, but I've been trying to find a way to make this work.

      I tried increasing the width of the vertical scrollbar with the plan to set the scrollbar opacity to 0 and overlay it above the grid contents, however I cannot get the scrollbar to overlay on top of the grid layout, it keeps adding the horizontal scrollbar and scaling the contents based on the width of the vertical bar. (even if i try disabling the horizontal scrollbar)
      I've been trying different css strings to change the positioning but it doesn't do anything.

      I tried setting up a signal/slot in QT designer with a vertical scroll bar and linking it to a 2nd scrollbar so that when one is pressed the other follows. One would be visible the other hidden essentally for this plan. It worked with the individual qt vertical scrollbars but not with the scrollarea. The scrollarea does not have the same inputs in the signal/slot. (sliderMovedInt.)

      I tried removing the scrollarea and linking a widget or frame (tried both) into a vertical scrollbar and then add the grid layout, but it never works. The scrollbar does not appear to control the contents.

      Im running out of ideas.
      If anyone has any suggestions, it would be very much appreciated. Maybe I'm making this more complicated than it needs to be, lol

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @Raureru

      With your QtDesigner only, it's impossible. You need to make some changes in your code.
      QtDesigner and the "default" signals & slots, that can be used directly in design mode, are very limited. Some things just can't be done.

      That seems to be it:

      • https://forum.qt.io/topic/67636/scrolling-a-widget-by-hand-mouse

      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      1
      • R Offline
        R Offline
        Raureru
        wrote on last edited by
        #3

        @Pl45m4

        Ah, ok, I thought it would be doable, and I was just missing something. Thank you though for letting me know.

        1 Reply Last reply
        0

        • Login

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