PDA

View Full Version : How to add items while click on QCombobox



RameshNani
4th February 2014, 05:40
How to call a function for adding items in QComboBox while click on QCombobox.

Please suggest any one...

ChrisW67
4th February 2014, 06:05
What do you mean?

RameshNani
4th February 2014, 07:07
thank you for your reply.

I mean

how to add items into combobox dynamically from table.

My Code like

Constructor()
{
sqlquery qry("select distinct column from table",db);

while(qry.next())
{
combobox->addItem(qry.value(0).toString());
}
}

but when i add any new value in table i didn't get into combobox , until i close the app and reopen the app. why because the constructor calls only when i open the app.

but i want to get all values dynamically.

is there any signal for call our own function while click on combobox .

if it's possible i will run above query and add to combobox every time.