Exemplo n.º 1
0
void FontPointSizePropItem::setModelData(QWidget *propertyEditor, QAbstractItemModel *model, const QModelIndex &index)
{
    model->setData(index,qobject_cast<SpinBoxEditor*>(propertyEditor)->value());
    QFont font = object()->property(parent()->propertyName().toLatin1()).value<QFont>();
    font.setPointSize(propertyValue().toInt());
    setValueToObject(parent()->propertyName(),font);
}
Exemplo n.º 2
0
void FontFamilyPropItem::setModelData(QWidget *propertyEditor, QAbstractItemModel *model, const QModelIndex &index)
{
    QFont font = object()->property(parent()->propertyName().toLatin1()).value<QFont>();
//    font.setFamily(qobject_cast<QFontComboBox*>(propertyEditor)->currentFont().family());
    font.setFamily(qobject_cast<FontFamilyEditor*>(propertyEditor)->currentFont().family());
    model->setData(index,font);
    setValueToObject(parent()->propertyName(),font);
}
Exemplo n.º 3
0
void EnumPropItem::slotEnumChanged(const QString &text)
{
    if ( nameByType(object()->property(propertyName().toLatin1()).toInt())!=text){
        beginChangeValue();
        setPropertyValue(typeByName(text));
        setValueToObject(propertyName(),typeByName(text));
        endChangeValue();
    }
}
Exemplo n.º 4
0
void FontAttribPropItem::setModelData(QWidget *propertyEditor , QAbstractItemModel *model, const QModelIndex &index)
{
    model->setData(index,qobject_cast<CheckBoxEditor*>(propertyEditor)->isChecked());
    QFont font = object()->property(parent()->propertyName().toLatin1()).value<QFont>();
    if (propertyName()=="bold"){
        font.setBold(propertyValue().toBool());
    }
    if (propertyName()=="italic"){
        font.setItalic(propertyValue().toBool());
    }
    if (propertyName()=="underline"){
        font.setUnderline(propertyValue().toBool());
    }
    setValueToObject(parent()->propertyName(),font);
}
Exemplo n.º 5
0
void BoolPropItem::setModelData(QWidget *propertyEditor, QAbstractItemModel *model, const QModelIndex &index)
{
    model->setData(index,qobject_cast<CheckBoxEditor*>(propertyEditor)->isChecked());
    setValueToObject(propertyName(),propertyValue());
}
Exemplo n.º 6
0
void EnumPropItem::setModelData(QWidget *propertyEditor, QAbstractItemModel *model, const QModelIndex &index)
{
    setValueToObject(propertyName(),typeByName(qobject_cast<ComboBoxEditor*>(propertyEditor)->text()));
    model->setData(index,object()->property(propertyName().toLatin1()));
}
Exemplo n.º 7
0
void FontPropItem::setModelData(QWidget* propertyEditor, QAbstractItemModel* model, const QModelIndex &index)
{
    model->setData(index,qobject_cast<FontEditor*>(propertyEditor)->fontValue());
    setValueToObject(propertyName(),propertyValue());
}