On the widget is a ComboBox with data from the database. From this widget I invoke a dialog in which I make another entry to the database. How can I make this entry appear in my ComboBox, and not after restarting the program? If possible, in more detail, please.

    2 answers 2

    as an option, after writing to the database, remember the text of the combobox, setModel again, and then search for a comboboks search

    • Can you give an example? I just do not understand how to connect this dialogue with the widget - Leonty Kopytov
    • Connect to the void QDialog::finished(int result) dialog completion signal (or send your own signal). In the handler, refill with the actual values ​​of the QComboBox . - aleks.andr
     QComboBox *combobox = new QComboBox; fillMyComBoBox(); // новая запись из бд в комбобокс combobox->update(); 
    • Please try to write more detailed answers. I am sure the author of the question would be grateful for your expert commentary on the code above. - Nicolas Chabanovsky