Fixed bug when count of favorites buttons changed.
This commit is contained in:
@@ -103,6 +103,13 @@ void ShopForm::loadButtons()
|
|||||||
Service<FavoritItem> srvFav;
|
Service<FavoritItem> srvFav;
|
||||||
QMap<QString, FavoritItemPtr> btnMap;
|
QMap<QString, FavoritItemPtr> btnMap;
|
||||||
|
|
||||||
|
foreach (QWidget *child, ui->favorites->findChildren<QWidget*>()) {
|
||||||
|
if (child->objectName() != "directSale")
|
||||||
|
{
|
||||||
|
delete child;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
foreach (FavoritItemPtr item, srvFav.all()) {
|
foreach (FavoritItemPtr item, srvFav.all()) {
|
||||||
btnMap[item->favButtonName()] = item;
|
btnMap[item->favButtonName()] = item;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTableView" name="commodityTable">
|
<widget class="QTableView" name="commodityTable">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>400</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="selectionMode">
|
<property name="selectionMode">
|
||||||
<enum>QAbstractItemView::SingleSelection</enum>
|
<enum>QAbstractItemView::SingleSelection</enum>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
Reference in New Issue
Block a user