mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Shortcut for filter
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include <QLabel>
|
||||
#include <QMovie>
|
||||
#include <QPainter>
|
||||
#include <QShortcut>
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackGui;
|
||||
@@ -43,6 +44,11 @@ namespace BlackGui
|
||||
this->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
this->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
this->setWordWrap(true);
|
||||
|
||||
QShortcut *filter = new QShortcut(FilterKey, this);
|
||||
bool c = connect(filter, &QShortcut::activated, this, &CViewBaseNonTemplate::ps_displayFilterDialog);
|
||||
Q_ASSERT(c);
|
||||
Q_UNUSED(c);
|
||||
}
|
||||
|
||||
void CViewBaseNonTemplate::resizeToContents()
|
||||
@@ -152,7 +158,7 @@ namespace BlackGui
|
||||
|
||||
if (this->m_withMenuFilter)
|
||||
{
|
||||
menu.addAction(BlackMisc::CIcons::tableSheet16(), "Filter", this, SLOT(ps_displayFilterDialog()));
|
||||
menu.addAction(BlackMisc::CIcons::tableSheet16(), "Filter", this, SLOT(ps_displayFilterDialog()), FilterKey);
|
||||
menu.addAction(BlackMisc::CIcons::tableSheet16(), "Remove Filter", this, SLOT(ps_removeFilter()));
|
||||
}
|
||||
if (!menu.isEmpty()) { menu.addSeparator(); }
|
||||
|
||||
@@ -238,6 +238,7 @@ namespace BlackGui
|
||||
bool m_displayAutomatically = true; //!< display directly when loaded
|
||||
|
||||
QWidget *m_filterWidget = nullptr; //!< filter widget if any
|
||||
const QKeySequence FilterKey {Qt::CTRL + Qt::Key_F}; //!< shortcut filter
|
||||
BlackGui::IMenuDelegate *m_menu = nullptr; //!< custom menu if any
|
||||
BlackGui::CLoadIndicator *m_loadIndicator = nullptr; //!< load indicator if neeeded
|
||||
|
||||
@@ -374,7 +375,7 @@ namespace BlackGui
|
||||
|
||||
//! \copydoc CViewBaseNonTemplate::ps_filterWidgetChangedFilter(bool)
|
||||
//! \remarks Actually a slot, but not defined as such as the template does not support Q_OBJECT
|
||||
virtual bool ps_filterWidgetChangedFilter(bool enabled) override;
|
||||
virtual bool ps_filterWidgetChangedFilter(bool enabled) override;
|
||||
|
||||
//! \copydoc CViewBaseNonTemplate::ps_removeFilter
|
||||
//! \remarks Actually a slot, but not defined as such as the template does not support Q_OBJECT
|
||||
|
||||
Reference in New Issue
Block a user