MCPcopy Create free account
hub / github.com/Linloir/GraphBuilder / ScrollAreaCustom

Method ScrollAreaCustom

customScrollContainer.cpp:3–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "customScrollContainer.h"
2
3ScrollAreaCustom::ScrollAreaCustom(QWidget *parent) : QWidget(parent)
4{
5 //initialize list container and timer
6 container = new ScrollListContainer(this);
7 container->move(0, 0);
8 container->resize(this->width(), 3);
9 getCord = new QTimer;
10 getCord->setSingleShot(true);
11 rfrshView = new QTimer;
12 getCord->setSingleShot(true);
13
14 indicator = new ScrollIndicator(this);
15 indicator->resize(indicator->width(), (int)((double)this->height() * this->height() / (double)container->height()));
16 indicator->move(this->width() - indicator->width() - 3, 0);
17
18 this->setMouseTracking(true);
19 container->setMouseTracking(true);
20 indicator->setMouseTracking(true);
21
22 bounce = new QPropertyAnimation(container, "pos");
23
24 QObject::connect(getCord, SIGNAL(timeout()), this, SLOT(updateSpd()));
25 QObject::connect(rfrshView, SIGNAL(timeout()), this, SLOT(scrollContainer()));
26 QObject::connect(indicator, SIGNAL(scrollPage(int)), this, SLOT(scrollIndicator(int)));
27}
28
29void ScrollAreaCustom::paintEvent(QPaintEvent *event){
30 container->resize(this->width(), container->height());

Callers

nothing calls this directly

Calls 1

moveMethod · 0.80

Tested by

no test coverage detected