rtError pxText::setFont(rtObjectRef o) { mFont = NULL; mFontLoaded = false; mFontFailed = false; createNewPromise(); removeResourceListener(); if (o){ rtString desc; rtError err = o.sendReturns<rtString>("description", desc); if (err == RT_OK && desc.compare("pxFont") == 0) { mFont = o; } } if(getFontResource() == NULL) { resourceReady("reject"); } mListenerAdded = true; if (getFontResource() != NULL) { getFontResource()->addListener(this); } return RT_OK; }
void GoodsDialog::setSibModel(SibModel *sibModel) { this->sibModel = sibModel; connect(sibModel, SIGNAL(resourceReady(std::string)), this, SLOT(on_resourceReady(std::string))); sibModel->fetch(); }
void pxText::onInit() { mInitialized = true; if( getFontResource() != NULL && getFontResource()->isFontLoaded()) { resourceReady("resolve"); } }