Results 1 to 18 of 18

Thread: QListWidget

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2009
    Posts
    94
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QListWidget

    Quote Originally Posted by Lykurg View Post
    Your dialog? pTest->exec();
    I attached one file.On selecting each item on the left side it will open a dialog and pressing Ok in that dialog some item will be added to the rightside listwidget.

    Everytime if i will create a new instance of the QLIstwidget, adding itm and doing exec() it is adding in the beginning of the list.

    To keep one instance of QListWidget for all the dialog i need to keep a global variable which is not a good programming style.

    So please let me know any other solution is there for this?
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QListWidget

    Quote Originally Posted by bismitapadhy View Post
    Everytime if i will create a new instance of the QLIstwidget, adding itm and doing exec() it is adding in the beginning of the list.
    Hmm... So every time you are adding item to different QListWidget? So after clicking OK (or what do you have there) 10times, you will have 10 QListWidgets? I don't think that this is what you really want...
    To keep one instance of QListWidget for all the dialog i need to keep a global variable which is not a good programming style.
    So pass the pointer to your QListWidget to this dialog.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  3. #3
    Join Date
    May 2009
    Posts
    94
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QListWidget

    Quote Originally Posted by faldżip View Post
    Hmm... So every time you are adding item to different QListWidget? So after clicking OK (or what do you have there) 10times, you will have 10 QListWidgets? I don't think that this is what you really want...

    So pass the pointer to your QListWidget to this dialog.
    I already searched and didn't found the solution.

Similar Threads

  1. QListWidget with STL
    By rajeshs in forum Qt Programming
    Replies: 1
    Last Post: 21st July 2007, 16:16
  2. QTableWidget or QListWidget
    By bpetty in forum Newbie
    Replies: 3
    Last Post: 6th December 2006, 19:40
  3. QListWidget help please
    By munna in forum Qt Programming
    Replies: 5
    Last Post: 28th November 2006, 12:16
  4. Another QListWidget bug?
    By SkripT in forum Qt Programming
    Replies: 12
    Last Post: 15th April 2006, 13:40
  5. Possible bug of Qt on QListWidget?
    By SkripT in forum Qt Programming
    Replies: 9
    Last Post: 28th March 2006, 13:05

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.