Fix item add after init can't show

This commit is contained in:
杨万青 2015-07-07 10:12:16 +08:00
parent ee40afb328
commit d566addbce
3 changed files with 5 additions and 1 deletions

View File

@ -28,6 +28,8 @@ void AppManager::slotEntryAdded(const QDBusObjectPath &path)
DBusEntryProxyer *entryProxyer = new DBusEntryProxyer(path.path());
if (entryProxyer->isValid())
{
if (entryProxyer->data().value("title") == "dde-dock")
return;
AppItem *item = new AppItem();
item->setEntryProxyer(entryProxyer);
emit entryAdded(item);

View File

@ -141,10 +141,11 @@ void Panel::slotRemoveAppItem(const QString &id)
if (tmpItem->itemId() == id)
{
//TODO,remove from layout
leftLayout->removeItem(i);
qWarning() << "=====" << leftLayout->getItemCount();
return;
}
}
qWarning() << "=====" << leftLayout->getItemCount();
}
void Panel::mousePressEvent(QMouseEvent *event)

View File

@ -15,6 +15,7 @@ void DockLayout::addItem(AbstractDockItem *item)
void DockLayout::insertItem(AbstractDockItem *item, int index)
{
item->setParent(this);
item->show();
int appCount = appList.count();
index = index > appCount ? appCount : (index < 0 ? 0 : index);