void xyzWidget::create(bsDoubleMode mode, double minimum, double maximum, bool periodic, bool horizontal)
{
if(horizontal)
else
layout()->setMargin(0);
if(horizontal)
w_xyzGroupBox
->setLayout
(new QHBoxLayout(w_xyzGroupBox
));
else
w_xyzGroupBox
->setLayout
(new QVBoxLayout(w_xyzGroupBox
));
w_xyzGroupBox->hide();
w_xValue = new bsDoubleWidget(this, mode, minimum, maximum, periodic);
w_xValue->setLabel(tr("X :"));
w_xValue
->setLabelColor
(QColor(200,
0,
0));
connect(w_xValue, SIGNAL(valueChanged(double)), this, SLOT(xyzChanged(double)));
connect(w_xValue, SIGNAL(editingBegin()), this, SIGNAL(xyzEditingBegin()));
connect(w_xValue, SIGNAL(editingFinished()), this, SIGNAL(xyzEditingFinished()));
layout()->addWidget(w_xValue);
w_yValue = new bsDoubleWidget(this, mode, minimum, maximum, periodic);
w_yValue->setLabel(tr("Y :"));
w_yValue
->setLabelColor
(QColor(0,
200,
0));
connect(w_yValue, SIGNAL(valueChanged(double)), this, SLOT(xyzChanged(double)));
connect(w_yValue, SIGNAL(editingBegin()), this, SIGNAL(xyzEditingBegin()));
connect(w_yValue, SIGNAL(editingFinished()), this, SIGNAL(xyzEditingFinished()));
layout()->addWidget(w_yValue);
w_zValue = new bsDoubleWidget(this, mode, minimum, maximum, periodic);
w_zValue->setLabel(tr("Z :"));
w_zValue
->setLabelColor
(QColor(0,
0,
200));
connect(w_zValue, SIGNAL(valueChanged(double)), this, SLOT(xyzChanged(double)));
connect(w_zValue, SIGNAL(editingBegin()), this, SIGNAL(xyzEditingBegin()));
connect(w_zValue, SIGNAL(editingFinished()), this, SIGNAL(xyzEditingFinished()));
layout()->addWidget(w_zValue);
}
void xyzWidget::create(bsDoubleMode mode, double minimum, double maximum, bool periodic, bool horizontal)
{
setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred));
if(horizontal)
setLayout(new QHBoxLayout(this));
else
setLayout(new QVBoxLayout(this));
layout()->setMargin(0);
w_xyzGroupBox = new QGroupBox(this);
w_xyzGroupBox->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred));
if(horizontal)
w_xyzGroupBox->setLayout(new QHBoxLayout(w_xyzGroupBox));
else
w_xyzGroupBox->setLayout(new QVBoxLayout(w_xyzGroupBox));
w_xyzGroupBox->hide();
w_xValue = new bsDoubleWidget(this, mode, minimum, maximum, periodic);
w_xValue->setLabel(tr("X :"));
w_xValue->setLabelColor(QColor(200, 0, 0));
connect(w_xValue, SIGNAL(valueChanged(double)), this, SLOT(xyzChanged(double)));
connect(w_xValue, SIGNAL(editingBegin()), this, SIGNAL(xyzEditingBegin()));
connect(w_xValue, SIGNAL(editingFinished()), this, SIGNAL(xyzEditingFinished()));
layout()->addWidget(w_xValue);
w_yValue = new bsDoubleWidget(this, mode, minimum, maximum, periodic);
w_yValue->setLabel(tr("Y :"));
w_yValue->setLabelColor(QColor(0, 200, 0));
connect(w_yValue, SIGNAL(valueChanged(double)), this, SLOT(xyzChanged(double)));
connect(w_yValue, SIGNAL(editingBegin()), this, SIGNAL(xyzEditingBegin()));
connect(w_yValue, SIGNAL(editingFinished()), this, SIGNAL(xyzEditingFinished()));
layout()->addWidget(w_yValue);
w_zValue = new bsDoubleWidget(this, mode, minimum, maximum, periodic);
w_zValue->setLabel(tr("Z :"));
w_zValue->setLabelColor(QColor(0, 0, 200));
connect(w_zValue, SIGNAL(valueChanged(double)), this, SLOT(xyzChanged(double)));
connect(w_zValue, SIGNAL(editingBegin()), this, SIGNAL(xyzEditingBegin()));
connect(w_zValue, SIGNAL(editingFinished()), this, SIGNAL(xyzEditingFinished()));
layout()->addWidget(w_zValue);
}
To copy to clipboard, switch view to plain text mode
Bookmarks