mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-15 16:49:20 -05:00
Merge Filter ComboBox to Header Context Menu in IdDialog.
This commit is contained in:
parent
431dd68509
commit
d3beccf3e2
5 changed files with 430 additions and 374 deletions
|
|
@ -169,6 +169,11 @@ void RSTreeWidget::addHeaderContextMenuAction(QAction *action)
|
|||
mHeaderContextMenuActions.push_back(action);
|
||||
}
|
||||
|
||||
void RSTreeWidget::addHeaderContextMenuMenu(QMenu *menu)
|
||||
{
|
||||
mHeaderContextMenuMenus.push_back(menu);
|
||||
}
|
||||
|
||||
void RSTreeWidget::headerContextMenuRequested(const QPoint &pos)
|
||||
{
|
||||
QMenu contextMenu(this);
|
||||
|
|
@ -207,6 +212,13 @@ void RSTreeWidget::headerContextMenuRequested(const QPoint &pos)
|
|||
contextMenu.addActions(mHeaderContextMenuActions);
|
||||
}
|
||||
|
||||
if (!mHeaderContextMenuMenus.isEmpty()) {
|
||||
foreach(QMenu *menu, mHeaderContextMenuMenus) {
|
||||
contextMenu.addSeparator();
|
||||
contextMenu.addMenu(menu);
|
||||
}
|
||||
}
|
||||
|
||||
if (contextMenu.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ public:
|
|||
|
||||
// Add QAction to context menu (action won't be deleted)
|
||||
void addHeaderContextMenuAction(QAction *action);
|
||||
// Add QMenu to context menu (menu won't be deleted)
|
||||
void addHeaderContextMenuMenu(QMenu *menu);
|
||||
|
||||
signals:
|
||||
void signalMouseMiddleButtonClicked(QTreeWidgetItem *item);
|
||||
|
|
@ -69,6 +71,7 @@ private:
|
|||
quint32 mSettingsVersion;
|
||||
QMap<int, bool> mColumnCustomizable;
|
||||
QList<QAction*> mHeaderContextMenuActions;
|
||||
QList<QMenu*> mHeaderContextMenuMenus;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue