-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathqnavigationwidget.h
More file actions
38 lines (30 loc) · 832 Bytes
/
Copy pathqnavigationwidget.h
File metadata and controls
38 lines (30 loc) · 832 Bytes
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
#ifndef QNAVIGATIONWIDGET_H
#define QNAVIGATIONWIDGET_H
#include <QWidget>
#include <QMouseEvent>
class QNavigationWidget : public QWidget
{
Q_OBJECT
public:
QNavigationWidget(QWidget *parent=0);
~QNavigationWidget();
void addItem(const QString &title);
void setWidth(const int &width);
void setBackgroundColor(const QString &color);
void setSelectColor(const QString &color);
void setRowHeight(const int &height);
protected:
void paintEvent(QPaintEvent *);
void mouseMoveEvent(QMouseEvent *);
void mousePressEvent(QMouseEvent *);
void mouseReleaseEvent(QMouseEvent *);
private:
QList<QString> listItems;
QString backgroundColor;
QString selectedColor;
int rowHeight;
int currentIndex;
signals:
void currentItemChanged(const int &index);
};
#endif