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. how to use QScroller::grabGesture in multiple scrollareas
Forum Updated to NodeBB v4.3 + New Features

how to use QScroller::grabGesture in multiple scrollareas

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 196 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.
  • Ramkumar MohanR Offline
    Ramkumar MohanR Offline
    Ramkumar Mohan
    wrote on last edited by
    #1

    Re: how to use QScroller::grabGesture(ui->scrollArea in one or more scrollarea ?)

    If four buttons are clicked separately, all four scrollareas should scroll individually, and each scrollarea should scroll for each button.

    how to set the function,

    void MainWindow::SetupScroller(QScrollArea *area)
    {
    
       QScroller::grabGesture(area->viewport(), QScroller::LeftMouseButtonGesture);
       QVariant OvershootPolicy = QVariant::fromValue<QScrollerProperties::OvershootPolicy> (QScrollerProperties::OvershootAlwaysOff);
        QScrollerProperties ScrollerProperties = QScroller::scroller(area->viewport())->scrollerProperties();
        ScrollerProperties.setScrollMetric(QScrollerProperties::VerticalOvershootPolicy, OvershootPolicy);
       ScrollerProperties.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, OvershootPolicy);
       QScroller::scroller(area->viewport())->setScrollerProperties(ScrollerProperties);
    }
    
     ....
      SetupScroller(ui->scrollArea3);
       SetupScroller(ui->scrollArea_2)
    

    i have use the function but the function doesn't work properly , this function scrolling one scroll area only , others are doesnot work

    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