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

# roundrectitem.h Example File
graphicsview/padnavigator/roundrectitem.h

     /****************************************************************************
     **
     ** Copyright (C) 1992-$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.
     **
     ****************************************************************************/

     #include <QtCore/qobject.h>
     #include <QtCore/qtimeline.h>
     #include <QtGui/qgraphicsitem.h>
     #include <QtGui/qbrush.h>

     class QGraphicsProxyWidget;

     class RoundRectItem : public QObject, public QGraphicsRectItem
     {
         Q_OBJECT
     public:
         RoundRectItem(const QRectF &rect, const QBrush &brush, QWidget *embeddedWidget = 0);

         void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *);
         QRectF boundingRect() const;

         void setPixmap(const QPixmap &pixmap);

         qreal opacity() const;
         void setOpacity(qreal opacity);

     Q_SIGNALS:
         void activated();

     protected:
         void keyPressEvent(QKeyEvent *event);
         void keyReleaseEvent(QKeyEvent *event);

     private slots:
         void updateValue(qreal value);

     private:
         QBrush brush;
         QPixmap pix;
         QTimeLine timeLine;
         qreal lastVal;
         qreal opa;

         QGraphicsProxyWidget *proxyWidget;
     };