|  | Home · All Namespaces · All Classes · Main Classes · Grouped Classes · Modules · Functions |

# diagramtextitem.h Example File
graphicsview/diagramscene/diagramtextitem.h

     /****************************************************************************
     **
     ** Copyright (C) 2007-$THISYEAR$ $TROLLTECH$. All rights reserved.
     **
     ** This file is part of the $MODULE$ of the Qt Toolkit.
     **
     ** $TROLLTECH_DUAL_LICENSE$
     **
     ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
     ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
     **
     ****************************************************************************/

     #ifndef DIAGRAMTEXTITEM_H
     #define DIAGRAMTEXTITEM_H

     #include <QGraphicsTextItem>
     #include <QPen>

     class QFocusEvent;
     class QGraphicsItem;
     class QGraphicsScene;
     class QGraphicsSceneMouseEvent;

     class DiagramTextItem : public QGraphicsTextItem
     {
         Q_OBJECT

     public:
         enum { Type = UserType + 3 };

         DiagramTextItem(QGraphicsItem *parent = 0, QGraphicsScene *scene = 0);

         int type() const
             { return Type; }

     signals:
         void lostFocus(DiagramTextItem *item);
         void selectedChange(QGraphicsItem *item);

     protected:
         QVariant itemChange(GraphicsItemChange change, const QVariant &value);
         void focusOutEvent(QFocusEvent *event);
         void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
     };

     #endif