81 bool withAlpha =
true,
95 template <
typename T = Scalar>
114 template <
typename T = Scalar>
115 void addConstrainedNumberInput(
const std::string& name,
161 template <
typename T = Scalar>
177 const Ra::Core::MatrixN& initial,
231 void addWidget( QWidget* newWidget );
236 void addStretch(
int stretch );
239 m_contentLayout =
new QGridLayout();
240 m_contentLayout->setObjectName(
"new layout" );
241 m_mainLayout->addLayout( m_contentLayout );
246 QVBoxLayout* m_mainLayout;
247 QGridLayout* m_contentLayout;
257 auto inputLabel =
new QLabel( tr( name.
c_str() ) );
260 inputField->setValue( initial );
264 qOverload<
typename QtSpinBox::getType<T>::SignalType>(
267 inputField->setPredicate( predicate );
269 if constexpr ( std::is_floating_point_v<T> ) { inputField->setDecimals( dec ); }
271 if ( !tooltip.
empty() ) {
273 QString(
"<qt>%1</qt>" ).arg( QString( tooltip.
c_str() ).toHtmlEscaped() );
274 inputLabel->setToolTip( tooltipString );
275 inputField->setToolTip( tooltipString );
277 auto index = m_contentLayout->rowCount();
278 m_contentLayout->addWidget( inputLabel, index, 0 );
279 m_contentLayout->addWidget( inputField, index, 1 );
291 auto inputLabel =
new QLabel( tr( name.
c_str() ) );
293 using WidgetType =
typename QtSpinBox::getType<T>::Type;
294 auto inputField =
new WidgetType();
295 auto inputLayout =
new QHBoxLayout();
296 inputLayout->addStretch();
297 inputLayout->addWidget( inputField );
299 inputField->setRange(
303 inputField->setValue( initial );
305 qOverload<
typename QtSpinBox::getType<T>::SignalType>( &WidgetType::valueChanged ),
307 if constexpr ( std::is_floating_point_v<T> ) { inputField->setDecimals( dec ); }
309 if ( !tooltip.
empty() ) {
311 QString(
"<qt>%1</qt>" ).arg( QString( tooltip.
c_str() ).toHtmlEscaped() );
312 inputLabel->setToolTip( tooltipString );
313 inputField->setToolTip( tooltipString );
315 auto index = m_contentLayout->rowCount();
316 m_contentLayout->addWidget( inputLabel, index, 0 );
317 m_contentLayout->addLayout( inputLayout, index, 1 );
326 auto inputLabel =
new QLabel( tr( name.
c_str() ) );
329 if ( !tooltip.
empty() ) {
331 QString(
"<qt>%1</qt>" ).arg( QString( tooltip.
c_str() ).toHtmlEscaped() );
332 inputLabel->setToolTip( tooltipString );
333 inputField->setToolTip( tooltipString );
336 QOverload<
const std::vector<T>&>::of( &VectorEditorSignals::valueChanged ),
339 auto index = m_contentLayout->rowCount();
340 m_contentLayout->addWidget( inputLabel, index, 0 );
341 m_contentLayout->addWidget( inputField, index, 1 );