void FileSystemWidget::setStartIndex(const QModelIndex &index)
{
    QModelIndex oldIndex = m_model->startIndex();
    if (oldIndex != index) {
        m_model->setStartIndex(index);
        m_tree->update(oldIndex);
        m_tree->update(index);
        emit startPathChanged(m_model->filePath(index));
    }
}
Exemple #2
0
void GopathBrowser::setStartIndex(const QModelIndex &index)
{
    QModelIndex oldIndex = m_model->startIndex();
    if (oldIndex != index) {
        m_model->setStartIndex(index);
        m_pathTree->update(oldIndex);
        m_pathTree->update(index);
        emit startPathChanged(m_model->filePath(index));
        PathNode *node = m_model->nodeFromIndex(index);
        if (node) {
            m_startPathLabel->setText(QString("<p><a href file://%1>%2</p>").arg(node->path()).arg(node->text()));
            m_startPathLabel->setToolTip(node->path());
        }
    }
}