void DevicesConfigurationWidget::prependCustomWidget(RobotModelInterface &robotModel, QWidget * const widget) { if (!widget) { return; } Q_ASSERT(mRobotModelConfigurers.contains(robotModel.name())); QVBoxLayout *layout = dynamic_cast<QVBoxLayout *>(mRobotModelConfigurers[robotModel.name()]->layout()); Q_ASSERT(layout); layout->insertWidget(0, widget); }
void DevicesConfigurationWidget::selectRobotModel(RobotModelInterface &robotModel) { if (mCurrentModelType == robotModel.name() && mCurrentModelId == robotModel.robotId()) { return; } mCurrentModelType = robotModel.name(); mCurrentModelId = robotModel.robotId(); takeWidget(); if (mRobotModels.contains(mCurrentModelType)) { setWidget(mRobotModelConfigurers[mCurrentModelType]); refresh(); } }
void DevicesConfigurationWidget::selectRobotModel(RobotModelInterface &robotModel) { QString const robotModelId = robotModel.name(); mCurrentModel = robotModelId; takeWidget(); if (mRobotModels.contains(robotModelId)) { setWidget(mRobotModelConfigurers[robotModelId]); refresh(); } }