CheckDirTree::CheckDirTree( QWidget* parent ) : QTreeView( parent ) { m_dirModel.setFilter( QDir::Dirs | QDir::NoDotAndDotDot ); m_dirModel.setRootPath( "/" ); m_dirModel.setNameFilters( QStringList() << "[^\\.]*" ); setModel( &m_dirModel ); setColumnHidden( 1, true ); setColumnHidden( 2, true ); setColumnHidden( 3, true ); //header()->hide(); connect( &m_dirModel, SIGNAL( dataChangedByUser( QModelIndex ) ), SLOT( updateNode( QModelIndex ) ) ); connect( &m_dirModel, SIGNAL( dataChangedByUser( const QModelIndex& ) ), SIGNAL( changed() ) ); connect( &m_dirModel, SIGNAL( modelReset() ), SLOT( modelReset() ) ); connect( this, SIGNAL( collapsed( QModelIndex ) ), SLOT( onCollapse( QModelIndex ) ) ); connect( this, SIGNAL( expanded( QModelIndex ) ), SLOT( onExpand( QModelIndex ) ) ); }
void BookmarksPanel::setup() { UrlPanel::setup(); connect(panelTreeView(), SIGNAL(delKeyPressed()), this, SLOT(deleteBookmark())); connect(panelTreeView(), SIGNAL(collapsed(QModelIndex)), this, SLOT(onCollapse(QModelIndex))); connect(panelTreeView(), SIGNAL(expanded(QModelIndex)), this, SLOT(onExpand(QModelIndex))); loadFoldedState(); }
void TreeItem::setExpanded(bool ex) { expanded = ex; if (ex) { if (onExpand) { onExpand(this); } } else { if (onCollapse) { onCollapse(this); } } }
void CategoryWidget::setExpanded(bool isExpanded, bool save) { expanded = isExpanded; setMouseTracking(true); listWidget->setVisible(isExpanded); QString pixmapPath; if (isExpanded) pixmapPath = ":/ui/chatArea/scrollBarDownArrow.svg"; else pixmapPath = ":/ui/chatArea/scrollBarRightArrow.svg"; statusPic.setPixmap(QPixmap(pixmapPath)); // The listWidget will recieve a enterEvent for some reason if now visible. // Using the following, we prevent that. QApplication::processEvents(QEventLoop::ExcludeSocketNotifiers); container->hide(); container->show(); if (save) onExpand(); }