mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
cleanup
This commit is contained in:
parent
6cf3f9e1c2
commit
633ca9c3ac
|
@ -17,6 +17,7 @@
|
||||||
#include "chatlinecontentproxy.h"
|
#include "chatlinecontentproxy.h"
|
||||||
#include <QLayout>
|
#include <QLayout>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
#include <QPainter>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
ChatLineContentProxy::ChatLineContentProxy(QWidget* widget, int minWidth, float widthInPercent)
|
ChatLineContentProxy::ChatLineContentProxy(QWidget* widget, int minWidth, float widthInPercent)
|
||||||
|
@ -32,19 +33,15 @@ QRectF ChatLineContentProxy::boundingRect() const
|
||||||
return proxy->boundingRect();
|
return proxy->boundingRect();
|
||||||
}
|
}
|
||||||
|
|
||||||
QRectF ChatLineContentProxy::boundingSceneRect() const
|
|
||||||
{
|
|
||||||
return proxy->boundingRect().translated(scenePos());
|
|
||||||
}
|
|
||||||
|
|
||||||
void ChatLineContentProxy::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
void ChatLineContentProxy::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||||
{
|
{
|
||||||
|
painter->setClipRect(boundingRect());
|
||||||
proxy->paint(painter, option, widget);
|
proxy->paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal ChatLineContentProxy::getAscent() const
|
qreal ChatLineContentProxy::getAscent() const
|
||||||
{
|
{
|
||||||
return proxy->widget()->layout()->contentsMargins().top();
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *ChatLineContentProxy::getWidget() const
|
QWidget *ChatLineContentProxy::getWidget() const
|
||||||
|
|
|
@ -26,7 +26,6 @@ public:
|
||||||
ChatLineContentProxy(QWidget* widget, int minWidth, float widthInPercent = 1.0f);
|
ChatLineContentProxy(QWidget* widget, int minWidth, float widthInPercent = 1.0f);
|
||||||
|
|
||||||
virtual QRectF boundingRect() const;
|
virtual QRectF boundingRect() const;
|
||||||
virtual QRectF boundingSceneRect() const;
|
|
||||||
virtual void setWidth(qreal width);
|
virtual void setWidth(qreal width);
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||||
virtual qreal getAscent() const;
|
virtual qreal getAscent() const;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user