RatingComboBox::RatingComboBox(QWidget* const parent) : ModelIndexBasedComboBox(parent) { m_syncing = false; // create a custom model that contains the rating values m_model = new RatingComboBoxModel(this); setModel(m_model); // set a custom delegate which draws rating stars RatingComboBoxDelegate* delegate = new RatingComboBoxDelegate(this); view()->setItemDelegate(delegate); // set a line edit that carries a RatingWidget ProxyLineEdit* lineEdit = new ProxyLineEdit; m_ratingWidget = new RatingComboBoxWidget; lineEdit->setWidget(m_ratingWidget); setLineEdit(lineEdit); connect(view()->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(currentValueChanged(QModelIndex,QModelIndex))); connect(m_ratingWidget, SIGNAL(ratingValueChanged(int)), this, SLOT(ratingWidgetChanged(int))); }
void MgGaugeController::setCurrentValue(float arg) { if (m_currentValue != arg) { m_currentValue = arg; Q_EMIT currentValueChanged(arg); calculateProjectedAngle(); } }
void MyCounter::increase() { ++counter; emit currentValueChanged(); if(0 == counter%10){ emit reached10(value()); } }