PeriDyno 1.0.0
Loading...
Searching...
No Matches
QVectorIntFieldWidget.cpp
Go to the documentation of this file.
2
3#include <QGridLayout>
4
5#include "Field.h"
6#include "QPiecewiseSpinBox.h"
7
8#include <QPushButton.h>
9
10namespace dyno
11{
13
16 {
17 mainLayout = new QVBoxLayout;
18 mainLayout->setContentsMargins(0, 0, 0, 0);
19 mainLayout->setAlignment(Qt::AlignLeft);
20
21 this->setLayout(mainLayout);
22
23 //Label
24 QHBoxLayout* nameLayout = new QHBoxLayout;
25 QLabel* name = new QLabel();
26 name->setText(FormatFieldWidgetName(field->getObjectName()));
27
28 QPushButton* addItembutton = new QPushButton("add Item");
29 addItembutton->setFixedSize(100, 40);
30
31 nameLayout->addWidget(name);
32 nameLayout->addWidget(addItembutton);
33
34 mainLayout->addLayout(nameLayout);
35
36
37 QObject::connect(addItembutton, SIGNAL(pressed()), this, SLOT(addItemWidget()));
38 QObject::connect(this, SIGNAL(vectorChange()), this, SLOT(updateField()));
39
41 if (f != nullptr)
42 {
43 mVec = f->getValue();
44 }
45
47
48 };
49
51 {
52 for (size_t i = 0; i < mVec.size(); i++)
53 {
55 }
56
57 }
58
59}
60
#define IMPL_FIELD_WIDGET(_data_type_, _type_)
T getValue()
Definition Field.h:130
QFieldWidget(FBase *field)
DECLARE_FIELD_WIDGET QVectorIntFieldWidget(FBase *field)
TA * cast(TB *b)
Definition Typedef.inl:286
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
QString FormatFieldWidgetName(std::string name)
Definition Format.cpp:9