Exemplo n.º 1
0
DoublePropertyBasePtr NetworkConnectionHandle::createPortOption()
{
	DoublePropertyPtr retval;
	int defval = mClient->getConnectionInfo().port;
	retval = DoubleProperty::initialize("port", "Port",
										"Network Port (default "+QString::number(defval)+")",
										defval,
										DoubleRange(1024, 49151, 1), 0,
										mOptions.getElement());
	retval->setGuiRepresentation(DoublePropertyBase::grSPINBOX);
	retval->setAdvanced(true);
	retval->setGroup("Connection");
	connect(retval.get(), &Property::changed, this, &NetworkConnectionHandle::onPropertiesChanged);
	return retval;
}
Exemplo n.º 2
0
void Transform3DWidget::addTranslationControls(QString uid, QString name, int index, QVBoxLayout* layout)
{
  QHBoxLayout* hLayout = new QHBoxLayout;

  DoublePropertyPtr adapter = DoubleProperty::initialize(uid, name, "", 0, DoubleRange(-10000,10000,0.1),1);
  connect(adapter.get(), SIGNAL(changed()), this, SLOT(changedSlot()));
  adapter->setInternal2Display(1.0);
  hLayout->addWidget(new SpinBoxGroupWidget(this, adapter));

  QSize mMinBarSize = QSize(20,20);
  MousePadWidget* pad = new MousePadWidget(this, mMinBarSize);
  pad->setFixedYPos(true);
  hLayout->addWidget(pad);

  // use QtSignalAdapters library to work magic:
  QtSignalAdapters::connect1<void(QPointF)>(pad, SIGNAL(mouseMoved(QPointF)),
      boost::bind(&Transform3DWidget::translateSlot, this, _1, index));

  layout->addLayout(hLayout);
  mTranslationAdapter[index] = adapter;
}