本文整理汇总了C++中kjs::Value::toUInt32方法的典型用法代码示例。如果您正苦于以下问题:C++ Value::toUInt32方法的具体用法?C++ Value::toUInt32怎么用?C++ Value::toUInt32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kjs::Value
的用法示例。
在下文中一共展示了Value::toUInt32方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setLineStyle
void KstBindCubicBezier::setLineStyle(KJS::ExecState *exec, const KJS::Value& value) {
unsigned w = 0;
if (value.type() != KJS::NumberType || !value.toUInt32(w)) {
KJS::Object eobj = KJS::Error::create(exec, KJS::TypeError);
exec->setException(eobj);
return;
}
KstViewBezierPtr d = makeBezier(_d);
if (d) {
KstWriteLocker wl(d);
switch (w) {
case 0:
d->setPenStyle(Qt::SolidLine);
break;
case 1:
d->setPenStyle(Qt::DashLine);
break;
case 2:
d->setPenStyle(Qt::DotLine);
break;
case 3:
d->setPenStyle(Qt::DashDotLine);
break;
case 4:
d->setPenStyle(Qt::DashDotDotLine);
break;
default:
return;
}
KstApp::inst()->paintAll(P_PAINT);
}
}
示例2: setW
void KstBindSize::setW(KJS::ExecState *exec, const KJS::Value& value) {
unsigned int w = 0;
if (value.type() != KJS::NumberType || !value.toUInt32(w)) {
KJS::Object eobj = KJS::Error::create(exec, KJS::TypeError);
exec->setException(eobj);
return;
}
_sz.setWidth(w);
}
示例3: setOutput
void KstBindTimeInterpretation::setOutput(KJS::ExecState *exec, const KJS::Value& value) {
if (!_d) {
KJS::Object eobj = KJS::Error::create(exec, KJS::GeneralError);
exec->setException(eobj);
return;
}
unsigned i = 0;
if (value.type() != KJS::NumberType || !value.toUInt32(i)) {
KJS::Object eobj = KJS::Error::create(exec, KJS::TypeError);
exec->setException(eobj);
return;
}
KstWriteLocker wl(_d->_d);
bool isIt;
KstAxisInterpretation interp;
KstAxisDisplay disp, newDisp;
switch (i) {
default:
case 0:
newDisp = AXIS_DISPLAY_DDMMYYHHMMSS_SS;
break;
case 1:
newDisp = AXIS_DISPLAY_YYMMDDHHMMSS_SS;
break;
case 2:
newDisp = AXIS_DISPLAY_JD;
break;
case 3:
newDisp = AXIS_DISPLAY_MJD;
break;
case 4:
newDisp = AXIS_DISPLAY_RJD;
break;
case 5:
newDisp = AXIS_DISPLAY_YEAR;
break;
case 6:
newDisp = AXIS_DISPLAY_KDE_SHORTDATE;
break;
case 7:
newDisp = AXIS_DISPLAY_KDE_LONGDATE;
break;
}
if (_d->_xAxis) {
_d->_d->getXAxisInterpretation(isIt, interp, disp);
_d->_d->setXAxisInterpretation(isIt, interp, newDisp);
} else {
_d->_d->getYAxisInterpretation(isIt, interp, disp);
_d->_d->setYAxisInterpretation(isIt, interp, newDisp);
}
_d->_d->setDirty();
KstApp::inst()->paintAll(KstPainter::P_PAINT);
}
示例4: setLength
void KstBindPowerSpectrum::setLength(KJS::ExecState *exec, const KJS::Value& value) {
unsigned val;
if (value.type() != KJS::NumberType || !value.toUInt32(val)) {
KJS::Object eobj = KJS::Error::create(exec, KJS::TypeError);
exec->setException(eobj);
return;
}
KstPSDPtr d = makePSD(_d);
if (d) {
KstWriteLocker wl(d);
d->setLen(val);
}
}
示例5: setBorderWidth
void KstBindEllipse::setBorderWidth(KJS::ExecState *exec, const KJS::Value& value) {
unsigned w = 0;
if (value.type() != KJS::NumberType || !value.toUInt32(w)) {
KJS::Object eobj = KJS::Error::create(exec, KJS::TypeError);
exec->setException(eobj);
return;
}
KstViewEllipsePtr d = makeEllipse(_d);
if (d) {
KstWriteLocker wl(d);
d->setBorderWidth(w);
KstApp::inst()->paintAll(KstPainter::P_PAINT);
}
}