pToolButton.sip 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*!
  2. \file pToolButton.h
  3. \date 2008-01-14T00:27:54
  4. \author Filipe AZEVEDO aka Nox P\@sNox <pasnox@gmail.com>
  5. \brief A corner button used by the pTabbedWorkspaceCorner class
  6. */
  7. class pToolButton : QToolButton
  8. {
  9. %TypeHeaderCode
  10. #include <gui/pToolButton.h>
  11. %End
  12. public:
  13. pToolButton( QWidget* parent, QBoxLayout::Direction direction = QBoxLayout::LeftToRight );
  14. virtual QSize minimumSizeHint() const;
  15. virtual QSize sizeHint() const;
  16. QBoxLayout::Direction direction() const;
  17. QVariant userData() const;
  18. public slots:
  19. void setDirection( QBoxLayout::Direction direction );
  20. void setUserData( const QVariant& data );
  21. protected:
  22. enum CursorArea {
  23. caNone = 0,
  24. caArrow,
  25. caButton,
  26. caArrowClicked,
  27. caButtonClicked
  28. };
  29. virtual void paintEvent( QPaintEvent* event );
  30. virtual void mousePressEvent( QMouseEvent* event );
  31. virtual void mouseMoveEvent( QMouseEvent* event );
  32. virtual void mouseReleaseEvent( QMouseEvent* event );
  33. void paint( QStyleOptionToolButton* option );
  34. QSize internalSize( Qt::Orientation orientation ) const;
  35. pToolButton::CursorArea cursorArea( const QPoint& pos = QPoint() ) const;
  36. QMenu* hasMenu() const;
  37. bool menuButtonDown() const;
  38. };