KstObjectItem::KstObjectItem(QListView *parent, KstDataObjectPtr x, KstDataManagerI *dm, int localUseCount) : QObject(), QListViewItem(parent), _rtti(RTTI_OBJ_OBJECT), _tag(x->tag()), _dm(dm) { assert(x); _inUse = false; setText(0, x->tag().tag()); for (KstVectorMap::Iterator i = x->outputVectors().begin(); i != x->outputVectors().end(); ++i) { KstObjectItem *item = new KstObjectItem(this, i.data(), _dm); connect(item, SIGNAL(updated()), this, SIGNAL(updated())); } for (KstMatrixMap::Iterator i = x->outputMatrices().begin(); i != x->outputMatrices().end(); ++i) { KstObjectItem *item = new KstObjectItem(this, i.data(), _dm); connect(item, SIGNAL(updated()), this, SIGNAL(updated())); } x = 0L; // keep the counts in sync update(false, localUseCount); }
void KstObjectItem::activateHint(int id) { KstDataObjectPtr d = dataObject(); const KstCurveHintList* hints = d->curveHints(); int cnt = 0; for (KstCurveHintList::ConstIterator i = hints->begin(); i != hints->end(); ++i) { if (cnt == id) { KstBaseCurvePtr c = (*i)->makeCurve(KST::suggestCurveName(d->tag(), false), KstColorSequence::next()); if (c) { KST::dataObjectList.lock().writeLock(); KST::dataObjectList.append(c.data()); KST::dataObjectList.lock().unlock(); emit updated(); } else { KMessageBox::sorry(KstApp::inst(), i18n("Unable to create quick curve.")); } break; } ++cnt; } }