selectionitem.cpp 758 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #include "selectionitem.h"
  2. SelectionItem::SelectionItem(QObject* parent)
  3. : QObject(parent)
  4. {
  5. m_selected = false;
  6. }
  7. void SelectionItem::setItemRect(QRect& itemRect)
  8. {
  9. m_itemRect = itemRect;
  10. }
  11. QRect& SelectionItem::itemRect()
  12. {
  13. return m_itemRect;
  14. }
  15. QString SelectionItem::caption() const
  16. {
  17. return m_caption;
  18. }
  19. void SelectionItem::setCaption(const QString& caption)
  20. {
  21. m_caption = caption;
  22. }
  23. QPixmap SelectionItem::icon() const
  24. {
  25. return m_icon;
  26. }
  27. void SelectionItem::setIcon(const QPixmap& icon)
  28. {
  29. m_icon = icon.scaled(16, 16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
  30. }
  31. bool SelectionItem::selected() const
  32. {
  33. return m_selected;
  34. }
  35. void SelectionItem::setSelected(bool selected)
  36. {
  37. m_selected = selected;
  38. }