Fix warning "using-directive shall not be used.".
--HG-- branch : develop
This commit is contained in:
parent
bba88c108f
commit
5153e997d1
|
@ -37,22 +37,20 @@
|
||||||
|
|
||||||
enum class ChildType : char {Invalid = 0, Value = 1, Formula = 2};
|
enum class ChildType : char {Invalid = 0, Value = 1, Formula = 2};
|
||||||
|
|
||||||
using namespace VPE;
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VFormulaProperty::VFormulaProperty(const QString &name)
|
VFormulaProperty::VFormulaProperty(const QString &name)
|
||||||
: VProperty(name, static_cast<QVariant::Type>(VFormula::FormulaTypeId()))
|
: VProperty(name, static_cast<QVariant::Type>(VFormula::FormulaTypeId()))
|
||||||
{
|
{
|
||||||
d_ptr->type = Property::Complex;
|
d_ptr->type = VPE::Property::Complex;
|
||||||
|
|
||||||
VStringProperty* tmpValue = new VStringProperty(tr("Value"));
|
VPE::VStringProperty* tmpValue = new VPE::VStringProperty(tr("Value"));
|
||||||
addChild(tmpValue);
|
addChild(tmpValue);
|
||||||
tmpValue->setUpdateBehaviour(true, false);
|
tmpValue->setUpdateBehaviour(true, false);
|
||||||
tmpValue->setReadOnly(true);
|
tmpValue->setReadOnly(true);
|
||||||
tmpValue->setOsSeparator(qApp->Settings()->GetOsSeparator());
|
tmpValue->setOsSeparator(qApp->Settings()->GetOsSeparator());
|
||||||
tmpValue->setTypeForParent(static_cast<int>(ChildType::Value));
|
tmpValue->setTypeForParent(static_cast<int>(ChildType::Value));
|
||||||
|
|
||||||
VStringProperty* tmpFormula = new VStringProperty(tr("Formula"));
|
VPE::VStringProperty* tmpFormula = new VPE::VStringProperty(tr("Formula"));
|
||||||
addChild(tmpFormula);
|
addChild(tmpFormula);
|
||||||
tmpFormula->setClearButtonEnable(true);
|
tmpFormula->setClearButtonEnable(true);
|
||||||
tmpFormula->setUpdateBehaviour(true, false);
|
tmpFormula->setUpdateBehaviour(true, false);
|
||||||
|
@ -143,7 +141,7 @@ QString VFormulaProperty::type() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VProperty *VFormulaProperty::clone(bool include_children, VProperty *container) const
|
VPE::VProperty *VFormulaProperty::clone(bool include_children, VProperty *container) const
|
||||||
{
|
{
|
||||||
if (!container)
|
if (!container)
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,8 +39,6 @@
|
||||||
#include "../vpropertyexplorer/vproperty.h"
|
#include "../vpropertyexplorer/vproperty.h"
|
||||||
#include "../vtools/dialogs/support/dialogeditwrongformula.h"
|
#include "../vtools/dialogs/support/dialogeditwrongformula.h"
|
||||||
|
|
||||||
using namespace VPE;
|
|
||||||
|
|
||||||
// VFormulaPropertyEditor
|
// VFormulaPropertyEditor
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VFormulaPropertyEditor::VFormulaPropertyEditor(QWidget *parent)
|
VFormulaPropertyEditor::VFormulaPropertyEditor(QWidget *parent)
|
||||||
|
@ -100,7 +98,7 @@ void VFormulaPropertyEditor::onToolButtonClicked()
|
||||||
TextLabel->setText(formula.getStringValue());
|
TextLabel->setText(formula.getStringValue());
|
||||||
delete tmpWidget;
|
delete tmpWidget;
|
||||||
emit dataChangedByUser(formula, this);
|
emit dataChangedByUser(formula, this);
|
||||||
UserChangeEvent *event = new UserChangeEvent();
|
VPE::UserChangeEvent *event = new VPE::UserChangeEvent();
|
||||||
QCoreApplication::postEvent ( this, event );
|
QCoreApplication::postEvent ( this, event );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,16 +43,14 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
|
||||||
using namespace VPE;
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VToolOptionsPropertyBrowser::VToolOptionsPropertyBrowser(QDockWidget *parent)
|
VToolOptionsPropertyBrowser::VToolOptionsPropertyBrowser(QDockWidget *parent)
|
||||||
:QObject(parent), PropertyModel(nullptr), formView(nullptr), currentItem(nullptr),
|
:QObject(parent), PropertyModel(nullptr), formView(nullptr), currentItem(nullptr),
|
||||||
propertyToId(QMap<VProperty *, QString>()),
|
propertyToId(QMap<VPE::VProperty *, QString>()),
|
||||||
idToProperty(QMap<QString, VProperty *>())
|
idToProperty(QMap<QString, VPE::VProperty *>())
|
||||||
{
|
{
|
||||||
PropertyModel = new VPropertyModel(this);
|
PropertyModel = new VPE::VPropertyModel(this);
|
||||||
formView = new VPropertyFormView(PropertyModel, parent);
|
formView = new VPE::VPropertyFormView(PropertyModel, parent);
|
||||||
formView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
formView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
|
||||||
QScrollArea *scroll = new QScrollArea(parent);
|
QScrollArea *scroll = new QScrollArea(parent);
|
||||||
|
@ -61,7 +59,8 @@ VToolOptionsPropertyBrowser::VToolOptionsPropertyBrowser(QDockWidget *parent)
|
||||||
|
|
||||||
parent->setWidget(scroll);
|
parent->setWidget(scroll);
|
||||||
|
|
||||||
connect(PropertyModel, &VPropertyModel::onDataChangedByEditor, this, &VToolOptionsPropertyBrowser::userChangedData);
|
connect(PropertyModel, &VPE::VPropertyModel::onDataChangedByEditor, this,
|
||||||
|
&VToolOptionsPropertyBrowser::userChangedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -339,9 +338,9 @@ void VToolOptionsPropertyBrowser::RefreshOptions()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::userChangedData(VProperty *property)
|
void VToolOptionsPropertyBrowser::userChangedData(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
VProperty *prop = property;
|
VPE::VProperty *prop = property;
|
||||||
if (!propertyToId.contains(prop))
|
if (!propertyToId.contains(prop))
|
||||||
{
|
{
|
||||||
if (!propertyToId.contains(prop->getParent()))// Maybe we know parent
|
if (!propertyToId.contains(prop->getParent()))// Maybe we know parent
|
||||||
|
@ -526,7 +525,7 @@ void VToolOptionsPropertyBrowser::AddPropertyFormula(const QString &propertyName
|
||||||
template<class Tool>
|
template<class Tool>
|
||||||
void VToolOptionsPropertyBrowser::AddPropertyObjectName(Tool *i, const QString &propertyName, bool readOnly)
|
void VToolOptionsPropertyBrowser::AddPropertyObjectName(Tool *i, const QString &propertyName, bool readOnly)
|
||||||
{
|
{
|
||||||
auto itemName = new VStringProperty(propertyName);
|
auto itemName = new VPE::VStringProperty(propertyName);
|
||||||
itemName->setClearButtonEnable(true);
|
itemName->setClearButtonEnable(true);
|
||||||
itemName->setValue(i->name());
|
itemName->setValue(i->name());
|
||||||
itemName->setReadOnly(readOnly);
|
itemName->setReadOnly(readOnly);
|
||||||
|
@ -537,7 +536,7 @@ void VToolOptionsPropertyBrowser::AddPropertyObjectName(Tool *i, const QString &
|
||||||
template<class Tool>
|
template<class Tool>
|
||||||
void VToolOptionsPropertyBrowser::AddPropertyPointName1(Tool *i, const QString &propertyName)
|
void VToolOptionsPropertyBrowser::AddPropertyPointName1(Tool *i, const QString &propertyName)
|
||||||
{
|
{
|
||||||
VStringProperty *itemName = new VStringProperty(propertyName);
|
VPE::VStringProperty *itemName = new VPE::VStringProperty(propertyName);
|
||||||
itemName->setClearButtonEnable(true);
|
itemName->setClearButtonEnable(true);
|
||||||
itemName->setValue(i->nameP1());
|
itemName->setValue(i->nameP1());
|
||||||
AddProperty(itemName, AttrName1);
|
AddProperty(itemName, AttrName1);
|
||||||
|
@ -547,7 +546,7 @@ void VToolOptionsPropertyBrowser::AddPropertyPointName1(Tool *i, const QString &
|
||||||
template<class Tool>
|
template<class Tool>
|
||||||
void VToolOptionsPropertyBrowser::AddPropertyPointName2(Tool *i, const QString &propertyName)
|
void VToolOptionsPropertyBrowser::AddPropertyPointName2(Tool *i, const QString &propertyName)
|
||||||
{
|
{
|
||||||
VStringProperty *itemName = new VStringProperty(propertyName);
|
VPE::VStringProperty *itemName = new VPE::VStringProperty(propertyName);
|
||||||
itemName->setClearButtonEnable(true);
|
itemName->setClearButtonEnable(true);
|
||||||
itemName->setValue(i->nameP2());
|
itemName->setValue(i->nameP2());
|
||||||
AddProperty(itemName, AttrName2);
|
AddProperty(itemName, AttrName2);
|
||||||
|
@ -557,7 +556,7 @@ void VToolOptionsPropertyBrowser::AddPropertyPointName2(Tool *i, const QString &
|
||||||
template<class Tool>
|
template<class Tool>
|
||||||
void VToolOptionsPropertyBrowser::AddPropertyOperationSuffix(Tool *i, const QString &propertyName, bool readOnly)
|
void VToolOptionsPropertyBrowser::AddPropertyOperationSuffix(Tool *i, const QString &propertyName, bool readOnly)
|
||||||
{
|
{
|
||||||
auto itemSuffix = new VStringProperty(propertyName);
|
auto itemSuffix = new VPE::VStringProperty(propertyName);
|
||||||
itemSuffix->setClearButtonEnable(true);
|
itemSuffix->setClearButtonEnable(true);
|
||||||
itemSuffix->setValue(i->Suffix());
|
itemSuffix->setValue(i->Suffix());
|
||||||
itemSuffix->setReadOnly(readOnly);
|
itemSuffix->setReadOnly(readOnly);
|
||||||
|
@ -568,7 +567,7 @@ void VToolOptionsPropertyBrowser::AddPropertyOperationSuffix(Tool *i, const QStr
|
||||||
template<class Tool>
|
template<class Tool>
|
||||||
void VToolOptionsPropertyBrowser::AddPropertyCrossPoint(Tool *i, const QString &propertyName)
|
void VToolOptionsPropertyBrowser::AddPropertyCrossPoint(Tool *i, const QString &propertyName)
|
||||||
{
|
{
|
||||||
VEnumProperty* itemProperty = new VEnumProperty(propertyName);
|
VPE::VEnumProperty* itemProperty = new VPE::VEnumProperty(propertyName);
|
||||||
itemProperty->setLiterals(QStringList()<< tr("First point") << tr("Second point"));
|
itemProperty->setLiterals(QStringList()<< tr("First point") << tr("Second point"));
|
||||||
itemProperty->setValue(static_cast<int>(i->GetCrossCirclesPoint())-1);
|
itemProperty->setValue(static_cast<int>(i->GetCrossCirclesPoint())-1);
|
||||||
AddProperty(itemProperty, AttrCrossPoint);
|
AddProperty(itemProperty, AttrCrossPoint);
|
||||||
|
@ -578,7 +577,7 @@ void VToolOptionsPropertyBrowser::AddPropertyCrossPoint(Tool *i, const QString &
|
||||||
template<class Tool>
|
template<class Tool>
|
||||||
void VToolOptionsPropertyBrowser::AddPropertyVCrossPoint(Tool *i, const QString &propertyName)
|
void VToolOptionsPropertyBrowser::AddPropertyVCrossPoint(Tool *i, const QString &propertyName)
|
||||||
{
|
{
|
||||||
auto itemProperty = new VEnumProperty(propertyName);
|
auto itemProperty = new VPE::VEnumProperty(propertyName);
|
||||||
itemProperty->setLiterals(QStringList()<< tr("Highest point") << tr("Lowest point"));
|
itemProperty->setLiterals(QStringList()<< tr("Highest point") << tr("Lowest point"));
|
||||||
itemProperty->setValue(static_cast<int>(i->GetVCrossPoint())-1);
|
itemProperty->setValue(static_cast<int>(i->GetVCrossPoint())-1);
|
||||||
AddProperty(itemProperty, AttrVCrossPoint);
|
AddProperty(itemProperty, AttrVCrossPoint);
|
||||||
|
@ -588,7 +587,7 @@ void VToolOptionsPropertyBrowser::AddPropertyVCrossPoint(Tool *i, const QString
|
||||||
template<class Tool>
|
template<class Tool>
|
||||||
void VToolOptionsPropertyBrowser::AddPropertyHCrossPoint(Tool *i, const QString &propertyName)
|
void VToolOptionsPropertyBrowser::AddPropertyHCrossPoint(Tool *i, const QString &propertyName)
|
||||||
{
|
{
|
||||||
auto itemProperty = new VEnumProperty(propertyName);
|
auto itemProperty = new VPE::VEnumProperty(propertyName);
|
||||||
itemProperty->setLiterals(QStringList()<< tr("Leftmost point") << tr("Rightmost point"));
|
itemProperty->setLiterals(QStringList()<< tr("Leftmost point") << tr("Rightmost point"));
|
||||||
itemProperty->setValue(static_cast<int>(i->GetHCrossPoint())-1);
|
itemProperty->setValue(static_cast<int>(i->GetHCrossPoint())-1);
|
||||||
AddProperty(itemProperty, AttrHCrossPoint);
|
AddProperty(itemProperty, AttrHCrossPoint);
|
||||||
|
@ -598,7 +597,7 @@ void VToolOptionsPropertyBrowser::AddPropertyHCrossPoint(Tool *i, const QString
|
||||||
template<class Tool>
|
template<class Tool>
|
||||||
void VToolOptionsPropertyBrowser::AddPropertyAxisType(Tool *i, const QString &propertyName)
|
void VToolOptionsPropertyBrowser::AddPropertyAxisType(Tool *i, const QString &propertyName)
|
||||||
{
|
{
|
||||||
auto itemProperty = new VEnumProperty(propertyName);
|
auto itemProperty = new VPE::VEnumProperty(propertyName);
|
||||||
itemProperty->setLiterals(QStringList()<< tr("Vertical axis") << tr("Horizontal axis"));
|
itemProperty->setLiterals(QStringList()<< tr("Vertical axis") << tr("Horizontal axis"));
|
||||||
itemProperty->setValue(static_cast<int>(i->GetAxisType())-1);
|
itemProperty->setValue(static_cast<int>(i->GetAxisType())-1);
|
||||||
AddProperty(itemProperty, AttrAxisType);
|
AddProperty(itemProperty, AttrAxisType);
|
||||||
|
@ -609,9 +608,9 @@ template<class Tool>
|
||||||
void VToolOptionsPropertyBrowser::AddPropertyLineType(Tool *i, const QString &propertyName,
|
void VToolOptionsPropertyBrowser::AddPropertyLineType(Tool *i, const QString &propertyName,
|
||||||
const QMap<QString, QIcon> &styles)
|
const QMap<QString, QIcon> &styles)
|
||||||
{
|
{
|
||||||
VLineTypeProperty *lineTypeProperty = new VLineTypeProperty(propertyName);
|
VPE::VLineTypeProperty *lineTypeProperty = new VPE::VLineTypeProperty(propertyName);
|
||||||
lineTypeProperty->setStyles(styles);
|
lineTypeProperty->setStyles(styles);
|
||||||
const qint32 index = VLineTypeProperty::IndexOfStyle(styles, i->getLineType());
|
const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(styles, i->getLineType());
|
||||||
if (index == -1)
|
if (index == -1)
|
||||||
{
|
{
|
||||||
qWarning()<<"Can't find line style" << i->getLineType()<<"in list";
|
qWarning()<<"Can't find line style" << i->getLineType()<<"in list";
|
||||||
|
@ -625,9 +624,9 @@ template<class Tool>
|
||||||
void VToolOptionsPropertyBrowser::AddPropertyLineColor(Tool *i, const QString &propertyName,
|
void VToolOptionsPropertyBrowser::AddPropertyLineColor(Tool *i, const QString &propertyName,
|
||||||
const QMap<QString, QString> &colors, const QString &id)
|
const QMap<QString, QString> &colors, const QString &id)
|
||||||
{
|
{
|
||||||
VLineColorProperty *lineColorProperty = new VLineColorProperty(propertyName);
|
VPE::VLineColorProperty *lineColorProperty = new VPE::VLineColorProperty(propertyName);
|
||||||
lineColorProperty->setColors(colors);
|
lineColorProperty->setColors(colors);
|
||||||
const qint32 index = VLineColorProperty::IndexOfColor(colors, i->GetLineColor());
|
const qint32 index = VPE::VLineColorProperty::IndexOfColor(colors, i->GetLineColor());
|
||||||
if (index == -1)
|
if (index == -1)
|
||||||
{
|
{
|
||||||
qWarning()<<"Can't find line style" << i->GetLineColor()<<"in list";
|
qWarning()<<"Can't find line style" << i->GetLineColor()<<"in list";
|
||||||
|
@ -835,7 +834,7 @@ void VToolOptionsPropertyBrowser::SetAxisType(const QVariant &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::AddProperty(VProperty *property, const QString &id)
|
void VToolOptionsPropertyBrowser::AddProperty(VPE::VProperty *property, const QString &id)
|
||||||
{
|
{
|
||||||
propertyToId[property] = id;
|
propertyToId[property] = id;
|
||||||
idToProperty[id] = property;
|
idToProperty[id] = property;
|
||||||
|
@ -843,11 +842,11 @@ void VToolOptionsPropertyBrowser::AddProperty(VProperty *property, const QString
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolSinglePoint(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolSinglePoint(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
switch (PropertiesList().indexOf(id))
|
switch (PropertiesList().indexOf(id))
|
||||||
|
@ -865,11 +864,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolSinglePoint(VProperty *property)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolEndLine(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolEndLine(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolEndLine *i = qgraphicsitem_cast<VToolEndLine *>(currentItem);
|
VToolEndLine *i = qgraphicsitem_cast<VToolEndLine *>(currentItem);
|
||||||
|
@ -898,11 +897,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolEndLine(VProperty *property)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolAlongLine(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolAlongLine(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolAlongLine *i = qgraphicsitem_cast<VToolAlongLine *>(currentItem);
|
VToolAlongLine *i = qgraphicsitem_cast<VToolAlongLine *>(currentItem);
|
||||||
|
@ -928,11 +927,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolAlongLine(VProperty *property)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolArc(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolArc(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolArc *i = qgraphicsitem_cast<VToolArc *>(currentItem);
|
VToolArc *i = qgraphicsitem_cast<VToolArc *>(currentItem);
|
||||||
|
@ -958,11 +957,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolArc(VProperty *property)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolArcWithLength(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolArcWithLength(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolArcWithLength *i = qgraphicsitem_cast<VToolArcWithLength *>(currentItem);
|
VToolArcWithLength *i = qgraphicsitem_cast<VToolArcWithLength *>(currentItem);
|
||||||
|
@ -988,11 +987,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolArcWithLength(VProperty *propert
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolBisector(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolBisector(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolBisector *i = qgraphicsitem_cast<VToolBisector *>(currentItem);
|
VToolBisector *i = qgraphicsitem_cast<VToolBisector *>(currentItem);
|
||||||
|
@ -1018,11 +1017,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolBisector(VProperty *property)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolTrueDarts(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolTrueDarts(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
switch (PropertiesList().indexOf(id))
|
switch (PropertiesList().indexOf(id))
|
||||||
|
@ -1040,11 +1039,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolTrueDarts(VProperty *property)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolCutArc(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolCutArc(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolCutArc *i = qgraphicsitem_cast<VToolCutArc *>(currentItem);
|
VToolCutArc *i = qgraphicsitem_cast<VToolCutArc *>(currentItem);
|
||||||
|
@ -1064,11 +1063,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutArc(VProperty *property)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolCutSpline(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolCutSpline(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolCutSpline *i = qgraphicsitem_cast<VToolCutSpline *>(currentItem);
|
VToolCutSpline *i = qgraphicsitem_cast<VToolCutSpline *>(currentItem);
|
||||||
|
@ -1088,11 +1087,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutSpline(VProperty *property)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolCutSplinePath(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolCutSplinePath(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolCutSplinePath *i = qgraphicsitem_cast<VToolCutSplinePath *>(currentItem);
|
VToolCutSplinePath *i = qgraphicsitem_cast<VToolCutSplinePath *>(currentItem);
|
||||||
|
@ -1112,11 +1111,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutSplinePath(VProperty *propert
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolHeight(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolHeight(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolHeight *i = qgraphicsitem_cast<VToolHeight *>(currentItem);
|
VToolHeight *i = qgraphicsitem_cast<VToolHeight *>(currentItem);
|
||||||
|
@ -1139,11 +1138,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolHeight(VProperty *property)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolLine(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolLine(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolLine *i = qgraphicsitem_cast<VToolLine *>(currentItem);
|
VToolLine *i = qgraphicsitem_cast<VToolLine *>(currentItem);
|
||||||
|
@ -1163,11 +1162,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLine(VProperty *property)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersect(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersect(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
switch (PropertiesList().indexOf(id))
|
switch (PropertiesList().indexOf(id))
|
||||||
|
@ -1182,11 +1181,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersect(VProperty *propert
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolNormal(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolNormal(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolNormal *i = qgraphicsitem_cast<VToolNormal *>(currentItem);
|
VToolNormal *i = qgraphicsitem_cast<VToolNormal *>(currentItem);
|
||||||
|
@ -1215,11 +1214,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolNormal(VProperty *property)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolPointOfContact(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolPointOfContact(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolPointOfContact *i = qgraphicsitem_cast<VToolPointOfContact *>(currentItem);
|
VToolPointOfContact *i = qgraphicsitem_cast<VToolPointOfContact *>(currentItem);
|
||||||
|
@ -1239,11 +1238,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfContact(VProperty *proper
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersection(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersection(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
switch (PropertiesList().indexOf(id))
|
switch (PropertiesList().indexOf(id))
|
||||||
|
@ -1258,11 +1257,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersection(VProperty *p
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionArcs(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionArcs(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
switch (PropertiesList().indexOf(id))
|
switch (PropertiesList().indexOf(id))
|
||||||
|
@ -1272,7 +1271,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionArcs(VPropert
|
||||||
break;
|
break;
|
||||||
case 28: // AttrCrossPoint
|
case 28: // AttrCrossPoint
|
||||||
{
|
{
|
||||||
const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole);
|
const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole);
|
||||||
SetCrossCirclesPoint<VToolPointOfIntersectionArcs>(value);
|
SetCrossCirclesPoint<VToolPointOfIntersectionArcs>(value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1283,11 +1282,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionArcs(VPropert
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCircles(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCircles(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolPointOfIntersectionCircles *i = qgraphicsitem_cast<VToolPointOfIntersectionCircles *>(currentItem);
|
VToolPointOfIntersectionCircles *i = qgraphicsitem_cast<VToolPointOfIntersectionCircles *>(currentItem);
|
||||||
|
@ -1299,7 +1298,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCircles(VProp
|
||||||
break;
|
break;
|
||||||
case 28: // AttrCrossPoint
|
case 28: // AttrCrossPoint
|
||||||
{
|
{
|
||||||
const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole);
|
const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole);
|
||||||
SetCrossCirclesPoint<VToolPointOfIntersectionCircles>(value);
|
SetCrossCirclesPoint<VToolPointOfIntersectionCircles>(value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1316,11 +1315,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCircles(VProp
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCurves(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCurves(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
switch (PropertiesList().indexOf(id))
|
switch (PropertiesList().indexOf(id))
|
||||||
|
@ -1330,13 +1329,13 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCurves(VPrope
|
||||||
break;
|
break;
|
||||||
case 34: // AttrVCrossPoint
|
case 34: // AttrVCrossPoint
|
||||||
{
|
{
|
||||||
const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole);
|
const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole);
|
||||||
SetVCrossCurvesPoint<VToolPointOfIntersectionCurves>(value);
|
SetVCrossCurvesPoint<VToolPointOfIntersectionCurves>(value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 35: // AttrHCrossPoint
|
case 35: // AttrHCrossPoint
|
||||||
{
|
{
|
||||||
const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole);
|
const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole);
|
||||||
SetHCrossCurvesPoint<VToolPointOfIntersectionCurves>(value);
|
SetHCrossCurvesPoint<VToolPointOfIntersectionCurves>(value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1347,11 +1346,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCurves(VPrope
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolPointFromCircleAndTangent(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolPointFromCircleAndTangent(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolPointFromCircleAndTangent *i = qgraphicsitem_cast<VToolPointFromCircleAndTangent *>(currentItem);
|
VToolPointFromCircleAndTangent *i = qgraphicsitem_cast<VToolPointFromCircleAndTangent *>(currentItem);
|
||||||
|
@ -1366,7 +1365,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointFromCircleAndTangent(VPrope
|
||||||
break;
|
break;
|
||||||
case 28: // AttrCrossPoint
|
case 28: // AttrCrossPoint
|
||||||
{
|
{
|
||||||
const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole);
|
const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole);
|
||||||
SetCrossCirclesPoint<VToolPointFromCircleAndTangent>(value);
|
SetCrossCirclesPoint<VToolPointFromCircleAndTangent>(value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1377,11 +1376,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointFromCircleAndTangent(VPrope
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolPointFromArcAndTangent(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolPointFromArcAndTangent(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
switch (PropertiesList().indexOf(id))
|
switch (PropertiesList().indexOf(id))
|
||||||
|
@ -1391,7 +1390,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointFromArcAndTangent(VProperty
|
||||||
break;
|
break;
|
||||||
case 28: // AttrCrossPoint
|
case 28: // AttrCrossPoint
|
||||||
{
|
{
|
||||||
const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole);
|
const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole);
|
||||||
SetCrossCirclesPoint<VToolPointFromArcAndTangent>(value);
|
SetCrossCirclesPoint<VToolPointFromArcAndTangent>(value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1402,11 +1401,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointFromArcAndTangent(VProperty
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolShoulderPoint(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolShoulderPoint(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolShoulderPoint *i = qgraphicsitem_cast<VToolShoulderPoint *>(currentItem);
|
VToolShoulderPoint *i = qgraphicsitem_cast<VToolShoulderPoint *>(currentItem);
|
||||||
|
@ -1432,11 +1431,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolShoulderPoint(VProperty *propert
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolSpline(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolSpline(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
auto i = qgraphicsitem_cast<VToolSpline *>(currentItem);
|
auto i = qgraphicsitem_cast<VToolSpline *>(currentItem);
|
||||||
|
@ -1488,11 +1487,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolSpline(VProperty *property)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezier(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezier(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
auto i = qgraphicsitem_cast<VToolCubicBezier *>(currentItem);
|
auto i = qgraphicsitem_cast<VToolCubicBezier *>(currentItem);
|
||||||
|
@ -1513,11 +1512,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezier(VProperty *property)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolSplinePath(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolSplinePath(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolSplinePath *i = qgraphicsitem_cast<VToolSplinePath *>(currentItem);
|
VToolSplinePath *i = qgraphicsitem_cast<VToolSplinePath *>(currentItem);
|
||||||
|
@ -1537,11 +1536,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolSplinePath(VProperty *property)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezierPath(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezierPath(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolCubicBezierPath *i = qgraphicsitem_cast<VToolCubicBezierPath *>(currentItem);
|
VToolCubicBezierPath *i = qgraphicsitem_cast<VToolCubicBezierPath *>(currentItem);
|
||||||
|
@ -1561,11 +1560,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezierPath(VProperty *prope
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolTriangle(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolTriangle(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
switch (PropertiesList().indexOf(id))
|
switch (PropertiesList().indexOf(id))
|
||||||
|
@ -1580,11 +1579,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolTriangle(VProperty *property)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersectAxis(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersectAxis(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolLineIntersectAxis *i = qgraphicsitem_cast<VToolLineIntersectAxis *>(currentItem);
|
VToolLineIntersectAxis *i = qgraphicsitem_cast<VToolLineIntersectAxis *>(currentItem);
|
||||||
|
@ -1610,11 +1609,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersectAxis(VProperty *pro
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolCurveIntersectAxis(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolCurveIntersectAxis(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolCurveIntersectAxis *i = qgraphicsitem_cast<VToolCurveIntersectAxis *>(currentItem);
|
VToolCurveIntersectAxis *i = qgraphicsitem_cast<VToolCurveIntersectAxis *>(currentItem);
|
||||||
|
@ -1640,11 +1639,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCurveIntersectAxis(VProperty *pr
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolRotation(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolRotation(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolRotation *i = qgraphicsitem_cast<VToolRotation *>(currentItem);
|
VToolRotation *i = qgraphicsitem_cast<VToolRotation *>(currentItem);
|
||||||
|
@ -1664,11 +1663,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolRotation(VProperty *property)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolMove(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolMove(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolMove *i = qgraphicsitem_cast<VToolMove *>(currentItem);
|
VToolMove *i = qgraphicsitem_cast<VToolMove *>(currentItem);
|
||||||
|
@ -1691,11 +1690,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolMove(VProperty *property)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByLine(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByLine(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
switch (PropertiesList().indexOf(id))
|
switch (PropertiesList().indexOf(id))
|
||||||
|
@ -1710,18 +1709,18 @@ void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByLine(VProperty *proper
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByAxis(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByAxis(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
switch (PropertiesList().indexOf(id))
|
switch (PropertiesList().indexOf(id))
|
||||||
{
|
{
|
||||||
case 39: // AttrAxisType
|
case 39: // AttrAxisType
|
||||||
{
|
{
|
||||||
const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole);
|
const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole);
|
||||||
SetAxisType<VToolFlippingByAxis>(value);
|
SetAxisType<VToolFlippingByAxis>(value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1735,11 +1734,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByAxis(VProperty *proper
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolOptionsPropertyBrowser::ChangeDataToolEllipticalArc(VProperty *property)
|
void VToolOptionsPropertyBrowser::ChangeDataToolEllipticalArc(VPE::VProperty *property)
|
||||||
{
|
{
|
||||||
SCASSERT(property != nullptr)
|
SCASSERT(property != nullptr)
|
||||||
|
|
||||||
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
|
||||||
const QString id = propertyToId[property];
|
const QString id = propertyToId[property];
|
||||||
|
|
||||||
VToolEllipticalArc *i = qgraphicsitem_cast<VToolEllipticalArc *>(currentItem);
|
VToolEllipticalArc *i = qgraphicsitem_cast<VToolEllipticalArc *>(currentItem);
|
||||||
|
@ -1779,7 +1778,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolSinglePoint(QGraphicsItem *item
|
||||||
|
|
||||||
AddPropertyObjectName(i, tr("Point label"));
|
AddPropertyObjectName(i, tr("Point label"));
|
||||||
|
|
||||||
VPointFProperty* itemPosition = new VPointFProperty(tr("Position"));
|
VPE::VPointFProperty* itemPosition = new VPE::VPointFProperty(tr("Position"));
|
||||||
itemPosition->setValue(i->pos());
|
itemPosition->setValue(i->pos());
|
||||||
AddProperty(itemPosition, QLatin1String("position"));
|
AddProperty(itemPosition, QLatin1String("position"));
|
||||||
}
|
}
|
||||||
|
@ -1941,7 +1940,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolNormal(QGraphicsItem *item)
|
||||||
AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics());
|
AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics());
|
||||||
AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor);
|
AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor);
|
||||||
|
|
||||||
VDoubleProperty* itemAngle = new VDoubleProperty(tr("Additional angle degrees"));
|
VPE::VDoubleProperty* itemAngle = new VPE::VDoubleProperty(tr("Additional angle degrees"));
|
||||||
itemAngle->setValue(i->GetAngle());
|
itemAngle->setValue(i->GetAngle());
|
||||||
itemAngle->setSetting("Min", -360);
|
itemAngle->setSetting("Min", -360);
|
||||||
itemAngle->setSetting("Max", 360);
|
itemAngle->setSetting("Max", 360);
|
||||||
|
@ -2223,12 +2222,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolEndLine()
|
||||||
idToProperty[AttrName]->setValue(i->name());
|
idToProperty[AttrName]->setValue(i->name());
|
||||||
|
|
||||||
{
|
{
|
||||||
const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
||||||
idToProperty[AttrTypeLine]->setValue(index);
|
idToProperty[AttrTypeLine]->setValue(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
||||||
idToProperty[AttrLineColor]->setValue(index);
|
idToProperty[AttrLineColor]->setValue(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2248,12 +2247,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolAlongLine()
|
||||||
idToProperty[AttrName]->setValue(i->name());
|
idToProperty[AttrName]->setValue(i->name());
|
||||||
|
|
||||||
{
|
{
|
||||||
const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
||||||
idToProperty[AttrTypeLine]->setValue(index);
|
idToProperty[AttrTypeLine]->setValue(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
||||||
idToProperty[AttrLineColor]->setValue(index);
|
idToProperty[AttrLineColor]->setValue(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2279,7 +2278,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolArc()
|
||||||
valueSecondAngle.setValue(i->GetFormulaF2());
|
valueSecondAngle.setValue(i->GetFormulaF2());
|
||||||
idToProperty[AttrAngle2]->setValue(valueSecondAngle);
|
idToProperty[AttrAngle2]->setValue(valueSecondAngle);
|
||||||
|
|
||||||
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
||||||
idToProperty[AttrColor]->setValue(index);
|
idToProperty[AttrColor]->setValue(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2300,7 +2299,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolArcWithLength()
|
||||||
valueLength.setValue(i->GetFormulaLength());
|
valueLength.setValue(i->GetFormulaLength());
|
||||||
idToProperty[AttrLength]->setValue(valueLength);
|
idToProperty[AttrLength]->setValue(valueLength);
|
||||||
|
|
||||||
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
||||||
idToProperty[AttrColor]->setValue(index);
|
idToProperty[AttrColor]->setValue(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2316,12 +2315,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolBisector()
|
||||||
idToProperty[AttrLength]->setValue(valueFormula);
|
idToProperty[AttrLength]->setValue(valueFormula);
|
||||||
|
|
||||||
{
|
{
|
||||||
const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
||||||
idToProperty[AttrTypeLine]->setValue(index);
|
idToProperty[AttrTypeLine]->setValue(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
||||||
idToProperty[AttrLineColor]->setValue(index);
|
idToProperty[AttrLineColor]->setValue(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2379,12 +2378,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolHeight()
|
||||||
idToProperty[AttrName]->setValue(i->name());
|
idToProperty[AttrName]->setValue(i->name());
|
||||||
|
|
||||||
{
|
{
|
||||||
const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
||||||
idToProperty[AttrTypeLine]->setValue(index);
|
idToProperty[AttrTypeLine]->setValue(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
||||||
idToProperty[AttrLineColor]->setValue(index);
|
idToProperty[AttrLineColor]->setValue(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2395,12 +2394,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolLine()
|
||||||
VToolLine *i = qgraphicsitem_cast<VToolLine *>(currentItem);
|
VToolLine *i = qgraphicsitem_cast<VToolLine *>(currentItem);
|
||||||
|
|
||||||
{
|
{
|
||||||
const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
||||||
idToProperty[AttrTypeLine]->setValue(index);
|
idToProperty[AttrTypeLine]->setValue(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
||||||
idToProperty[AttrLineColor]->setValue(index);
|
idToProperty[AttrLineColor]->setValue(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2427,12 +2426,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolNormal()
|
||||||
idToProperty[AttrAngle]->setValue( i->GetAngle());
|
idToProperty[AttrAngle]->setValue( i->GetAngle());
|
||||||
|
|
||||||
{
|
{
|
||||||
const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
||||||
idToProperty[AttrTypeLine]->setValue(index);
|
idToProperty[AttrTypeLine]->setValue(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
||||||
idToProperty[AttrLineColor]->setValue(index);
|
idToProperty[AttrLineColor]->setValue(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2527,12 +2526,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolShoulderPoint()
|
||||||
idToProperty[AttrName]->setValue(i->name());
|
idToProperty[AttrName]->setValue(i->name());
|
||||||
|
|
||||||
{
|
{
|
||||||
const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
||||||
idToProperty[AttrTypeLine]->setValue(index);
|
idToProperty[AttrTypeLine]->setValue(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
||||||
idToProperty[AttrLineColor]->setValue(index);
|
idToProperty[AttrLineColor]->setValue(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2577,7 +2576,8 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolSpline()
|
||||||
length2.setValue(length2F);
|
length2.setValue(length2F);
|
||||||
idToProperty[AttrLength2]->setValue(length2);
|
idToProperty[AttrLength2]->setValue(length2);
|
||||||
|
|
||||||
idToProperty[AttrColor]->setValue(VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()));
|
idToProperty[AttrColor]->setValue(VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(),
|
||||||
|
i->GetLineColor()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -2586,7 +2586,8 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCubicBezier()
|
||||||
auto i = qgraphicsitem_cast<VToolCubicBezier *>(currentItem);
|
auto i = qgraphicsitem_cast<VToolCubicBezier *>(currentItem);
|
||||||
|
|
||||||
idToProperty[AttrName]->setValue(i->name());
|
idToProperty[AttrName]->setValue(i->name());
|
||||||
idToProperty[AttrColor]->setValue(VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()));
|
idToProperty[AttrColor]->setValue(VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(),
|
||||||
|
i->GetLineColor()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -2595,7 +2596,8 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolSplinePath()
|
||||||
auto i = qgraphicsitem_cast<VToolSplinePath *>(currentItem);
|
auto i = qgraphicsitem_cast<VToolSplinePath *>(currentItem);
|
||||||
|
|
||||||
idToProperty[AttrName]->setValue(i->name());
|
idToProperty[AttrName]->setValue(i->name());
|
||||||
idToProperty[AttrColor]->setValue(VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()));
|
idToProperty[AttrColor]->setValue(VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(),
|
||||||
|
i->GetLineColor()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -2604,7 +2606,8 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCubicBezierPath()
|
||||||
auto i = qgraphicsitem_cast<VToolCubicBezierPath *>(currentItem);
|
auto i = qgraphicsitem_cast<VToolCubicBezierPath *>(currentItem);
|
||||||
|
|
||||||
idToProperty[AttrName]->setValue(i->name());
|
idToProperty[AttrName]->setValue(i->name());
|
||||||
idToProperty[AttrColor]->setValue(VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()));
|
idToProperty[AttrColor]->setValue(VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(),
|
||||||
|
i->GetLineColor()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -2622,12 +2625,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolLineIntersectAxis()
|
||||||
idToProperty[AttrName]->setValue(i->name());
|
idToProperty[AttrName]->setValue(i->name());
|
||||||
|
|
||||||
{
|
{
|
||||||
const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
||||||
idToProperty[AttrTypeLine]->setValue(index);
|
idToProperty[AttrTypeLine]->setValue(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
||||||
idToProperty[AttrLineColor]->setValue(index);
|
idToProperty[AttrLineColor]->setValue(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2643,12 +2646,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCurveIntersectAxis()
|
||||||
idToProperty[AttrName]->setValue(i->name());
|
idToProperty[AttrName]->setValue(i->name());
|
||||||
|
|
||||||
{
|
{
|
||||||
const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
||||||
idToProperty[AttrTypeLine]->setValue(index);
|
idToProperty[AttrTypeLine]->setValue(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
||||||
idToProperty[AttrLineColor]->setValue(index);
|
idToProperty[AttrLineColor]->setValue(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2723,7 +2726,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolEllipticalArc()
|
||||||
valueFormulaRotationAngle.setValue(i->GetFormulaRotationAngle());
|
valueFormulaRotationAngle.setValue(i->GetFormulaRotationAngle());
|
||||||
idToProperty[AttrRotationAngle]->setValue(valueFormulaRotationAngle);
|
idToProperty[AttrRotationAngle]->setValue(valueFormulaRotationAngle);
|
||||||
|
|
||||||
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
||||||
idToProperty[AttrColor]->setValue(index);
|
idToProperty[AttrColor]->setValue(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,6 @@
|
||||||
#include "qmuparsererror.h"
|
#include "qmuparsererror.h"
|
||||||
#include "../vmisc/vmath.h"
|
#include "../vmisc/vmath.h"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* @brief Implementation of the standard floating point QmuParser.
|
* @brief Implementation of the standard floating point QmuParser.
|
||||||
|
|
|
@ -36,8 +36,6 @@
|
||||||
#include "qmudef.h"
|
#include "qmudef.h"
|
||||||
#include "../vmisc/vmath.h"
|
#include "../vmisc/vmath.h"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* @brief This file contains the basic implementation of the muparser engine.
|
* @brief This file contains the basic implementation of the muparser engine.
|
||||||
|
@ -396,7 +394,7 @@ void QmuParserBase::SetExpr(const QString &a_sExpr)
|
||||||
{
|
{
|
||||||
// Check locale compatibility
|
// Check locale compatibility
|
||||||
std::locale loc;
|
std::locale loc;
|
||||||
if (m_pTokenReader->GetArgSep()==std::use_facet<numpunct<char_type> >(loc).decimal_point())
|
if (m_pTokenReader->GetArgSep()==std::use_facet<std::numpunct<char_type> >(loc).decimal_point())
|
||||||
{
|
{
|
||||||
Error(ecLOCALE);
|
Error(ecLOCALE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,8 +41,6 @@
|
||||||
#include "qmuparsererror.h"
|
#include "qmuparsererror.h"
|
||||||
#include "../vmisc/vmath.h"
|
#include "../vmisc/vmath.h"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* @brief This file contains the implementation of parser test cases.
|
* @brief This file contains the implementation of parser test cases.
|
||||||
|
|
|
@ -36,8 +36,6 @@
|
||||||
#include "../vmisc/def.h"
|
#include "../vmisc/def.h"
|
||||||
#include "../qmuparser/qmuparsererror.h"
|
#include "../qmuparser/qmuparsererror.h"
|
||||||
|
|
||||||
using namespace qmu;
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief Calculator class wraper for QMuParser. Make easy initialization math parser.
|
* @brief Calculator class wraper for QMuParser. Make easy initialization math parser.
|
||||||
|
@ -142,7 +140,7 @@ void Calculator::InitVariables(const QHash<QString, qreal *> &vars, const QMap<i
|
||||||
|
|
||||||
if (found == false)
|
if (found == false)
|
||||||
{
|
{
|
||||||
throw qmu::QmuParserError (ecUNASSIGNABLE_TOKEN, i.value(), formula, i.key());
|
throw qmu::QmuParserError (qmu::ecUNASSIGNABLE_TOKEN, i.value(), formula, i.key());
|
||||||
}
|
}
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,13 +31,11 @@
|
||||||
#include "../qmuparser/qmutranslation.h"
|
#include "../qmuparser/qmutranslation.h"
|
||||||
#include "../vmisc/def.h"
|
#include "../vmisc/def.h"
|
||||||
|
|
||||||
using namespace qmu;
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VTranslateMeasurements::VTranslateMeasurements()
|
VTranslateMeasurements::VTranslateMeasurements()
|
||||||
:measurements(QMap<QString, QmuTranslation>()),
|
:measurements(QMap<QString, qmu::QmuTranslation>()),
|
||||||
guiTexts(QMap<QString, QmuTranslation>()),
|
guiTexts(QMap<QString, qmu::QmuTranslation>()),
|
||||||
descriptions(QMap<QString, QmuTranslation>()),
|
descriptions(QMap<QString, qmu::QmuTranslation>()),
|
||||||
numbers(QMap<QString, QString>()),
|
numbers(QMap<QString, QString>()),
|
||||||
formulas(QMap<QString, QString>())
|
formulas(QMap<QString, QString>())
|
||||||
{
|
{
|
||||||
|
@ -60,7 +58,7 @@ VTranslateMeasurements::~VTranslateMeasurements()
|
||||||
bool VTranslateMeasurements::MeasurementsFromUser(QString &newFormula, int position, const QString &token,
|
bool VTranslateMeasurements::MeasurementsFromUser(QString &newFormula, int position, const QString &token,
|
||||||
int &bias) const
|
int &bias) const
|
||||||
{
|
{
|
||||||
QMap<QString, QmuTranslation>::const_iterator i = measurements.constBegin();
|
QMap<QString, qmu::QmuTranslation>::const_iterator i = measurements.constBegin();
|
||||||
while (i != measurements.constEnd())
|
while (i != measurements.constEnd())
|
||||||
{
|
{
|
||||||
if (token == i.value().translate())
|
if (token == i.value().translate())
|
||||||
|
@ -166,8 +164,9 @@ void VTranslateMeasurements::InitMeasurements()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VTranslateMeasurements::InitMeasurement(const QString &name, const QmuTranslation &m, const QmuTranslation &g,
|
void VTranslateMeasurements::InitMeasurement(const QString &name, const qmu::QmuTranslation &m,
|
||||||
const QmuTranslation &d, const QString &number, const QString &formula)
|
const qmu::QmuTranslation &g, const qmu::QmuTranslation &d,
|
||||||
|
const QString &number, const QString &formula)
|
||||||
{
|
{
|
||||||
measurements.insert(name, m);
|
measurements.insert(name, m);
|
||||||
guiTexts.insert(name, g);
|
guiTexts.insert(name, g);
|
||||||
|
@ -176,16 +175,16 @@ void VTranslateMeasurements::InitMeasurement(const QString &name, const QmuTrans
|
||||||
formulas.insert(name, formula);
|
formulas.insert(name, formula);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define translate(context, source, disambiguation) QmuTranslation::translate((context), (source), (disambiguation))
|
#define translate(context, source, disambiguation) qmu::QmuTranslation::translate((context), (source), (disambiguation))
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VTranslateMeasurements::InitGroupA()
|
void VTranslateMeasurements::InitGroupA()
|
||||||
{
|
{
|
||||||
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
||||||
//mark such string to translation.
|
//mark such string to translation.
|
||||||
QmuTranslation m;
|
qmu::QmuTranslation m;
|
||||||
QmuTranslation g;
|
qmu::QmuTranslation g;
|
||||||
QmuTranslation d;
|
qmu::QmuTranslation d;
|
||||||
|
|
||||||
//=================================================================================================================
|
//=================================================================================================================
|
||||||
m = translate("VTranslateMeasurements", "height",
|
m = translate("VTranslateMeasurements", "height",
|
||||||
|
@ -357,9 +356,9 @@ void VTranslateMeasurements::InitGroupB()
|
||||||
{
|
{
|
||||||
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
||||||
//mark such string to translation.
|
//mark such string to translation.
|
||||||
QmuTranslation m;
|
qmu::QmuTranslation m;
|
||||||
QmuTranslation g;
|
qmu::QmuTranslation g;
|
||||||
QmuTranslation d;
|
qmu::QmuTranslation d;
|
||||||
|
|
||||||
//=================================================================================================================
|
//=================================================================================================================
|
||||||
m = translate("VTranslateMeasurements", "width_shoulder",
|
m = translate("VTranslateMeasurements", "width_shoulder",
|
||||||
|
@ -404,9 +403,9 @@ void VTranslateMeasurements::InitGroupC()
|
||||||
{
|
{
|
||||||
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
||||||
//mark such string to translation.
|
//mark such string to translation.
|
||||||
QmuTranslation m;
|
qmu::QmuTranslation m;
|
||||||
QmuTranslation g;
|
qmu::QmuTranslation g;
|
||||||
QmuTranslation d;
|
qmu::QmuTranslation d;
|
||||||
|
|
||||||
//=================================================================================================================
|
//=================================================================================================================
|
||||||
m = translate("VTranslateMeasurements", "indent_neck_back",
|
m = translate("VTranslateMeasurements", "indent_neck_back",
|
||||||
|
@ -437,9 +436,9 @@ void VTranslateMeasurements::InitGroupD()
|
||||||
{
|
{
|
||||||
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
||||||
//mark such string to translation.
|
//mark such string to translation.
|
||||||
QmuTranslation m;
|
qmu::QmuTranslation m;
|
||||||
QmuTranslation g;
|
qmu::QmuTranslation g;
|
||||||
QmuTranslation d;
|
qmu::QmuTranslation d;
|
||||||
|
|
||||||
//=================================================================================================================
|
//=================================================================================================================
|
||||||
m = translate("VTranslateMeasurements", "hand_palm_length",
|
m = translate("VTranslateMeasurements", "hand_palm_length",
|
||||||
|
@ -482,9 +481,9 @@ void VTranslateMeasurements::InitGroupE()
|
||||||
{
|
{
|
||||||
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
||||||
//mark such string to translation.
|
//mark such string to translation.
|
||||||
QmuTranslation m;
|
qmu::QmuTranslation m;
|
||||||
QmuTranslation g;
|
qmu::QmuTranslation g;
|
||||||
QmuTranslation d;
|
qmu::QmuTranslation d;
|
||||||
|
|
||||||
//=================================================================================================================
|
//=================================================================================================================
|
||||||
m = translate("VTranslateMeasurements", "foot_width",
|
m = translate("VTranslateMeasurements", "foot_width",
|
||||||
|
@ -521,9 +520,9 @@ void VTranslateMeasurements::InitGroupF()
|
||||||
{
|
{
|
||||||
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
||||||
//mark such string to translation.
|
//mark such string to translation.
|
||||||
QmuTranslation m;
|
qmu::QmuTranslation m;
|
||||||
QmuTranslation g;
|
qmu::QmuTranslation g;
|
||||||
QmuTranslation d;
|
qmu::QmuTranslation d;
|
||||||
|
|
||||||
//=================================================================================================================
|
//=================================================================================================================
|
||||||
m = translate("VTranslateMeasurements", "head_circ",
|
m = translate("VTranslateMeasurements", "head_circ",
|
||||||
|
@ -576,9 +575,9 @@ void VTranslateMeasurements::InitGroupG()
|
||||||
{
|
{
|
||||||
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
||||||
//mark such string to translation.
|
//mark such string to translation.
|
||||||
QmuTranslation m;
|
qmu::QmuTranslation m;
|
||||||
QmuTranslation g;
|
qmu::QmuTranslation g;
|
||||||
QmuTranslation d;
|
qmu::QmuTranslation d;
|
||||||
|
|
||||||
//=================================================================================================================
|
//=================================================================================================================
|
||||||
m = translate("VTranslateMeasurements", "neck_mid_circ",
|
m = translate("VTranslateMeasurements", "neck_mid_circ",
|
||||||
|
@ -928,9 +927,9 @@ void VTranslateMeasurements::InitGroupH()
|
||||||
{
|
{
|
||||||
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
||||||
//mark such string to translation.
|
//mark such string to translation.
|
||||||
QmuTranslation m;
|
qmu::QmuTranslation m;
|
||||||
QmuTranslation g;
|
qmu::QmuTranslation g;
|
||||||
QmuTranslation d;
|
qmu::QmuTranslation d;
|
||||||
|
|
||||||
//=================================================================================================================
|
//=================================================================================================================
|
||||||
m = translate("VTranslateMeasurements", "neck_front_to_waist_f",
|
m = translate("VTranslateMeasurements", "neck_front_to_waist_f",
|
||||||
|
@ -1233,9 +1232,9 @@ void VTranslateMeasurements::InitGroupI()
|
||||||
{
|
{
|
||||||
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
||||||
//mark such string to translation.
|
//mark such string to translation.
|
||||||
QmuTranslation m;
|
qmu::QmuTranslation m;
|
||||||
QmuTranslation g;
|
qmu::QmuTranslation g;
|
||||||
QmuTranslation d;
|
qmu::QmuTranslation d;
|
||||||
|
|
||||||
//=================================================================================================================
|
//=================================================================================================================
|
||||||
m = translate("VTranslateMeasurements", "shoulder_length",
|
m = translate("VTranslateMeasurements", "shoulder_length",
|
||||||
|
@ -1344,9 +1343,9 @@ void VTranslateMeasurements::InitGroupJ()
|
||||||
{
|
{
|
||||||
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
||||||
//mark such string to translation.
|
//mark such string to translation.
|
||||||
QmuTranslation m;
|
qmu::QmuTranslation m;
|
||||||
QmuTranslation g;
|
qmu::QmuTranslation g;
|
||||||
QmuTranslation d;
|
qmu::QmuTranslation d;
|
||||||
|
|
||||||
//=================================================================================================================
|
//=================================================================================================================
|
||||||
m = translate("VTranslateMeasurements", "bustpoint_to_bustpoint",
|
m = translate("VTranslateMeasurements", "bustpoint_to_bustpoint",
|
||||||
|
@ -1425,9 +1424,9 @@ void VTranslateMeasurements::InitGroupK()
|
||||||
{
|
{
|
||||||
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
||||||
//mark such string to translation.
|
//mark such string to translation.
|
||||||
QmuTranslation m;
|
qmu::QmuTranslation m;
|
||||||
QmuTranslation g;
|
qmu::QmuTranslation g;
|
||||||
QmuTranslation d;
|
qmu::QmuTranslation d;
|
||||||
|
|
||||||
//=================================================================================================================
|
//=================================================================================================================
|
||||||
m = translate("VTranslateMeasurements", "shoulder_tip_to_waist_front",
|
m = translate("VTranslateMeasurements", "shoulder_tip_to_waist_front",
|
||||||
|
@ -1529,9 +1528,9 @@ void VTranslateMeasurements::InitGroupL()
|
||||||
{
|
{
|
||||||
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
||||||
//mark such string to translation.
|
//mark such string to translation.
|
||||||
QmuTranslation m;
|
qmu::QmuTranslation m;
|
||||||
QmuTranslation g;
|
qmu::QmuTranslation g;
|
||||||
QmuTranslation d;
|
qmu::QmuTranslation d;
|
||||||
|
|
||||||
//=================================================================================================================
|
//=================================================================================================================
|
||||||
m = translate("VTranslateMeasurements", "arm_shoulder_tip_to_wrist_bent",
|
m = translate("VTranslateMeasurements", "arm_shoulder_tip_to_wrist_bent",
|
||||||
|
@ -1697,9 +1696,9 @@ void VTranslateMeasurements::InitGroupM()
|
||||||
{
|
{
|
||||||
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
||||||
//mark such string to translation.
|
//mark such string to translation.
|
||||||
QmuTranslation m;
|
qmu::QmuTranslation m;
|
||||||
QmuTranslation g;
|
qmu::QmuTranslation g;
|
||||||
QmuTranslation d;
|
qmu::QmuTranslation d;
|
||||||
|
|
||||||
//=================================================================================================================
|
//=================================================================================================================
|
||||||
m = translate("VTranslateMeasurements", "leg_crotch_to_floor",
|
m = translate("VTranslateMeasurements", "leg_crotch_to_floor",
|
||||||
|
@ -1808,9 +1807,9 @@ void VTranslateMeasurements::InitGroupN()
|
||||||
{
|
{
|
||||||
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
||||||
//mark such string to translation.
|
//mark such string to translation.
|
||||||
QmuTranslation m;
|
qmu::QmuTranslation m;
|
||||||
QmuTranslation g;
|
qmu::QmuTranslation g;
|
||||||
QmuTranslation d;
|
qmu::QmuTranslation d;
|
||||||
|
|
||||||
//=================================================================================================================
|
//=================================================================================================================
|
||||||
m = translate("VTranslateMeasurements", "crotch_length",
|
m = translate("VTranslateMeasurements", "crotch_length",
|
||||||
|
@ -1880,9 +1879,9 @@ void VTranslateMeasurements::InitGroupO()
|
||||||
{
|
{
|
||||||
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
||||||
//mark such string to translation.
|
//mark such string to translation.
|
||||||
QmuTranslation m;
|
qmu::QmuTranslation m;
|
||||||
QmuTranslation g;
|
qmu::QmuTranslation g;
|
||||||
QmuTranslation d;
|
qmu::QmuTranslation d;
|
||||||
|
|
||||||
//=================================================================================================================
|
//=================================================================================================================
|
||||||
m = translate("VTranslateMeasurements", "neck_back_to_waist_front",
|
m = translate("VTranslateMeasurements", "neck_back_to_waist_front",
|
||||||
|
@ -1996,9 +1995,9 @@ void VTranslateMeasurements::InitGroupP()
|
||||||
{
|
{
|
||||||
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
||||||
//mark such string to translation.
|
//mark such string to translation.
|
||||||
QmuTranslation m;
|
qmu::QmuTranslation m;
|
||||||
QmuTranslation g;
|
qmu::QmuTranslation g;
|
||||||
QmuTranslation d;
|
qmu::QmuTranslation d;
|
||||||
|
|
||||||
//=================================================================================================================
|
//=================================================================================================================
|
||||||
m = translate("VTranslateMeasurements", "neck_back_to_bust_front",
|
m = translate("VTranslateMeasurements", "neck_back_to_bust_front",
|
||||||
|
@ -2098,9 +2097,9 @@ void VTranslateMeasurements::InitGroupQ()
|
||||||
{
|
{
|
||||||
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
||||||
//mark such string to translation.
|
//mark such string to translation.
|
||||||
QmuTranslation m;
|
qmu::QmuTranslation m;
|
||||||
QmuTranslation g;
|
qmu::QmuTranslation g;
|
||||||
QmuTranslation d;
|
qmu::QmuTranslation d;
|
||||||
|
|
||||||
//=================================================================================================================
|
//=================================================================================================================
|
||||||
m = translate("VTranslateMeasurements", "dart_width_shoulder",
|
m = translate("VTranslateMeasurements", "dart_width_shoulder",
|
||||||
|
|
|
@ -44,19 +44,17 @@
|
||||||
#include "../vmisc/vabstractapplication.h"
|
#include "../vmisc/vabstractapplication.h"
|
||||||
#include "vtranslatemeasurements.h"
|
#include "vtranslatemeasurements.h"
|
||||||
|
|
||||||
using namespace qmu;
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VTranslateVars::VTranslateVars()
|
VTranslateVars::VTranslateVars()
|
||||||
:VTranslateMeasurements(),
|
:VTranslateMeasurements(),
|
||||||
PMSystemNames(QMap<QString, QmuTranslation>()),
|
PMSystemNames(QMap<QString, qmu::QmuTranslation>()),
|
||||||
PMSystemAuthors(QMap<QString, QmuTranslation>()),
|
PMSystemAuthors(QMap<QString, qmu::QmuTranslation>()),
|
||||||
PMSystemBooks(QMap<QString, QmuTranslation>()),
|
PMSystemBooks(QMap<QString, qmu::QmuTranslation>()),
|
||||||
variables(QMap<QString, QmuTranslation>()),
|
variables(QMap<QString, qmu::QmuTranslation>()),
|
||||||
functions(QMap<QString, QmuTranslation>()),
|
functions(QMap<QString, qmu::QmuTranslation>()),
|
||||||
postfixOperators(QMap<QString, QmuTranslation>()),
|
postfixOperators(QMap<QString, qmu::QmuTranslation>()),
|
||||||
placeholders(QMap<QString, QmuTranslation>()),
|
placeholders(QMap<QString, qmu::QmuTranslation>()),
|
||||||
stDescriptions(QMap<QString, QmuTranslation>())
|
stDescriptions(QMap<QString, qmu::QmuTranslation>())
|
||||||
{
|
{
|
||||||
InitPatternMakingSystems();
|
InitPatternMakingSystems();
|
||||||
InitVariables();
|
InitVariables();
|
||||||
|
@ -69,16 +67,16 @@ VTranslateVars::VTranslateVars()
|
||||||
VTranslateVars::~VTranslateVars()
|
VTranslateVars::~VTranslateVars()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
#define translate(context, source, disambiguation) QmuTranslation::translate((context), (source), (disambiguation))
|
#define translate(context, source, disambiguation) qmu::QmuTranslation::translate((context), (source), (disambiguation))
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VTranslateVars::InitPatternMakingSystems()
|
void VTranslateVars::InitPatternMakingSystems()
|
||||||
{
|
{
|
||||||
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
||||||
//mark such string to translation.
|
//mark such string to translation.
|
||||||
QmuTranslation name;
|
qmu::QmuTranslation name;
|
||||||
QmuTranslation author;
|
qmu::QmuTranslation author;
|
||||||
QmuTranslation book;
|
qmu::QmuTranslation book;
|
||||||
|
|
||||||
//=================================================================================================================
|
//=================================================================================================================
|
||||||
name = translate("VTranslateVars", "Bunka", "System name");
|
name = translate("VTranslateVars", "Bunka", "System name");
|
||||||
|
@ -448,8 +446,8 @@ void VTranslateVars::InitPlaceholder()
|
||||||
#undef translate
|
#undef translate
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VTranslateVars::InitSystem(const QString &code, const QmuTranslation &name, const QmuTranslation &author,
|
void VTranslateVars::InitSystem(const QString &code, const qmu::QmuTranslation &name, const qmu::QmuTranslation &author,
|
||||||
const QmuTranslation &book)
|
const qmu::QmuTranslation &book)
|
||||||
{
|
{
|
||||||
PMSystemNames.insert(code, name);
|
PMSystemNames.insert(code, name);
|
||||||
PMSystemAuthors.insert(code, author);
|
PMSystemAuthors.insert(code, author);
|
||||||
|
@ -519,10 +517,10 @@ void VTranslateVars::BiasTokens(int position, int bias, QMap<int, QString> &toke
|
||||||
*/
|
*/
|
||||||
bool VTranslateVars::VariablesFromUser(QString &newFormula, int position, const QString &token, int &bias) const
|
bool VTranslateVars::VariablesFromUser(QString &newFormula, int position, const QString &token, int &bias) const
|
||||||
{
|
{
|
||||||
QMap<QString, QmuTranslation>::const_iterator i = variables.constBegin();
|
QMap<QString, qmu::QmuTranslation>::const_iterator i = variables.constBegin();
|
||||||
while (i != variables.constEnd())
|
while (i != variables.constEnd())
|
||||||
{
|
{
|
||||||
const QmuTranslation &var = i.value();
|
const qmu::QmuTranslation &var = i.value();
|
||||||
if (token.indexOf( var.translate() ) == 0)
|
if (token.indexOf( var.translate() ) == 0)
|
||||||
{
|
{
|
||||||
newFormula.replace(position, var.translate().length(), i.key());
|
newFormula.replace(position, var.translate().length(), i.key());
|
||||||
|
@ -547,7 +545,7 @@ bool VTranslateVars::VariablesFromUser(QString &newFormula, int position, const
|
||||||
*/
|
*/
|
||||||
bool VTranslateVars::PostfixOperatorsFromUser(QString &newFormula, int position, const QString &token, int &bias) const
|
bool VTranslateVars::PostfixOperatorsFromUser(QString &newFormula, int position, const QString &token, int &bias) const
|
||||||
{
|
{
|
||||||
QMap<QString, QmuTranslation>::const_iterator i = postfixOperators.constBegin();
|
QMap<QString, qmu::QmuTranslation>::const_iterator i = postfixOperators.constBegin();
|
||||||
while (i != postfixOperators.constEnd())
|
while (i != postfixOperators.constEnd())
|
||||||
{
|
{
|
||||||
if (token == i.value().translate())
|
if (token == i.value().translate())
|
||||||
|
@ -572,7 +570,7 @@ bool VTranslateVars::PostfixOperatorsFromUser(QString &newFormula, int position,
|
||||||
*/
|
*/
|
||||||
bool VTranslateVars::FunctionsFromUser(QString &newFormula, int position, const QString &token, int &bias) const
|
bool VTranslateVars::FunctionsFromUser(QString &newFormula, int position, const QString &token, int &bias) const
|
||||||
{
|
{
|
||||||
QMap<QString, QmuTranslation>::const_iterator i = functions.constBegin();
|
QMap<QString, qmu::QmuTranslation>::const_iterator i = functions.constBegin();
|
||||||
while (i != functions.constEnd())
|
while (i != functions.constEnd())
|
||||||
{
|
{
|
||||||
if (token == i.value().translate())
|
if (token == i.value().translate())
|
||||||
|
@ -597,7 +595,7 @@ bool VTranslateVars::FunctionsFromUser(QString &newFormula, int position, const
|
||||||
*/
|
*/
|
||||||
bool VTranslateVars::VariablesToUser(QString &newFormula, int position, const QString &token, int &bias) const
|
bool VTranslateVars::VariablesToUser(QString &newFormula, int position, const QString &token, int &bias) const
|
||||||
{
|
{
|
||||||
QMap<QString, QmuTranslation>::const_iterator i = variables.constBegin();
|
QMap<QString, qmu::QmuTranslation>::const_iterator i = variables.constBegin();
|
||||||
while (i != variables.constEnd())
|
while (i != variables.constEnd())
|
||||||
{
|
{
|
||||||
if (token.indexOf( i.key() ) == 0)
|
if (token.indexOf( i.key() ) == 0)
|
||||||
|
@ -729,7 +727,7 @@ QString VTranslateVars::FormulaFromUser(const QString &formula, bool osSeparator
|
||||||
}
|
}
|
||||||
QString newFormula = formula;// Local copy for making changes
|
QString newFormula = formula;// Local copy for making changes
|
||||||
|
|
||||||
QmuTokenParser *cal = new QmuTokenParser(formula, osSeparator);// Eval formula
|
qmu::QmuTokenParser *cal = new qmu::QmuTokenParser(formula, osSeparator);// Eval formula
|
||||||
QMap<int, QString> tokens = cal->GetTokens();// Tokens (variables, measurements)
|
QMap<int, QString> tokens = cal->GetTokens();// Tokens (variables, measurements)
|
||||||
QMap<int, QString> numbers = cal->GetNumbers();// All numbers in expression for changing decimal separator
|
QMap<int, QString> numbers = cal->GetNumbers();// All numbers in expression for changing decimal separator
|
||||||
delete cal;
|
delete cal;
|
||||||
|
@ -850,7 +848,7 @@ QString VTranslateVars::FormulaToUser(const QString &formula, bool osSeparator)
|
||||||
QMap<int, QString> numbers;
|
QMap<int, QString> numbers;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
QmuTokenParser *cal = new QmuTokenParser(formula, false);// Eval formula
|
qmu::QmuTokenParser *cal = new qmu::QmuTokenParser(formula, false);// Eval formula
|
||||||
tokens = cal->GetTokens();// Tokens (variables, measurements)
|
tokens = cal->GetTokens();// Tokens (variables, measurements)
|
||||||
numbers = cal->GetNumbers();// All numbers in expression for changing decimal separator
|
numbers = cal->GetNumbers();// All numbers in expression for changing decimal separator
|
||||||
delete cal;
|
delete cal;
|
||||||
|
@ -979,7 +977,7 @@ void VTranslateVars::Retranslate()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QMap<QString, QmuTranslation> VTranslateVars::GetFunctions() const
|
QMap<QString, qmu::QmuTranslation> VTranslateVars::GetFunctions() const
|
||||||
{
|
{
|
||||||
return functions;
|
return functions;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
|
|
||||||
#include "vvector3dproperty.h"
|
#include "vvector3dproperty.h"
|
||||||
|
|
||||||
using namespace VPE;
|
|
||||||
|
|
||||||
#include <QFlags>
|
#include <QFlags>
|
||||||
#include <QForeachContainer>
|
#include <QForeachContainer>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
@ -30,7 +28,7 @@ using namespace VPE;
|
||||||
#include "../../vproperty_p.h"
|
#include "../../vproperty_p.h"
|
||||||
#include "../vnumberproperty.h"
|
#include "../vnumberproperty.h"
|
||||||
|
|
||||||
QVector3DProperty::QVector3DProperty(const QString& name)
|
VPE::QVector3DProperty::QVector3DProperty(const QString& name)
|
||||||
: VProperty(name, QVariant::String) // todo: QVariant::Vector3D??
|
: VProperty(name, QVariant::String) // todo: QVariant::Vector3D??
|
||||||
{
|
{
|
||||||
QVariant tmpFloat(0); tmpFloat.convert(QVariant::Double);
|
QVariant tmpFloat(0); tmpFloat.convert(QVariant::Double);
|
||||||
|
@ -42,7 +40,7 @@ QVector3DProperty::QVector3DProperty(const QString& name)
|
||||||
|
|
||||||
|
|
||||||
//! Get the data how it should be displayed
|
//! Get the data how it should be displayed
|
||||||
QVariant QVector3DProperty::data (int column, int role) const
|
QVariant VPE::QVector3DProperty::data (int column, int role) const
|
||||||
{
|
{
|
||||||
if (column == DPC_Data && Qt::DisplayRole == role)
|
if (column == DPC_Data && Qt::DisplayRole == role)
|
||||||
{
|
{
|
||||||
|
@ -56,7 +54,7 @@ QVariant QVector3DProperty::data (int column, int role) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns item flags
|
//! Returns item flags
|
||||||
Qt::ItemFlags QVector3DProperty::flags(int column) const
|
Qt::ItemFlags VPE::QVector3DProperty::flags(int column) const
|
||||||
{
|
{
|
||||||
if (column == DPC_Name || column == DPC_Data)
|
if (column == DPC_Name || column == DPC_Data)
|
||||||
{
|
{
|
||||||
|
@ -68,7 +66,7 @@ Qt::ItemFlags QVector3DProperty::flags(int column) const
|
||||||
|
|
||||||
|
|
||||||
//! Returns the Vector3d
|
//! Returns the Vector3d
|
||||||
Vector3D QVector3DProperty::getVector() const
|
VPE::Vector3D VPE::QVector3DProperty::getVector() const
|
||||||
{
|
{
|
||||||
Vector3D tmpVect;
|
Vector3D tmpVect;
|
||||||
|
|
||||||
|
@ -85,12 +83,12 @@ Vector3D QVector3DProperty::getVector() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the Vector3d
|
//! Sets the Vector3d
|
||||||
void QVector3DProperty::setVector(const Vector3D &vect)
|
void VPE::QVector3DProperty::setVector(const Vector3D &vect)
|
||||||
{
|
{
|
||||||
setVector(vect.X, vect.Y, vect.Z);
|
setVector(vect.X, vect.Y, vect.Z);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QVector3DProperty::setVector(double x, double y, double z)
|
void VPE::QVector3DProperty::setVector(double x, double y, double z)
|
||||||
{
|
{
|
||||||
if (d_ptr->Children.count() < 3)
|
if (d_ptr->Children.count() < 3)
|
||||||
{
|
{
|
||||||
|
@ -105,12 +103,12 @@ void QVector3DProperty::setVector(double x, double y, double z)
|
||||||
d_ptr->Children.at(2)->setValue(tmpZ);
|
d_ptr->Children.at(2)->setValue(tmpZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QVector3DProperty::type() const
|
QString VPE::QVector3DProperty::type() const
|
||||||
{
|
{
|
||||||
return "vector3d";
|
return "vector3d";
|
||||||
}
|
}
|
||||||
|
|
||||||
VProperty* QVector3DProperty::clone(bool include_children, VProperty* container) const
|
VPE::VProperty* VPE::QVector3DProperty::clone(bool include_children, VProperty* container) const
|
||||||
{
|
{
|
||||||
if (!container)
|
if (!container)
|
||||||
{
|
{
|
||||||
|
@ -130,7 +128,7 @@ VProperty* QVector3DProperty::clone(bool include_children, VProperty* container)
|
||||||
return VProperty::clone(false, container); // Child
|
return VProperty::clone(false, container); // Child
|
||||||
}
|
}
|
||||||
|
|
||||||
void QVector3DProperty::setValue(const QVariant &value)
|
void VPE::QVector3DProperty::setValue(const QVariant &value)
|
||||||
{
|
{
|
||||||
QStringList tmpStrings = value.toString().split(",");
|
QStringList tmpStrings = value.toString().split(",");
|
||||||
if (tmpStrings.count() == 3)
|
if (tmpStrings.count() == 3)
|
||||||
|
@ -140,7 +138,7 @@ void QVector3DProperty::setValue(const QVariant &value)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant QVector3DProperty::getValue() const
|
QVariant VPE::QVector3DProperty::getValue() const
|
||||||
{
|
{
|
||||||
Vector3D tmpVect = getVector();
|
Vector3D tmpVect = getVector();
|
||||||
return QString("%1,%2,%3").arg(QString::number(tmpVect.X), QString::number(tmpVect.Y), QString::number(tmpVect.Z));
|
return QString("%1,%2,%3").arg(QString::number(tmpVect.X), QString::number(tmpVect.Y), QString::number(tmpVect.Z));
|
||||||
|
|
|
@ -25,12 +25,11 @@
|
||||||
|
|
||||||
#include "../vproperty_p.h"
|
#include "../vproperty_p.h"
|
||||||
|
|
||||||
using namespace VPE;
|
|
||||||
|
|
||||||
QVariant VBoolProperty::TrueText;
|
QVariant VPE::VBoolProperty::TrueText;
|
||||||
QVariant VBoolProperty::FalseText;
|
QVariant VPE::VBoolProperty::FalseText;
|
||||||
|
|
||||||
VBoolProperty::VBoolProperty(const QString& name) :
|
VPE::VBoolProperty::VBoolProperty(const QString& name) :
|
||||||
VProperty(name, QVariant::Bool)
|
VProperty(name, QVariant::Bool)
|
||||||
{
|
{
|
||||||
d_ptr->VariantValue.setValue(false);
|
d_ptr->VariantValue.setValue(false);
|
||||||
|
@ -49,7 +48,7 @@ VBoolProperty::VBoolProperty(const QString& name) :
|
||||||
|
|
||||||
|
|
||||||
//! Get the data how it should be displayed
|
//! Get the data how it should be displayed
|
||||||
QVariant VBoolProperty::data (int column, int role) const
|
QVariant VPE::VBoolProperty::data (int column, int role) const
|
||||||
{
|
{
|
||||||
if (column == DPC_Data && (Qt::DisplayRole == role || Qt::EditRole == role))
|
if (column == DPC_Data && (Qt::DisplayRole == role || Qt::EditRole == role))
|
||||||
{
|
{
|
||||||
|
@ -63,7 +62,7 @@ QVariant VBoolProperty::data (int column, int role) const
|
||||||
return VProperty::data(column, role);
|
return VProperty::data(column, role);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VBoolProperty::setData(const QVariant &data, int role)
|
bool VPE::VBoolProperty::setData(const QVariant &data, int role)
|
||||||
{
|
{
|
||||||
if (Qt::CheckStateRole == role)
|
if (Qt::CheckStateRole == role)
|
||||||
{
|
{
|
||||||
|
@ -75,7 +74,7 @@ bool VBoolProperty::setData(const QVariant &data, int role)
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns item flags
|
//! Returns item flags
|
||||||
Qt::ItemFlags VBoolProperty::flags(int column) const
|
Qt::ItemFlags VPE::VBoolProperty::flags(int column) const
|
||||||
{
|
{
|
||||||
if (column == DPC_Data)
|
if (column == DPC_Data)
|
||||||
{
|
{
|
||||||
|
@ -85,12 +84,12 @@ Qt::ItemFlags VBoolProperty::flags(int column) const
|
||||||
return VProperty::flags(column);
|
return VProperty::flags(column);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString VBoolProperty::type() const
|
QString VPE::VBoolProperty::type() const
|
||||||
{
|
{
|
||||||
return "bool";
|
return "bool";
|
||||||
}
|
}
|
||||||
|
|
||||||
VProperty *VBoolProperty::clone(bool include_children, VProperty *container) const
|
VPE::VProperty *VPE::VBoolProperty::clone(bool include_children, VProperty *container) const
|
||||||
{
|
{
|
||||||
return VProperty::clone(include_children, container ? container : new VBoolProperty(getName()));
|
return VProperty::clone(include_children, container ? container : new VBoolProperty(getName()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,16 +31,14 @@
|
||||||
class QAbstractItemDelegate;
|
class QAbstractItemDelegate;
|
||||||
class QStyleOptionViewItem;
|
class QStyleOptionViewItem;
|
||||||
|
|
||||||
using namespace VPE;
|
VPE::VColorProperty::VColorProperty(const QString &name) :
|
||||||
|
|
||||||
VColorProperty::VColorProperty(const QString &name) :
|
|
||||||
VProperty(name, QVariant::Color)
|
VProperty(name, QVariant::Color)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! Get the data how it should be displayed
|
//! Get the data how it should be displayed
|
||||||
QVariant VColorProperty::data (int column, int role) const
|
QVariant VPE::VColorProperty::data (int column, int role) const
|
||||||
{
|
{
|
||||||
if (column == DPC_Data && (Qt::DisplayRole == role))
|
if (column == DPC_Data && (Qt::DisplayRole == role))
|
||||||
{
|
{
|
||||||
|
@ -59,7 +57,7 @@ QVariant VColorProperty::data (int column, int role) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns an editor widget, or NULL if it doesn't supply one
|
//! Returns an editor widget, or NULL if it doesn't supply one
|
||||||
QWidget* VColorProperty::createEditor(QWidget* parent, const QStyleOptionViewItem& options,
|
QWidget* VPE::VColorProperty::createEditor(QWidget* parent, const QStyleOptionViewItem& options,
|
||||||
const QAbstractItemDelegate* delegate)
|
const QAbstractItemDelegate* delegate)
|
||||||
{
|
{
|
||||||
Q_UNUSED(options)
|
Q_UNUSED(options)
|
||||||
|
@ -72,7 +70,7 @@ QWidget* VColorProperty::createEditor(QWidget* parent, const QStyleOptionViewIte
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the property's data to the editor (returns false, if the standard delegate should do that)
|
//! Sets the property's data to the editor (returns false, if the standard delegate should do that)
|
||||||
bool VColorProperty::setEditorData(QWidget* editor)
|
bool VPE::VColorProperty::setEditorData(QWidget* editor)
|
||||||
{
|
{
|
||||||
VColorPropertyEditor* tmpWidget = qobject_cast<VColorPropertyEditor*>(editor);
|
VColorPropertyEditor* tmpWidget = qobject_cast<VColorPropertyEditor*>(editor);
|
||||||
if (tmpWidget)
|
if (tmpWidget)
|
||||||
|
@ -86,7 +84,7 @@ bool VColorProperty::setEditorData(QWidget* editor)
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Gets the data from the widget
|
//! Gets the data from the widget
|
||||||
QVariant VColorProperty::getEditorData(const QWidget *editor) const
|
QVariant VPE::VColorProperty::getEditorData(const QWidget *editor) const
|
||||||
{
|
{
|
||||||
const VColorPropertyEditor* tmpWidget = qobject_cast<const VColorPropertyEditor*>(editor);
|
const VColorPropertyEditor* tmpWidget = qobject_cast<const VColorPropertyEditor*>(editor);
|
||||||
if (tmpWidget)
|
if (tmpWidget)
|
||||||
|
@ -97,12 +95,12 @@ QVariant VColorProperty::getEditorData(const QWidget *editor) const
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString VColorProperty::type() const
|
QString VPE::VColorProperty::type() const
|
||||||
{
|
{
|
||||||
return "color";
|
return "color";
|
||||||
}
|
}
|
||||||
|
|
||||||
VProperty *VColorProperty::clone(bool include_children, VProperty *container) const
|
VPE::VProperty *VPE::VColorProperty::clone(bool include_children, VProperty *container) const
|
||||||
{
|
{
|
||||||
return VProperty::clone(include_children, container ? container : new VColorProperty(getName()));
|
return VProperty::clone(include_children, container ? container : new VColorProperty(getName()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,9 +35,7 @@
|
||||||
|
|
||||||
class QHBoxLayout;
|
class QHBoxLayout;
|
||||||
|
|
||||||
using namespace VPE;
|
VPE::VColorPropertyEditor::VColorPropertyEditor(QWidget *parent)
|
||||||
|
|
||||||
VColorPropertyEditor::VColorPropertyEditor(QWidget *parent)
|
|
||||||
: QWidget(parent), Color(), ToolButton(nullptr), TextLabel(nullptr), ColorLabel(nullptr), Spacer(nullptr)
|
: QWidget(parent), Color(), ToolButton(nullptr), TextLabel(nullptr), ColorLabel(nullptr), Spacer(nullptr)
|
||||||
{
|
{
|
||||||
setAutoFillBackground(true);
|
setAutoFillBackground(true);
|
||||||
|
@ -75,7 +73,7 @@ VColorPropertyEditor::VColorPropertyEditor(QWidget *parent)
|
||||||
//ColorLabel->hide(); // for now, we just use the standard display and only add the button
|
//ColorLabel->hide(); // for now, we just use the standard display and only add the button
|
||||||
}
|
}
|
||||||
|
|
||||||
void VColorPropertyEditor::SetColor(const QColor& color_)
|
void VPE::VColorPropertyEditor::SetColor(const QColor& color_)
|
||||||
{
|
{
|
||||||
if (Color != color_)
|
if (Color != color_)
|
||||||
{
|
{
|
||||||
|
@ -85,7 +83,7 @@ void VColorPropertyEditor::SetColor(const QColor& color_)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QPixmap VColorPropertyEditor::GetColorPixmap(const QColor& color, quint32 size)
|
QPixmap VPE::VColorPropertyEditor::GetColorPixmap(const QColor& color, quint32 size)
|
||||||
{
|
{
|
||||||
QImage tmpImgage(static_cast<int>(size), static_cast<int>(size), QImage::Format_ARGB32_Premultiplied);
|
QImage tmpImgage(static_cast<int>(size), static_cast<int>(size), QImage::Format_ARGB32_Premultiplied);
|
||||||
tmpImgage.fill(static_cast<quint32>(color.rgb()));
|
tmpImgage.fill(static_cast<quint32>(color.rgb()));
|
||||||
|
@ -93,12 +91,12 @@ QPixmap VColorPropertyEditor::GetColorPixmap(const QColor& color, quint32 size)
|
||||||
// todo: support alpha channel
|
// todo: support alpha channel
|
||||||
}
|
}
|
||||||
|
|
||||||
QString VColorPropertyEditor::GetColorString(const QColor& color)
|
QString VPE::VColorPropertyEditor::GetColorString(const QColor& color)
|
||||||
{
|
{
|
||||||
return QString("[%1, %2, %3] (%4)").arg(color.red()).arg(color.green()).arg(color.blue()).arg(color.alpha());
|
return QString("[%1, %2, %3] (%4)").arg(color.red()).arg(color.green()).arg(color.blue()).arg(color.alpha());
|
||||||
}
|
}
|
||||||
|
|
||||||
void VColorPropertyEditor::onToolButtonClicked()
|
void VPE::VColorPropertyEditor::onToolButtonClicked()
|
||||||
{
|
{
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
QRgb oldRgba = Color.rgba();
|
QRgb oldRgba = Color.rgba();
|
||||||
|
@ -112,7 +110,7 @@ void VColorPropertyEditor::onToolButtonClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VColorPropertyEditor::eventFilter(QObject *obj, QEvent *ev)
|
bool VPE::VColorPropertyEditor::eventFilter(QObject *obj, QEvent *ev)
|
||||||
{
|
{
|
||||||
if (obj == ToolButton && ev->type() == QEvent::KeyPress)
|
if (obj == ToolButton && ev->type() == QEvent::KeyPress)
|
||||||
{
|
{
|
||||||
|
@ -125,12 +123,12 @@ bool VColorPropertyEditor::eventFilter(QObject *obj, QEvent *ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VColorPropertyEditor::~VColorPropertyEditor()
|
VPE::VColorPropertyEditor::~VColorPropertyEditor()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor VColorPropertyEditor::GetColor() const
|
QColor VPE::VColorPropertyEditor::GetColor() const
|
||||||
{
|
{
|
||||||
return Color;
|
return Color;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,27 +35,25 @@ namespace VPE {
|
||||||
class VPropertyPrivate;
|
class VPropertyPrivate;
|
||||||
} // namespace VPE
|
} // namespace VPE
|
||||||
|
|
||||||
using namespace VPE;
|
VPE::VEmptyProperty::VEmptyProperty(const QString& name)
|
||||||
|
|
||||||
VEmptyProperty::VEmptyProperty(const QString& name)
|
|
||||||
: VProperty(name, QVariant::Invalid)
|
: VProperty(name, QVariant::Invalid)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VEmptyProperty::VEmptyProperty(VPropertyPrivate *d)
|
VPE::VEmptyProperty::VEmptyProperty(VPropertyPrivate *d)
|
||||||
: VProperty(d)
|
: VProperty(d)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VEmptyProperty::~VEmptyProperty()
|
VPE::VEmptyProperty::~VEmptyProperty()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Get the data how it should be displayed
|
//! Get the data how it should be displayed
|
||||||
QVariant VEmptyProperty::data (int column, int role) const
|
QVariant VPE::VEmptyProperty::data (int column, int role) const
|
||||||
{
|
{
|
||||||
if (column == DPC_Data && (Qt::DisplayRole == role || Qt::EditRole == role))
|
if (column == DPC_Data && (Qt::DisplayRole == role || Qt::EditRole == role))
|
||||||
{
|
{
|
||||||
|
@ -74,7 +72,7 @@ QVariant VEmptyProperty::data (int column, int role) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns an editor widget, or NULL if it doesn't supply one
|
//! Returns an editor widget, or NULL if it doesn't supply one
|
||||||
QWidget* VEmptyProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
|
QWidget* VPE::VEmptyProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
|
||||||
const QAbstractItemDelegate* delegate)
|
const QAbstractItemDelegate* delegate)
|
||||||
{
|
{
|
||||||
Q_UNUSED(options)
|
Q_UNUSED(options)
|
||||||
|
@ -86,7 +84,7 @@ QWidget* VEmptyProperty::createEditor(QWidget * parent, const QStyleOptionViewIt
|
||||||
|
|
||||||
|
|
||||||
//! Gets the data from the widget
|
//! Gets the data from the widget
|
||||||
QVariant VEmptyProperty::getEditorData(const QWidget *editor) const
|
QVariant VPE::VEmptyProperty::getEditorData(const QWidget *editor) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(editor)
|
Q_UNUSED(editor)
|
||||||
|
|
||||||
|
@ -94,19 +92,19 @@ QVariant VEmptyProperty::getEditorData(const QWidget *editor) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns item flags
|
//! Returns item flags
|
||||||
Qt::ItemFlags VEmptyProperty::flags(int column) const
|
Qt::ItemFlags VPE::VEmptyProperty::flags(int column) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(column)
|
Q_UNUSED(column)
|
||||||
|
|
||||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
|
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString VEmptyProperty::type() const
|
QString VPE::VEmptyProperty::type() const
|
||||||
{
|
{
|
||||||
return "empty";
|
return "empty";
|
||||||
}
|
}
|
||||||
|
|
||||||
VProperty* VEmptyProperty::clone(bool include_children, VProperty* container) const
|
VPE::VProperty* VPE::VEmptyProperty::clone(bool include_children, VProperty* container) const
|
||||||
{
|
{
|
||||||
return VProperty::clone(include_children, container ? container : new VEmptyProperty(getName()));
|
return VProperty::clone(include_children, container ? container : new VEmptyProperty(getName()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,9 +30,7 @@
|
||||||
class QAbstractItemDelegate;
|
class QAbstractItemDelegate;
|
||||||
class QStyleOptionViewItem;
|
class QStyleOptionViewItem;
|
||||||
|
|
||||||
using namespace VPE;
|
VPE::VEnumProperty::VEnumProperty(const QString& name)
|
||||||
|
|
||||||
VEnumProperty::VEnumProperty(const QString& name)
|
|
||||||
: VProperty(name, QVariant::Int), EnumerationLiterals()
|
: VProperty(name, QVariant::Int), EnumerationLiterals()
|
||||||
{
|
{
|
||||||
VProperty::d_ptr->VariantValue = 0;
|
VProperty::d_ptr->VariantValue = 0;
|
||||||
|
@ -41,7 +39,7 @@ VEnumProperty::VEnumProperty(const QString& name)
|
||||||
|
|
||||||
|
|
||||||
//! Get the data how it should be displayed
|
//! Get the data how it should be displayed
|
||||||
QVariant VEnumProperty::data (int column, int role) const
|
QVariant VPE::VEnumProperty::data (int column, int role) const
|
||||||
{
|
{
|
||||||
if (EnumerationLiterals.empty())
|
if (EnumerationLiterals.empty())
|
||||||
{
|
{
|
||||||
|
@ -69,7 +67,7 @@ QVariant VEnumProperty::data (int column, int role) const
|
||||||
|
|
||||||
|
|
||||||
//! Returns an editor widget, or NULL if it doesn't supply one
|
//! Returns an editor widget, or NULL if it doesn't supply one
|
||||||
QWidget* VEnumProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
|
QWidget* VPE::VEnumProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
|
||||||
const QAbstractItemDelegate* delegate)
|
const QAbstractItemDelegate* delegate)
|
||||||
{
|
{
|
||||||
Q_UNUSED(options)
|
Q_UNUSED(options)
|
||||||
|
@ -87,7 +85,7 @@ QWidget* VEnumProperty::createEditor(QWidget * parent, const QStyleOptionViewIte
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Gets the data from the widget
|
//! Gets the data from the widget
|
||||||
QVariant VEnumProperty::getEditorData(const QWidget *editor) const
|
QVariant VPE::VEnumProperty::getEditorData(const QWidget *editor) const
|
||||||
{
|
{
|
||||||
const QComboBox* tmpEditor = qobject_cast<const QComboBox*>(editor);
|
const QComboBox* tmpEditor = qobject_cast<const QComboBox*>(editor);
|
||||||
if (tmpEditor)
|
if (tmpEditor)
|
||||||
|
@ -99,19 +97,19 @@ QVariant VEnumProperty::getEditorData(const QWidget *editor) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the enumeration literals
|
//! Sets the enumeration literals
|
||||||
void VEnumProperty::setLiterals(const QStringList& literals)
|
void VPE::VEnumProperty::setLiterals(const QStringList& literals)
|
||||||
{
|
{
|
||||||
EnumerationLiterals = literals;
|
EnumerationLiterals = literals;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Get the settings. This function has to be implemented in a subclass in order to have an effect
|
//! Get the settings. This function has to be implemented in a subclass in order to have an effect
|
||||||
QStringList VEnumProperty::getLiterals() const
|
QStringList VPE::VEnumProperty::getLiterals() const
|
||||||
{
|
{
|
||||||
return EnumerationLiterals;
|
return EnumerationLiterals;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the value of the property
|
//! Sets the value of the property
|
||||||
void VEnumProperty::setValue(const QVariant& value)
|
void VPE::VEnumProperty::setValue(const QVariant& value)
|
||||||
{
|
{
|
||||||
int tmpIndex = value.toInt();
|
int tmpIndex = value.toInt();
|
||||||
|
|
||||||
|
@ -129,17 +127,17 @@ void VEnumProperty::setValue(const QVariant& value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString VEnumProperty::type() const
|
QString VPE::VEnumProperty::type() const
|
||||||
{
|
{
|
||||||
return "enum";
|
return "enum";
|
||||||
}
|
}
|
||||||
|
|
||||||
VProperty* VEnumProperty::clone(bool include_children, VProperty* container) const
|
VPE::VProperty* VPE::VEnumProperty::clone(bool include_children, VProperty* container) const
|
||||||
{
|
{
|
||||||
return VProperty::clone(include_children, container ? container : new VEnumProperty(getName()));
|
return VProperty::clone(include_children, container ? container : new VEnumProperty(getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VEnumProperty::setSetting(const QString& key, const QVariant& value)
|
void VPE::VEnumProperty::setSetting(const QString& key, const QVariant& value)
|
||||||
{
|
{
|
||||||
if (key == "literals")
|
if (key == "literals")
|
||||||
{
|
{
|
||||||
|
@ -147,7 +145,7 @@ void VEnumProperty::setSetting(const QString& key, const QVariant& value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant VEnumProperty::getSetting(const QString& key) const
|
QVariant VPE::VEnumProperty::getSetting(const QString& key) const
|
||||||
{
|
{
|
||||||
if (key == "literals")
|
if (key == "literals")
|
||||||
{
|
{
|
||||||
|
@ -157,12 +155,12 @@ QVariant VEnumProperty::getSetting(const QString& key) const
|
||||||
return VProperty::getSetting(key);
|
return VProperty::getSetting(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList VEnumProperty::getSettingKeys() const
|
QStringList VPE::VEnumProperty::getSettingKeys() const
|
||||||
{
|
{
|
||||||
return QStringList("literals");
|
return QStringList("literals");
|
||||||
}
|
}
|
||||||
|
|
||||||
void VEnumProperty::currentIndexChanged(int index)
|
void VPE::VEnumProperty::currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
Q_UNUSED(index)
|
Q_UNUSED(index)
|
||||||
UserChangeEvent *event = new UserChangeEvent();
|
UserChangeEvent *event = new UserChangeEvent();
|
||||||
|
|
|
@ -31,45 +31,43 @@
|
||||||
|
|
||||||
class QStyleOptionViewItem;
|
class QStyleOptionViewItem;
|
||||||
|
|
||||||
using namespace VPE;
|
VPE::VFileProperty::VFileProperty(const QString& name)
|
||||||
|
|
||||||
VFileProperty::VFileProperty(const QString& name)
|
|
||||||
: VProperty(new VFilePropertyPrivate(name, QVariant::String))
|
: VProperty(new VFilePropertyPrivate(name, QVariant::String))
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VFileProperty::~VFileProperty()
|
VPE::VFileProperty::~VFileProperty()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void VFileProperty::setFileFilters(const QString& filefilters)
|
void VPE::VFileProperty::setFileFilters(const QString& filefilters)
|
||||||
{
|
{
|
||||||
static_cast<VFilePropertyPrivate*>(d_ptr)->FileFilters = filefilters;
|
static_cast<VFilePropertyPrivate*>(d_ptr)->FileFilters = filefilters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString VFileProperty::getFileFilters() const
|
QString VPE::VFileProperty::getFileFilters() const
|
||||||
{
|
{
|
||||||
return static_cast<VFilePropertyPrivate*>(d_ptr)->FileFilters;
|
return static_cast<VFilePropertyPrivate*>(d_ptr)->FileFilters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void VFileProperty::setFile(const QString& file)
|
void VPE::VFileProperty::setFile(const QString& file)
|
||||||
{
|
{
|
||||||
d_ptr->VariantValue.setValue(file);
|
d_ptr->VariantValue.setValue(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString VFileProperty::getFile() const
|
QString VPE::VFileProperty::getFile() const
|
||||||
{
|
{
|
||||||
return d_ptr->VariantValue.toString();
|
return d_ptr->VariantValue.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QVariant VFileProperty::data (int column, int role) const
|
QVariant VPE::VFileProperty::data (int column, int role) const
|
||||||
{
|
{
|
||||||
if (column == DPC_Data && (Qt::DisplayRole == role || Qt::EditRole == role))
|
if (column == DPC_Data && (Qt::DisplayRole == role || Qt::EditRole == role))
|
||||||
{
|
{
|
||||||
|
@ -81,7 +79,7 @@ QVariant VFileProperty::data (int column, int role) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QWidget* VFileProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
|
QWidget* VPE::VFileProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
|
||||||
const QAbstractItemDelegate* delegate)
|
const QAbstractItemDelegate* delegate)
|
||||||
{
|
{
|
||||||
Q_UNUSED(options)
|
Q_UNUSED(options)
|
||||||
|
@ -100,7 +98,7 @@ QWidget* VFileProperty::createEditor(QWidget * parent, const QStyleOptionViewIte
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool VFileProperty::setEditorData(QWidget* editor)
|
bool VPE::VFileProperty::setEditorData(QWidget* editor)
|
||||||
{
|
{
|
||||||
VFileEditWidget* tmpWidget = qobject_cast<VFileEditWidget*>(editor);
|
VFileEditWidget* tmpWidget = qobject_cast<VFileEditWidget*>(editor);
|
||||||
if (tmpWidget)
|
if (tmpWidget)
|
||||||
|
@ -114,7 +112,7 @@ bool VFileProperty::setEditorData(QWidget* editor)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QVariant VFileProperty::getEditorData(const QWidget *editor) const
|
QVariant VPE::VFileProperty::getEditorData(const QWidget *editor) const
|
||||||
{
|
{
|
||||||
const VFileEditWidget* tmpWidget = qobject_cast<const VFileEditWidget*>(editor);
|
const VFileEditWidget* tmpWidget = qobject_cast<const VFileEditWidget*>(editor);
|
||||||
if (tmpWidget)
|
if (tmpWidget)
|
||||||
|
@ -125,7 +123,7 @@ QVariant VFileProperty::getEditorData(const QWidget *editor) const
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VFileProperty::setSetting(const QString& key, const QVariant& value)
|
void VPE::VFileProperty::setSetting(const QString& key, const QVariant& value)
|
||||||
{
|
{
|
||||||
if (key == "FileFilters")
|
if (key == "FileFilters")
|
||||||
{
|
{
|
||||||
|
@ -137,7 +135,7 @@ void VFileProperty::setSetting(const QString& key, const QVariant& value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant VFileProperty::getSetting(const QString& key) const
|
QVariant VPE::VFileProperty::getSetting(const QString& key) const
|
||||||
{
|
{
|
||||||
if (key == "FileFilters")
|
if (key == "FileFilters")
|
||||||
{
|
{
|
||||||
|
@ -151,28 +149,28 @@ QVariant VFileProperty::getSetting(const QString& key) const
|
||||||
return VProperty::getSetting(key);
|
return VProperty::getSetting(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList VFileProperty::getSettingKeys() const
|
QStringList VPE::VFileProperty::getSettingKeys() const
|
||||||
{
|
{
|
||||||
return QStringList("FileFilters") << "Directory";
|
return QStringList("FileFilters") << "Directory";
|
||||||
}
|
}
|
||||||
|
|
||||||
QString VFileProperty::type() const
|
QString VPE::VFileProperty::type() const
|
||||||
{
|
{
|
||||||
return "file";
|
return "file";
|
||||||
}
|
}
|
||||||
|
|
||||||
VProperty* VFileProperty::clone(bool include_children, VProperty* container) const
|
VPE::VProperty* VPE::VFileProperty::clone(bool include_children, VProperty* container) const
|
||||||
{
|
{
|
||||||
return VProperty::clone(include_children, container ? container : new VFileProperty(getName()));
|
return VProperty::clone(include_children, container ? container : new VFileProperty(getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VFileProperty::isDirectory() const
|
bool VPE::VFileProperty::isDirectory() const
|
||||||
{
|
{
|
||||||
return static_cast<VFilePropertyPrivate*>(d_ptr)->Directory;
|
return static_cast<VFilePropertyPrivate*>(d_ptr)->Directory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void VFileProperty::setDirectory(bool is_directory)
|
void VPE::VFileProperty::setDirectory(bool is_directory)
|
||||||
{
|
{
|
||||||
static_cast<VFilePropertyPrivate*>(d_ptr)->Directory = is_directory;
|
static_cast<VFilePropertyPrivate*>(d_ptr)->Directory = is_directory;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,9 +45,7 @@ class QDragMoveEvent;
|
||||||
class QDropEvent;
|
class QDropEvent;
|
||||||
class QHBoxLayout;
|
class QHBoxLayout;
|
||||||
|
|
||||||
using namespace VPE;
|
VPE::VFileEditWidget::VFileEditWidget(QWidget *parent, bool is_directory)
|
||||||
|
|
||||||
VFileEditWidget::VFileEditWidget(QWidget *parent, bool is_directory)
|
|
||||||
: QWidget(parent), CurrentFilePath(), ToolButton(nullptr), FileLineEdit(nullptr), FileDialogFilter(), FilterList(),
|
: QWidget(parent), CurrentFilePath(), ToolButton(nullptr), FileLineEdit(nullptr), FileDialogFilter(), FilterList(),
|
||||||
Directory(is_directory)
|
Directory(is_directory)
|
||||||
{
|
{
|
||||||
|
@ -79,13 +77,13 @@ VFileEditWidget::VFileEditWidget(QWidget *parent, bool is_directory)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VFileEditWidget::~VFileEditWidget()
|
VPE::VFileEditWidget::~VFileEditWidget()
|
||||||
{
|
{
|
||||||
// nothing needs to be done here
|
// nothing needs to be done here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void VFileEditWidget::setFile(const QString &value, bool emit_signal)
|
void VPE::VFileEditWidget::setFile(const QString &value, bool emit_signal)
|
||||||
{
|
{
|
||||||
if (CurrentFilePath != value)
|
if (CurrentFilePath != value)
|
||||||
{
|
{
|
||||||
|
@ -101,24 +99,24 @@ void VFileEditWidget::setFile(const QString &value, bool emit_signal)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void VFileEditWidget::setFilter(const QString &dialog_filter, const QStringList& filter_list)
|
void VPE::VFileEditWidget::setFilter(const QString &dialog_filter, const QStringList& filter_list)
|
||||||
{
|
{
|
||||||
FileDialogFilter = dialog_filter;
|
FileDialogFilter = dialog_filter;
|
||||||
FilterList = filter_list;
|
FilterList = filter_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VFileEditWidget::setDirectory(bool dir)
|
void VPE::VFileEditWidget::setDirectory(bool dir)
|
||||||
{
|
{
|
||||||
Directory = dir;
|
Directory = dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString VFileEditWidget::getFile() const
|
QString VPE::VFileEditWidget::getFile() const
|
||||||
{
|
{
|
||||||
return CurrentFilePath;
|
return CurrentFilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void VFileEditWidget::onToolButtonClicked()
|
void VPE::VFileEditWidget::onToolButtonClicked()
|
||||||
{
|
{
|
||||||
QString filepath = (Directory ? QFileDialog::getExistingDirectory(0, tr("Directory"), CurrentFilePath)
|
QString filepath = (Directory ? QFileDialog::getExistingDirectory(0, tr("Directory"), CurrentFilePath)
|
||||||
: QFileDialog::getOpenFileName(0, tr("Open File"), CurrentFilePath,
|
: QFileDialog::getOpenFileName(0, tr("Open File"), CurrentFilePath,
|
||||||
|
@ -130,7 +128,7 @@ void VFileEditWidget::onToolButtonClicked()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool VFileEditWidget::eventFilter(QObject *obj, QEvent *ev)
|
bool VPE::VFileEditWidget::eventFilter(QObject *obj, QEvent *ev)
|
||||||
{
|
{
|
||||||
if (ev->type() == QEvent::DragEnter || ev->type() == QEvent::Drop)
|
if (ev->type() == QEvent::DragEnter || ev->type() == QEvent::Drop)
|
||||||
{
|
{
|
||||||
|
@ -170,13 +168,13 @@ bool VFileEditWidget::eventFilter(QObject *obj, QEvent *ev)
|
||||||
return QWidget::eventFilter(obj, ev);
|
return QWidget::eventFilter(obj, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VFileEditWidget::isDirectory()
|
bool VPE::VFileEditWidget::isDirectory()
|
||||||
{
|
{
|
||||||
return Directory;
|
return Directory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void VFileEditWidget::dragEnterEvent(QDragEnterEvent* event)
|
void VPE::VFileEditWidget::dragEnterEvent(QDragEnterEvent* event)
|
||||||
{
|
{
|
||||||
QString tmpFileName;
|
QString tmpFileName;
|
||||||
if (checkMimeData(event->mimeData(), tmpFileName))
|
if (checkMimeData(event->mimeData(), tmpFileName))
|
||||||
|
@ -187,18 +185,18 @@ void VFileEditWidget::dragEnterEvent(QDragEnterEvent* event)
|
||||||
}
|
}
|
||||||
|
|
||||||
// cppcheck-suppress unusedFunction
|
// cppcheck-suppress unusedFunction
|
||||||
void VFileEditWidget::dragMoveEvent(QDragMoveEvent* event)
|
void VPE::VFileEditWidget::dragMoveEvent(QDragMoveEvent* event)
|
||||||
{
|
{
|
||||||
event->acceptProposedAction();
|
event->acceptProposedAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// cppcheck-suppress unusedFunction
|
// cppcheck-suppress unusedFunction
|
||||||
void VFileEditWidget::dragLeaveEvent(QDragLeaveEvent* event)
|
void VPE::VFileEditWidget::dragLeaveEvent(QDragLeaveEvent* event)
|
||||||
{
|
{
|
||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VFileEditWidget::dropEvent(QDropEvent* event)
|
void VPE::VFileEditWidget::dropEvent(QDropEvent* event)
|
||||||
{
|
{
|
||||||
QString tmpFileName;
|
QString tmpFileName;
|
||||||
if (checkMimeData(event->mimeData(), tmpFileName))
|
if (checkMimeData(event->mimeData(), tmpFileName))
|
||||||
|
@ -212,7 +210,7 @@ void VFileEditWidget::dropEvent(QDropEvent* event)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool VFileEditWidget::checkMimeData(const QMimeData* data, QString& file) const
|
bool VPE::VFileEditWidget::checkMimeData(const QMimeData* data, QString& file) const
|
||||||
{
|
{
|
||||||
if (data->hasUrls())
|
if (data->hasUrls())
|
||||||
{
|
{
|
||||||
|
@ -235,7 +233,7 @@ bool VFileEditWidget::checkMimeData(const QMimeData* data, QString& file) const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VFileEditWidget::checkFileFilter(const QString& file) const
|
bool VPE::VFileEditWidget::checkFileFilter(const QString& file) const
|
||||||
{
|
{
|
||||||
if (FilterList.isEmpty())
|
if (FilterList.isEmpty())
|
||||||
{
|
{
|
||||||
|
|
|
@ -45,16 +45,14 @@
|
||||||
class QAbstractItemDelegate;
|
class QAbstractItemDelegate;
|
||||||
class QStyleOptionViewItem;
|
class QStyleOptionViewItem;
|
||||||
|
|
||||||
using namespace VPE;
|
VPE::VLineColorProperty::VLineColorProperty(const QString &name)
|
||||||
|
|
||||||
VLineColorProperty::VLineColorProperty(const QString &name)
|
|
||||||
: VProperty(name, QVariant::Int), colors(), indexList()
|
: VProperty(name, QVariant::Int), colors(), indexList()
|
||||||
{
|
{
|
||||||
VProperty::d_ptr->VariantValue = 0;
|
VProperty::d_ptr->VariantValue = 0;
|
||||||
VProperty::d_ptr->VariantValue.convert(QVariant::Int);
|
VProperty::d_ptr->VariantValue.convert(QVariant::Int);
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant VLineColorProperty::data(int column, int role) const
|
QVariant VPE::VLineColorProperty::data(int column, int role) const
|
||||||
{
|
{
|
||||||
if (colors.empty())
|
if (colors.empty())
|
||||||
{
|
{
|
||||||
|
@ -82,7 +80,7 @@ QVariant VLineColorProperty::data(int column, int role) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *VLineColorProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &options,
|
QWidget *VPE::VLineColorProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &options,
|
||||||
const QAbstractItemDelegate *delegate)
|
const QAbstractItemDelegate *delegate)
|
||||||
{
|
{
|
||||||
Q_UNUSED(options)
|
Q_UNUSED(options)
|
||||||
|
@ -113,7 +111,7 @@ QWidget *VLineColorProperty::createEditor(QWidget *parent, const QStyleOptionVie
|
||||||
return VProperty::d_ptr->editor;
|
return VProperty::d_ptr->editor;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant VLineColorProperty::getEditorData(const QWidget *editor) const
|
QVariant VPE::VLineColorProperty::getEditorData(const QWidget *editor) const
|
||||||
{
|
{
|
||||||
const QComboBox* tmpEditor = qobject_cast<const QComboBox*>(editor);
|
const QComboBox* tmpEditor = qobject_cast<const QComboBox*>(editor);
|
||||||
if (tmpEditor)
|
if (tmpEditor)
|
||||||
|
@ -124,7 +122,7 @@ QVariant VLineColorProperty::getEditorData(const QWidget *editor) const
|
||||||
return QVariant(0);
|
return QVariant(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VLineColorProperty::setColors(const QMap<QString, QString> &colors)
|
void VPE::VLineColorProperty::setColors(const QMap<QString, QString> &colors)
|
||||||
{
|
{
|
||||||
this->colors = colors;
|
this->colors = colors;
|
||||||
indexList.clear();
|
indexList.clear();
|
||||||
|
@ -137,12 +135,12 @@ void VLineColorProperty::setColors(const QMap<QString, QString> &colors)
|
||||||
}
|
}
|
||||||
|
|
||||||
// cppcheck-suppress unusedFunction
|
// cppcheck-suppress unusedFunction
|
||||||
QMap<QString, QString> VLineColorProperty::getColors() const
|
QMap<QString, QString> VPE::VLineColorProperty::getColors() const
|
||||||
{
|
{
|
||||||
return colors;
|
return colors;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VLineColorProperty::setValue(const QVariant &value)
|
void VPE::VLineColorProperty::setValue(const QVariant &value)
|
||||||
{
|
{
|
||||||
int tmpIndex = value.toInt();
|
int tmpIndex = value.toInt();
|
||||||
|
|
||||||
|
@ -160,17 +158,17 @@ void VLineColorProperty::setValue(const QVariant &value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString VLineColorProperty::type() const
|
QString VPE::VLineColorProperty::type() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("lineColor");
|
return QStringLiteral("lineColor");
|
||||||
}
|
}
|
||||||
|
|
||||||
VProperty *VLineColorProperty::clone(bool include_children, VProperty *container) const
|
VPE::VProperty *VPE::VLineColorProperty::clone(bool include_children, VProperty *container) const
|
||||||
{
|
{
|
||||||
return VProperty::clone(include_children, container ? container : new VLineColorProperty(getName()));
|
return VProperty::clone(include_children, container ? container : new VLineColorProperty(getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
int VLineColorProperty::IndexOfColor(const QMap<QString, QString> &colors, const QString &color)
|
int VPE::VLineColorProperty::IndexOfColor(const QMap<QString, QString> &colors, const QString &color)
|
||||||
{
|
{
|
||||||
QVector<QString> indexList;
|
QVector<QString> indexList;
|
||||||
QMap<QString, QString>::const_iterator i = colors.constBegin();
|
QMap<QString, QString>::const_iterator i = colors.constBegin();
|
||||||
|
@ -182,7 +180,7 @@ int VLineColorProperty::IndexOfColor(const QMap<QString, QString> &colors, const
|
||||||
return indexList.indexOf(color);
|
return indexList.indexOf(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VLineColorProperty::currentIndexChanged(int index)
|
void VPE::VLineColorProperty::currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
Q_UNUSED(index)
|
Q_UNUSED(index)
|
||||||
UserChangeEvent *event = new UserChangeEvent();
|
UserChangeEvent *event = new UserChangeEvent();
|
||||||
|
|
|
@ -42,16 +42,14 @@
|
||||||
class QAbstractItemDelegate;
|
class QAbstractItemDelegate;
|
||||||
class QStyleOptionViewItem;
|
class QStyleOptionViewItem;
|
||||||
|
|
||||||
using namespace VPE;
|
VPE::VLineTypeProperty::VLineTypeProperty(const QString &name)
|
||||||
|
|
||||||
VLineTypeProperty::VLineTypeProperty(const QString &name)
|
|
||||||
: VProperty(name, QVariant::Int), styles(), indexList()
|
: VProperty(name, QVariant::Int), styles(), indexList()
|
||||||
{
|
{
|
||||||
VProperty::d_ptr->VariantValue = 0;
|
VProperty::d_ptr->VariantValue = 0;
|
||||||
VProperty::d_ptr->VariantValue.convert(QVariant::Int);
|
VProperty::d_ptr->VariantValue.convert(QVariant::Int);
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant VLineTypeProperty::data(int column, int role) const
|
QVariant VPE::VLineTypeProperty::data(int column, int role) const
|
||||||
{
|
{
|
||||||
if (styles.empty())
|
if (styles.empty())
|
||||||
{
|
{
|
||||||
|
@ -79,7 +77,7 @@ QVariant VLineTypeProperty::data(int column, int role) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *VLineTypeProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &options,
|
QWidget *VPE::VLineTypeProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &options,
|
||||||
const QAbstractItemDelegate *delegate)
|
const QAbstractItemDelegate *delegate)
|
||||||
{
|
{
|
||||||
Q_UNUSED(options)
|
Q_UNUSED(options)
|
||||||
|
@ -106,7 +104,7 @@ QWidget *VLineTypeProperty::createEditor(QWidget *parent, const QStyleOptionView
|
||||||
return VProperty::d_ptr->editor;
|
return VProperty::d_ptr->editor;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant VLineTypeProperty::getEditorData(const QWidget *editor) const
|
QVariant VPE::VLineTypeProperty::getEditorData(const QWidget *editor) const
|
||||||
{
|
{
|
||||||
const QComboBox* tmpEditor = qobject_cast<const QComboBox*>(editor);
|
const QComboBox* tmpEditor = qobject_cast<const QComboBox*>(editor);
|
||||||
if (tmpEditor)
|
if (tmpEditor)
|
||||||
|
@ -117,7 +115,7 @@ QVariant VLineTypeProperty::getEditorData(const QWidget *editor) const
|
||||||
return QVariant(0);
|
return QVariant(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VLineTypeProperty::setStyles(const QMap<QString, QIcon> &styles)
|
void VPE::VLineTypeProperty::setStyles(const QMap<QString, QIcon> &styles)
|
||||||
{
|
{
|
||||||
this->styles = styles;
|
this->styles = styles;
|
||||||
indexList.clear();
|
indexList.clear();
|
||||||
|
@ -130,12 +128,12 @@ void VLineTypeProperty::setStyles(const QMap<QString, QIcon> &styles)
|
||||||
}
|
}
|
||||||
|
|
||||||
// cppcheck-suppress unusedFunction
|
// cppcheck-suppress unusedFunction
|
||||||
QMap<QString, QIcon> VLineTypeProperty::getStyles() const
|
QMap<QString, QIcon> VPE::VLineTypeProperty::getStyles() const
|
||||||
{
|
{
|
||||||
return styles;
|
return styles;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VLineTypeProperty::setValue(const QVariant &value)
|
void VPE::VLineTypeProperty::setValue(const QVariant &value)
|
||||||
{
|
{
|
||||||
int tmpIndex = value.toInt();
|
int tmpIndex = value.toInt();
|
||||||
|
|
||||||
|
@ -153,17 +151,17 @@ void VLineTypeProperty::setValue(const QVariant &value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString VLineTypeProperty::type() const
|
QString VPE::VLineTypeProperty::type() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("lineType");
|
return QStringLiteral("lineType");
|
||||||
}
|
}
|
||||||
|
|
||||||
VProperty *VLineTypeProperty::clone(bool include_children, VProperty *container) const
|
VPE::VProperty *VPE::VLineTypeProperty::clone(bool include_children, VProperty *container) const
|
||||||
{
|
{
|
||||||
return VProperty::clone(include_children, container ? container : new VLineTypeProperty(getName()));
|
return VProperty::clone(include_children, container ? container : new VLineTypeProperty(getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
int VLineTypeProperty::IndexOfStyle(const QMap<QString, QIcon> &styles, const QString &style)
|
int VPE::VLineTypeProperty::IndexOfStyle(const QMap<QString, QIcon> &styles, const QString &style)
|
||||||
{
|
{
|
||||||
QVector<QString> indexList;
|
QVector<QString> indexList;
|
||||||
QMap<QString, QIcon>::const_iterator i = styles.constBegin();
|
QMap<QString, QIcon>::const_iterator i = styles.constBegin();
|
||||||
|
@ -175,7 +173,7 @@ int VLineTypeProperty::IndexOfStyle(const QMap<QString, QIcon> &styles, const QS
|
||||||
return indexList.indexOf(style);
|
return indexList.indexOf(style);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VLineTypeProperty::currentIndexChanged(int index)
|
void VPE::VLineTypeProperty::currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
Q_UNUSED(index)
|
Q_UNUSED(index)
|
||||||
UserChangeEvent *event = new UserChangeEvent();
|
UserChangeEvent *event = new UserChangeEvent();
|
||||||
|
|
|
@ -33,13 +33,10 @@
|
||||||
class QAbstractItemDelegate;
|
class QAbstractItemDelegate;
|
||||||
class QStyleOptionViewItem;
|
class QStyleOptionViewItem;
|
||||||
|
|
||||||
using namespace VPE;
|
const int VPE::VIntegerProperty::StandardMin = -1000000;
|
||||||
|
const int VPE::VIntegerProperty::StandardMax = 1000000;
|
||||||
|
|
||||||
|
VPE::VIntegerProperty::VIntegerProperty(const QString& name, const QMap<QString, QVariant>& settings)
|
||||||
const int VIntegerProperty::StandardMin = -1000000;
|
|
||||||
const int VIntegerProperty::StandardMax = 1000000;
|
|
||||||
|
|
||||||
VIntegerProperty::VIntegerProperty(const QString& name, const QMap<QString, QVariant>& settings)
|
|
||||||
: VProperty(name, QVariant::Int), minValue(StandardMin), maxValue(StandardMax), singleStep(1.0)
|
: VProperty(name, QVariant::Int), minValue(StandardMin), maxValue(StandardMax), singleStep(1.0)
|
||||||
{
|
{
|
||||||
VProperty::setSettings(settings);
|
VProperty::setSettings(settings);
|
||||||
|
@ -47,7 +44,7 @@ VIntegerProperty::VIntegerProperty(const QString& name, const QMap<QString, QVar
|
||||||
VProperty::d_ptr->VariantValue.convert(QVariant::Int);
|
VProperty::d_ptr->VariantValue.convert(QVariant::Int);
|
||||||
}
|
}
|
||||||
|
|
||||||
VIntegerProperty::VIntegerProperty(const QString &name)
|
VPE::VIntegerProperty::VIntegerProperty(const QString &name)
|
||||||
: VProperty(name), minValue(StandardMin), maxValue(StandardMax), singleStep(1.0)
|
: VProperty(name), minValue(StandardMin), maxValue(StandardMax), singleStep(1.0)
|
||||||
{
|
{
|
||||||
VProperty::d_ptr->VariantValue.setValue(0);
|
VProperty::d_ptr->VariantValue.setValue(0);
|
||||||
|
@ -55,7 +52,7 @@ VIntegerProperty::VIntegerProperty(const QString &name)
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns an editor widget, or NULL if it doesn't supply one
|
//! Returns an editor widget, or NULL if it doesn't supply one
|
||||||
QWidget* VIntegerProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
|
QWidget* VPE::VIntegerProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
|
||||||
const QAbstractItemDelegate* delegate)
|
const QAbstractItemDelegate* delegate)
|
||||||
{
|
{
|
||||||
Q_UNUSED(options)
|
Q_UNUSED(options)
|
||||||
|
@ -76,7 +73,7 @@ QWidget* VIntegerProperty::createEditor(QWidget * parent, const QStyleOptionView
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Gets the data from the widget
|
//! Gets the data from the widget
|
||||||
QVariant VIntegerProperty::getEditorData(const QWidget *editor) const
|
QVariant VPE::VIntegerProperty::getEditorData(const QWidget *editor) const
|
||||||
{
|
{
|
||||||
const QSpinBox* tmpEditor = qobject_cast<const QSpinBox*>(editor);
|
const QSpinBox* tmpEditor = qobject_cast<const QSpinBox*>(editor);
|
||||||
if (tmpEditor)
|
if (tmpEditor)
|
||||||
|
@ -87,7 +84,7 @@ QVariant VIntegerProperty::getEditorData(const QWidget *editor) const
|
||||||
return QVariant(0);
|
return QVariant(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VIntegerProperty::setSetting(const QString& key, const QVariant& value)
|
void VPE::VIntegerProperty::setSetting(const QString& key, const QVariant& value)
|
||||||
{
|
{
|
||||||
if (key == QLatin1String("Min"))
|
if (key == QLatin1String("Min"))
|
||||||
{
|
{
|
||||||
|
@ -103,7 +100,7 @@ void VIntegerProperty::setSetting(const QString& key, const QVariant& value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant VIntegerProperty::getSetting(const QString& key) const
|
QVariant VPE::VIntegerProperty::getSetting(const QString& key) const
|
||||||
{
|
{
|
||||||
if (key == QLatin1String("Min"))
|
if (key == QLatin1String("Min"))
|
||||||
{
|
{
|
||||||
|
@ -121,31 +118,31 @@ QVariant VIntegerProperty::getSetting(const QString& key) const
|
||||||
return VProperty::getSetting(key);
|
return VProperty::getSetting(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList VIntegerProperty::getSettingKeys() const
|
QStringList VPE::VIntegerProperty::getSettingKeys() const
|
||||||
{
|
{
|
||||||
return (QStringList("Min") << "Max" << "Step");
|
return (QStringList("Min") << "Max" << "Step");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString VIntegerProperty::type() const
|
QString VPE::VIntegerProperty::type() const
|
||||||
{
|
{
|
||||||
return "integer";
|
return "integer";
|
||||||
}
|
}
|
||||||
|
|
||||||
VProperty* VIntegerProperty::clone(bool include_children, VProperty* container) const
|
VPE::VProperty* VPE::VIntegerProperty::clone(bool include_children, VProperty* container) const
|
||||||
{
|
{
|
||||||
return VProperty::clone(include_children, container ? container : new VIntegerProperty(getName()));
|
return VProperty::clone(include_children, container ? container : new VIntegerProperty(getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VIntegerProperty::valueChanged(int i)
|
void VPE::VIntegerProperty::valueChanged(int i)
|
||||||
{
|
{
|
||||||
Q_UNUSED(i)
|
Q_UNUSED(i)
|
||||||
UserChangeEvent *event = new UserChangeEvent();
|
UserChangeEvent *event = new UserChangeEvent();
|
||||||
QCoreApplication::postEvent ( VProperty::d_ptr->editor, event );
|
QCoreApplication::postEvent ( VProperty::d_ptr->editor, event );
|
||||||
}
|
}
|
||||||
|
|
||||||
const double VDoubleProperty::StandardPrecision = 5;
|
const double VPE::VDoubleProperty::StandardPrecision = 5;
|
||||||
|
|
||||||
VDoubleProperty::VDoubleProperty(const QString& name, const QMap<QString, QVariant>& settings)
|
VPE::VDoubleProperty::VDoubleProperty(const QString& name, const QMap<QString, QVariant>& settings)
|
||||||
: VIntegerProperty(name), Precision(static_cast<int>(StandardPrecision))
|
: VIntegerProperty(name), Precision(static_cast<int>(StandardPrecision))
|
||||||
{
|
{
|
||||||
VProperty::setSettings(settings);
|
VProperty::setSettings(settings);
|
||||||
|
@ -154,7 +151,7 @@ VDoubleProperty::VDoubleProperty(const QString& name, const QMap<QString, QVaria
|
||||||
VProperty::d_ptr->PropertyVariantType = QVariant::Double;
|
VProperty::d_ptr->PropertyVariantType = QVariant::Double;
|
||||||
}
|
}
|
||||||
|
|
||||||
VDoubleProperty::VDoubleProperty(const QString &name)
|
VPE::VDoubleProperty::VDoubleProperty(const QString &name)
|
||||||
: VIntegerProperty(name), Precision(static_cast<int>(StandardPrecision))
|
: VIntegerProperty(name), Precision(static_cast<int>(StandardPrecision))
|
||||||
{
|
{
|
||||||
VProperty::d_ptr->VariantValue.setValue(0);
|
VProperty::d_ptr->VariantValue.setValue(0);
|
||||||
|
@ -163,7 +160,7 @@ VDoubleProperty::VDoubleProperty(const QString &name)
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns an editor widget, or NULL if it doesn't supply one
|
//! Returns an editor widget, or NULL if it doesn't supply one
|
||||||
QWidget* VDoubleProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
|
QWidget* VPE::VDoubleProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
|
||||||
const QAbstractItemDelegate* delegate)
|
const QAbstractItemDelegate* delegate)
|
||||||
{
|
{
|
||||||
Q_UNUSED(options)
|
Q_UNUSED(options)
|
||||||
|
@ -184,7 +181,7 @@ QWidget* VDoubleProperty::createEditor(QWidget * parent, const QStyleOptionViewI
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Gets the data from the widget
|
//! Gets the data from the widget
|
||||||
QVariant VDoubleProperty::getEditorData(const QWidget *editor) const
|
QVariant VPE::VDoubleProperty::getEditorData(const QWidget *editor) const
|
||||||
{
|
{
|
||||||
const QDoubleSpinBox* tmpEditor = qobject_cast<const QDoubleSpinBox*>(editor);
|
const QDoubleSpinBox* tmpEditor = qobject_cast<const QDoubleSpinBox*>(editor);
|
||||||
if (tmpEditor)
|
if (tmpEditor)
|
||||||
|
@ -195,7 +192,7 @@ QVariant VDoubleProperty::getEditorData(const QWidget *editor) const
|
||||||
return QVariant(0);
|
return QVariant(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VDoubleProperty::setSetting(const QString& key, const QVariant& value)
|
void VPE::VDoubleProperty::setSetting(const QString& key, const QVariant& value)
|
||||||
{
|
{
|
||||||
if (key == QLatin1String("Min"))
|
if (key == QLatin1String("Min"))
|
||||||
{
|
{
|
||||||
|
@ -215,7 +212,7 @@ void VDoubleProperty::setSetting(const QString& key, const QVariant& value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant VDoubleProperty::getSetting(const QString& key) const
|
QVariant VPE::VDoubleProperty::getSetting(const QString& key) const
|
||||||
{
|
{
|
||||||
if (key == QLatin1String("Min"))
|
if (key == QLatin1String("Min"))
|
||||||
{
|
{
|
||||||
|
@ -237,17 +234,17 @@ QVariant VDoubleProperty::getSetting(const QString& key) const
|
||||||
return VProperty::getSetting(key);
|
return VProperty::getSetting(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList VDoubleProperty::getSettingKeys() const
|
QStringList VPE::VDoubleProperty::getSettingKeys() const
|
||||||
{
|
{
|
||||||
return (QStringList("Min") << "Max" << "Step" << "Precision");
|
return (QStringList("Min") << "Max" << "Step" << "Precision");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString VDoubleProperty::type() const
|
QString VPE::VDoubleProperty::type() const
|
||||||
{
|
{
|
||||||
return "double";
|
return "double";
|
||||||
}
|
}
|
||||||
|
|
||||||
VProperty* VDoubleProperty::clone(bool include_children, VProperty* container) const
|
VPE::VProperty* VPE::VDoubleProperty::clone(bool include_children, VProperty* container) const
|
||||||
{
|
{
|
||||||
return VIntegerProperty::clone(include_children, container ? container : new VDoubleProperty(getName()));
|
return VIntegerProperty::clone(include_children, container ? container : new VDoubleProperty(getName()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,9 +30,7 @@
|
||||||
class QAbstractItemDelegate;
|
class QAbstractItemDelegate;
|
||||||
class QStyleOptionViewItem;
|
class QStyleOptionViewItem;
|
||||||
|
|
||||||
using namespace VPE;
|
VPE::VObjectProperty::VObjectProperty(const QString& name)
|
||||||
|
|
||||||
VObjectProperty::VObjectProperty(const QString& name)
|
|
||||||
: VProperty(name, QVariant::Int), objects()
|
: VProperty(name, QVariant::Int), objects()
|
||||||
{
|
{
|
||||||
VProperty::d_ptr->VariantValue = 0;
|
VProperty::d_ptr->VariantValue = 0;
|
||||||
|
@ -40,7 +38,7 @@ VObjectProperty::VObjectProperty(const QString& name)
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Get the data how it should be displayed
|
//! Get the data how it should be displayed
|
||||||
QVariant VObjectProperty::data (int column, int role) const
|
QVariant VPE::VObjectProperty::data (int column, int role) const
|
||||||
{
|
{
|
||||||
if (objects.empty())
|
if (objects.empty())
|
||||||
{
|
{
|
||||||
|
@ -62,7 +60,7 @@ QVariant VObjectProperty::data (int column, int role) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns an editor widget, or NULL if it doesn't supply one
|
//! Returns an editor widget, or NULL if it doesn't supply one
|
||||||
QWidget* VObjectProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
|
QWidget* VPE::VObjectProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
|
||||||
const QAbstractItemDelegate* delegate)
|
const QAbstractItemDelegate* delegate)
|
||||||
{
|
{
|
||||||
Q_UNUSED(options)
|
Q_UNUSED(options)
|
||||||
|
@ -79,7 +77,7 @@ QWidget* VObjectProperty::createEditor(QWidget * parent, const QStyleOptionViewI
|
||||||
return VProperty::d_ptr->editor;
|
return VProperty::d_ptr->editor;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VObjectProperty::setEditorData(QWidget *editor)
|
bool VPE::VObjectProperty::setEditorData(QWidget *editor)
|
||||||
{
|
{
|
||||||
if (!editor)
|
if (!editor)
|
||||||
{
|
{
|
||||||
|
@ -106,7 +104,7 @@ bool VObjectProperty::setEditorData(QWidget *editor)
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Gets the data from the widget
|
//! Gets the data from the widget
|
||||||
QVariant VObjectProperty::getEditorData(const QWidget *editor) const
|
QVariant VPE::VObjectProperty::getEditorData(const QWidget *editor) const
|
||||||
{
|
{
|
||||||
const QComboBox* tmpEditor = qobject_cast<const QComboBox*>(editor);
|
const QComboBox* tmpEditor = qobject_cast<const QComboBox*>(editor);
|
||||||
if (tmpEditor)
|
if (tmpEditor)
|
||||||
|
@ -119,20 +117,20 @@ QVariant VObjectProperty::getEditorData(const QWidget *editor) const
|
||||||
|
|
||||||
//! Sets the objects list
|
//! Sets the objects list
|
||||||
// cppcheck-suppress unusedFunction
|
// cppcheck-suppress unusedFunction
|
||||||
void VObjectProperty::setObjectsList(const QMap<QString, quint32> &objects)
|
void VPE::VObjectProperty::setObjectsList(const QMap<QString, quint32> &objects)
|
||||||
{
|
{
|
||||||
this->objects = objects;
|
this->objects = objects;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Get the settings. This function has to be implemented in a subclass in order to have an effect
|
//! Get the settings. This function has to be implemented in a subclass in order to have an effect
|
||||||
// cppcheck-suppress unusedFunction
|
// cppcheck-suppress unusedFunction
|
||||||
QMap<QString, quint32> VObjectProperty::getObjects() const
|
QMap<QString, quint32> VPE::VObjectProperty::getObjects() const
|
||||||
{
|
{
|
||||||
return objects;
|
return objects;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the value of the property
|
//! Sets the value of the property
|
||||||
void VObjectProperty::setValue(const QVariant& value)
|
void VPE::VObjectProperty::setValue(const QVariant& value)
|
||||||
{
|
{
|
||||||
VProperty::d_ptr->VariantValue = value;
|
VProperty::d_ptr->VariantValue = value;
|
||||||
VProperty::d_ptr->VariantValue.convert(QVariant::UInt);
|
VProperty::d_ptr->VariantValue.convert(QVariant::UInt);
|
||||||
|
@ -143,24 +141,24 @@ void VObjectProperty::setValue(const QVariant& value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString VObjectProperty::type() const
|
QString VPE::VObjectProperty::type() const
|
||||||
{
|
{
|
||||||
return "objectList";
|
return "objectList";
|
||||||
}
|
}
|
||||||
|
|
||||||
VProperty* VObjectProperty::clone(bool include_children, VProperty* container) const
|
VPE::VProperty* VPE::VObjectProperty::clone(bool include_children, VProperty* container) const
|
||||||
{
|
{
|
||||||
return VProperty::clone(include_children, container ? container : new VObjectProperty(getName()));
|
return VProperty::clone(include_children, container ? container : new VObjectProperty(getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VObjectProperty::currentIndexChanged(int index)
|
void VPE::VObjectProperty::currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
Q_UNUSED(index)
|
Q_UNUSED(index)
|
||||||
UserChangeEvent *event = new UserChangeEvent();
|
UserChangeEvent *event = new UserChangeEvent();
|
||||||
QCoreApplication::postEvent ( VProperty::d_ptr->editor, event );
|
QCoreApplication::postEvent ( VProperty::d_ptr->editor, event );
|
||||||
}
|
}
|
||||||
|
|
||||||
void VObjectProperty::FillList(QComboBox *box, const QMap<QString, quint32> &list) const
|
void VPE::VObjectProperty::FillList(QComboBox *box, const QMap<QString, quint32> &list) const
|
||||||
{
|
{
|
||||||
box->clear();
|
box->clear();
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
|
|
||||||
#include "vpointfproperty.h"
|
#include "vpointfproperty.h"
|
||||||
|
|
||||||
using namespace VPE;
|
|
||||||
|
|
||||||
#include <QFlags>
|
#include <QFlags>
|
||||||
#include <QForeachContainer>
|
#include <QForeachContainer>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
@ -49,7 +47,7 @@ VPE::VPointFProperty::VPointFProperty(const QString &name)
|
||||||
setValue(QPointF());
|
setValue(QPointF());
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant VPointFProperty::data(int column, int role) const
|
QVariant VPE::VPointFProperty::data(int column, int role) const
|
||||||
{
|
{
|
||||||
if (column == DPC_Data && Qt::DisplayRole == role)
|
if (column == DPC_Data && Qt::DisplayRole == role)
|
||||||
{
|
{
|
||||||
|
@ -59,7 +57,7 @@ QVariant VPointFProperty::data(int column, int role) const
|
||||||
return VProperty::data(column, role);
|
return VProperty::data(column, role);
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt::ItemFlags VPointFProperty::flags(int column) const
|
Qt::ItemFlags VPE::VPointFProperty::flags(int column) const
|
||||||
{
|
{
|
||||||
if (column == DPC_Name || column == DPC_Data)
|
if (column == DPC_Name || column == DPC_Data)
|
||||||
{
|
{
|
||||||
|
@ -69,7 +67,7 @@ Qt::ItemFlags VPointFProperty::flags(int column) const
|
||||||
return Qt::NoItemFlags;
|
return Qt::NoItemFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
QPointF VPointFProperty::getPointF() const
|
QPointF VPE::VPointFProperty::getPointF() const
|
||||||
{
|
{
|
||||||
QPointF tmpValue;
|
QPointF tmpValue;
|
||||||
|
|
||||||
|
@ -84,12 +82,12 @@ QPointF VPointFProperty::getPointF() const
|
||||||
return tmpValue;
|
return tmpValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPointFProperty::setPointF(const QPointF &point)
|
void VPE::VPointFProperty::setPointF(const QPointF &point)
|
||||||
{
|
{
|
||||||
setPointF(point.x(), point.y());
|
setPointF(point.x(), point.y());
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPointFProperty::setPointF(qreal x, qreal y)
|
void VPE::VPointFProperty::setPointF(qreal x, qreal y)
|
||||||
{
|
{
|
||||||
if (d_ptr->Children.count() < 2)
|
if (d_ptr->Children.count() < 2)
|
||||||
{
|
{
|
||||||
|
@ -106,12 +104,12 @@ void VPointFProperty::setPointF(qreal x, qreal y)
|
||||||
d_ptr->Children.at(1)->setValue(tmpY);
|
d_ptr->Children.at(1)->setValue(tmpY);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString VPointFProperty::type() const
|
QString VPE::VPointFProperty::type() const
|
||||||
{
|
{
|
||||||
return "pointF";
|
return "pointF";
|
||||||
}
|
}
|
||||||
|
|
||||||
VProperty *VPointFProperty::clone(bool include_children, VProperty *container) const
|
VPE::VProperty *VPE::VPointFProperty::clone(bool include_children, VProperty *container) const
|
||||||
{
|
{
|
||||||
if (!container)
|
if (!container)
|
||||||
{
|
{
|
||||||
|
@ -131,13 +129,13 @@ VProperty *VPointFProperty::clone(bool include_children, VProperty *container) c
|
||||||
return VProperty::clone(false, container); // Child
|
return VProperty::clone(false, container); // Child
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPointFProperty::setValue(const QVariant &value)
|
void VPE::VPointFProperty::setValue(const QVariant &value)
|
||||||
{
|
{
|
||||||
QPointF tmpPoint = value.toPointF();
|
QPointF tmpPoint = value.toPointF();
|
||||||
setPointF(tmpPoint);
|
setPointF(tmpPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant VPointFProperty::getValue() const
|
QVariant VPE::VPointFProperty::getValue() const
|
||||||
{
|
{
|
||||||
QPointF tmpValue = getPointF();
|
QPointF tmpValue = getPointF();
|
||||||
return QString("%1,%2").arg(QString::number(tmpValue.x()), QString::number(tmpValue.y()));
|
return QString("%1,%2").arg(QString::number(tmpValue.x()), QString::number(tmpValue.y()));
|
||||||
|
|
|
@ -30,21 +30,18 @@
|
||||||
|
|
||||||
class QStyleOptionViewItem;
|
class QStyleOptionViewItem;
|
||||||
|
|
||||||
|
VPE::VShortcutProperty::VShortcutProperty(const QString& name)
|
||||||
using namespace VPE;
|
|
||||||
|
|
||||||
VShortcutProperty::VShortcutProperty(const QString& name)
|
|
||||||
: VProperty(name, QVariant::String)
|
: VProperty(name, QVariant::String)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VShortcutProperty::~VShortcutProperty()
|
VPE::VShortcutProperty::~VShortcutProperty()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant VShortcutProperty::data (int column, int role) const
|
QVariant VPE::VShortcutProperty::data (int column, int role) const
|
||||||
{
|
{
|
||||||
if (column == DPC_Data && (Qt::DisplayRole == role || Qt::EditRole == role))
|
if (column == DPC_Data && (Qt::DisplayRole == role || Qt::EditRole == role))
|
||||||
{
|
{
|
||||||
|
@ -55,7 +52,7 @@ QVariant VShortcutProperty::data (int column, int role) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QWidget* VShortcutProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
|
QWidget* VPE::VShortcutProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
|
||||||
const QAbstractItemDelegate* delegate)
|
const QAbstractItemDelegate* delegate)
|
||||||
{
|
{
|
||||||
Q_UNUSED(options)
|
Q_UNUSED(options)
|
||||||
|
@ -70,7 +67,7 @@ QWidget* VShortcutProperty::createEditor(QWidget * parent, const QStyleOptionVie
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool VShortcutProperty::setEditorData(QWidget* editor)
|
bool VPE::VShortcutProperty::setEditorData(QWidget* editor)
|
||||||
{
|
{
|
||||||
VShortcutEditWidget* tmpWidget = qobject_cast<VShortcutEditWidget*>(editor);
|
VShortcutEditWidget* tmpWidget = qobject_cast<VShortcutEditWidget*>(editor);
|
||||||
if (tmpWidget)
|
if (tmpWidget)
|
||||||
|
@ -84,7 +81,7 @@ bool VShortcutProperty::setEditorData(QWidget* editor)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QVariant VShortcutProperty::getEditorData(const QWidget *editor) const
|
QVariant VPE::VShortcutProperty::getEditorData(const QWidget *editor) const
|
||||||
{
|
{
|
||||||
const VShortcutEditWidget* tmpWidget = qobject_cast<const VShortcutEditWidget*>(editor);
|
const VShortcutEditWidget* tmpWidget = qobject_cast<const VShortcutEditWidget*>(editor);
|
||||||
if (tmpWidget)
|
if (tmpWidget)
|
||||||
|
@ -96,17 +93,17 @@ QVariant VShortcutProperty::getEditorData(const QWidget *editor) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString VShortcutProperty::type() const
|
QString VPE::VShortcutProperty::type() const
|
||||||
{
|
{
|
||||||
return "shortcut";
|
return "shortcut";
|
||||||
}
|
}
|
||||||
|
|
||||||
VProperty* VShortcutProperty::clone(bool include_children, VProperty* container) const
|
VPE::VProperty* VPE::VShortcutProperty::clone(bool include_children, VProperty* container) const
|
||||||
{
|
{
|
||||||
return VProperty::clone(include_children, container ? container : new VShortcutProperty(getName()));
|
return VProperty::clone(include_children, container ? container : new VShortcutProperty(getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VShortcutProperty::setValue(const QVariant &value)
|
void VPE::VShortcutProperty::setValue(const QVariant &value)
|
||||||
{
|
{
|
||||||
VProperty::setValue(QKeySequence::fromString(value.toString()).toString());
|
VProperty::setValue(QKeySequence::fromString(value.toString()).toString());
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,9 +30,7 @@
|
||||||
class QHBoxLayout;
|
class QHBoxLayout;
|
||||||
class QKeyEvent;
|
class QKeyEvent;
|
||||||
|
|
||||||
using namespace VPE;
|
VPE::VShortcutEditWidget::VShortcutEditWidget(QWidget *parent)
|
||||||
|
|
||||||
VShortcutEditWidget::VShortcutEditWidget(QWidget *parent)
|
|
||||||
: QWidget(parent), CurrentKeySequence(), LineEdit(nullptr)
|
: QWidget(parent), CurrentKeySequence(), LineEdit(nullptr)
|
||||||
{
|
{
|
||||||
// Create the line edit widget
|
// Create the line edit widget
|
||||||
|
@ -51,12 +49,12 @@ VShortcutEditWidget::VShortcutEditWidget(QWidget *parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VShortcutEditWidget::~VShortcutEditWidget()
|
VPE::VShortcutEditWidget::~VShortcutEditWidget()
|
||||||
{
|
{
|
||||||
// nothing needs to be done here
|
// nothing needs to be done here
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VShortcutEditWidget::eventFilter(QObject *obj, QEvent *event)
|
bool VPE::VShortcutEditWidget::eventFilter(QObject *obj, QEvent *event)
|
||||||
{
|
{
|
||||||
if (obj == LineEdit)
|
if (obj == LineEdit)
|
||||||
{
|
{
|
||||||
|
@ -82,23 +80,23 @@ bool VShortcutEditWidget::eventFilter(QObject *obj, QEvent *event)
|
||||||
return QWidget::eventFilter(obj, event);
|
return QWidget::eventFilter(obj, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString VShortcutEditWidget::getShortcutAsString() const
|
QString VPE::VShortcutEditWidget::getShortcutAsString() const
|
||||||
{
|
{
|
||||||
return CurrentKeySequence.toString();
|
return CurrentKeySequence.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// cppcheck-suppress unusedFunction
|
// cppcheck-suppress unusedFunction
|
||||||
QKeySequence VShortcutEditWidget::getShortcut()
|
QKeySequence VPE::VShortcutEditWidget::getShortcut()
|
||||||
{
|
{
|
||||||
return CurrentKeySequence;
|
return CurrentKeySequence;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VShortcutEditWidget::setShortcut(const QString &shortcut, bool emit_signal)
|
void VPE::VShortcutEditWidget::setShortcut(const QString &shortcut, bool emit_signal)
|
||||||
{
|
{
|
||||||
setShortcut(QKeySequence::fromString(shortcut), emit_signal);
|
setShortcut(QKeySequence::fromString(shortcut), emit_signal);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VShortcutEditWidget::setShortcut(const QKeySequence &shortcut, bool emit_signal)
|
void VPE::VShortcutEditWidget::setShortcut(const QKeySequence &shortcut, bool emit_signal)
|
||||||
{
|
{
|
||||||
if (shortcut != CurrentKeySequence)
|
if (shortcut != CurrentKeySequence)
|
||||||
{
|
{
|
||||||
|
@ -111,7 +109,7 @@ void VShortcutEditWidget::setShortcut(const QKeySequence &shortcut, bool emit_si
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VShortcutEditWidget::onTextEdited(const QString &text)
|
void VPE::VShortcutEditWidget::onTextEdited(const QString &text)
|
||||||
{
|
{
|
||||||
setShortcut(text, true);
|
setShortcut(text, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,9 +35,6 @@
|
||||||
class QAbstractItemDelegate;
|
class QAbstractItemDelegate;
|
||||||
class QStyleOptionViewItem;
|
class QStyleOptionViewItem;
|
||||||
|
|
||||||
using namespace VPE;
|
|
||||||
|
|
||||||
|
|
||||||
VPE::VStringProperty::VStringProperty(const QString &name, const QMap<QString, QVariant> &settings)
|
VPE::VStringProperty::VStringProperty(const QString &name, const QMap<QString, QVariant> &settings)
|
||||||
: VProperty(name, QVariant::String), readOnly(false), typeForParent(0), clearButton(false), m_osSeparator(false)
|
: VProperty(name, QVariant::String), readOnly(false), typeForParent(0), clearButton(false), m_osSeparator(false)
|
||||||
{
|
{
|
||||||
|
@ -89,12 +86,12 @@ void VPE::VStringProperty::setReadOnly(bool readOnly)
|
||||||
this->readOnly = readOnly;
|
this->readOnly = readOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VStringProperty::setOsSeparator(bool separator)
|
void VPE::VStringProperty::setOsSeparator(bool separator)
|
||||||
{
|
{
|
||||||
m_osSeparator = separator;
|
m_osSeparator = separator;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VStringProperty::setClearButtonEnable(bool value)
|
void VPE::VStringProperty::setClearButtonEnable(bool value)
|
||||||
{
|
{
|
||||||
this->clearButton = value;
|
this->clearButton = value;
|
||||||
}
|
}
|
||||||
|
@ -142,23 +139,23 @@ VPE::VProperty *VPE::VStringProperty::clone(bool include_children, VPE::VPropert
|
||||||
return VProperty::clone(include_children, container ? container : new VStringProperty(getName(), getSettings()));
|
return VProperty::clone(include_children, container ? container : new VStringProperty(getName(), getSettings()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VStringProperty::UpdateParent(const QVariant &value)
|
void VPE::VStringProperty::UpdateParent(const QVariant &value)
|
||||||
{
|
{
|
||||||
emit childChanged(value, typeForParent);
|
emit childChanged(value, typeForParent);
|
||||||
}
|
}
|
||||||
|
|
||||||
// cppcheck-suppress unusedFunction
|
// cppcheck-suppress unusedFunction
|
||||||
int VStringProperty::getTypeForParent() const
|
int VPE::VStringProperty::getTypeForParent() const
|
||||||
{
|
{
|
||||||
return typeForParent;
|
return typeForParent;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VStringProperty::setTypeForParent(int value)
|
void VPE::VStringProperty::setTypeForParent(int value)
|
||||||
{
|
{
|
||||||
typeForParent = value;
|
typeForParent = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VStringProperty::eventFilter(QObject *object, QEvent *event)
|
bool VPE::VStringProperty::eventFilter(QObject *object, QEvent *event)
|
||||||
{
|
{
|
||||||
if (QLineEdit *textEdit = qobject_cast<QLineEdit *>(object))
|
if (QLineEdit *textEdit = qobject_cast<QLineEdit *>(object))
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,24 +28,22 @@
|
||||||
#include "vemptyproperty.h"
|
#include "vemptyproperty.h"
|
||||||
#include "../vproperty.h"
|
#include "../vproperty.h"
|
||||||
|
|
||||||
using namespace VPE;
|
VPE::VWidgetProperty::VWidgetProperty(const QString& name, QWidget* widget)
|
||||||
|
|
||||||
VWidgetProperty::VWidgetProperty(const QString& name, QWidget* widget)
|
|
||||||
: VEmptyProperty(new VWidgetPropertyPrivate(name, QVariant::Invalid, widget))
|
: VEmptyProperty(new VWidgetPropertyPrivate(name, QVariant::Invalid, widget))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
VWidgetProperty::~VWidgetProperty()
|
VPE::VWidgetProperty::~VWidgetProperty()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *VWidgetProperty::getWidget() const
|
QWidget *VPE::VWidgetProperty::getWidget() const
|
||||||
{
|
{
|
||||||
return static_cast<VWidgetPropertyPrivate*>(d_ptr)->Widget.data();
|
return static_cast<VWidgetPropertyPrivate*>(d_ptr)->Widget.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VWidgetProperty::setWidget(QWidget* widget)
|
void VPE::VWidgetProperty::setWidget(QWidget* widget)
|
||||||
{
|
{
|
||||||
VWidgetPropertyPrivate* tmpDPtr = static_cast<VWidgetPropertyPrivate*>(d_ptr);
|
VWidgetPropertyPrivate* tmpDPtr = static_cast<VWidgetPropertyPrivate*>(d_ptr);
|
||||||
QWidget* tmpOldWidget = tmpDPtr->Widget.data();
|
QWidget* tmpOldWidget = tmpDPtr->Widget.data();
|
||||||
|
@ -58,12 +56,12 @@ void VWidgetProperty::setWidget(QWidget* widget)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString VWidgetProperty::type() const
|
QString VPE::VWidgetProperty::type() const
|
||||||
{
|
{
|
||||||
return "widget";
|
return "widget";
|
||||||
}
|
}
|
||||||
|
|
||||||
VProperty* VWidgetProperty::clone(bool include_children, VProperty* container) const
|
VPE::VProperty* VPE::VWidgetProperty::clone(bool include_children, VProperty* container) const
|
||||||
{
|
{
|
||||||
/* todo: This is a tricky one to clone... don't know what would be the best way to do so... Maybe serialize the
|
/* todo: This is a tricky one to clone... don't know what would be the best way to do so... Maybe serialize the
|
||||||
* widget somehow?
|
* widget somehow?
|
||||||
|
|
|
@ -38,22 +38,20 @@ class QModelIndex;
|
||||||
class QPainter;
|
class QPainter;
|
||||||
class QStyleOptionViewItem;
|
class QStyleOptionViewItem;
|
||||||
|
|
||||||
using namespace VPE;
|
|
||||||
|
|
||||||
//! Standard constructor, takes a name and a parent property as argument
|
//! Standard constructor, takes a name and a parent property as argument
|
||||||
VProperty::VProperty(const QString& name, QVariant::Type type)
|
VPE::VProperty::VProperty(const QString& name, QVariant::Type type)
|
||||||
: QObject(), d_ptr(new VPropertyPrivate(name, type))
|
: QObject(), d_ptr(new VPropertyPrivate(name, type))
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VProperty::VProperty(VPropertyPrivate *d)
|
VPE::VProperty::VProperty(VPropertyPrivate *d)
|
||||||
: d_ptr(d)
|
: d_ptr(d)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VProperty::~VProperty()
|
VPE::VProperty::~VProperty()
|
||||||
{
|
{
|
||||||
setParent(nullptr);
|
setParent(nullptr);
|
||||||
|
|
||||||
|
@ -66,13 +64,13 @@ VProperty::~VProperty()
|
||||||
delete d_ptr;
|
delete d_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString VProperty::type() const
|
QString VPE::VProperty::type() const
|
||||||
{
|
{
|
||||||
return "string";
|
return "string";
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Get the data how it should be displayed
|
//! Get the data how it should be displayed
|
||||||
QVariant VProperty::data (int column, int role) const
|
QVariant VPE::VProperty::data (int column, int role) const
|
||||||
{
|
{
|
||||||
if (column == DPC_Name && Qt::DisplayRole == role)
|
if (column == DPC_Name && Qt::DisplayRole == role)
|
||||||
{
|
{
|
||||||
|
@ -90,7 +88,7 @@ QVariant VProperty::data (int column, int role) const
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VProperty::setData(const QVariant &data, int role)
|
bool VPE::VProperty::setData(const QVariant &data, int role)
|
||||||
{
|
{
|
||||||
bool tmpResult = false;
|
bool tmpResult = false;
|
||||||
if (Qt::EditRole == role)
|
if (Qt::EditRole == role)
|
||||||
|
@ -102,7 +100,7 @@ bool VProperty::setData(const QVariant &data, int role)
|
||||||
return tmpResult;
|
return tmpResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VProperty::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index,
|
bool VPE::VProperty::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index,
|
||||||
const QAbstractItemDelegate *delegate) const
|
const QAbstractItemDelegate *delegate) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(painter)
|
Q_UNUSED(painter)
|
||||||
|
@ -114,7 +112,7 @@ bool VProperty::paint(QPainter *painter, const QStyleOptionViewItem &option, con
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns an editor widget, or NULL if it doesn't supply one
|
//! Returns an editor widget, or NULL if it doesn't supply one
|
||||||
QWidget* VProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
|
QWidget* VPE::VProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
|
||||||
const QAbstractItemDelegate* delegate)
|
const QAbstractItemDelegate* delegate)
|
||||||
{
|
{
|
||||||
Q_UNUSED(options)
|
Q_UNUSED(options)
|
||||||
|
@ -129,7 +127,7 @@ QWidget* VProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& o
|
||||||
return d_ptr->editor;
|
return d_ptr->editor;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VProperty::setEditorData(QWidget* editor)
|
bool VPE::VProperty::setEditorData(QWidget* editor)
|
||||||
{
|
{
|
||||||
if (!editor)
|
if (!editor)
|
||||||
{
|
{
|
||||||
|
@ -150,7 +148,7 @@ bool VProperty::setEditorData(QWidget* editor)
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Gets the data from the widget
|
//! Gets the data from the widget
|
||||||
QVariant VProperty::getEditorData(const QWidget* editor) const
|
QVariant VPE::VProperty::getEditorData(const QWidget* editor) const
|
||||||
{
|
{
|
||||||
if (!editor)
|
if (!editor)
|
||||||
{
|
{
|
||||||
|
@ -168,7 +166,7 @@ QVariant VProperty::getEditorData(const QWidget* editor) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns item flags
|
//! Returns item flags
|
||||||
Qt::ItemFlags VProperty::flags(int column) const
|
Qt::ItemFlags VPE::VProperty::flags(int column) const
|
||||||
{
|
{
|
||||||
if (column == DPC_Name)
|
if (column == DPC_Name)
|
||||||
{
|
{
|
||||||
|
@ -183,7 +181,7 @@ Qt::ItemFlags VProperty::flags(int column) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void VProperty::setValue(const QVariant &value)
|
void VPE::VProperty::setValue(const QVariant &value)
|
||||||
{
|
{
|
||||||
d_ptr->VariantValue = value;
|
d_ptr->VariantValue = value;
|
||||||
d_ptr->VariantValue.convert(static_cast<int>(d_ptr->PropertyVariantType));
|
d_ptr->VariantValue.convert(static_cast<int>(d_ptr->PropertyVariantType));
|
||||||
|
@ -193,60 +191,60 @@ void VProperty::setValue(const QVariant &value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant VProperty::getValue() const
|
QVariant VPE::VProperty::getValue() const
|
||||||
{
|
{
|
||||||
return d_ptr->VariantValue;
|
return d_ptr->VariantValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// cppcheck-suppress unusedFunction
|
// cppcheck-suppress unusedFunction
|
||||||
QString VProperty::serialize() const
|
QString VPE::VProperty::serialize() const
|
||||||
{
|
{
|
||||||
return getValue().toString();
|
return getValue().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VProperty::deserialize(const QString& value)
|
void VPE::VProperty::deserialize(const QString& value)
|
||||||
{
|
{
|
||||||
setValue(QVariant(value));
|
setValue(QVariant(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void VProperty::setName(const QString& name)
|
void VPE::VProperty::setName(const QString& name)
|
||||||
{
|
{
|
||||||
d_ptr->Name = name;
|
d_ptr->Name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString VProperty::getName() const
|
QString VPE::VProperty::getName() const
|
||||||
{
|
{
|
||||||
return d_ptr->Name;
|
return d_ptr->Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void VProperty::setDescription(const QString& desc)
|
void VPE::VProperty::setDescription(const QString& desc)
|
||||||
{
|
{
|
||||||
d_ptr->Description = desc;
|
d_ptr->Description = desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString VProperty::getDescription() const
|
QString VPE::VProperty::getDescription() const
|
||||||
{
|
{
|
||||||
return d_ptr->Description;
|
return d_ptr->Description;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns a reference to the list of children
|
//! Returns a reference to the list of children
|
||||||
QList<VProperty*>& VProperty::getChildren()
|
QList<VPE::VProperty*>& VPE::VProperty::getChildren()
|
||||||
{
|
{
|
||||||
return d_ptr->Children;
|
return d_ptr->Children;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns a reference to the list of children
|
//! Returns a reference to the list of children
|
||||||
const QList<VProperty*>& VProperty::getChildren() const
|
const QList<VPE::VProperty*>& VPE::VProperty::getChildren() const
|
||||||
{
|
{
|
||||||
return d_ptr->Children;
|
return d_ptr->Children;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns the child at a certain row
|
//! Returns the child at a certain row
|
||||||
VProperty* VProperty::getChild(int row) const
|
VPE::VProperty* VPE::VProperty::getChild(int row) const
|
||||||
{
|
{
|
||||||
if (row >= 0 && row < getRowCount())
|
if (row >= 0 && row < getRowCount())
|
||||||
{
|
{
|
||||||
|
@ -257,19 +255,19 @@ VProperty* VProperty::getChild(int row) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Gets the number of children
|
//! Gets the number of children
|
||||||
int VProperty::getRowCount() const
|
int VPE::VProperty::getRowCount() const
|
||||||
{
|
{
|
||||||
return d_ptr->Children.count();
|
return d_ptr->Children.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Gets the parent of this property
|
//! Gets the parent of this property
|
||||||
VProperty* VProperty::getParent() const
|
VPE::VProperty* VPE::VProperty::getParent() const
|
||||||
{
|
{
|
||||||
return d_ptr->Parent;
|
return d_ptr->Parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the parent of this property
|
//! Sets the parent of this property
|
||||||
void VProperty::setParent(VProperty* parent)
|
void VPE::VProperty::setParent(VProperty* parent)
|
||||||
{
|
{
|
||||||
if (d_ptr->Parent == parent)
|
if (d_ptr->Parent == parent)
|
||||||
{
|
{
|
||||||
|
@ -290,7 +288,7 @@ void VProperty::setParent(VProperty* parent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int VProperty::addChild(VProperty *child)
|
int VPE::VProperty::addChild(VProperty *child)
|
||||||
{
|
{
|
||||||
if (child && child->getParent() != this)
|
if (child && child->getParent() != this)
|
||||||
{
|
{
|
||||||
|
@ -309,7 +307,7 @@ int VProperty::addChild(VProperty *child)
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Removes a child from the children list
|
//! Removes a child from the children list
|
||||||
void VProperty::removeChild(VProperty* child)
|
void VPE::VProperty::removeChild(VProperty* child)
|
||||||
{
|
{
|
||||||
d_ptr->Children.removeAll(child);
|
d_ptr->Children.removeAll(child);
|
||||||
|
|
||||||
|
@ -320,32 +318,32 @@ void VProperty::removeChild(VProperty* child)
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns the row the child has
|
//! Returns the row the child has
|
||||||
int VProperty::getChildRow(VProperty* child) const
|
int VPE::VProperty::getChildRow(VProperty* child) const
|
||||||
{
|
{
|
||||||
return d_ptr->Children.indexOf(child);
|
return d_ptr->Children.indexOf(child);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns whether the views have to update the parent of this property if it changes
|
//! Returns whether the views have to update the parent of this property if it changes
|
||||||
bool VProperty::getUpdateParent() const
|
bool VPE::VProperty::getUpdateParent() const
|
||||||
{
|
{
|
||||||
return d_ptr->UpdateParent;
|
return d_ptr->UpdateParent;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns whether the views have to update the children of this property if it changes
|
//! Returns whether the views have to update the children of this property if it changes
|
||||||
bool VProperty::getUpdateChildren() const
|
bool VPE::VProperty::getUpdateChildren() const
|
||||||
{
|
{
|
||||||
return d_ptr->UpdateChildren;
|
return d_ptr->UpdateChildren;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets whether the views should update Parents or children after this property changes
|
//! Sets whether the views should update Parents or children after this property changes
|
||||||
void VProperty::setUpdateBehaviour(bool update_parent, bool update_children)
|
void VPE::VProperty::setUpdateBehaviour(bool update_parent, bool update_children)
|
||||||
{
|
{
|
||||||
d_ptr->UpdateParent = update_parent;
|
d_ptr->UpdateParent = update_parent;
|
||||||
d_ptr->UpdateChildren = update_children;
|
d_ptr->UpdateChildren = update_children;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void VProperty::setSettings(const QMap<QString, QVariant>& settings)
|
void VPE::VProperty::setSettings(const QMap<QString, QVariant>& settings)
|
||||||
{
|
{
|
||||||
QMap<QString, QVariant>::const_iterator tmpIterator = settings.constBegin();
|
QMap<QString, QVariant>::const_iterator tmpIterator = settings.constBegin();
|
||||||
for (; tmpIterator != settings.constEnd(); ++tmpIterator)
|
for (; tmpIterator != settings.constEnd(); ++tmpIterator)
|
||||||
|
@ -354,7 +352,7 @@ void VProperty::setSettings(const QMap<QString, QVariant>& settings)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QMap<QString, QVariant> VProperty::getSettings() const
|
QMap<QString, QVariant> VPE::VProperty::getSettings() const
|
||||||
{
|
{
|
||||||
QMap<QString, QVariant> tmpResult;
|
QMap<QString, QVariant> tmpResult;
|
||||||
|
|
||||||
|
@ -365,26 +363,26 @@ QMap<QString, QVariant> VProperty::getSettings() const
|
||||||
return tmpResult;
|
return tmpResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VProperty::setSetting(const QString& key, const QVariant& value)
|
void VPE::VProperty::setSetting(const QString& key, const QVariant& value)
|
||||||
{
|
{
|
||||||
Q_UNUSED(key)
|
Q_UNUSED(key)
|
||||||
Q_UNUSED(value)
|
Q_UNUSED(value)
|
||||||
// Not needed in the Standard property
|
// Not needed in the Standard property
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant VProperty::getSetting(const QString& key) const
|
QVariant VPE::VProperty::getSetting(const QString& key) const
|
||||||
{
|
{
|
||||||
// Not needed in the Standard property
|
// Not needed in the Standard property
|
||||||
Q_UNUSED(key)
|
Q_UNUSED(key)
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList VProperty::getSettingKeys() const
|
QStringList VPE::VProperty::getSettingKeys() const
|
||||||
{
|
{
|
||||||
return QStringList();
|
return QStringList();
|
||||||
}
|
}
|
||||||
|
|
||||||
VProperty* VProperty::clone(bool include_children, VProperty* container) const
|
VPE::VProperty* VPE::VProperty::clone(bool include_children, VProperty* container) const
|
||||||
{
|
{
|
||||||
if (!container)
|
if (!container)
|
||||||
{
|
{
|
||||||
|
@ -407,28 +405,28 @@ VProperty* VProperty::clone(bool include_children, VProperty* container) const
|
||||||
return container;
|
return container;
|
||||||
}
|
}
|
||||||
|
|
||||||
Property VProperty::propertyType() const
|
VPE::Property VPE::VProperty::propertyType() const
|
||||||
{
|
{
|
||||||
return d_ptr->type;
|
return d_ptr->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VProperty::setPropertyType(const Property &type)
|
void VPE::VProperty::setPropertyType(const Property &type)
|
||||||
{
|
{
|
||||||
d_ptr->type = type;
|
d_ptr->type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VProperty::UpdateParent(const QVariant &value)
|
void VPE::VProperty::UpdateParent(const QVariant &value)
|
||||||
{
|
{
|
||||||
Q_UNUSED(value)
|
Q_UNUSED(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
void VProperty::ValueChildChanged(const QVariant &value, int typeForParent)
|
void VPE::VProperty::ValueChildChanged(const QVariant &value, int typeForParent)
|
||||||
{
|
{
|
||||||
Q_UNUSED(value)
|
Q_UNUSED(value)
|
||||||
Q_UNUSED(typeForParent)
|
Q_UNUSED(typeForParent)
|
||||||
}
|
}
|
||||||
|
|
||||||
UserChangeEvent::~UserChangeEvent()
|
VPE::UserChangeEvent::~UserChangeEvent()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
VPE::VPropertyPrivate::~VPropertyPrivate()
|
VPE::VPropertyPrivate::~VPropertyPrivate()
|
||||||
|
|
|
@ -36,19 +36,17 @@
|
||||||
class QStyleOptionViewItem;
|
class QStyleOptionViewItem;
|
||||||
class QWidget;
|
class QWidget;
|
||||||
|
|
||||||
using namespace VPE;
|
VPE::VPropertyDelegate::VPropertyDelegate(QObject *parent) :
|
||||||
|
|
||||||
VPropertyDelegate::VPropertyDelegate(QObject *parent) :
|
|
||||||
QStyledItemDelegate(parent), RowHeight(0), AddRowHeight(false)
|
QStyledItemDelegate(parent), RowHeight(0), AddRowHeight(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
VPropertyDelegate::~VPropertyDelegate()
|
VPE::VPropertyDelegate::~VPropertyDelegate()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget* VPropertyDelegate::createEditor (QWidget* parent, const QStyleOptionViewItem& option,
|
QWidget* VPE::VPropertyDelegate::createEditor (QWidget* parent, const QStyleOptionViewItem& option,
|
||||||
const QModelIndex& index) const
|
const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
QWidget* tmpWidget = nullptr;
|
QWidget* tmpWidget = nullptr;
|
||||||
|
@ -63,7 +61,7 @@ QWidget* VPropertyDelegate::createEditor (QWidget* parent, const QStyleOptionVie
|
||||||
|
|
||||||
|
|
||||||
//! Sets the index data to the editor
|
//! Sets the index data to the editor
|
||||||
void VPropertyDelegate::setEditorData (QWidget * editor, const QModelIndex & index) const
|
void VPE::VPropertyDelegate::setEditorData (QWidget * editor, const QModelIndex & index) const
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
if (index.isValid() && editor)
|
if (index.isValid() && editor)
|
||||||
|
@ -79,7 +77,8 @@ void VPropertyDelegate::setEditorData (QWidget * editor, const QModelIndex & ind
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Updates the index data
|
//! Updates the index data
|
||||||
void VPropertyDelegate::setModelData (QWidget * editor, QAbstractItemModel * model, const QModelIndex & index) const
|
void VPE::VPropertyDelegate::setModelData (QWidget * editor, QAbstractItemModel * model,
|
||||||
|
const QModelIndex & index) const
|
||||||
{
|
{
|
||||||
QVariant tmpData;
|
QVariant tmpData;
|
||||||
if (index.isValid() && editor)
|
if (index.isValid() && editor)
|
||||||
|
@ -96,7 +95,7 @@ void VPropertyDelegate::setModelData (QWidget * editor, QAbstractItemModel * mod
|
||||||
model->setData(index, tmpData);
|
model->setData(index, tmpData);
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize VPropertyDelegate::sizeHint (const QStyleOptionViewItem& option, const QModelIndex& index) const
|
QSize VPE::VPropertyDelegate::sizeHint (const QStyleOptionViewItem& option, const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
QSize tmpStandardSizeHint = QStyledItemDelegate::sizeHint(option, index);
|
QSize tmpStandardSizeHint = QStyledItemDelegate::sizeHint(option, index);
|
||||||
tmpStandardSizeHint.setHeight(tmpStandardSizeHint.height() + 1);
|
tmpStandardSizeHint.setHeight(tmpStandardSizeHint.height() + 1);
|
||||||
|
@ -109,13 +108,14 @@ QSize VPropertyDelegate::sizeHint (const QStyleOptionViewItem& option, const QMo
|
||||||
return tmpStandardSizeHint;
|
return tmpStandardSizeHint;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyDelegate::setRowHeight(int height, bool add_to_standard)
|
void VPE::VPropertyDelegate::setRowHeight(int height, bool add_to_standard)
|
||||||
{
|
{
|
||||||
RowHeight = height;
|
RowHeight = height;
|
||||||
AddRowHeight = add_to_standard;
|
AddRowHeight = add_to_standard;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
|
void VPE::VPropertyDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option,
|
||||||
|
const QModelIndex& index ) const
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
if (index.isValid() && index.column() == 1)
|
if (index.isValid() && index.column() == 1)
|
||||||
|
|
|
@ -30,18 +30,15 @@
|
||||||
#include "vpropertyfactorymanager_p.h"
|
#include "vpropertyfactorymanager_p.h"
|
||||||
#include "vstandardpropertyfactory.h"
|
#include "vstandardpropertyfactory.h"
|
||||||
|
|
||||||
using namespace VPE;
|
VPE::VPropertyFactoryManager* VPE::VPropertyFactoryManager::DefaultManager = NULL;
|
||||||
|
|
||||||
|
VPE::VPropertyFactoryManager::VPropertyFactoryManager(QObject *parent)
|
||||||
VPropertyFactoryManager* VPropertyFactoryManager::DefaultManager = NULL;
|
|
||||||
|
|
||||||
VPropertyFactoryManager::VPropertyFactoryManager(QObject *parent)
|
|
||||||
: QObject(parent), d_ptr(new VPropertyFactoryManagerPrivate())
|
: QObject(parent), d_ptr(new VPropertyFactoryManagerPrivate())
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VPropertyFactoryManager::~VPropertyFactoryManager()
|
VPE::VPropertyFactoryManager::~VPropertyFactoryManager()
|
||||||
{
|
{
|
||||||
// Delete all factories
|
// Delete all factories
|
||||||
QList<VAbstractPropertyFactory*> tmpFactories = d_ptr->Factories.values();
|
QList<VAbstractPropertyFactory*> tmpFactories = d_ptr->Factories.values();
|
||||||
|
@ -60,7 +57,7 @@ VPropertyFactoryManager::~VPropertyFactoryManager()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFactoryManager::registerFactory(const QString& type, VAbstractPropertyFactory* factory)
|
void VPE::VPropertyFactoryManager::registerFactory(const QString& type, VAbstractPropertyFactory* factory)
|
||||||
{
|
{
|
||||||
if (type.isEmpty())
|
if (type.isEmpty())
|
||||||
{
|
{
|
||||||
|
@ -73,7 +70,7 @@ void VPropertyFactoryManager::registerFactory(const QString& type, VAbstractProp
|
||||||
d_ptr->Factories[type] = factory;
|
d_ptr->Factories[type] = factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFactoryManager::unregisterFactory(VAbstractPropertyFactory* factory, const QString& type,
|
void VPE::VPropertyFactoryManager::unregisterFactory(VAbstractPropertyFactory* factory, const QString& type,
|
||||||
bool delete_if_unused)
|
bool delete_if_unused)
|
||||||
{
|
{
|
||||||
if (!factory)
|
if (!factory)
|
||||||
|
@ -109,19 +106,19 @@ void VPropertyFactoryManager::unregisterFactory(VAbstractPropertyFactory* factor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VPropertyFactoryManager::isRegistered(VAbstractPropertyFactory* factory)
|
bool VPE::VPropertyFactoryManager::isRegistered(VAbstractPropertyFactory* factory)
|
||||||
{
|
{
|
||||||
return (!d_ptr->Factories.key(factory, QString()).isEmpty());
|
return (!d_ptr->Factories.key(factory, QString()).isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
VAbstractPropertyFactory* VPropertyFactoryManager::getFactory(const QString& type)
|
VPE::VAbstractPropertyFactory* VPE::VPropertyFactoryManager::getFactory(const QString& type)
|
||||||
{
|
{
|
||||||
return d_ptr->Factories.value(type, NULL);
|
return d_ptr->Factories.value(type, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VProperty* VPropertyFactoryManager::createProperty(const QString& type, const QString& name, const QString& description,
|
VPE::VProperty* VPE::VPropertyFactoryManager::createProperty(const QString& type, const QString& name,
|
||||||
const QString &default_value)
|
const QString& description, const QString &default_value)
|
||||||
{
|
{
|
||||||
VAbstractPropertyFactory* tmpFactory = getFactory(type);
|
VAbstractPropertyFactory* tmpFactory = getFactory(type);
|
||||||
VProperty* tmpResult = NULL;
|
VProperty* tmpResult = NULL;
|
||||||
|
@ -144,7 +141,7 @@ VProperty* VPropertyFactoryManager::createProperty(const QString& type, const QS
|
||||||
}
|
}
|
||||||
|
|
||||||
// cppcheck-suppress unusedFunction
|
// cppcheck-suppress unusedFunction
|
||||||
VPropertyFactoryManager *VPropertyFactoryManager::getDefaultManager()
|
VPE::VPropertyFactoryManager *VPE::VPropertyFactoryManager::getDefaultManager()
|
||||||
{
|
{
|
||||||
if (!DefaultManager)
|
if (!DefaultManager)
|
||||||
{
|
{
|
||||||
|
@ -156,7 +153,7 @@ VPropertyFactoryManager *VPropertyFactoryManager::getDefaultManager()
|
||||||
}
|
}
|
||||||
|
|
||||||
// cppcheck-suppress unusedFunction
|
// cppcheck-suppress unusedFunction
|
||||||
QStringList VPropertyFactoryManager::getSupportedTypes()
|
QStringList VPE::VPropertyFactoryManager::getSupportedTypes()
|
||||||
{
|
{
|
||||||
return d_ptr->Factories.keys();
|
return d_ptr->Factories.keys();
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,32 +33,30 @@ class QModelIndex;
|
||||||
class QShowEvent;
|
class QShowEvent;
|
||||||
class QWidget;
|
class QWidget;
|
||||||
|
|
||||||
using namespace VPE;
|
VPE::VPropertyFormView::VPropertyFormView(QWidget* parent)
|
||||||
|
|
||||||
VPropertyFormView::VPropertyFormView(QWidget* parent)
|
|
||||||
: VPropertyFormWidget(new VPropertyFormViewPrivate(), parent)
|
: VPropertyFormWidget(new VPropertyFormViewPrivate(), parent)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
VPropertyFormView::VPropertyFormView(VPropertyModel* model, QWidget *parent)
|
VPE::VPropertyFormView::VPropertyFormView(VPropertyModel* model, QWidget *parent)
|
||||||
: VPropertyFormWidget(new VPropertyFormViewPrivate(), parent)
|
: VPropertyFormWidget(new VPropertyFormViewPrivate(), parent)
|
||||||
{
|
{
|
||||||
setModel(model);
|
setModel(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
VPropertyFormView::VPropertyFormView(VPropertySet* property_set, QWidget *parent)
|
VPE::VPropertyFormView::VPropertyFormView(VPropertySet* property_set, QWidget *parent)
|
||||||
: VPropertyFormWidget(new VPropertyFormViewPrivate(), parent)
|
: VPropertyFormWidget(new VPropertyFormViewPrivate(), parent)
|
||||||
{
|
{
|
||||||
setPropertySet(property_set);
|
setPropertySet(property_set);
|
||||||
}
|
}
|
||||||
|
|
||||||
VPropertyFormView::~VPropertyFormView()
|
VPE::VPropertyFormView::~VPropertyFormView()
|
||||||
{
|
{
|
||||||
// Nothing to do
|
// Nothing to do
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFormView::build()
|
void VPE::VPropertyFormView::build()
|
||||||
{
|
{
|
||||||
VPropertyFormWidget::build();
|
VPropertyFormWidget::build();
|
||||||
|
|
||||||
|
@ -66,7 +64,7 @@ void VPropertyFormView::build()
|
||||||
connectPropertyFormWidget(this);
|
connectPropertyFormWidget(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFormView::setModel(VPropertyModel *model)
|
void VPE::VPropertyFormView::setModel(VPropertyModel *model)
|
||||||
{
|
{
|
||||||
// Remove old model or set
|
// Remove old model or set
|
||||||
removeModelAndSet();
|
removeModelAndSet();
|
||||||
|
@ -92,7 +90,7 @@ void VPropertyFormView::setModel(VPropertyModel *model)
|
||||||
updatePropertyList();
|
updatePropertyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFormView::setPropertySet(VPropertySet* property_set)
|
void VPE::VPropertyFormView::setPropertySet(VPropertySet* property_set)
|
||||||
{
|
{
|
||||||
// Remove old model or set
|
// Remove old model or set
|
||||||
removeModelAndSet();
|
removeModelAndSet();
|
||||||
|
@ -109,7 +107,7 @@ void VPropertyFormView::setPropertySet(VPropertySet* property_set)
|
||||||
updatePropertyList();
|
updatePropertyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFormView::rowsRemoved(const QModelIndex &parent, int start, int end)
|
void VPE::VPropertyFormView::rowsRemoved(const QModelIndex &parent, int start, int end)
|
||||||
{
|
{
|
||||||
// todo: Only rebuild the neccessary parts
|
// todo: Only rebuild the neccessary parts
|
||||||
Q_UNUSED(parent)
|
Q_UNUSED(parent)
|
||||||
|
@ -118,7 +116,7 @@ void VPropertyFormView::rowsRemoved(const QModelIndex &parent, int start, int en
|
||||||
updatePropertyList();
|
updatePropertyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFormView::rowsInserted(const QModelIndex &parent, int start, int end) //-V524
|
void VPE::VPropertyFormView::rowsInserted(const QModelIndex &parent, int start, int end) //-V524
|
||||||
{
|
{
|
||||||
// todo: Only rebuild the neccessary parts
|
// todo: Only rebuild the neccessary parts
|
||||||
Q_UNUSED(parent)
|
Q_UNUSED(parent)
|
||||||
|
@ -127,18 +125,18 @@ void VPropertyFormView::rowsInserted(const QModelIndex &parent, int start, int e
|
||||||
updatePropertyList();
|
updatePropertyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFormView::modelReset()
|
void VPE::VPropertyFormView::modelReset()
|
||||||
{
|
{
|
||||||
updatePropertyList();
|
updatePropertyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFormView::modelDestroyed()
|
void VPE::VPropertyFormView::modelDestroyed()
|
||||||
{
|
{
|
||||||
removeModelAndSet();
|
removeModelAndSet();
|
||||||
updatePropertyList();
|
updatePropertyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFormView::dataChanged(const QModelIndex &top_left, const QModelIndex &bottom_right)
|
void VPE::VPropertyFormView::dataChanged(const QModelIndex &top_left, const QModelIndex &bottom_right)
|
||||||
{
|
{
|
||||||
Q_UNUSED(top_left)
|
Q_UNUSED(top_left)
|
||||||
Q_UNUSED(bottom_right)
|
Q_UNUSED(bottom_right)
|
||||||
|
@ -149,7 +147,7 @@ void VPropertyFormView::dataChanged(const QModelIndex &top_left, const QModelInd
|
||||||
// todo: handle data changes
|
// todo: handle data changes
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFormView::dataSubmitted(VProperty *property)
|
void VPE::VPropertyFormView::dataSubmitted(VProperty *property)
|
||||||
{
|
{
|
||||||
VPropertyModel* tmpModel = static_cast<VPropertyFormViewPrivate*>(d_ptr)->Model;
|
VPropertyModel* tmpModel = static_cast<VPropertyFormViewPrivate*>(d_ptr)->Model;
|
||||||
|
|
||||||
|
@ -161,7 +159,7 @@ void VPropertyFormView::dataSubmitted(VProperty *property)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFormView::showEvent(QShowEvent *event)
|
void VPE::VPropertyFormView::showEvent(QShowEvent *event)
|
||||||
{
|
{
|
||||||
Q_UNUSED(event)
|
Q_UNUSED(event)
|
||||||
if (static_cast<VPropertyFormViewPrivate*>(d_ptr)->NeedsRebuild)
|
if (static_cast<VPropertyFormViewPrivate*>(d_ptr)->NeedsRebuild)
|
||||||
|
@ -171,7 +169,7 @@ void VPropertyFormView::showEvent(QShowEvent *event)
|
||||||
static_cast<VPropertyFormViewPrivate*>(d_ptr)->NeedsRebuild = false;
|
static_cast<VPropertyFormViewPrivate*>(d_ptr)->NeedsRebuild = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFormView::updatePropertyList()
|
void VPE::VPropertyFormView::updatePropertyList()
|
||||||
{
|
{
|
||||||
VPropertyModel* tmpModel = static_cast<VPropertyFormViewPrivate*>(d_ptr)->Model;
|
VPropertyModel* tmpModel = static_cast<VPropertyFormViewPrivate*>(d_ptr)->Model;
|
||||||
VPropertySet* tmpSet = static_cast<VPropertyFormViewPrivate*>(d_ptr)->PropertySet;
|
VPropertySet* tmpSet = static_cast<VPropertyFormViewPrivate*>(d_ptr)->PropertySet;
|
||||||
|
@ -195,7 +193,7 @@ void VPropertyFormView::updatePropertyList()
|
||||||
static_cast<VPropertyFormViewPrivate*>(d_ptr)->NeedsRebuild = true;
|
static_cast<VPropertyFormViewPrivate*>(d_ptr)->NeedsRebuild = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFormView::removeModelAndSet()
|
void VPE::VPropertyFormView::removeModelAndSet()
|
||||||
{
|
{
|
||||||
if (static_cast<VPropertyFormViewPrivate*>(d_ptr)->Model)
|
if (static_cast<VPropertyFormViewPrivate*>(d_ptr)->Model)
|
||||||
{
|
{
|
||||||
|
@ -208,7 +206,7 @@ void VPropertyFormView::removeModelAndSet()
|
||||||
static_cast<VPropertyFormViewPrivate*>(d_ptr)->PropertySet = nullptr;
|
static_cast<VPropertyFormViewPrivate*>(d_ptr)->PropertySet = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFormView::connectPropertyFormWidget(VPropertyFormWidget *widget)
|
void VPE::VPropertyFormView::connectPropertyFormWidget(VPropertyFormWidget *widget)
|
||||||
{
|
{
|
||||||
if (!widget)
|
if (!widget)
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,9 +38,7 @@
|
||||||
|
|
||||||
class QKeyEvent;
|
class QKeyEvent;
|
||||||
|
|
||||||
using namespace VPE;
|
VPE::VPropertyFormWidget::VPropertyFormWidget(const QString &title, const QString &description,
|
||||||
|
|
||||||
VPropertyFormWidget::VPropertyFormWidget(const QString &title, const QString &description,
|
|
||||||
const QList<VProperty*>& properties, QWidget *parent)
|
const QList<VProperty*>& properties, QWidget *parent)
|
||||||
: QGroupBox(title, parent), d_ptr(new VPropertyFormWidgetPrivate(properties))
|
: QGroupBox(title, parent), d_ptr(new VPropertyFormWidgetPrivate(properties))
|
||||||
{
|
{
|
||||||
|
@ -49,7 +47,7 @@ VPropertyFormWidget::VPropertyFormWidget(const QString &title, const QString &de
|
||||||
setWhatsThis(description);
|
setWhatsThis(description);
|
||||||
}
|
}
|
||||||
|
|
||||||
VPropertyFormWidget::VPropertyFormWidget(VProperty *parent_property, QWidget *parent)
|
VPE::VPropertyFormWidget::VPropertyFormWidget(VProperty *parent_property, QWidget *parent)
|
||||||
: QGroupBox(parent), d_ptr(new VPropertyFormWidgetPrivate())
|
: QGroupBox(parent), d_ptr(new VPropertyFormWidgetPrivate())
|
||||||
{
|
{
|
||||||
if (parent_property)
|
if (parent_property)
|
||||||
|
@ -62,8 +60,8 @@ VPropertyFormWidget::VPropertyFormWidget(VProperty *parent_property, QWidget *pa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VPropertyFormWidget::VPropertyFormWidget(VPropertyFormWidgetPrivate *d_pointer, QWidget *parent, const QString &title,
|
VPE::VPropertyFormWidget::VPropertyFormWidget(VPropertyFormWidgetPrivate *d_pointer, QWidget *parent,
|
||||||
const QString &description)
|
const QString &title, const QString &description)
|
||||||
: QGroupBox(title, parent), d_ptr(d_pointer)
|
: QGroupBox(title, parent), d_ptr(d_pointer)
|
||||||
{
|
{
|
||||||
build();
|
build();
|
||||||
|
@ -71,13 +69,13 @@ VPropertyFormWidget::VPropertyFormWidget(VPropertyFormWidgetPrivate *d_pointer,
|
||||||
setWhatsThis(description);
|
setWhatsThis(description);
|
||||||
}
|
}
|
||||||
|
|
||||||
VPropertyFormWidget::~VPropertyFormWidget()
|
VPE::VPropertyFormWidget::~VPropertyFormWidget()
|
||||||
{
|
{
|
||||||
delete d_ptr;
|
delete d_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void VPropertyFormWidget::build()
|
void VPE::VPropertyFormWidget::build()
|
||||||
{
|
{
|
||||||
// Clear the old content, delete old widgets
|
// Clear the old content, delete old widgets
|
||||||
d_ptr->EditorWidgets.clear();
|
d_ptr->EditorWidgets.clear();
|
||||||
|
@ -160,7 +158,7 @@ void VPropertyFormWidget::build()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFormWidget::buildEditor(VProperty* property, QFormLayout* formLayout, Property type)
|
void VPE::VPropertyFormWidget::buildEditor(VProperty* property, QFormLayout* formLayout, Property type)
|
||||||
{
|
{
|
||||||
// Add property (no child properties)
|
// Add property (no child properties)
|
||||||
// Create the editor (if it doesn't work, create empty widget)
|
// Create the editor (if it doesn't work, create empty widget)
|
||||||
|
@ -194,7 +192,7 @@ void VPropertyFormWidget::buildEditor(VProperty* property, QFormLayout* formLayo
|
||||||
d_ptr->EditorWidgets.append(VPropertyFormWidgetPrivate::SEditorWidget(tmpEditor));
|
d_ptr->EditorWidgets.append(VPropertyFormWidgetPrivate::SEditorWidget(tmpEditor));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFormWidget::commitData()
|
void VPE::VPropertyFormWidget::commitData()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < d_ptr->Properties.count(); ++i)
|
for (int i = 0; i < d_ptr->Properties.count(); ++i)
|
||||||
{
|
{
|
||||||
|
@ -202,7 +200,7 @@ void VPropertyFormWidget::commitData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFormWidget::loadData()
|
void VPE::VPropertyFormWidget::loadData()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < d_ptr->Properties.count(); ++i)
|
for (int i = 0; i < d_ptr->Properties.count(); ++i)
|
||||||
{
|
{
|
||||||
|
@ -210,7 +208,7 @@ void VPropertyFormWidget::loadData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFormWidget::commitData(int row)
|
void VPE::VPropertyFormWidget::commitData(int row)
|
||||||
{
|
{
|
||||||
if (row < 0 || row >= d_ptr->EditorWidgets.count() || row >= d_ptr->Properties.count())
|
if (row < 0 || row >= d_ptr->EditorWidgets.count() || row >= d_ptr->Properties.count())
|
||||||
{
|
{
|
||||||
|
@ -249,7 +247,7 @@ void VPropertyFormWidget::commitData(int row)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFormWidget::loadData(int row)
|
void VPE::VPropertyFormWidget::loadData(int row)
|
||||||
{
|
{
|
||||||
if (row < 0 || row >= d_ptr->EditorWidgets.count() || row >= d_ptr->Properties.count())
|
if (row < 0 || row >= d_ptr->EditorWidgets.count() || row >= d_ptr->Properties.count())
|
||||||
{
|
{
|
||||||
|
@ -268,7 +266,7 @@ void VPropertyFormWidget::loadData(int row)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFormWidget::setCommitBehaviour(bool auto_commit)
|
void VPE::VPropertyFormWidget::setCommitBehaviour(bool auto_commit)
|
||||||
{
|
{
|
||||||
d_ptr->UpdateEditors = auto_commit;
|
d_ptr->UpdateEditors = auto_commit;
|
||||||
|
|
||||||
|
@ -282,7 +280,7 @@ void VPropertyFormWidget::setCommitBehaviour(bool auto_commit)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<VPropertyFormWidget *> VPropertyFormWidget::getChildPropertyFormWidgets() const
|
QList<VPE::VPropertyFormWidget *> VPE::VPropertyFormWidget::getChildPropertyFormWidgets() const
|
||||||
{
|
{
|
||||||
QList<VPropertyFormWidget *> tmpResult;
|
QList<VPropertyFormWidget *> tmpResult;
|
||||||
foreach(const VPropertyFormWidgetPrivate::SEditorWidget& tmpEditorWidget, d_ptr->EditorWidgets)
|
foreach(const VPropertyFormWidgetPrivate::SEditorWidget& tmpEditorWidget, d_ptr->EditorWidgets)
|
||||||
|
@ -296,7 +294,7 @@ QList<VPropertyFormWidget *> VPropertyFormWidget::getChildPropertyFormWidgets()
|
||||||
return tmpResult;
|
return tmpResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VPropertyFormWidget::eventFilter(QObject *object, QEvent *event)
|
bool VPE::VPropertyFormWidget::eventFilter(QObject *object, QEvent *event)
|
||||||
{
|
{
|
||||||
if (!d_ptr->UpdateEditors)
|
if (!d_ptr->UpdateEditors)
|
||||||
{
|
{
|
||||||
|
@ -354,7 +352,7 @@ bool VPropertyFormWidget::eventFilter(QObject *object, QEvent *event)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyFormWidget::commitData(const QWidget *editor)
|
void VPE::VPropertyFormWidget::commitData(const QWidget *editor)
|
||||||
{
|
{
|
||||||
if (!editor)
|
if (!editor)
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,29 +25,27 @@
|
||||||
#include "vproperty.h"
|
#include "vproperty.h"
|
||||||
#include "vpropertyset.h"
|
#include "vpropertyset.h"
|
||||||
|
|
||||||
using namespace VPE;
|
|
||||||
|
|
||||||
#include "vpropertymodel_p.h"
|
#include "vpropertymodel_p.h"
|
||||||
|
|
||||||
VPropertyModel::VPropertyModel(VPropertyModelPrivate *d, QObject *parent)
|
VPE::VPropertyModel::VPropertyModel(VPropertyModelPrivate *d, QObject *parent)
|
||||||
: QAbstractItemModel(parent), d_ptr(d)
|
: QAbstractItemModel(parent), d_ptr(d)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VPropertyModel::VPropertyModel(QObject * parent) :
|
VPE::VPropertyModel::VPropertyModel(QObject * parent) :
|
||||||
QAbstractItemModel(parent), d_ptr(new VPropertyModelPrivate())
|
QAbstractItemModel(parent), d_ptr(new VPropertyModelPrivate())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
VPropertyModel::~VPropertyModel()
|
VPE::VPropertyModel::~VPropertyModel()
|
||||||
{
|
{
|
||||||
delete d_ptr->Properties;
|
delete d_ptr->Properties;
|
||||||
delete d_ptr;
|
delete d_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Adds the property to the model and attaches it to the parentid
|
//! Adds the property to the model and attaches it to the parentid
|
||||||
bool VPropertyModel::addProperty(VProperty* property, const QString& id, const QString &parentid, bool emitsignals)
|
bool VPE::VPropertyModel::addProperty(VProperty* property, const QString& id, const QString &parentid, bool emitsignals)
|
||||||
{
|
{
|
||||||
if (!property)
|
if (!property)
|
||||||
{
|
{
|
||||||
|
@ -78,7 +76,7 @@ bool VPropertyModel::addProperty(VProperty* property, const QString& id, const Q
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Creates a property and adds it to the model
|
//! Creates a property and adds it to the model
|
||||||
VProperty* VPropertyModel::createProperty(const QString& id, const QString& name, const QString& parentid,
|
VPE::VProperty* VPE::VPropertyModel::createProperty(const QString& id, const QString& name, const QString& parentid,
|
||||||
const QVariant& data)
|
const QVariant& data)
|
||||||
{
|
{
|
||||||
VProperty* tmpProp = new VProperty(name);
|
VProperty* tmpProp = new VProperty(name);
|
||||||
|
@ -92,13 +90,13 @@ VProperty* VPropertyModel::createProperty(const QString& id, const QString& name
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Gets a property by it's ID
|
//! Gets a property by it's ID
|
||||||
VProperty* VPropertyModel::getProperty(const QString& id)
|
VPE::VProperty* VPE::VPropertyModel::getProperty(const QString& id)
|
||||||
{
|
{
|
||||||
return d_ptr->Properties != nullptr ? d_ptr->Properties->getProperty(id) : nullptr;
|
return d_ptr->Properties != nullptr ? d_ptr->Properties->getProperty(id) : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns the model index at row/column
|
//! Returns the model index at row/column
|
||||||
QModelIndex VPropertyModel::index(int row, int column, const QModelIndex& parent) const
|
QModelIndex VPE::VPropertyModel::index(int row, int column, const QModelIndex& parent) const
|
||||||
{
|
{
|
||||||
if (d_ptr->Properties == nullptr || (parent.isValid() && parent.column() > 1))
|
if (d_ptr->Properties == nullptr || (parent.isValid() && parent.column() > 1))
|
||||||
{
|
{
|
||||||
|
@ -127,7 +125,7 @@ QModelIndex VPropertyModel::index(int row, int column, const QModelIndex& parent
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns the parent of one model index
|
//! Returns the parent of one model index
|
||||||
QModelIndex VPropertyModel::parent ( const QModelIndex & index ) const
|
QModelIndex VPE::VPropertyModel::parent ( const QModelIndex & index ) const
|
||||||
{
|
{
|
||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
{
|
{
|
||||||
|
@ -155,7 +153,7 @@ QModelIndex VPropertyModel::parent ( const QModelIndex & index ) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns the item flags for the given index
|
//! Returns the item flags for the given index
|
||||||
Qt::ItemFlags VPropertyModel::flags (const QModelIndex& index) const
|
Qt::ItemFlags VPE::VPropertyModel::flags (const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
VProperty* tmpProperty = getProperty(index);
|
VProperty* tmpProperty = getProperty(index);
|
||||||
if (!tmpProperty)
|
if (!tmpProperty)
|
||||||
|
@ -167,7 +165,7 @@ Qt::ItemFlags VPropertyModel::flags (const QModelIndex& index) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the role data for the item at index to value
|
//! Sets the role data for the item at index to value
|
||||||
bool VPropertyModel::setData (const QModelIndex& index, const QVariant& value, int role)
|
bool VPE::VPropertyModel::setData (const QModelIndex& index, const QVariant& value, int role)
|
||||||
{
|
{
|
||||||
VProperty* tmpProperty = getProperty(index);
|
VProperty* tmpProperty = getProperty(index);
|
||||||
if (index.column() == 1 && tmpProperty)
|
if (index.column() == 1 && tmpProperty)
|
||||||
|
@ -191,7 +189,7 @@ bool VPropertyModel::setData (const QModelIndex& index, const QVariant& value, i
|
||||||
|
|
||||||
|
|
||||||
//! Returns the data of an model index
|
//! Returns the data of an model index
|
||||||
QVariant VPropertyModel::data ( const QModelIndex & index, int role ) const
|
QVariant VPE::VPropertyModel::data ( const QModelIndex & index, int role ) const
|
||||||
{
|
{
|
||||||
VProperty* tmpProperty = getProperty(index);
|
VProperty* tmpProperty = getProperty(index);
|
||||||
if (!tmpProperty)
|
if (!tmpProperty)
|
||||||
|
@ -203,7 +201,7 @@ QVariant VPropertyModel::data ( const QModelIndex & index, int role ) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QVariant VPropertyModel::headerData (int section, Qt::Orientation orientation, int role) const
|
QVariant VPE::VPropertyModel::headerData (int section, Qt::Orientation orientation, int role) const
|
||||||
{
|
{
|
||||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
|
if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
|
||||||
{
|
{
|
||||||
|
@ -227,7 +225,7 @@ QVariant VPropertyModel::headerData (int section, Qt::Orientation orientation, i
|
||||||
|
|
||||||
|
|
||||||
//! Returns the number of rows
|
//! Returns the number of rows
|
||||||
int VPropertyModel::rowCount ( const QModelIndex & parent ) const
|
int VPE::VPropertyModel::rowCount ( const QModelIndex & parent ) const
|
||||||
{
|
{
|
||||||
if (parent.isValid())
|
if (parent.isValid())
|
||||||
{
|
{
|
||||||
|
@ -249,7 +247,7 @@ int VPropertyModel::rowCount ( const QModelIndex & parent ) const
|
||||||
|
|
||||||
|
|
||||||
//! Returns the number of columns
|
//! Returns the number of columns
|
||||||
int VPropertyModel::columnCount ( const QModelIndex & parent) const
|
int VPE::VPropertyModel::columnCount ( const QModelIndex & parent) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(parent)
|
Q_UNUSED(parent)
|
||||||
return 2;
|
return 2;
|
||||||
|
@ -257,7 +255,7 @@ int VPropertyModel::columnCount ( const QModelIndex & parent) const
|
||||||
|
|
||||||
|
|
||||||
//! Gets a property by its ModelIndex
|
//! Gets a property by its ModelIndex
|
||||||
VProperty* VPropertyModel::getProperty(const QModelIndex &index) const
|
VPE::VProperty* VPE::VPropertyModel::getProperty(const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
if (index.isValid())
|
if (index.isValid())
|
||||||
{
|
{
|
||||||
|
@ -271,12 +269,12 @@ VProperty* VPropertyModel::getProperty(const QModelIndex &index) const
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString VPropertyModel::getPropertyID(const VProperty *prop) const
|
QString VPE::VPropertyModel::getPropertyID(const VProperty *prop) const
|
||||||
{
|
{
|
||||||
return d_ptr->Properties != nullptr ? d_ptr->Properties->getPropertyID(prop) : QString();
|
return d_ptr->Properties != nullptr ? d_ptr->Properties->getPropertyID(prop) : QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QModelIndex VPropertyModel::getIndexFromProperty(VProperty* property, int column) const
|
QModelIndex VPE::VPropertyModel::getIndexFromProperty(VProperty* property, int column) const
|
||||||
{
|
{
|
||||||
if (!property || column > columnCount() || column < 0)
|
if (!property || column > columnCount() || column < 0)
|
||||||
{
|
{
|
||||||
|
@ -295,7 +293,7 @@ QModelIndex VPropertyModel::getIndexFromProperty(VProperty* property, int column
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void VPropertyModel::onDataChangedByModel(VProperty* property)
|
void VPE::VPropertyModel::onDataChangedByModel(VProperty* property)
|
||||||
{
|
{
|
||||||
QModelIndex tmpIndex = getIndexFromProperty(property, 1);
|
QModelIndex tmpIndex = getIndexFromProperty(property, 1);
|
||||||
if (tmpIndex.isValid())
|
if (tmpIndex.isValid())
|
||||||
|
@ -305,17 +303,17 @@ void VPropertyModel::onDataChangedByModel(VProperty* property)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const VPropertySet *VPropertyModel::getPropertySet() const
|
const VPE::VPropertySet *VPE::VPropertyModel::getPropertySet() const
|
||||||
{
|
{
|
||||||
return d_ptr->Properties;
|
return d_ptr->Properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyModel::clear(bool emit_signals)
|
void VPE::VPropertyModel::clear(bool emit_signals)
|
||||||
{
|
{
|
||||||
setPropertySet(nullptr, emit_signals);
|
setPropertySet(nullptr, emit_signals);
|
||||||
}
|
}
|
||||||
|
|
||||||
VPropertySet *VPropertyModel::takePropertySet(VPropertySet *new_property_set, bool emit_signals)
|
VPE::VPropertySet *VPE::VPropertyModel::takePropertySet(VPropertySet *new_property_set, bool emit_signals)
|
||||||
{
|
{
|
||||||
VPropertySet* tmpOldPropertySet = d_ptr->Properties;
|
VPropertySet* tmpOldPropertySet = d_ptr->Properties;
|
||||||
|
|
||||||
|
@ -332,13 +330,13 @@ VPropertySet *VPropertyModel::takePropertySet(VPropertySet *new_property_set, bo
|
||||||
return tmpOldPropertySet;
|
return tmpOldPropertySet;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyModel::setPropertySet(VPropertySet *property_set, bool emit_signals)
|
void VPE::VPropertyModel::setPropertySet(VPropertySet *property_set, bool emit_signals)
|
||||||
{
|
{
|
||||||
VPropertySet* tmpOldPropertySet = takePropertySet(property_set, emit_signals);
|
VPropertySet* tmpOldPropertySet = takePropertySet(property_set, emit_signals);
|
||||||
delete tmpOldPropertySet;
|
delete tmpOldPropertySet;
|
||||||
}
|
}
|
||||||
|
|
||||||
VProperty *VPropertyModel::takeProperty(const QString &id)
|
VPE::VProperty *VPE::VPropertyModel::takeProperty(const QString &id)
|
||||||
{
|
{
|
||||||
QModelIndex tmpIndex = getIndexFromProperty(getProperty(id));
|
QModelIndex tmpIndex = getIndexFromProperty(getProperty(id));
|
||||||
if (d_ptr->Properties && tmpIndex.isValid())
|
if (d_ptr->Properties && tmpIndex.isValid())
|
||||||
|
@ -352,7 +350,7 @@ VProperty *VPropertyModel::takeProperty(const QString &id)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyModel::removeProperty(const QString &id)
|
void VPE::VPropertyModel::removeProperty(const QString &id)
|
||||||
{
|
{
|
||||||
QModelIndex tmpIndex = getIndexFromProperty(getProperty(id));
|
QModelIndex tmpIndex = getIndexFromProperty(getProperty(id));
|
||||||
if (d_ptr->Properties && tmpIndex.isValid())
|
if (d_ptr->Properties && tmpIndex.isValid())
|
||||||
|
|
|
@ -25,19 +25,17 @@
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
|
||||||
using namespace VPE;
|
|
||||||
|
|
||||||
#include "vproperty.h"
|
#include "vproperty.h"
|
||||||
#include "vpropertyset_p.h"
|
#include "vpropertyset_p.h"
|
||||||
|
|
||||||
|
|
||||||
VPropertySet::VPropertySet()
|
VPE::VPropertySet::VPropertySet()
|
||||||
: d_ptr(new VPropertySetPrivate())
|
: d_ptr(new VPropertySetPrivate())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VPropertySet::~VPropertySet()
|
VPE::VPropertySet::~VPropertySet()
|
||||||
{
|
{
|
||||||
// Delete all the properties
|
// Delete all the properties
|
||||||
clear(true);
|
clear(true);
|
||||||
|
@ -45,7 +43,7 @@ VPropertySet::~VPropertySet()
|
||||||
delete d_ptr;
|
delete d_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VPropertySet::addProperty(VProperty *property, const QString &id, const QString &parentid)
|
bool VPE::VPropertySet::addProperty(VProperty *property, const QString &id, const QString &parentid)
|
||||||
{
|
{
|
||||||
// Check if the property to add is not a null pointer
|
// Check if the property to add is not a null pointer
|
||||||
if (!property)
|
if (!property)
|
||||||
|
@ -57,7 +55,7 @@ bool VPropertySet::addProperty(VProperty *property, const QString &id, const QSt
|
||||||
return addProperty(property, id, tmpParent);
|
return addProperty(property, id, tmpParent);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VPropertySet::addProperty(VProperty *property, const QString &id, VProperty *parent_property)
|
bool VPE::VPropertySet::addProperty(VProperty *property, const QString &id, VProperty *parent_property)
|
||||||
{
|
{
|
||||||
// Check if the property to add is not a null pointer
|
// Check if the property to add is not a null pointer
|
||||||
if (!property)
|
if (!property)
|
||||||
|
@ -92,7 +90,7 @@ bool VPropertySet::addProperty(VProperty *property, const QString &id, VProperty
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VPropertySet::hasProperty(VProperty *property) const
|
bool VPE::VPropertySet::hasProperty(VProperty *property) const
|
||||||
{
|
{
|
||||||
if (!property)
|
if (!property)
|
||||||
{
|
{
|
||||||
|
@ -102,12 +100,12 @@ bool VPropertySet::hasProperty(VProperty *property) const
|
||||||
return hasProperty(property, NULL);
|
return hasProperty(property, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
VProperty *VPropertySet::getProperty(const QString &id) const
|
VPE::VProperty *VPE::VPropertySet::getProperty(const QString &id) const
|
||||||
{
|
{
|
||||||
return d_ptr->Properties.value(id, NULL);
|
return d_ptr->Properties.value(id, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
VProperty *VPropertySet::takeProperty(const QString &id)
|
VPE::VProperty *VPE::VPropertySet::takeProperty(const QString &id)
|
||||||
{
|
{
|
||||||
VProperty* tmpProp = getProperty(id);
|
VProperty* tmpProp = getProperty(id);
|
||||||
removeProperty(tmpProp, false);
|
removeProperty(tmpProp, false);
|
||||||
|
@ -116,13 +114,13 @@ VProperty *VPropertySet::takeProperty(const QString &id)
|
||||||
return tmpProp;
|
return tmpProp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertySet::removeProperty(const QString &id)
|
void VPE::VPropertySet::removeProperty(const QString &id)
|
||||||
{
|
{
|
||||||
VProperty* tmpProp = takeProperty(id);
|
VProperty* tmpProp = takeProperty(id);
|
||||||
delete tmpProp;
|
delete tmpProp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertySet::removeProperty(VProperty* prop, bool delete_property)
|
void VPE::VPropertySet::removeProperty(VProperty* prop, bool delete_property)
|
||||||
{
|
{
|
||||||
// Remove all the children
|
// Remove all the children
|
||||||
removePropertyFromSet(prop);
|
removePropertyFromSet(prop);
|
||||||
|
@ -139,12 +137,12 @@ void VPropertySet::removeProperty(VProperty* prop, bool delete_property)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int VPropertySet::count() const
|
int VPE::VPropertySet::count() const
|
||||||
{
|
{
|
||||||
return d_ptr->Properties.count();
|
return d_ptr->Properties.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertySet::clear(bool delete_properties)
|
void VPE::VPropertySet::clear(bool delete_properties)
|
||||||
{
|
{
|
||||||
d_ptr->Properties.clear();
|
d_ptr->Properties.clear();
|
||||||
while (!d_ptr->RootProperties.isEmpty())
|
while (!d_ptr->RootProperties.isEmpty())
|
||||||
|
@ -157,7 +155,7 @@ void VPropertySet::clear(bool delete_properties)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString VPropertySet::getPropertyID(const VProperty *prop, bool look_for_parent_id) const
|
QString VPE::VPropertySet::getPropertyID(const VProperty *prop, bool look_for_parent_id) const
|
||||||
{
|
{
|
||||||
QString tmpResult;
|
QString tmpResult;
|
||||||
const VProperty* tmpCurrentProp = prop;
|
const VProperty* tmpCurrentProp = prop;
|
||||||
|
@ -185,27 +183,27 @@ QString VPropertySet::getPropertyID(const VProperty *prop, bool look_for_parent_
|
||||||
}
|
}
|
||||||
|
|
||||||
// cppcheck-suppress unusedFunction
|
// cppcheck-suppress unusedFunction
|
||||||
const QMap<QString, VProperty *> &VPropertySet::getPropertiesMap() const
|
const QMap<QString, VPE::VProperty *> &VPE::VPropertySet::getPropertiesMap() const
|
||||||
{
|
{
|
||||||
return d_ptr->Properties;
|
return d_ptr->Properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QList<VProperty *> &VPropertySet::getRootProperties() const
|
const QList<VPE::VProperty *> &VPE::VPropertySet::getRootProperties() const
|
||||||
{
|
{
|
||||||
return d_ptr->RootProperties;
|
return d_ptr->RootProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
VProperty *VPropertySet::getRootProperty(int row) const
|
VPE::VProperty *VPE::VPropertySet::getRootProperty(int row) const
|
||||||
{
|
{
|
||||||
return d_ptr->RootProperties.value(row, NULL);
|
return d_ptr->RootProperties.value(row, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int VPropertySet::getRootPropertyCount() const
|
int VPE::VPropertySet::getRootPropertyCount() const
|
||||||
{
|
{
|
||||||
return d_ptr->RootProperties.count();
|
return d_ptr->RootProperties.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
VPropertySet* VPropertySet::clone() const
|
VPE::VPropertySet* VPE::VPropertySet::clone() const
|
||||||
{
|
{
|
||||||
VPropertySet* tmpResult = new VPropertySet();
|
VPropertySet* tmpResult = new VPropertySet();
|
||||||
|
|
||||||
|
@ -216,7 +214,7 @@ VPropertySet* VPropertySet::clone() const
|
||||||
return tmpResult;
|
return tmpResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VPropertySet::hasProperty(VProperty *property, VProperty *parent) const
|
bool VPE::VPropertySet::hasProperty(VProperty *property, VProperty *parent) const
|
||||||
{
|
{
|
||||||
if (!property)
|
if (!property)
|
||||||
{
|
{
|
||||||
|
@ -239,7 +237,7 @@ bool VPropertySet::hasProperty(VProperty *property, VProperty *parent) const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertySet::cloneProperty(VProperty* property_to_clone, VProperty *parent_property,
|
void VPE::VPropertySet::cloneProperty(VProperty* property_to_clone, VProperty *parent_property,
|
||||||
VPropertySet *output_set) const
|
VPropertySet *output_set) const
|
||||||
{
|
{
|
||||||
if (!output_set || !property_to_clone || !hasProperty(property_to_clone))
|
if (!output_set || !property_to_clone || !hasProperty(property_to_clone))
|
||||||
|
@ -259,7 +257,7 @@ void VPropertySet::cloneProperty(VProperty* property_to_clone, VProperty *parent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertySet::removePropertyFromSet(VProperty *prop)
|
void VPE::VPropertySet::removePropertyFromSet(VProperty *prop)
|
||||||
{
|
{
|
||||||
// Remove all the children
|
// Remove all the children
|
||||||
foreach(VProperty* tmpChild, prop->getChildren())
|
foreach(VProperty* tmpChild, prop->getChildren())
|
||||||
|
|
|
@ -29,15 +29,13 @@
|
||||||
|
|
||||||
class QWidget;
|
class QWidget;
|
||||||
|
|
||||||
using namespace VPE;
|
VPE::VPropertyTreeView::VPropertyTreeView(QWidget *parent)
|
||||||
|
|
||||||
VPropertyTreeView::VPropertyTreeView(QWidget *parent)
|
|
||||||
: QTreeView(parent), d_ptr(new VPropertyTreeViewPrivate())
|
: QTreeView(parent), d_ptr(new VPropertyTreeViewPrivate())
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
VPropertyTreeView::VPropertyTreeView(VPropertyModel *model, QWidget *parent)
|
VPE::VPropertyTreeView::VPropertyTreeView(VPropertyModel *model, QWidget *parent)
|
||||||
: QTreeView(parent), d_ptr(new VPropertyTreeViewPrivate())
|
: QTreeView(parent), d_ptr(new VPropertyTreeViewPrivate())
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
|
@ -48,7 +46,7 @@ VPropertyTreeView::VPropertyTreeView(VPropertyModel *model, QWidget *parent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VPropertyTreeView::VPropertyTreeView(VPropertyTreeViewPrivate *d, bool init_, QWidget *parent)
|
VPE::VPropertyTreeView::VPropertyTreeView(VPropertyTreeViewPrivate *d, bool init_, QWidget *parent)
|
||||||
: QTreeView(parent), d_ptr(d)
|
: QTreeView(parent), d_ptr(d)
|
||||||
{
|
{
|
||||||
if (init_)
|
if (init_)
|
||||||
|
@ -57,18 +55,18 @@ VPropertyTreeView::VPropertyTreeView(VPropertyTreeViewPrivate *d, bool init_, QW
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VPropertyTreeView::~VPropertyTreeView()
|
VPE::VPropertyTreeView::~VPropertyTreeView()
|
||||||
{
|
{
|
||||||
delete d_ptr;
|
delete d_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void VPropertyTreeView::setRowHeight(int height, bool add_to_standard)
|
void VPE::VPropertyTreeView::setRowHeight(int height, bool add_to_standard)
|
||||||
{
|
{
|
||||||
d_ptr->PropertyDelegate->setRowHeight(height, add_to_standard);
|
d_ptr->PropertyDelegate->setRowHeight(height, add_to_standard);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VPropertyTreeView::init()
|
void VPE::VPropertyTreeView::init()
|
||||||
{
|
{
|
||||||
setAlternatingRowColors(true);
|
setAlternatingRowColors(true);
|
||||||
setUniformRowHeights(true);
|
setUniformRowHeights(true);
|
||||||
|
|
|
@ -26,16 +26,14 @@
|
||||||
#include "vproperty.h"
|
#include "vproperty.h"
|
||||||
#include "vpropertyset.h"
|
#include "vpropertyset.h"
|
||||||
|
|
||||||
using namespace VPE;
|
VPE::VSerializedProperty::VSerializedProperty()
|
||||||
|
|
||||||
VSerializedProperty::VSerializedProperty()
|
|
||||||
: ID(), Type(), Value(), Children()
|
: ID(), Type(), Value(), Children()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/*! Creates a new VSerializedProperty from an existing property
|
/*! Creates a new VSerializedProperty from an existing property
|
||||||
|
|
||||||
*/
|
*/
|
||||||
VSerializedProperty::VSerializedProperty(const VProperty* property, const VPropertySet* set)
|
VPE::VSerializedProperty::VSerializedProperty(const VProperty* property, const VPropertySet* set)
|
||||||
: ID(), Type(property ? property->type() : QString()), Value(property ? property->getValue() : QVariant()),
|
: ID(), Type(property ? property->type() : QString()), Value(property ? property->getValue() : QVariant()),
|
||||||
Children()
|
Children()
|
||||||
{
|
{
|
||||||
|
@ -47,19 +45,19 @@ VSerializedProperty::VSerializedProperty(const VProperty* property, const VPrope
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VSerializedProperty::VSerializedProperty(const VProperty *property, const QString &id, const VPropertySet *set)
|
VPE::VSerializedProperty::VSerializedProperty(const VProperty *property, const QString &id, const VPropertySet *set)
|
||||||
: ID(id), Type(property ? property->type() : QString()), Value(property ? property->getValue() : QVariant()),
|
: ID(id), Type(property ? property->type() : QString()), Value(property ? property->getValue() : QVariant()),
|
||||||
Children()
|
Children()
|
||||||
{
|
{
|
||||||
initChildren(property, set);
|
initChildren(property, set);
|
||||||
}
|
}
|
||||||
|
|
||||||
VSerializedProperty::VSerializedProperty(const QString &id, const QString &type, const QVariant &value)
|
VPE::VSerializedProperty::VSerializedProperty(const QString &id, const QString &type, const QVariant &value)
|
||||||
: ID(id), Type(type), Value(value), Children()
|
: ID(id), Type(type), Value(value), Children()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void VSerializedProperty::initChildren(const VProperty *property, const VPropertySet *set)
|
void VPE::VSerializedProperty::initChildren(const VProperty *property, const VPropertySet *set)
|
||||||
{
|
{
|
||||||
if (property && set)
|
if (property && set)
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,15 +31,12 @@
|
||||||
#include "plugins/vshortcutproperty.h"
|
#include "plugins/vshortcutproperty.h"
|
||||||
#include "vpropertyfactorymanager.h"
|
#include "vpropertyfactorymanager.h"
|
||||||
|
|
||||||
|
VPE::VStandardPropertyFactory::VStandardPropertyFactory()
|
||||||
using namespace VPE;
|
|
||||||
|
|
||||||
VStandardPropertyFactory::VStandardPropertyFactory()
|
|
||||||
: VAbstractPropertyFactory()
|
: VAbstractPropertyFactory()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
VStandardPropertyFactory::VStandardPropertyFactory(VPropertyFactoryManager *manager)
|
VPE::VStandardPropertyFactory::VStandardPropertyFactory(VPropertyFactoryManager *manager)
|
||||||
: VAbstractPropertyFactory()
|
: VAbstractPropertyFactory()
|
||||||
{
|
{
|
||||||
if (manager)
|
if (manager)
|
||||||
|
@ -57,7 +54,7 @@ VStandardPropertyFactory::VStandardPropertyFactory(VPropertyFactoryManager *mana
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VProperty *VStandardPropertyFactory::createProperty(const QString &type, const QString &name)
|
VPE::VProperty *VPE::VStandardPropertyFactory::createProperty(const QString &type, const QString &name)
|
||||||
{
|
{
|
||||||
if (type == QString("string"))
|
if (type == QString("string"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,9 +31,6 @@
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include "../qmuparser/qmuparsertest.h"
|
#include "../qmuparser/qmuparsertest.h"
|
||||||
|
|
||||||
using namespace qmu;
|
|
||||||
using namespace Test;
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void testMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
|
void testMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
|
||||||
{
|
{
|
||||||
|
@ -64,7 +61,7 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QCoreApplication a(argc, argv);
|
QCoreApplication a(argc, argv);
|
||||||
qInstallMessageHandler(testMessageOutput);
|
qInstallMessageHandler(testMessageOutput);
|
||||||
QmuParserTester pt;
|
qmu::Test::QmuParserTester pt;
|
||||||
QTimer::singleShot(0, &pt, SLOT(Run()));
|
QTimer::singleShot(0, &pt, SLOT(Run()));
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user