From da3aa2987cc4e4c8f4f212f731c4bc249a41bba8 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Thu, 6 Apr 2017 21:20:16 +0200 Subject: [PATCH] Fixed bug when count of favorites buttons changed. --- shop/shopform.cpp | 7 +++++++ shop/shopform.ui | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/shop/shopform.cpp b/shop/shopform.cpp index 23c6a8d..afe8098 100644 --- a/shop/shopform.cpp +++ b/shop/shopform.cpp @@ -103,6 +103,13 @@ void ShopForm::loadButtons() Service srvFav; QMap btnMap; + foreach (QWidget *child, ui->favorites->findChildren()) { + if (child->objectName() != "directSale") + { + delete child; + } + } + foreach (FavoritItemPtr item, srvFav.all()) { btnMap[item->favButtonName()] = item; } diff --git a/shop/shopform.ui b/shop/shopform.ui index 3ed8b9c..7413734 100644 --- a/shop/shopform.ui +++ b/shop/shopform.ui @@ -50,6 +50,12 @@ + + + 400 + 0 + + QAbstractItemView::SingleSelection