void MenuItem::setPrice(float price) { if(m_price != price) { m_price = price; logMenuPropertyChanged(m_price, "price"); priceChanged(m_price); fireCostChanged(); } }
PromoEditor::PromoEditor( QWidget *parent ) : KDialog( parent ) { ui = new PromoEditorUI( this ); setMainWidget( ui ); setCaption( i18n("Discounts Editor") ); setButtons( KDialog::Ok|KDialog::Cancel ); // BFB: New spinboxPrice: I've created new slots to control when discount, price or product are changed connect( ui->spinboxDiscount, SIGNAL(editingFinished()),this, SLOT(discountChanged()) ); connect( ui->spinboxPrice, SIGNAL(editingFinished()),this, SLOT(priceChanged()) ); connect(ui->offersDatepickerStart, SIGNAL(dateChanged(const QDate & )), this, SLOT(checkValid())); connect(ui->offersDatepickerEnd, SIGNAL(dateChanged(const QDate & )), this, SLOT(checkValid())); connect(ui->productsList, SIGNAL(clicked(const QModelIndex &)), this, SLOT(productChanged())); connect(ui->productsList, SIGNAL(activated(const QModelIndex &)), this, SLOT(productChanged())); connect(ui->productsList, SIGNAL(entered(const QModelIndex &)), this, SLOT(productChanged())); QTimer::singleShot(750, this, SLOT(checkValid())); }
void Tire::setPrice(double price) { _price = price; emit priceChanged(); }