##// END OF EJS Templates
Partly reimplemented Graph event handling + bugfix...
Partly reimplemented Graph event handling + bugfix - Now pure UX scroll doesn't affect variable delta T - Now all events are captured by VisualizationGraphWidget(VGW) this avoid that QCP intercept them then FW them to VGW which interact back with QCP - Non transformation events a broken for now - Added keyboard navigation Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r1328:eb278710ae3b
r1362:0033c08c242f Pybind11
Show More
SelectionZoneAction.cpp
77 lines | 2.3 KiB | text/x-c | CppLexer
/ gui / src / Actions / SelectionZoneAction.cpp
Adds a a gui controller class to manage global actions across the application.
r1076 #include <Actions/SelectionZoneAction.h>
#include <Visualization/VisualizationSelectionZoneItem.h>
Q_LOGGING_CATEGORY(LOG_SelectionZoneAction, "SelectionZoneAction")
struct SelectionZoneAction::SelectionZoneActionPrivate {
Put the align actions in sub menus
r1083 explicit SelectionZoneActionPrivate(const QString &name, const QStringList &subMenuList,
Adds a a gui controller class to manage global actions across the application.
r1076 SelectionZoneAction::ExecuteFunction fun)
Put the align actions in sub menus
r1083 : m_Name{name}, m_SubMenuList{subMenuList}, m_Fun{std::move(fun)}
Adds a a gui controller class to manage global actions across the application.
r1076 {
}
QString m_Name;
Put the align actions in sub menus
r1083 QStringList m_SubMenuList;
Add action to remove the selected zone with the "del" buttons
r1082 QKeySequence m_DisplayedShortcut;
Adds a a gui controller class to manage global actions across the application.
r1076 SelectionZoneAction::ExecuteFunction m_Fun;
Add a lambda in SeletionZoneAction to enable or disable the action
r1080 SelectionZoneAction::EnableFunction m_EnableFun = [](auto zones) { return true; };
LineEdit to filter the create catalogue menu
r1328 bool m_FilteringAllowed = true;
Adds a a gui controller class to manage global actions across the application.
r1076 };
SelectionZoneAction::SelectionZoneAction(const QString &name, ExecuteFunction fun)
Put the align actions in sub menus
r1083 : impl{spimpl::make_unique_impl<SelectionZoneActionPrivate>(name, QStringList{},
std::move(fun))}
{
}
SelectionZoneAction::SelectionZoneAction(const QStringList &subMenuList, const QString &name,
SelectionZoneAction::ExecuteFunction fun)
: impl{spimpl::make_unique_impl<SelectionZoneActionPrivate>(name, subMenuList,
std::move(fun))}
Adds a a gui controller class to manage global actions across the application.
r1076 {
}
Add a lambda in SeletionZoneAction to enable or disable the action
r1080 void SelectionZoneAction::setEnableFunction(EnableFunction fun)
{
impl->m_EnableFun = std::move(fun);
}
Add action to remove the selected zone with the "del" buttons
r1082 void SelectionZoneAction::setDisplayedShortcut(const QKeySequence &shortcut)
{
impl->m_DisplayedShortcut = shortcut;
}
QKeySequence SelectionZoneAction::displayedShortcut() const
{
return impl->m_DisplayedShortcut;
}
Adds a a gui controller class to manage global actions across the application.
r1076 QString SelectionZoneAction::name() const noexcept
{
return impl->m_Name;
}
Put the align actions in sub menus
r1083 QStringList SelectionZoneAction::subMenuList() const noexcept
{
return impl->m_SubMenuList;
}
LineEdit to filter the create catalogue menu
r1328 void SelectionZoneAction::setAllowedFiltering(bool value)
{
impl->m_FilteringAllowed = value;
}
bool SelectionZoneAction::isFilteringAllowed() const
{
return impl->m_FilteringAllowed;
}
Adds a a gui controller class to manage global actions across the application.
r1076 void SelectionZoneAction::execute(const QVector<VisualizationSelectionZoneItem *> &item)
{
impl->m_Fun(item);
}
Add a lambda in SeletionZoneAction to enable or disable the action
r1080
bool SelectionZoneAction::isEnabled(const QVector<VisualizationSelectionZoneItem *> &item)
{
return impl->m_EnableFun(item);
}