mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user