Hey guys,
first of all english isn't my first language.
I got some problems to creat my own QGraphicsItem. First of all i will show u what i got already:

postit.h
Qt Code:
  1. #ifndef POSTIT_H
  2. #define POSTIT_H
  3.  
  4. #include <QGraphicsItem>
  5. #include <QPainter>
  6. #include <QRectF>
  7. #include <QTextItem>
  8. #include <QGraphicsTextItem>
  9.  
  10.  
  11. class PostIt : public QGraphicsItem
  12. {
  13. public:
  14. PostIt(QGraphicsItem* parent = NULL);
  15.  
  16. protected:
  17. void paint(QPainter *painter,
  18. const QStyleOptionGraphicsItem *option,
  19. QWidget *widget);
  20. QRectF boundingRect() const;
  21. };
  22.  
  23. #endif // POSTIT_H
To copy to clipboard, switch view to plain text mode 
postit.cpp:
Qt Code:
  1. #include "../header/postit.h"
  2.  
  3. PostIt::PostIt(QGraphicsItem* parent) : QGraphicsItem(parent){
  4.  
  5.  
  6. setFlag(QGraphicsItem::ItemIsMovable);
  7.  
  8.  
  9. }
  10.  
  11. QRectF PostIt::boundingRect() const{
  12. return QRectF(0,0,400,400);
  13. }
  14. void PostIt::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget){
  15. painter->setPen(Qt::black);
  16. painter->setBrush(Qt::yellow);
  17. painter->drawRoundedRect(0,0,400,400,5,5);
  18. painter->drawRoundedRect(0,0,200,100,5,2);
  19.  
  20. }
  21.  
  22. }
To copy to clipboard, switch view to plain text mode 
This one looks exactly like i want. But i need to draw text, which is editable. I tried so much with QGraphicsTextItems and searched in the internet. I found some things, but i dont understand how i can draw this GraphicstextItem in my rect.
I addition, i want to display a picture in the rect. It would be perfect if the user can just drag and drop the picture in my rect. Maybe u can give me some tipps for this problem too.
thanks for reading!