You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

bianca

Unregistered

1

Saturday, May 7th 2005, 6:41pm

jump to 2. listview item

Hello!

I have a Listview and a button.
I want to click on this button and that the focus from the first Item jump to the 2. item (in the same column).

bianca

Unregistered

2

Saturday, May 7th 2005, 10:00pm

RE: jump to 2. listview item

nobody want to help me.
because i am a woman, nots mean that i am blond!

marioo

Unregistered

3

Saturday, May 7th 2005, 10:02pm

RE: jump to 2. listview item

do you belive in god?Ask gott!He is a specialist
:)

Christian

Unregistered

4

Saturday, May 7th 2005, 10:10pm

Have a look at

void QListView::setCurrentItem ( QListViewItem * i )

and maybe at

QListViewItem * itemAt ( const QPoint & viewPos ) const and
int itemPos ( const QListViewItem * item )

Posts: 2,162

Location: Graz, Austria

Occupation: Student

  • Send private message

5

Saturday, May 7th 2005, 10:25pm

Or QListView::setSelectedItem, ::selectedItem and QListViewItem::nextSibling()

Definitely nextSibling()

@bianca: you are too impatient, not everybody reads this forum every few minutes, especially not on saturday evening ;)

Cheers,
_
Qt/KDE Developer
Debian User

bianca

Unregistered

6

Saturday, May 7th 2005, 10:26pm

oh god..its more complicated i thought...
if i dont have another possibility i dont know what i will do..
thank you for your time...

see you and have good time!!

miss b.

*********************************
Help People to grow together!

Posts: 2,162

Location: Graz, Austria

Occupation: Student

  • Send private message

7

Saturday, May 7th 2005, 10:28pm

If you don't need a tree, you could try using a QListBox instead of the ListView

Cheers,
_
Qt/KDE Developer
Debian User

bianca

Unregistered

8

Saturday, May 7th 2005, 10:32pm

hi gott..the problem is i have a lot of functions with my listview..
you think its better when i beginn again??

Christian

Unregistered

9

Saturday, May 7th 2005, 10:37pm

Well it depends. If you need to display a tree stay with QListView - else QListBox.

And yes - QListViewItem::nextSibling() is the better solution :)

Hint:

Source code

1
listView->setSelectedItem(listView->nextSilbling());


And check if there a 0 pointers.

bianca

Unregistered

10

Saturday, May 7th 2005, 10:44pm

hi cris..
i think i have to sleep later :)

i tryed your code:
listView->setSelectedItem(listView->nextSilbling());

but he compiler say that setSelectedItem is not a Element of QListView

Christian

Unregistered

11

Saturday, May 7th 2005, 10:49pm

listView->setSelected(listView->nextSilbling());


sorry :)

bianca

Unregistered

12

Saturday, May 7th 2005, 10:52pm

nextSilbling() is not a element of QListView too, baby boy! :)

  • "wysota" is male

Posts: 4,276

Location: Warsaw, POLAND

  • Send private message

13

Sunday, May 8th 2005, 9:23am

Source code

1
listView->setSelected(listView->firstChild()->nextSilbling());


Read the docs the next time ;)

Christian

Unregistered

14

Sunday, May 8th 2005, 9:31am

baba :)

You got me :)

Just flow over the docs - and hey leaving a bit of work for bianca is a nice practice for her - isn't it :)

  • "wysota" is male

Posts: 4,276

Location: Warsaw, POLAND

  • Send private message

bianca

Unregistered

16

Sunday, May 8th 2005, 9:56am

Morning guys...

Thanks for help, but nextSilbling() is not a Element of QListViewItem,

i have Error..

  • "wysota" is male

Posts: 4,276

Location: Warsaw, POLAND

  • Send private message

17

Sunday, May 8th 2005, 10:00am

Very strannge because the docs say it is.

Quoted

QListViewItem * QListViewItem::nextSibling () const

Returns the sibling item below this item, or 0 if there is no sibling item after this item.

Note that the siblings are not guaranteed to be sorted properly. QListView and QListViewItem try to postpone or avoid sorting to the greatest degree possible, in order to keep the user interface snappy.

See also firstChild() and sortChildItems().

Example: xml/tagreader-with-features/structureparser.cpp.


What exact error do you get?

bianca

Unregistered

18

Sunday, May 8th 2005, 10:04am

error c2039:nextSilbling() is not a Element of QListViewItem
QListView::setselected: Function dont accept 1 Argument
fatal error U1077

bianca

Unregistered

19

Sunday, May 8th 2005, 10:17am

i found one misstake:
nextSilbling is false nextSibling its right (without L)

now just one error:
QListView::setselected: Function dont accept 1 Argument
fatal error U1077