本文整理汇总了C++中app::Color::setPackedValue方法的典型用法代码示例。如果您正苦于以下问题:C++ Color::setPackedValue方法的具体用法?C++ Color::setPackedValue怎么用?C++ Color::setPackedValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app::Color
的用法示例。
在下文中一共展示了Color::setPackedValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getSelectColor
QColor QGIView::getSelectColor()
{
Base::Reference<ParameterGrp> hGrp = getParmGroupCol();
App::Color fcColor;
fcColor.setPackedValue(hGrp->GetUnsigned("SelectColor", 0x00FF0000));
m_colSel = fcColor.asValue<QColor>();
return m_colSel;
}
示例2: getBackgroundColor
QColor QGVPage::getBackgroundColor()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
App::Color fcColor;
fcColor.setPackedValue(hGrp->GetUnsigned("Background", 0x70707000));
return fcColor.asValue<QColor>();
}
示例3: setPyObject
void PropertyColor::setPyObject(PyObject *value)
{
App::Color cCol;
if (PyTuple_Check(value) && PyTuple_Size(value) == 3) {
PyObject* item;
item = PyTuple_GetItem(value,0);
if (PyFloat_Check(item))
cCol.r = (float)PyFloat_AsDouble(item);
else
throw Base::Exception("Type in tuple must be float");
item = PyTuple_GetItem(value,1);
if (PyFloat_Check(item))
cCol.g = (float)PyFloat_AsDouble(item);
else
throw Base::Exception("Type in tuple must be float");
item = PyTuple_GetItem(value,2);
if (PyFloat_Check(item))
cCol.b = (float)PyFloat_AsDouble(item);
else
throw Base::Exception("Type in tuple must be float");
}
else if (PyTuple_Check(value) && PyTuple_Size(value) == 4) {
PyObject* item;
item = PyTuple_GetItem(value,0);
if (PyFloat_Check(item))
cCol.r = (float)PyFloat_AsDouble(item);
else
throw Base::Exception("Type in tuple must be float");
item = PyTuple_GetItem(value,1);
if (PyFloat_Check(item))
cCol.g = (float)PyFloat_AsDouble(item);
else
throw Base::Exception("Type in tuple must be float");
item = PyTuple_GetItem(value,2);
if (PyFloat_Check(item))
cCol.b = (float)PyFloat_AsDouble(item);
else
throw Base::Exception("Type in tuple must be float");
item = PyTuple_GetItem(value,3);
if (PyFloat_Check(item))
cCol.a = (float)PyFloat_AsDouble(item);
else
throw Base::Exception("Type in tuple must be float");
}
else if (PyLong_Check(value)) {
cCol.setPackedValue(PyLong_AsUnsignedLong(value));
}
else {
std::string error = std::string("type must be int or tuple of float, not ");
error += value->ob_type->tp_name;
throw Py::TypeError(error);
}
setValue( cCol );
}
示例4: decodeColor
App::Color Cell::decodeColor(const std::string & color, const App::Color & defaultColor)
{
if (color.size() == 7 || color.size() == 9) {
App::Color c;
if (color[0] != '#')
return defaultColor;
unsigned int value = strtoul(color.c_str() + 1, 0, 16);
if (color.size() == 7)
value = (value << 8) | 0xff;
c.setPackedValue(value);
return c;
}
else
return defaultColor;
}
示例5: getNormalColor
QColor QGCustomText::getNormalColor()
{
QColor result;
QGIView *parent;
QGraphicsItem* qparent = parentItem();
if (qparent == nullptr) {
parent = nullptr;
} else {
parent = dynamic_cast<QGIView *> (qparent);
}
if (parent != nullptr) {
result = parent->getNormalColor();
} else {
Base::Reference<ParameterGrp> hGrp = getParmGroup();
App::Color fcColor;
fcColor.setPackedValue(hGrp->GetUnsigned("NormalColor", 0x00000000));
result = fcColor.asValue<QColor>();
}
return result;
}