diff options
author | Roopesh Chander <roop@forwardbias.in> | 2009-11-13 17:08:31 +0530 |
---|---|---|
committer | Roopesh Chander <roop@forwardbias.in> | 2009-11-13 17:08:31 +0530 |
commit | d86b0e81bd9510391aa66d7331999225a58f630d (patch) | |
tree | 490b9538571a60164c9dc6b2d34a0ab1702b2c20 /webscrap.h | |
parent | 8b453b01e4a98c2d0db1e7ce713f825790ad2ed5 (diff) |
dont create the frame and the title bar as qgraphicsitems, let's paint them ourselves
Diffstat (limited to 'webscrap.h')
-rw-r--r-- | webscrap.h | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -68,6 +68,7 @@ public: WebScrapContainer(WebScrap *scrap, QGraphicsScene *scene, qreal xScale = 1.0, qreal yScale = 1.0); void createToolbar(); void createEditToolbar(); + void setBoundingRect(QRectF rect); QRectF boundingRect() const; WebScrap* webScrap() const; QGraphicsDropShadowEffect *glow() const; @@ -77,6 +78,7 @@ public: QPropertyAnimation* enterAnimation() const; void setLeaveAnimation(QPropertyAnimation *animation); QPropertyAnimation *leaveAnimation() const; + void paint(QPainter* painter, const QStyleOptionGraphicsItem* options, QWidget* widget = 0); public slots: void setTitle(const QString& title); @@ -88,7 +90,7 @@ public slots: void handleResetZoomClicked(); protected: - bool sceneEventFilter(QGraphicsItem *watched, QEvent* event); + void mousePressEvent(QGraphicsSceneMouseEvent *event); void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); signals: @@ -98,8 +100,6 @@ signals: private: QGraphicsScene *m_scene; WebScrap *m_scrap; - QGraphicsPathItem *m_frame; - QGraphicsTextItem *m_titlebar; GraphicsToolBar *m_toolbar; QToolButton *m_closeButton, *m_adjustButton, *m_reloadButton; GraphicsToolBar *m_editToolbar; @@ -111,6 +111,9 @@ private: QGraphicsDropShadowEffect *m_glow; bool m_located, m_searchMatched; QPropertyAnimation *m_enterAnimation, *m_leaveAnimation; + QString m_title; + QBrush m_titleBrush, m_backgroundBrush; + QRectF m_boundingRect; }; Q_DECLARE_METATYPE(WebScrapContainer*) |