Results 1 to 4 of 4

Thread: QListBox with QListBoxItems cyclic List

  1. #1
    Join Date
    Apr 2007
    Posts
    76
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QListBox with QListBoxItems cyclic List

    Hi!

    Could someone show me the way of how to implement a circular (continues) list in a QListBox.
    For example a user when working with arrows (listing elements) shall not find the end of the list instead should find the first item. It would be great if the focus should be at the center of the list (i have an idea of that but haven't work on it yet.)

    hope i make my self clear enough.
    thx

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QListBox with QListBoxItems cyclic List

    I'd suggest using QSpinBox instead. I don't think QListBox is really suitable for you. If you need such behaviour with a listbox-like widget, it'll be fastest if you implement it yourself instead of changing QListBox behaviour.

  3. #3
    Join Date
    Apr 2007
    Posts
    76
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QListBox with QListBoxItems cyclic List

    Thanks!

    If i understand right, my widget should be made out of multi line edit text, with a behaviour line selection like and in the background a linked list of elements.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QListBox with QListBoxItems cyclic List

    You can make it anything you want. The simplest way is to make a direct subclass of QWidget and always show for example three elements - the current one and its neighbourhood.

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.