double Instance::classValue() const { int classIndexValue = classIndex(); if (classIndexValue < 0) { throw "Class is not set!"; } return value(classIndexValue); }
bool Instance::classIsMissing() const { int classIndexValue = classIndex(); if (classIndexValue < 0) { throw "Class is not set!"; } return isMissing(classIndexValue); }
void Instance::setClassMissing() { int classIndexValue = classIndex(); if (classIndexValue < 0) { throw "Class is not set!"; } setMissing(classIndexValue); }
void ClassItem::dropEvent(QGraphicsSceneDragDropEvent *event) { qfLogFuncFrame(); QJsonDocument jsd = QJsonDocument::fromJson(event->mimeData()->text().toUtf8()); QVariantMap m = jsd.toVariant().toMap(); Qt::DropAction act = (m.isEmpty())? Qt::IgnoreAction: Qt::MoveAction; event->setDropAction(act); event->accept(); int slot1_ix = m.value(QStringLiteral("slotIndex"), -1).toInt(); int class1_ix = m.value(QStringLiteral("classIndex"), -1).toInt(); auto dt = data(); int slot2_ix = dt.startSlotIndex(); int class2_ix = dt.classIndex(); if(!m_dropInsertsBefore.toBool()) class2_ix++; qfDebug() << "DROP class:" << slot1_ix << class1_ix; ganttItem()->moveClassItem(slot1_ix, class1_ix, slot2_ix, class2_ix); m_dropInsertsBefore = QVariant(); update(); }