Results 1 to 8 of 8

Thread: QComboBox does not function properly

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Join Date
    Nov 2017
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QComboBox does not function properly

    I see there is an transcription error, ooops it should be:
    Qt Code:
    1. tmod = open('list.txt', 'r')
    2. for i in range(4):
    3. cb.addItem(str(i))
    4. tmod.close()
    To copy to clipboard, switch view to plain text mode 


    The first line opens the file called list.txt for reading as indicated by the 'r'.
    The second line is a for loop , that loops through 4 times -range(4)
    the third line adds the names(re-previous post) to the combobox
    The fourth line closes the the file.

    The above snippet of code works the problem is, it display is the numbers from 0 to 3. My question is how do I display the name in the file?. My suspicison is I should be not
    be using range(4)


    I will be away on business for the next few days, I will catch up with you again on Friday in my part of the world.
    Thank you

    PS the code snippet does not show once posted the way I wrote it in the message.
    Last edited by Zyron; 28th November 2017 at 01:33.

Similar Threads

  1. QCombobox contents not adjusting itself properly
    By anju123 in forum Qt Programming
    Replies: 4
    Last Post: 6th April 2016, 21:11
  2. Replies: 1
    Last Post: 27th November 2014, 09:11
  3. QComboBox Signals doesn't invoke the called function
    By ladiesfinger in forum Qt Programming
    Replies: 6
    Last Post: 30th December 2010, 16:20
  4. How to pass a QComboBox to a function?
    By Ricardo_arg in forum General Programming
    Replies: 4
    Last Post: 9th March 2008, 22:16
  5. Contents not Properly Visible in QComboBox
    By merry in forum Qt Programming
    Replies: 4
    Last Post: 25th September 2007, 12:32

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
  •  
Qt is a trademark of The Qt Company.