diff options
Diffstat (limited to 'src/panels/filter')
| -rw-r--r-- | src/panels/filter/filterpanel.cpp | 13 | ||||
| -rw-r--r-- | src/panels/filter/filterpanel.h | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/panels/filter/filterpanel.cpp b/src/panels/filter/filterpanel.cpp index 021a2d3b8..d13d6e520 100644 --- a/src/panels/filter/filterpanel.cpp +++ b/src/panels/filter/filterpanel.cpp @@ -39,6 +39,7 @@ #include <kfileitem.h> #include <kio/jobclasses.h> #include <kio/job.h> +#include <kmenu.h> #include <QPushButton> #include <QShowEvent> @@ -140,6 +141,18 @@ void FilterPanel::showEvent(QShowEvent* event) Panel::showEvent(event); } +void FilterPanel::contextMenuEvent(QContextMenuEvent* event) +{ + Panel::contextMenuEvent(event); + + QWeakPointer<KMenu> popup = new KMenu(this); + foreach (QAction* action, customContextMenuActions()) { + popup.data()->addAction(action); + } + popup.data()->exec(QCursor::pos()); + delete popup.data(); +} + void FilterPanel::slotSetUrlStatFinished(KJob* job) { m_lastSetUrlStatJob = 0; diff --git a/src/panels/filter/filterpanel.h b/src/panels/filter/filterpanel.h index c574d618e..574a9f389 100644 --- a/src/panels/filter/filterpanel.h +++ b/src/panels/filter/filterpanel.h @@ -52,6 +52,9 @@ protected: /** @see QWidget::showEvent() */ virtual void showEvent(QShowEvent* event); + /** @see QWidget::contextMenuEvent() */ + virtual void contextMenuEvent(QContextMenuEvent* event); + private slots: void slotSetUrlStatFinished(KJob*); void slotQueryTermChanged(const Nepomuk::Query::Term& term); |
