本文整理汇总了C++中Folder::filesModel方法的典型用法代码示例。如果您正苦于以下问题:C++ Folder::filesModel方法的具体用法?C++ Folder::filesModel怎么用?C++ Folder::filesModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Folder
的用法示例。
在下文中一共展示了Folder::filesModel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Folder
AbstractXmlItemObject * FoldersModel::newItem()
{
Folder *newItem = new Folder(this);
connect(newItem, SIGNAL(idChanged()), this, SLOT(itemDataChanged()));
connect(newItem, SIGNAL(additionalDataChanged()), this, SLOT(itemDataChanged()));
connect(newItem, SIGNAL(nameChanged()), this, SLOT(itemDataChanged()));
newItem->filesModel()->setItemAdditionalData(m_fileAdditionalData);
return newItem;
}
示例2: setFileAdditionalData
void FoldersModel::setFileAdditionalData(QQmlComponent *fileAdditionalData)
{
if (m_fileAdditionalData != fileAdditionalData) {
m_fileAdditionalData = fileAdditionalData;
//Установим новые дополнительные данные для всех существующих объектов
for (int i = 0; i < rowCount(); i++) {
Folder *folder = qobject_cast<Folder* >(get(i));
if (folder)
folder->filesModel()->setItemAdditionalData(fileAdditionalData);
}
emit fileAdditionalDataChanged();
}
}
示例3: data
QVariant FoldersModel::data(const QModelIndex &index, int role) const
{
Folder * item = qobject_cast<Folder *>(get(index.row()));
if (!item)
return QVariant();
switch (role) {
case Id:
return item->id();
break;
case Name:
return item->name();
break;
case AdditionalData:
return QVariant::fromValue(item->additionalData());
break;
case FilesModel:
return QVariant::fromValue(item->filesModel());
break;
}
return QVariant();
}