refs #735, allow to reset highlighting

(some leftovers of DB object highlighting also deleted)
This commit is contained in:
Klaus Basan
2016-08-15 21:09:06 +02:00
committed by Mathew Sutcliffe
parent 2434c7bbe2
commit b324a26747
9 changed files with 50 additions and 23 deletions

View File

@@ -357,6 +357,9 @@ namespace BlackGui
actionInteractiveResize->setChecked(autoResize);
actionInteractiveResize->setEnabled(enabled);
connect(actionInteractiveResize, &QAction::toggled, this, &CViewBaseNonTemplate::ps_toggleResizeMode);
// Clear highlighting
menuActions.addAction(CIcons::refresh16(), "Clear highlighting", CMenuAction::pathViewClearHighlighting(), nullptr , { this, &CViewBaseNonTemplate::clearHighlighting });
}
void CViewBaseNonTemplate::showEvent(QShowEvent *event)
@@ -957,6 +960,13 @@ namespace BlackGui
}
}
template <class ModelClass, class ContainerType, class ObjectType>
void CViewBase<ModelClass, ContainerType, ObjectType>::clearHighlighting()
{
Q_ASSERT(this->m_model);
return this->m_model->clearHighlighting();
}
template <class ModelClass, class ContainerType, class ObjectType>
int CViewBase<ModelClass, ContainerType, ObjectType>::rowCount() const
{

View File

@@ -309,6 +309,9 @@ namespace BlackGui
//! Remove selected rows
virtual int removeSelectedRows() = 0;
//! Clear any highlighted objects
virtual void clearHighlighting() = 0;
protected:
//! Constructor
CViewBaseNonTemplate(QWidget *parent);
@@ -543,6 +546,7 @@ namespace BlackGui
//! @{
virtual int removeSelectedRows() override;
virtual void presizeOrFullResizeToContents() override;
virtual void clearHighlighting() override;
//! @}
//! \name BlackGui::Views::CViewBaseNonTemplate implementations