1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
This commit is contained in:
krepa098 2015-02-04 15:36:45 +01:00
parent 6cf3f9e1c2
commit 633ca9c3ac
2 changed files with 3 additions and 7 deletions

View File

@ -17,6 +17,7 @@
#include "chatlinecontentproxy.h"
#include <QLayout>
#include <QWidget>
#include <QPainter>
#include <QDebug>
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

View File

@ -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;