当前位置: 首页>>代码示例>>C++>>正文


C++ EsmFile::fileName方法代码示例

本文整理汇总了C++中EsmFile::fileName方法的典型用法代码示例。如果您正苦于以下问题:C++ EsmFile::fileName方法的具体用法?C++ EsmFile::fileName怎么用?C++ EsmFile::fileName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EsmFile的用法示例。


在下文中一共展示了EsmFile::fileName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: flags

Qt::ItemFlags DataFilesModel::flags(const QModelIndex &index) const
{
    if (!index.isValid())
        return Qt::NoItemFlags;

    EsmFile *file = item(index.row());

    if (!file)
        return Qt::NoItemFlags;

    if (mAvailableFiles.contains(file->fileName())) {
        if (index.column() == 0) {
            return Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable;
        } else {
            return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
        }
    } else {
        if (index.column() == 0) {
            return Qt::ItemIsUserCheckable | Qt::ItemIsSelectable;
        } else {
            return Qt::NoItemFlags | Qt::ItemIsSelectable;
        }
    }

}
开发者ID:JordanMilne,项目名称:openmw,代码行数:25,代码来源:datafilesmodel.cpp

示例2: uncheckedItems

QStringList DataFilesModel::uncheckedItems()
{
    QStringList list;
    QStringList checked = checkedItems();

    QList<EsmFile *>::ConstIterator it;
    QList<EsmFile *>::ConstIterator itEnd = mFiles.constEnd();

    int i = 0;
    for (it = mFiles.constBegin(); it != itEnd; ++it) {
        EsmFile *file = item(i);
        ++i;

        // Add the items that are not in the checked list
        if (!checked.contains(file->fileName()))
            list << file->fileName();
    }

    return list;
}
开发者ID:JordanMilne,项目名称:openmw,代码行数:20,代码来源:datafilesmodel.cpp

示例3: findItem

EsmFile* DataFilesModel::findItem(const QString &name)
{
    QList<EsmFile *>::ConstIterator it;
    QList<EsmFile *>::ConstIterator itEnd = mFiles.constEnd();

    int i = 0;
    for (it = mFiles.constBegin(); it != itEnd; ++it) {
        EsmFile *file = item(i);
        ++i;

        if (name == file->fileName())
            return file;
    }

    // Not found
    return 0;
}
开发者ID:JordanMilne,项目名称:openmw,代码行数:17,代码来源:datafilesmodel.cpp

示例4: checkedItemsPaths

QStringList DataFilesModel::checkedItemsPaths()
{
    QStringList list;

    QList<EsmFile *>::ConstIterator it;
    QList<EsmFile *>::ConstIterator itEnd = mFiles.constEnd();

    int i = 0;
    for (it = mFiles.constBegin(); it != itEnd; ++it) {
        EsmFile *file = item(i);
        ++i;

        if (mCheckStates[file->fileName()] == Qt::Checked && canBeChecked(file))
            list << file->path();
    }

    return list;
}
开发者ID:Adrian-Revk,项目名称:openmw,代码行数:18,代码来源:datafilesmodel.cpp

示例5: checkedItems

QStringList DataFilesModel::checkedItems()
{
    QStringList list;

    QList<EsmFile *>::ConstIterator it;
    QList<EsmFile *>::ConstIterator itEnd = mFiles.constEnd();

    int i = 0;
    for (it = mFiles.constBegin(); it != itEnd; ++it) {
        EsmFile *file = item(i);
        ++i;

        QString name = file->fileName();

        // Only add the items that are in the checked list and available
        if (mCheckStates[name] == Qt::Checked && mAvailableFiles.contains(name))
            list << name;
    }

    return list;
}
开发者ID:JordanMilne,项目名称:openmw,代码行数:21,代码来源:datafilesmodel.cpp

示例6: data

QVariant DataFilesModel::data(const QModelIndex &index, int role) const
{
    if (!index.isValid())
        return QVariant();

    EsmFile *file = item(index.row());

    if (!file)
        return QVariant();

    const int column = index.column();

    switch (role) {
    case Qt::DisplayRole: {

        switch (column) {
        case 0:
            return file->fileName();
        case 1:
            return file->author();
        case 2:
            return QString("%1 kB").arg(int((file->size() + 1023) / 1024));
        case 3:
            //return file->modified().toString(Qt::TextDate);
            return file->modified().toString(Qt::ISODate);
        case 4:
            return file->accessed().toString(Qt::TextDate);
        case 5:
            return file->version();
        case 6:
            return file->path();
        case 7:
            return file->masters().join(", ");
        case 8:
            return file->description();
        }
    }

    case Qt::TextAlignmentRole: {
        switch (column) {
        case 0:
        case 1:
            return Qt::AlignLeft + Qt::AlignVCenter;
        case 2:
        case 3:
        case 4:
        case 5:
            return Qt::AlignRight + Qt::AlignVCenter;
        default:
            return Qt::AlignLeft + Qt::AlignVCenter;
        }
    }

    case Qt::CheckStateRole: {
        if (column != 0)
            return QVariant();
        return mCheckStates[file->fileName()];
    }
    case Qt::ToolTipRole:
    {
        if (column != 0)
            return QVariant();

        if (file->version() == 0.0f)
            return QVariant(); // Data not set

        QString tooltip =
                QString("<b>Author:</b> %1<br/> \
                        <b>Version:</b> %2<br/> \
                        <br/><b>Description:</b><br/>%3<br/> \
                        <br/><b>Dependencies: </b>%4<br/>")
                        .arg(file->author())
                        .arg(QString::number(file->version()))
                        .arg(file->description())
                        .arg(file->masters().join(", "));


        return tooltip;

    }
    default:
        return QVariant();
    }

}
开发者ID:JordanMilne,项目名称:openmw,代码行数:85,代码来源:datafilesmodel.cpp

示例7: checkState

Qt::CheckState DataFilesModel::checkState(const QModelIndex &index)
{
    EsmFile *file = item(index.row());
    return mCheckStates[file->fileName()];
}
开发者ID:JordanMilne,项目名称:openmw,代码行数:5,代码来源:datafilesmodel.cpp


注:本文中的EsmFile::fileName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。