Fixed GxsGroup TreeWidget's Context Menu by Phenom

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7387 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2014-05-29 13:34:08 +00:00
parent f54162db76
commit 5e1099f47f
3 changed files with 24 additions and 13 deletions

View File

@ -300,6 +300,16 @@ QString GroupTreeWidget::itemId(QTreeWidgetItem *item)
return item->data(COLUMN_DATA, ROLE_ID).toString(); return item->data(COLUMN_DATA, ROLE_ID).toString();
} }
QString GroupTreeWidget::itemIdAt(QPoint &point)
{
QTreeWidgetItem *item = ui->treeWidget->itemAt(point);
if (item == NULL) {
return "";
}
return item->data(COLUMN_DATA, ROLE_ID).toString();
}
void GroupTreeWidget::fillGroupItems(QTreeWidgetItem *categoryItem, const QList<GroupItemInfo> &itemList) void GroupTreeWidget::fillGroupItems(QTreeWidgetItem *categoryItem, const QList<GroupItemInfo> &itemList)
{ {
if (categoryItem == NULL) { if (categoryItem == NULL) {

View File

@ -83,6 +83,7 @@ public:
QTreeWidgetItem *addCategoryItem(const QString &name, const QIcon &icon, bool expand); QTreeWidgetItem *addCategoryItem(const QString &name, const QIcon &icon, bool expand);
// Get id of item // Get id of item
QString itemId(QTreeWidgetItem *item); QString itemId(QTreeWidgetItem *item);
QString itemIdAt(QPoint &point);
// Fill items of a group // Fill items of a group
void fillGroupItems(QTreeWidgetItem *categoryItem, const QList<GroupItemInfo> &itemList); void fillGroupItems(QTreeWidgetItem *categoryItem, const QList<GroupItemInfo> &itemList);
// Set the unread count of an item // Set the unread count of an item

View File

@ -206,7 +206,7 @@ void GxsGroupFrameDialog::todo()
void GxsGroupFrameDialog::groupTreeCustomPopupMenu(QPoint point) void GxsGroupFrameDialog::groupTreeCustomPopupMenu(QPoint point)
{ {
QString id = "" ;//ui->groupTreeWidget->itemIdAt(point); QString id = ui->groupTreeWidget->itemIdAt(point);
if (id.isEmpty()) return; if (id.isEmpty()) return;
mGroupId = RsGxsGroupId(id.toStdString()); mGroupId = RsGxsGroupId(id.toStdString());