summaryrefslogtreecommitdiffstats
path: root/webscrap.h
diff options
context:
space:
mode:
authorRoopesh Chander <roop@forwardbias.in>2009-11-13 17:08:31 +0530
committerRoopesh Chander <roop@forwardbias.in>2009-11-13 17:08:31 +0530
commitd86b0e81bd9510391aa66d7331999225a58f630d (patch)
tree490b9538571a60164c9dc6b2d34a0ab1702b2c20 /webscrap.h
parent8b453b01e4a98c2d0db1e7ce713f825790ad2ed5 (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.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/webscrap.h b/webscrap.h
index d90811b..aad2d9f 100644
--- a/webscrap.h
+++ b/webscrap.h
@@ -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*)