void ChannelTreeWidget::collapseChannel(const QString &channel)
{
    if (!channels.contains(channel))
        return;
    CHANNELITEM channelitem = channels.value(channel);
    collapseItem(channelitem.widgetitem);
}
Пример #2
0
// \todo Optimize this so we don't have to linear search through the whole model to find out which header was clicked
void AMVerticalStackWidget::onHeaderButtonClicked() {
	QObject* s = sender();
	for(int i=0; i<count(); i++) {
		if(model_.data(model_.index(i,0), AM::WidgetRole).value<AMHeaderButton*>() == s) {
			if(itemCollapsable(i))
				itemIsCollapsed(i) ? expandItem(i) : collapseItem(i);
			return;
		}
	}
}
Пример #3
0
void TreeWidget::collapseCurrentConnection()
{
    QTreeWidgetItem* item = currentItem();
    if (item && item->parent())
        item = item->parent();
    if (item) {
        collapseItem(item);
        setCurrentItem(item);
    }
}
Пример #4
0
void ItemBoxTreeWidget::setCategoryExpanded(int cat_idx, bool expand)
{

    QTreeWidgetItem *cat_item = topLevelItem(cat_idx);
    if(expand) {
        expandItem(cat_item);
    } else {
        collapseItem(cat_item);
    }

}
Пример #5
0
void QCSTreeWidget::collapseAll()
{
	for (int i=0;i<topLevelItemCount();++i) collapseItem(topLevelItem(i));
}
int QTreeWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QTreeView::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: itemPressed((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 1: itemClicked((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 2: itemDoubleClicked((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 3: itemActivated((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 4: itemEntered((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 5: itemChanged((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 6: itemExpanded((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1]))); break;
        case 7: itemCollapsed((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1]))); break;
        case 8: currentItemChanged((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< QTreeWidgetItem*(*)>(_a[2]))); break;
        case 9: itemSelectionChanged(); break;
        case 10: scrollToItem((*reinterpret_cast< const QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< QAbstractItemView::ScrollHint(*)>(_a[2]))); break;
        case 11: scrollToItem((*reinterpret_cast< const QTreeWidgetItem*(*)>(_a[1]))); break;
        case 12: expandItem((*reinterpret_cast< const QTreeWidgetItem*(*)>(_a[1]))); break;
        case 13: collapseItem((*reinterpret_cast< const QTreeWidgetItem*(*)>(_a[1]))); break;
        case 14: clear(); break;
        case 15: d_func()->_q_emitItemPressed((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 16: d_func()->_q_emitItemClicked((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 17: d_func()->_q_emitItemDoubleClicked((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 18: d_func()->_q_emitItemActivated((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 19: d_func()->_q_emitItemEntered((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 20: d_func()->_q_emitItemChanged((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 21: d_func()->_q_emitItemExpanded((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 22: d_func()->_q_emitItemCollapsed((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 23: d_func()->_q_emitCurrentItemChanged((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< const QModelIndex(*)>(_a[2]))); break;
        case 24: d_func()->_q_sort(); break;
        case 25: d_func()->_q_dataChanged((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< const QModelIndex(*)>(_a[2]))); break;
        case 26: d_func()->_q_itemsSorted(); break;
        case 27: d_func()->_q_selectionChanged((*reinterpret_cast< const QItemSelection(*)>(_a[1])),(*reinterpret_cast< const QItemSelection(*)>(_a[2]))); break;
        }
        _id -= 28;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< int*>(_v) = columnCount(); break;
        case 1: *reinterpret_cast< int*>(_v) = topLevelItemCount(); break;
        }
        _id -= 2;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setColumnCount(*reinterpret_cast< int*>(_v)); break;
        }
        _id -= 2;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 2;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}