Results 1 to 3 of 3

Thread: How to add items while click on QCombobox

  1. #1
    Join Date
    Feb 2014
    Posts
    43
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Thumbs up How to add items while click on QCombobox

    How to call a function for adding items in QComboBox while click on QCombobox.

    Please suggest any one...

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to add items while click on QCombobox

    What do you mean?

  3. #3
    Join Date
    Feb 2014
    Posts
    43
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: How to add items while click on QCombobox

    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.

Similar Threads

  1. QComboBox Item Right Click
    By wirasto in forum Qt Programming
    Replies: 9
    Last Post: 13th January 2013, 18:44
  2. QComboBox not showing all items
    By musikit in forum Qt Programming
    Replies: 3
    Last Post: 10th April 2008, 16:01
  3. Items in QListView should sort on Header Click
    By vinnu in forum Qt Programming
    Replies: 14
    Last Post: 10th November 2006, 12:49
  4. Automatically add items to a QComboBox (Qt4)
    By darkadept in forum Qt Programming
    Replies: 2
    Last Post: 19th May 2006, 15:32
  5. QcomboBox items
    By therealjag in forum Newbie
    Replies: 5
    Last Post: 27th March 2006, 08:21

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.