InteractiveButton.h 732 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef INTERACTIVEBUTTON
  2. #define INTERACTIVEBUTTON
  3. #include <QPushButton>
  4. class InteractiveButton : public QPushButton
  5. {
  6. Q_OBJECT
  7. public:
  8. InteractiveButton(QWidget* parent = 0);
  9. protected:
  10. virtual void enterEvent(QEvent* event);
  11. virtual void leaveEvent(QEvent* event);
  12. signals:
  13. void mouseOver(bool state);
  14. // this one is specific for the VDPRegViewer and depends on the
  15. // name of the button also
  16. void newBitValue(int reg, int bit, bool state);
  17. public slots:
  18. void highlight(bool state);
  19. void mustBeSet(bool state);
  20. private slots:
  21. // this one is specific for the VDPRegViewer
  22. void newBitValueSlot(bool);
  23. private:
  24. void setColor();
  25. bool _mustBeSet;
  26. bool _highlight;
  27. bool _state;
  28. };
  29. #endif // INTERACTIVEBUTTON