From 4efa8307c448c8c41230e46c9359d925a677d710 Mon Sep 17 00:00:00 2001 From: Iceyer Date: Fri, 9 Nov 2018 17:38:55 +0800 Subject: [PATCH] fix: disable search menu Change-Id: If68b5ab1f72eaefbae9d4c8ead2283063f95f2dc --- src/ui/widgets/search_edit.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ui/widgets/search_edit.cpp b/src/ui/widgets/search_edit.cpp index b3ca16d9..df4687cf 100644 --- a/src/ui/widgets/search_edit.cpp +++ b/src/ui/widgets/search_edit.cpp @@ -22,7 +22,10 @@ namespace dstore { SearchEdit::SearchEdit(QWidget* parent) : DSearchEdit(parent) { - + auto edit = this->findChild("Edit"); + if (edit) { + edit->setContextMenuPolicy(Qt::NoContextMenu); + } } SearchEdit::~SearchEdit() { @@ -51,4 +54,4 @@ void SearchEdit::keyPressEvent(QKeyEvent* event) { DSearchEdit::keyPressEvent(event); } -} // namespace dstore \ No newline at end of file +} // namespace dstore