Results 1 to 10 of 10

Thread: Comparing Items In List Box

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    Join Date
    Feb 2007
    Posts
    22
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Comparing Items In List Box

    Hi,

    Sorry I think I am confusing myself and others. This is what I am doing.

    I am loading values to the list box from the table in the first place.

    The Table is in the main window and the list box is residing in another dialog box.

    So to send data I am using the following code segment.

    Qt Code:
    1. b->ChoosenParam_lb->insertItem ( table1->text(i,0), -1 );
    To copy to clipboard, switch view to plain text mode 

    where
    b is object to the dialog that holds the list box,
    ChoosenParam_lb is the name of the dialog
    and Table1 is the name of the Table.

    The test statement and output are as follows
    This is given immediately after this code

    Qt Code:
    1. s=b->ChoosenParam_lb->currentText();//Test
    2. printf("Choosen Param : %s\n",s);//Test
    To copy to clipboard, switch view to plain text mode 

    O/P:- (null);


    The Whole Code is For loading the values is given below

    Qt Code:
    1. //Insert Items From Table to List Box Which is in Parameter Selection Dialog
    2. const char *s;
    3. if (size1 >18)
    4. {
    5. a = size1-18;
    6. for (i=0; i<18; i++)
    7. {
    8. b->ChoosenParam_lb->setCurrentItem(i); //Test
    9. b->ChoosenParam_lb->insertItem ( table1->text(i,0), -1 );
    10.  
    11. s=b->ChoosenParam_lb->currentText();//Test
    12. printf("Choosen Param : %s\n",s);//Test
    13. }
    14. }
    15. else
    16. {
    17. for (i=0; i<size1; i++)
    18. {
    19. b->ChoosenParam_lb->insertItem ( table1->text(i,0), -1 );
    20. }
    21. }
    22. if ( a!=0)
    23. {
    24. for (i=0; i<a; i++)
    25. {
    26. b->ChoosenParam_lb->insertItem ( table1->text(i,0), -1 );
    27. }
    28. }
    To copy to clipboard, switch view to plain text mode 

    Please see this and tell me what wrong.

    With Kind Regards
    Kenny
    Last edited by wysota; 19th February 2007 at 13:10. Reason: missing [code] tags

Similar Threads

  1. Get Visible Items from the QListWidget
    By srj in forum Qt Programming
    Replies: 4
    Last Post: 22nd November 2006, 21:13
  2. QGraphicsItem problem - how to save items info ??
    By aamer4yu in forum Qt Programming
    Replies: 3
    Last Post: 17th October 2006, 13:17
  3. delete items from list box
    By vvbkumar in forum Qt Programming
    Replies: 4
    Last Post: 23rd June 2006, 20:08
  4. Selective highlighting of Items
    By Kapil in forum Qt Programming
    Replies: 3
    Last Post: 26th May 2006, 13:20
  5. Replies: 3
    Last Post: 10th April 2006, 20:04

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.