mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
elements collection model : use QStandardItemModel has base class instead of QAbstractItemModel.
Add minor improvement. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4538 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -85,14 +85,14 @@ void ElementDialog::setUpWidget()
|
||||
|
||||
m_tree_view = new QTreeView(this);
|
||||
|
||||
ElementsCollectionModel *model = new ElementsCollectionModel(m_tree_view);
|
||||
if (m_mode == OpenElement) {model->addCommonCollection();}
|
||||
model->addCustomCollection();
|
||||
m_model = new ElementsCollectionModel(m_tree_view);
|
||||
if (m_mode == OpenElement) {m_model->addCommonCollection();}
|
||||
m_model->addCustomCollection();
|
||||
foreach (QETProject *project, QETApp::registeredProjects()) {
|
||||
model->addProject(project);
|
||||
m_model->addProject(project);
|
||||
}
|
||||
|
||||
m_tree_view->setModel(model);
|
||||
m_tree_view->setModel(m_model);
|
||||
m_tree_view->setHeaderHidden(true);
|
||||
layout->addWidget(m_tree_view);
|
||||
|
||||
@@ -138,7 +138,7 @@ void ElementDialog::setUpConnection()
|
||||
*/
|
||||
void ElementDialog::indexClicked(const QModelIndex &index)
|
||||
{
|
||||
ElementCollectionItem *eci = static_cast<ElementCollectionItem*> (index.internalPointer());
|
||||
ElementCollectionItem *eci = static_cast<ElementCollectionItem*> (m_model->itemFromIndex(index));
|
||||
m_location = ElementsLocation(eci->collectionPath());
|
||||
checkCurrentLocation();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user