Scroll gesture difficulties.



  • Hello! I have an issue with scrolling implementation. I`ve made this for Android device.

    1. Scrolling a bit sticking, and it doesn't work softly. 2. I`ve notice a big memory consumption. Help.
    QScrollArea* sa = new QScrollArea;                                       // Scroll pattern takes begin here
        sa->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
        sa->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
        QPixmap img2(":/description.jpg");
        auto wgt = new QWidget;
        QPalette pal;
        pal.setBrush(wgt->backgroundRole(), QBrush(img2));
        wgt->setPalette(pal);
     
        wgt->setAutoFillBackground(true);
        wgt->setFixedSize(img2.width(), img2.height());
        QScroller::grabGesture(sa->viewport(), QScroller::LeftMouseButtonGesture);
        sa->setWidgetResizable(true);
        sa->verticalScrollBar()->setSingleStep(1);
        sa->setWidget(wgt);
     
     
     
        //sa->setStyleSheet("QScrollArea {image: url(:/empty.png);}");
     
     
     
        tab->addTab(sa, QPixmap(":/Акаунт.png"), NULL);     // Передаем скролл на вторую вкладку
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.