diff --git a/src/widget/friendlistwidget.cpp b/src/widget/friendlistwidget.cpp index c997b6b4f..4eda21960 100644 --- a/src/widget/friendlistwidget.cpp +++ b/src/widget/friendlistwidget.cpp @@ -130,3 +130,11 @@ void FriendListWidget::moveWidget(QWidget *w, Status s) } l->addWidget(w); } + +// update widget after add/delete/hide/show +void FriendListWidget::reDraw() +{ + hide(); + show(); + resize(QSize()); //lifehack +} diff --git a/src/widget/friendlistwidget.h b/src/widget/friendlistwidget.h index 265073512..c3a4b3ab3 100644 --- a/src/widget/friendlistwidget.h +++ b/src/widget/friendlistwidget.h @@ -34,7 +34,7 @@ public: QVBoxLayout* getFriendLayout(Status s); QList getAllFriends(); - + void reDraw(); signals: public slots: diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index 0613016eb..ae7138e89 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -889,8 +889,7 @@ void Widget::removeFriend(Friend* f, bool fake) if (ui->mainHead->layout()->isEmpty()) onAddClicked(); - contactListWidget->hide(); - contactListWidget->show(); + contactListWidget->reDraw(); } void Widget::removeFriend(int friendId) @@ -1040,8 +1039,7 @@ void Widget::removeGroup(Group* g, bool fake) if (ui->mainHead->layout()->isEmpty()) onAddClicked(); - contactListWidget->hide(); - contactListWidget->show(); + contactListWidget->reDraw(); } void Widget::removeGroup(int groupId) @@ -1445,8 +1443,7 @@ void Widget::searchContacts() return; } - contactListWidget->hide(); - contactListWidget->show(); + contactListWidget->reDraw(); } void Widget::hideFriends(QString searchString, Status status, bool hideAll)