PDA

View Full Version : QListBox with QListBoxItems cyclic List



codebehind
21st June 2007, 21:31
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

wysota
23rd June 2007, 16:40
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.

codebehind
24th June 2007, 14:11
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.

wysota
24th June 2007, 19:47
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.