void QgsLayerTreeNode::setExpanded( bool expanded ) { if ( mExpanded == expanded ) return; mExpanded = expanded; emit expandedChanged( this, expanded ); }
GroupView::GroupView(Database* db, QWidget* parent) : QTreeView(parent) , m_model(new GroupModel(db, this)) , m_updatingExpanded(false) { QTreeView::setModel(m_model); setHeaderHidden(true); setUniformRowHeights(true); connect(this, SIGNAL(expanded(QModelIndex)), this, SLOT(expandedChanged(QModelIndex))); connect(this, SIGNAL(collapsed(QModelIndex)), this, SLOT(expandedChanged(QModelIndex))); connect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)), SLOT(syncExpandedState(QModelIndex,int,int))); connect(m_model, SIGNAL(modelReset()), SLOT(modelReset())); connect(selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), SLOT(emitGroupChanged())); modelReset(); setDragEnabled(true); viewport()->setAcceptDrops(true); setDropIndicatorShown(true); setDefaultDropAction(Qt::MoveAction); }
void StatesEditorWidget::reloadQmlSource() { QString statesListQmlFilePath = qmlSourcesPath() + QStringLiteral("/StatesList.qml"); QTC_ASSERT(QFileInfo::exists(statesListQmlFilePath), return); engine()->clearComponentCache(); setSource(QUrl::fromLocalFile(statesListQmlFilePath)); QTC_ASSERT(rootObject(), return); connect(rootObject(), SIGNAL(currentStateInternalIdChanged()), m_statesEditorView.data(), SLOT(synchonizeCurrentStateFromWidget())); connect(rootObject(), SIGNAL(createNewState()), m_statesEditorView.data(), SLOT(createNewState())); connect(rootObject(), SIGNAL(deleteState(int)), m_statesEditorView.data(), SLOT(removeState(int))); m_statesEditorView.data()->synchonizeCurrentStateFromWidget(); setFixedHeight(initialSize().height()); connect(rootObject(), SIGNAL(expandedChanged()), this, SLOT(changeHeight())); }