NavigationInterface.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef NAVIGATIONINTERFACE_H
  2. #define NAVIGATIONINTERFACE_H
  3. #include "NavigationPanel.h"
  4. #include <QWidget>
  5. class NavigationInterface : public QWidget
  6. {
  7. Q_OBJECT
  8. public:
  9. explicit NavigationInterface(bool showMenuButton = true, bool showReturnButton = true, QWidget *parent = nullptr);
  10. void addItem(const QString &routeKey, FluentIconBase *icon, const QString &text, const QObject *receiver,
  11. const char *onClick, bool selectable = true,
  12. NavigationItemPosition position = NavigationItemPosition::TOP);
  13. void addWidget(const QString &routeKey, NavigationWidget *widget, const QObject *receiver, const char *onClick,
  14. NavigationItemPosition position = NavigationItemPosition::TOP);
  15. void addSeparator(NavigationItemPosition position = NavigationItemPosition::TOP);
  16. void removeWidget(const QString &routeKey);
  17. void setCurrentItem(const QString &name);
  18. void setDefaultRouteKey(const QString &routeKey);
  19. void setExpandWidth(int width);
  20. virtual bool eventFilter(QObject *watched, QEvent *event) override;
  21. virtual void resizeEvent(QResizeEvent *event) override;
  22. NavigationPanel *panel;
  23. signals:
  24. void displayModeChanged(NavigationDisplayMode);
  25. };
  26. #endif // NAVIGATIONINTERFACE_H