Skip to content
Snippets Groups Projects
Commit 45b20489 authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

ComponentFlatView now doesn't let wheel events propagate down to editors.

parent 7de6cda2
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,7 @@
#include "SessionModel.h"
#include "LayoutUtils.h"
#include "PropertyWidgetItem.h"
#include "CustomEventFilters.h"
#include <QLabel>
#include <QVBoxLayout>
#include <QGridLayout>
......@@ -33,6 +34,7 @@ ComponentFlatView::ComponentFlatView(QWidget* parent)
, m_currentItem(nullptr)
, m_model(nullptr)
, m_show_children(true)
, m_wheel_event_filter(new WheelEventEater)
{
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
......@@ -149,6 +151,9 @@ PropertyWidgetItem* ComponentFlatView::createWidget(const SessionItem* item)
if (!editor)
return nullptr;
editor->installEventFilter(m_wheel_event_filter.get());
editor->setFocusPolicy(Qt::StrongFocus);
auto result = new PropertyWidgetItem(this);
result->setItemEditor(item, editor);
......
......@@ -18,12 +18,14 @@
#define COMPONENTFLATVIEW_H
#include "ComponentView.h"
#include <memory>
class SessionItem;
class SessionModel;
class QGridLayout;
class QBoxLayout;
class PropertyWidgetItem;
class WheelEventEater;
//! Component property widget for SessionItems. On the contrary to ComponentTreeView
//! properties are presented as widgets in grid layout.
......@@ -60,6 +62,7 @@ private:
SessionItem* m_currentItem;
SessionModel* m_model;
bool m_show_children;
std::unique_ptr<WheelEventEater> m_wheel_event_filter;
};
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment