mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +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:
@@ -61,7 +61,7 @@ NewElementWizard::~NewElementWizard() {
|
||||
*/
|
||||
void NewElementWizard::preselectedLocation(const ElementsLocation &location)
|
||||
{
|
||||
QModelIndex index = m_model->index(location);
|
||||
QModelIndex index = m_model->indexFromLocation(location);
|
||||
if (index.isValid()) {
|
||||
m_tree_view->scrollTo(index);
|
||||
m_tree_view->setCurrentIndex(index);
|
||||
@@ -170,7 +170,7 @@ bool NewElementWizard::validStep1()
|
||||
QModelIndex index = m_tree_view->currentIndex();
|
||||
if (index.isValid()) {
|
||||
|
||||
ElementCollectionItem *eci = static_cast<ElementCollectionItem*>(index.internalPointer());
|
||||
ElementCollectionItem *eci = static_cast<ElementCollectionItem*>(m_model->itemFromIndex(index));
|
||||
if (eci && eci->isDir()) {
|
||||
ElementsLocation loc(eci->collectionPath());
|
||||
if (loc.exist()) {
|
||||
|
||||
Reference in New Issue
Block a user