Ejemplo n.º 1
0
int QtPropertyModel::rowCount(const QModelIndex & parent /* = QModelIndex() */) const
{
	int count = 0;

	QtPropertyData *data = itemFromIndexInternal(parent);
	if(NULL != data)
	{
		count = data->ChildCount();
	}

	return count;
}
Ejemplo n.º 2
0
QModelIndex QtPropertyModel::index(int row, int column, const QModelIndex & parent /* = QModelIndex() */) const
{
	QModelIndex ret;

	QtPropertyData *data = itemFromIndexInternal(parent);
	if((NULL != data) &&
		(row >= 0) &&
		(column >= 0) &&
		(row < data->ChildCount()) &&
		(column < 2))
	{
		ret = createIndex(row, column, data);
	}

	return ret;
}