From 633ca9c3ac4f845f7110d30e7436d67c8fe762fe Mon Sep 17 00:00:00 2001 From: krepa098 Date: Wed, 4 Feb 2015 15:36:45 +0100 Subject: [PATCH] cleanup --- src/chatlog/chatlinecontentproxy.cpp | 9 +++------ src/chatlog/chatlinecontentproxy.h | 1 - 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/chatlog/chatlinecontentproxy.cpp b/src/chatlog/chatlinecontentproxy.cpp index 129f6fe5b..6e33547b3 100644 --- a/src/chatlog/chatlinecontentproxy.cpp +++ b/src/chatlog/chatlinecontentproxy.cpp @@ -17,6 +17,7 @@ #include "chatlinecontentproxy.h" #include #include +#include #include ChatLineContentProxy::ChatLineContentProxy(QWidget* widget, int minWidth, float widthInPercent) @@ -32,19 +33,15 @@ QRectF ChatLineContentProxy::boundingRect() const return proxy->boundingRect(); } -QRectF ChatLineContentProxy::boundingSceneRect() const -{ - return proxy->boundingRect().translated(scenePos()); -} - void ChatLineContentProxy::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { + painter->setClipRect(boundingRect()); proxy->paint(painter, option, widget); } qreal ChatLineContentProxy::getAscent() const { - return proxy->widget()->layout()->contentsMargins().top(); + return 0; } QWidget *ChatLineContentProxy::getWidget() const diff --git a/src/chatlog/chatlinecontentproxy.h b/src/chatlog/chatlinecontentproxy.h index b73fb126a..c7c93209d 100644 --- a/src/chatlog/chatlinecontentproxy.h +++ b/src/chatlog/chatlinecontentproxy.h @@ -26,7 +26,6 @@ public: ChatLineContentProxy(QWidget* widget, int minWidth, float widthInPercent = 1.0f); virtual QRectF boundingRect() const; - virtual QRectF boundingSceneRect() const; virtual void setWidth(qreal width); virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); virtual qreal getAscent() const;