element collection widget : highlight unused element in a project.

the feature "clean project" does not clean unused elements yet


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4561 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2016-06-30 09:12:25 +00:00
parent 62c2806e31
commit 438ce78c4f
11 changed files with 240 additions and 93 deletions

View File

@@ -76,8 +76,10 @@ void ElementsCollectionWidget::expandFirstItems()
* @param project
*/
void ElementsCollectionWidget::addProject(QETProject *project) {
if (m_model)
if (m_model) {
m_model->addProject(project);
m_model->highlightUnusedElement();
}
else
m_waiting_project.append(project);
}
@@ -87,6 +89,16 @@ void ElementsCollectionWidget::removeProject(QETProject *project) {
m_model->removeProject(project);
}
/**
* @brief ElementsCollectionWidget::highlightUnusedElement
* highlight the unused element
* @See ElementsCollectionModel::highlightUnusedElement()
*/
void ElementsCollectionWidget::highlightUnusedElement()
{
m_model->highlightUnusedElement();
}
bool ElementsCollectionWidget::event(QEvent *event)
{
if (m_first_show && event->type() == QEvent::WindowActivate) {
@@ -471,6 +483,7 @@ void ElementsCollectionWidget::reload()
m_progress_bar->setValue(futur.progressValue());
}
new_model->highlightUnusedElement();
m_tree_view->setModel(new_model);
m_index_at_context_menu = QModelIndex();
m_showed_index = QModelIndex();