1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Fix ownership problem (issue #8)

This commit is contained in:
krepa098 2015-02-08 10:11:55 +01:00
parent 624b73edc7
commit 5ec3a2db85
2 changed files with 12 additions and 0 deletions

View File

@ -99,6 +99,17 @@ ChatLog::ChatLog(QWidget* parent)
connect(workerTimer, &QTimer::timeout, this, &ChatLog::onWorkerTimeout);
}
ChatLog::~ChatLog()
{
// Drop ownership of items of type ChatLineContentType
// as they are owned by ChatLine
for(QGraphicsItem* item : items())
{
if(item->type() == ChatLineContent::ChatLineContentType)
scene->removeItem(item);
}
}
void ChatLog::clearSelection()
{
if(selectionMode == None)

View File

@ -36,6 +36,7 @@ class ChatLog : public QGraphicsView
Q_OBJECT
public:
explicit ChatLog(QWidget* parent = 0);
virtual ~ChatLog();
void insertChatlineAtBottom(ChatLine::Ptr l);
void insertChatlineOnTop(ChatLine::Ptr l);