Ejemplo n.º 1
0
void QDeclarativeVMEMetaObject::registerInterceptor(int index, int valueIndex, QDeclarativePropertyValueInterceptor *interceptor)
{
    if (aInterceptors.isEmpty())
        aInterceptors.resize(propertyCount() + metaData->propertyCount);
    aInterceptors.setBit(index);
    interceptors.insert(index, qMakePair(valueIndex, interceptor));
}
bool StylePropertySet::hasFailedOrCanceledSubresources() const
{
    unsigned size = propertyCount();
    for (unsigned i = 0; i < size; ++i) {
        if (propertyAt(i).value()->hasFailedOrCanceledSubresources())
            return true;
    }
    return false;
}
QString AbstractPropertyGroup::toString() const
{
	QString text = QString(QLatin1Char('['));
	for (int i=0; i<propertyCount(); ++i) {
		if (i)
			text += QLatin1String(", ");
		text += propertyAt(i)->toString();
	}
	text += QLatin1Char(']');
	return text;
}
Ejemplo n.º 4
0
QVariantMap qobject2qvariant(const T* object)
{
    QVariantMap map;
    auto metaObject = T::staticMetaObject;
    for(int i = metaObject.propertyOffset(); i < metaObject.propertyCount(); ++i) {
        QMetaProperty prop = metaObject.property(i);
        map.insert(QString::fromLatin1(prop.name()), prop.readOnGadget(object));
    }

    return map;
}
Ejemplo n.º 5
0
void getMeta(const QObject* object, QTextStream& output) {
    const auto metaObject = object->metaObject();
    // properties
    const auto propertyCount = metaObject->propertyCount();
    for (int i = 0; i < propertyCount; i++) {
        const auto property = metaObject->property(i);

        if (QString(property.typeName()).endsWith("*")) {
            const auto propertyObject = object->property(property.name());
            getMeta(qvariant_cast<QObject*>(propertyObject), output);
            output << "Object" << " "
            << property.typeName() << " "
            << qPrintable(QString(metaObject->className()) + "::" + property.name())
            << endl;
        } else {
            output << "Property" << " "
            << property.typeName() << " "
            << qPrintable(QString(metaObject->className()) + "::" + property.name())
            << endl;
        }
    }

    // methods
    const auto methodCount = metaObject->methodCount();
    for (int i = 0; i < methodCount; i++) {
        const auto method = metaObject->method(i);
        switch (method.methodType()) {
            case QMetaMethod::Slot: {
                if (method.access() == QMetaMethod::Public) {
                    output << "Slot" << " "
                    << method.typeName() << " "
                    << qPrintable(QString(metaObject->className()) + "::" + method.methodSignature().constData())
                    << endl;
                }
                break;
            }
            case QMetaMethod::Signal: {
                output << "Signal" << " "
                << method.typeName() << " "
                << qPrintable(QString(metaObject->className()) + "::" + method.methodSignature().constData())
                << endl;
                break;
            }
            default: {

            }
        }
    }
}
Ejemplo n.º 6
0
VkExtent3D SparseImagePageManager::CalculateExtent2D( VkPhysicalDevice device, VkDeviceSize granularityInBytes, VkFormat format ) {
    VkSparseImageFormatProperties	properties;
    uint32_t						propertyCount( 1u );

    vkGetPhysicalDeviceSparseImageFormatProperties( device,
            format,
            VkImageType::VK_IMAGE_TYPE_2D,
            VkSampleCountFlagBits::VK_SAMPLE_COUNT_1_BIT,
            VkImageUsageFlagBits::VK_IMAGE_USAGE_SAMPLED_BIT,
            VkImageTiling::VK_IMAGE_TILING_OPTIMAL,
            &propertyCount,
            &properties );

    return properties.imageGranularity;
}
Ejemplo n.º 7
0
void Settings::SingleObjectPropertiesReadWrite(const Settings::Action action,
                                               QObject *qobject_p, const QStringList &properties)
{
const QPointer<QObject> qo_qp(qobject_p);
    if (qo_qp) {
        // Static object properties
        const auto qmetaobject_p = qo_qp->metaObject();
        for (auto i = 0; i < (qmetaobject_p->propertyCount() - 1); ++i) {
            const QString property_name(qmetaobject_p->property(i).name());
            if (TRUE != property_name.isEmpty()) {
                const auto property = qmetaobject_p->property(i);
                if (property.isWritable() && (property.isUser() || properties.contains(property_name))) {
                    if (READ == action) {
                        property.write(qo_qp.data(), value(property_name));
                    } else if (WRITE == action) {
                        const QVariant property_value(property.read(qobject_p));
                        if (property_value.isValid()) {
                            setValue(property_name, property_value);
                        }
                    } else { D_ASSERT(FALSE); }
                }
            }
        }
        // Dynamic object properties
        foreach (const auto &property_name, qo_qp->dynamicPropertyNames()) {
            //if (properties.contains(property_name.constData())) {
                if (READ == action) {
                    qo_qp->setProperty(property_name.constData(), value(QString(property_name)));
                } else if (WRITE == action) {
                    const QVariant property_value(qo_qp->property(property_name.constData()));
                    if (property_value.isValid()) {
                        setValue(property_name, property_value);
                    }
                } else { D_ASSERT(FALSE); }
            //}
        }
    }
}
Ejemplo n.º 8
0
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
bool MetaObject::removeProperty(size_t index) {
	if ( index >= propertyCount() ) return false;

	_properties.erase(_properties.begin() + index);
	return true;
}
Ejemplo n.º 9
0
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
const MetaProperty *MetaObject::property(size_t index) const {
	if ( index >= propertyCount() ) return NULL;
	return _properties[index].get();
}