PDA

View Full Version : delete or remove QDialog?



kapitanluffy
8th February 2011, 12:59
here's how my program flow works..

user inserts a text on the input box. when he pressed 'add' the QDialog appears and asks for the Quantity of the input. after pressing 'set quantity' i managed to make the dialog disappear. but when i wanted to enter another item. i cannot delete the text in the input box

i attached my files here 5878

Added after 37 minutes:

ok fixed it by adding

qtyObj.close(); on line 27

here's another problem . the dialog disappears when the device is rotated making the main window invulnerable :|

franz
8th February 2011, 16:06
Try creating the quantity dialog with a parent:



void MainWindow::addItem()
{
Quantity qtyObj(this);
QString itm = this->get_input();
QString qty = qtyObj.askQuantity();
itm.append(qty);
qtyObj.close();
if(this->is_empty_Input(itm) && !this->is_in_List(itm)){
ui->list_view->addItem(itm);
}
}