Results 1 to 2 of 2

Thread: delete or remove QDialog?

  1. #1
    Join Date
    Feb 2011
    Posts
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: delete or remove QDialog?

    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 test.zip


    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 :|
    Last edited by kapitanluffy; 8th February 2011 at 13:59.

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: delete or remove QDialog?

    Try creating the quantity dialog with a parent:

    Qt Code:
    1. void MainWindow::addItem()
    2. {
    3. Quantity qtyObj(this);
    4. QString itm = this->get_input();
    5. QString qty = qtyObj.askQuantity();
    6. itm.append(qty);
    7. qtyObj.close();
    8. if(this->is_empty_Input(itm) && !this->is_in_List(itm)){
    9. ui->list_view->addItem(itm);
    10. }
    11. }
    To copy to clipboard, switch view to plain text mode 
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

Similar Threads

  1. Replies: 7
    Last Post: 20th November 2010, 00:20
  2. How to use QMap::remove() to delete some item?
    By jedychen in forum Qt Programming
    Replies: 5
    Last Post: 18th September 2008, 08:29
  3. remove the top left icon on qwidget\qdialog
    By Equilibrium in forum Qt Programming
    Replies: 3
    Last Post: 9th November 2007, 03:40
  4. Replies: 2
    Last Post: 22nd February 2006, 15:58

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.