void Dashboard::addCardItem(CardItem *card_item){ card_item->filter(filter); if(ClientInstance->getStatus() == Client::Playing) card_item->setEnabled(card_item->getFilteredCard()->isAvailable(Self)); else{ card_item->setEnabled(true); card_item->setEnabled(false); } card_item->setPos(mapFromScene(card_item->pos())); card_item->setParentItem(this); card_item->setRotation(0.0); card_item->setFlags(ItemIsFocusable); card_item->setZValue(0.1); card_items << card_item; connect(card_item, SIGNAL(clicked()), this, SLOT(onCardItemClicked())); connect(card_item, SIGNAL(thrown()), this, SLOT(onCardItemThrown())); connect(card_item, SIGNAL(enter_hover()), this, SLOT(onCardItemHover())); connect(card_item, SIGNAL(leave_hover()), this, SLOT(onCardItemLeaveHover())); sortCards(sort_type); handcard_num->setText(QString::number(Self->getHandcardNum())); //handcard_num->parentItem()->show(); }
void Dashboard::addCardItem(CardItem *card_item){ if(ClientInstance->getStatus() == Client::Playing) card_item->setEnabled(card_item->getCard()->isAvailable()); else card_item->setEnabled(false); card_item->setPos(mapFromScene(card_item->pos())); card_item->setParentItem(this); card_item->setRotation(0.0); card_item->setFlags(ItemIsFocusable); card_items << card_item; connect(card_item, SIGNAL(clicked()), this, SLOT(onCardItemClicked())); connect(card_item, SIGNAL(thrown()), this, SLOT(onCardItemThrown())); sortCards(); handcard_num->setText(QString::number(Self->getHandcardNum())); handcard_num->parentItem()->show(); }
void ThrowExceptionObject(JSContext* aCx, Exception* aException) { JS::Rooted<JS::Value> thrown(aCx); // If we stored the original thrown JS value in the exception // (see XPCConvert::ConstructException) and we are in a web context // (i.e., not chrome), rethrow the original value. This only applies to JS // implemented components so we only need to check for this on the main // thread. if (NS_IsMainThread() && !nsContentUtils::IsCallerChrome() && aException->StealJSVal(thrown.address())) { // Now check for the case when thrown is a number which matches // aException->GetResult(). This would indicate that what actually got // thrown was an nsresult value. In that situation, we should go back // through dom::Throw with that nsresult value, because it will make sure to // create the right sort of Exception or DOMException, with the right // global. if (thrown.isNumber()) { nsresult exceptionResult; if (NS_SUCCEEDED(aException->GetResult(&exceptionResult)) && double(exceptionResult) == thrown.toNumber()) { Throw(aCx, exceptionResult); return; } } if (!JS_WrapValue(aCx, &thrown)) { return; } ThrowExceptionValueIfSafe(aCx, thrown, aException); return; } if (!GetOrCreateDOMReflector(aCx, aException, &thrown)) { return; } ThrowExceptionValueIfSafe(aCx, thrown, aException); }
void CardItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event){ if(parentItem() && y() < -80) emit thrown(); goBack(); }
thrower() { throw thrown(); }