当前位置: 首页>>代码示例>>C++>>正文


C++ QDesignerFormEditorInterface::setGradientManager方法代码示例

本文整理汇总了C++中QDesignerFormEditorInterface::setGradientManager方法的典型用法代码示例。如果您正苦于以下问题:C++ QDesignerFormEditorInterface::setGradientManager方法的具体用法?C++ QDesignerFormEditorInterface::setGradientManager怎么用?C++ QDesignerFormEditorInterface::setGradientManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QDesignerFormEditorInterface的用法示例。


在下文中一共展示了QDesignerFormEditorInterface::setGradientManager方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: initialize

void QDesignerIntegrationPrivate::initialize()
{
    typedef void (QDesignerIntegration::*QDesignerIntegrationUpdatePropertySlot3)(const QString &, const QVariant &, bool);

    //
    // integrate the `Form Editor component'
    //

    // Extensions
    QDesignerFormEditorInterface *core = q->core();
    if (QDesignerPropertyEditor *designerPropertyEditor= qobject_cast<QDesignerPropertyEditor *>(core->propertyEditor())) {
        QObject::connect(designerPropertyEditor, &QDesignerPropertyEditor::propertyValueChanged,
                         q, static_cast<QDesignerIntegrationUpdatePropertySlot3>(&QDesignerIntegration::updateProperty));
        QObject::connect(designerPropertyEditor, &QDesignerPropertyEditor::resetProperty,
                         q, &QDesignerIntegration::resetProperty);
        QObject::connect(designerPropertyEditor, &QDesignerPropertyEditor::addDynamicProperty,
                q, &QDesignerIntegration::addDynamicProperty);
        QObject::connect(designerPropertyEditor, &QDesignerPropertyEditor::removeDynamicProperty,
                q, &QDesignerIntegration::removeDynamicProperty);
    } else {
        QObject::connect(core->propertyEditor(), SIGNAL(propertyChanged(QString,QVariant)),
                q, SLOT(updatePropertyPrivate(QString,QVariant))); // ### fixme: VS Integration leftover?
    }

    QObject::connect(core->formWindowManager(), &QDesignerFormWindowManagerInterface::formWindowAdded,
            q, &QDesignerIntegrationInterface::setupFormWindow);

    QObject::connect(core->formWindowManager(), &QDesignerFormWindowManagerInterface::activeFormWindowChanged,
            q, &QDesignerIntegrationInterface::updateActiveFormWindow);

    m_gradientManager = new QtGradientManager(q);
    core->setGradientManager(m_gradientManager);

    QString designerFolder = QDir::homePath();
    designerFolder += QDir::separator();
    designerFolder += QStringLiteral(".designer");
    m_gradientsPath = designerFolder;
    m_gradientsPath += QDir::separator();
    m_gradientsPath += QStringLiteral("gradients.xml");

    QFile f(m_gradientsPath);
    if (f.open(QIODevice::ReadOnly)) {
        QtGradientUtils::restoreState(m_gradientManager, QString::fromLatin1(f.readAll()));
        f.close();
    } else {
        QFile defaultGradients(QStringLiteral(":/qt-project.org/designer/defaultgradients.xml"));
        if (defaultGradients.open(QIODevice::ReadOnly)) {
            QtGradientUtils::restoreState(m_gradientManager, QString::fromLatin1(defaultGradients.readAll()));
            defaultGradients.close();
        }
    }

    if (WidgetDataBase *widgetDataBase = qobject_cast<WidgetDataBase*>(core->widgetDataBase()))
        widgetDataBase->grabStandardWidgetBoxIcons();
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:55,代码来源:abstractintegration.cpp


注:本文中的QDesignerFormEditorInterface::setGradientManager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。