-
-
Notifications
You must be signed in to change notification settings - Fork 557
/
Copy pathscrollarea.h
49 lines (37 loc) · 991 Bytes
/
scrollarea.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich
#ifndef SCROLLAREA_H
#define SCROLLAREA_H
#include <QWidget>
#include <QScrollArea>
#include "widget.h"
#include "groupbox.h"
class ScrollArea : public QScrollArea
{
Q_OBJECT
public:
explicit ScrollArea(QWidget *parent = 0);
QSize sizeHint() const;
void setWidget(QWidget *widget);
void updateMinimumWidth();
public slots:
signals:
void sizeHintRequest();
protected:
void resizeEvent(QResizeEvent *re);
void mouseMoveEvent(QMouseEvent *me);
void mousePressEvent(QMouseEvent *me);
void mouseReleaseEvent(QMouseEvent *me);
private slots:
void onContentSizeChanged(QSize newSize);
void onVerticalScrollBarValueChanged(int newValue);
void onScroll(int dx, int dy);
void onPressed();
private:
bool m_update;
QPoint m_pressedPos;
int m_pressedValue;
int m_width;
void updateBorders();
};
#endif // SCROLLAREA_H