From 1c5bb8345e11dec589fd45a700a2a3bd6186f8fc Mon Sep 17 00:00:00 2001 From: Nikhil Tanwar <2002nikhiltanwar@gmail.com> Date: Sun, 27 Aug 2023 22:05:34 +0530 Subject: [PATCH] Don't set focus/show options menu if choiceItem is clicked --- src/choiceitem.cpp | 7 +++++++ src/choiceitem.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/src/choiceitem.cpp b/src/choiceitem.cpp index 8748527..8f0ba0d 100644 --- a/src/choiceitem.cpp +++ b/src/choiceitem.cpp @@ -1,6 +1,7 @@ #include "choiceitem.h" #include "ui_choiceitem.h" #include +#include ChoiceItem::ChoiceItem(QString key, QString value, QWidget *parent) : QWidget(parent), @@ -25,3 +26,9 @@ ChoiceItem::~ChoiceItem() { delete ui; } + +void ChoiceItem::mousePressEvent(QMouseEvent *event) +{ + Q_UNUSED(event); + return; +} diff --git a/src/choiceitem.h b/src/choiceitem.h index 76ea477..b03b11d 100644 --- a/src/choiceitem.h +++ b/src/choiceitem.h @@ -17,6 +17,9 @@ public: QString getKey() { return m_key; } QString getValue() { return m_value; } +protected: + void mousePressEvent(QMouseEvent *event) override; + private: Ui::ChoiceItem *ui; QString m_key;