bool SalesModel::removeRow(int row, const QModelIndex &parent) { beginRemoveRows(parent,row,row); qDebug()<<"deleting sale"; removeSale(row, parent); updateResume(row); return true; endRemoveRows(); }
void AddCourseDialog::loadUi() { saleGroupBox->hide(); addButton->setIcon( QIcon(":/TransactionRecord/Resources/add.png") ); delButton->setIcon( QIcon(":/TransactionRecord/Resources/remove.png") ); upButton->setIcon( QIcon(":/TransactionRecord/Resources/up.png") ); downButton->setIcon( QIcon(":/TransactionRecord/Resources/down.png") ); QRegExp regexp("[0-9]{1,100}.[0-9]{0,4}"); cbLineEdit->setValidator(new QRegExpValidator(regexp, this)); connect( addButton, SIGNAL( clicked() ), this, SLOT( addSale() ) ); connect( addButton, SIGNAL( clicked() ), this, SLOT( enableButtons() ) ); connect( delButton, SIGNAL( clicked() ), this, SLOT( removeSale() ) ); connect( delButton, SIGNAL( clicked() ), this, SLOT( enableButtons() ) ); connect( upButton, SIGNAL( clicked() ), this, SLOT( selectItem() ) ); connect( downButton, SIGNAL( clicked() ), this, SLOT( selectItem() ) ); connect( okButton, SIGNAL( clicked() ), this, SLOT( okClicked() ) ); }