QVariant TaskContextMenuModel::data(const QModelIndex &index, int role) const
{
    if (index.row() < 0 || index.row() >= rowCount(QModelIndex()))
        return QVariant();

    if (index.row() < rowOffset())
        return staticData(static_cast<OptionType>(index.row()), role);

    const int tagRow = index.row() - rowOffset();
    QAbstractItemModel *tagModel = m_task->checkableTagModel();
    if (tagRow < 0 || tagRow >= tagModel->rowCount()) {
        qWarning() << "TaskContextMenuModel: invalid index" << tagRow;
        return QVariant();
    }

    QModelIndex tagIndex = tagModel->index(tagRow, 0);

    switch (role) {
    case TextRole:
        return tagIndex.data(CheckableTagModel::ItemTextRole);
    case IconRole:
        return "";
    case CheckableRole:
        return true;
    case DismissRole:
        return false;
    case Qt::CheckStateRole:
        return tagIndex.data(Qt::CheckStateRole);
    }

    return QVariant();
}
示例#2
0
StdUInt testlist::Parent::getNumFreeParents()  { return staticData().NumFreeParents; }
示例#3
0
Void testlist::Parent::setFirstFreeParent(const Parent & value)  {
    staticData().FirstFreeParent = value.id();
}
示例#4
0
Void testhash::Parent::setChildTableUsed(StdUInt value)  {
    staticData().ChildTableUsed = value;
}
示例#5
0
Void simplest::Simple::setUsed(StdUInt value)  {
    staticData().Used = value;
}
示例#6
0
Void simplest::Simple::setNumFreeSimples(StdUInt value)  {
    staticData().NumFreeSimples = value;
}
示例#7
0
Void simplest::Simple::setFirstFreeSimple(const Simple & value)  {
    staticData().FirstFreeSimple = value.id();
}
示例#8
0
Void testlist::Parent::setUsed(StdUInt value)  {
    staticData().Used = value;
}
示例#9
0
Void testlist::Child::setFirstFreeChild(const Child & value)  {
    staticData().FirstFreeChild = value.id();
}
示例#10
0
testlist::Child testlist::Child::getFirstFreeChild()  { return Child(staticData().FirstFreeChild); }
示例#11
0
Void testhash::Parent::setNum__ChildTableBlock__Parents(StdUInt value)  {
    staticData().Num__ChildTableBlock__Parents = value;
}
示例#12
0
StdUInt testhash::Parent::getNum__ChildTableBlock__Parents()  { return staticData().Num__ChildTableBlock__Parents; }
示例#13
0
Void testhash::Parent::setLast__ChildTableBlock__Parent(const Parent & value)  {
    staticData().Last__ChildTableBlock__Parent = value.id();
}
示例#14
0
testhash::Parent testhash::Parent::getLast__ChildTableBlock__Parent()  { return Parent(staticData().Last__ChildTableBlock__Parent); }
示例#15
0
Void testlist::Parent::setNumFreeParents(StdUInt value)  {
    staticData().NumFreeParents = value;
}
示例#16
0
StdUInt testlist::Child::getNumFreeChilds()  { return staticData().NumFreeChilds; }
示例#17
0
StdUInt testlist::Parent::getUsed()  { return staticData().Used; }
示例#18
0
Void testlist::Child::setNumFreeChilds(StdUInt value)  {
    staticData().NumFreeChilds = value;
}
示例#19
0
simplest::Simple simplest::Simple::getFirstFreeSimple()  {
    return Simple(staticData().FirstFreeSimple);
}
示例#20
0
StdUInt testlist::Child::getUsed()  { return staticData().Used; }
示例#21
0
StdUInt simplest::Simple::getNumFreeSimples()  {
    return staticData().NumFreeSimples;
}
示例#22
0
Void testlist::Child::setUsed(StdUInt value)  {
    staticData().Used = value;
}
示例#23
0
StdUInt simplest::Simple::getUsed()  {
    return staticData().Used;
}
示例#24
0
testlist::Parent testlist::Parent::getFirstFreeParent()  { return Parent(staticData().FirstFreeParent); }
示例#25
0
bool XMLHttpRequest::isAllowedHTTPHeader(const String& name)
{
    return !staticData().m_forbiddenRequestHeaders.contains(name) && !name.startsWith(staticData().m_proxyHeaderPrefix, false)
        && !name.startsWith(staticData().m_secHeaderPrefix, false);
}
示例#26
0
StdUInt testhash::Parent::getChildTableUsed()  { return staticData().ChildTableUsed; }