71 lines
1.4 KiB
C++
71 lines
1.4 KiB
C++
#ifndef QNAVIGATIONWIDGET_H
|
|
#define QNAVIGATIONWIDGET_H
|
|
|
|
#include <QWidget>
|
|
#include <QMouseEvent>
|
|
|
|
#pragma execution_character_set("utf-8")
|
|
|
|
#ifdef QNavigation
|
|
#include <qnavigantionglobal.h>
|
|
class QNAVGATIONSHARED_EXPORT QNavigationWidget : public QWidget {
|
|
#else
|
|
class QNavigationWidget : public QWidget
|
|
{
|
|
#endif
|
|
Q_OBJECT
|
|
|
|
public:
|
|
QNavigationWidget(QWidget *parent=nullptr);
|
|
~QNavigationWidget();
|
|
|
|
void addItem(const QString &title, QIcon &icon);
|
|
void setWidth(const int &width);
|
|
void setBackgroundColor(const QString &color);
|
|
void setSelectColor(const QString &color);
|
|
void setRowHeight(const int &height);
|
|
|
|
|
|
void setCurrentIndex(const int &index);
|
|
|
|
int Index(void);
|
|
|
|
signals:
|
|
void ItemChanged(const int &index);
|
|
|
|
void SizeChanged(QResizeEvent *);
|
|
|
|
protected:
|
|
void paintEvent(QPaintEvent *);
|
|
void mouseMoveEvent(QMouseEvent *);
|
|
void mousePressEvent(QMouseEvent *);
|
|
void mouseReleaseEvent(QMouseEvent *);
|
|
|
|
void enterEvent(QEvent *);
|
|
void leaveEvent(QEvent *);
|
|
void resizeEvent(QResizeEvent *);
|
|
|
|
|
|
private:
|
|
QList<QString> listItems;
|
|
QString backgroundColor;
|
|
QString selectedColor;
|
|
QString MouseColor;
|
|
|
|
QString controlBarColor;
|
|
QString controlSlideColor;
|
|
|
|
int controlBarWidth = 10;
|
|
|
|
int rowHeight;
|
|
int currentIndex;
|
|
int MouseIndex;
|
|
|
|
bool isHidden = false;
|
|
|
|
|
|
|
|
};
|
|
|
|
#endif
|