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:
parent
624b73edc7
commit
5ec3a2db85
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user