Results 1 to 4 of 4

Thread: Changing the position of an item in a QListWidget

  1. #1
    Join Date
    Jan 2006
    Posts
    105
    Thanks
    38
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Thumbs up Changing the position of an item in a QListWidget

    Hi all, in my app I use a QListWidget and a fill it with QListWidgetItems in icon mode. One of the options in my app is to move a selected item up or down one position in the list. I want to know what's the best/"elegant" way to do it. I've thought in two ways: Extracting the item from the list with "QListWidget::takeItem" and inserting it again in the correct position with "QListWidget::insertItem()". Another solution could be in copying the contents (icon and text) between the current item and the "destination item". Is there any better/other solution to do this? Thanks.
    Last edited by Dark_Tower; 11th April 2006 at 10:56.

  2. #2
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: Changing the position of an item in a QListWidget

    Maiby drag and drop
    a life without programming is like an empty bottle

  3. #3
    Join Date
    Jan 2006
    Posts
    105
    Thanks
    38
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Changing the position of an item in a QListWidget

    Quote Originally Posted by zlatko
    Maiby drag and drop
    Drag and drop, as far as I know, is manually (the user has to move manually the item). What I want is just change the position of the item up or down automaticly by pressing a button
    Last edited by Dark_Tower; 11th April 2006 at 11:47.

  4. #4
    Join Date
    Jan 2006
    Posts
    105
    Thanks
    38
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Changing the position of an item in a QListWidget

    Any other suggestion, please?

Similar Threads

  1. Help on QListWidget InternalMove item signal
    By tho97 in forum Qt Programming
    Replies: 3
    Last Post: 14th February 2009, 01:13
  2. Changing selected item color in non-current window.
    By Doug Broadwell in forum Qt Programming
    Replies: 1
    Last Post: 26th August 2007, 07:09
  3. QListWidget and selecting an item
    By invictus in forum Newbie
    Replies: 4
    Last Post: 19th June 2007, 11:59
  4. Replies: 1
    Last Post: 19th April 2007, 22:23
  5. how change the QListBox item position by pixel
    By roy_skyx in forum Qt Programming
    Replies: 2
    Last Post: 20th January 2006, 01:34

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.