qwt_arrow_button.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
  2. * Qwt Widget Library
  3. * Copyright (C) 1997 Josef Wilgen
  4. * Copyright (C) 2002 Uwe Rathmann
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the Qwt License, Version 1.0
  8. *****************************************************************************/
  9. #ifndef QWT_ARROW_BUTTON_H
  10. #define QWT_ARROW_BUTTON_H
  11. #include "qwt_global.h"
  12. #include <qpushbutton.h>
  13. /*!
  14. \brief Arrow Button
  15. A push button with one or more filled triangles on its front.
  16. An Arrow button can have 1 to 3 arrows in a row, pointing
  17. up, down, left or right.
  18. */
  19. class QWT_EXPORT QwtArrowButton : public QPushButton
  20. {
  21. public:
  22. explicit QwtArrowButton ( int num, Qt::ArrowType, QWidget *parent = NULL );
  23. virtual ~QwtArrowButton();
  24. Qt::ArrowType arrowType() const;
  25. int num() const;
  26. virtual QSize sizeHint() const;
  27. virtual QSize minimumSizeHint() const;
  28. protected:
  29. virtual void paintEvent( QPaintEvent *event );
  30. virtual void drawButtonLabel( QPainter * );
  31. virtual void drawArrow( QPainter *,
  32. const QRect &, Qt::ArrowType ) const;
  33. virtual QRect labelRect() const;
  34. virtual QSize arrowSize( Qt::ArrowType,
  35. const QSize &boundingSize ) const;
  36. virtual void keyPressEvent( QKeyEvent * );
  37. private:
  38. class PrivateData;
  39. PrivateData *d_data;
  40. };
  41. #endif