You are not logged in.

marioo

Unregistered

1

Friday, May 6th 2005, 11:26am

QSound::play("sounds/" + listvView->??? + "");

hello,

i am searching a function for the selecteditem to put the value in the code
QSound::play("sounds/" + listvView->????? + "");


thanks

Christian

Unregistered

2

Friday, May 6th 2005, 11:57am

QSound::play("sounds/" + listvView->text() + "");

Please read the docs.

marioo

Unregistered

3

Friday, May 6th 2005, 11:59am

i have tried yet this option

QSound::play("sounds/" + listvView->text() + "");

but the compiler say that ext() is not a element from listView

marioo

Unregistered

4

Friday, May 6th 2005, 12:22pm

text() is not a listView Element, thats true..

i have to try with QListviewItem. But i dont now how i can get a selected value from the listview to put it on this code:

QSound::play("sounds/" +????? + "");

dimitri

Professional

  • "dimitri" is male

Posts: 1,311

Occupation: Engineer

  • Send private message

5

Friday, May 6th 2005, 12:24pm

It's actually QListViewItem, not QListView. It's also text(), not ext(), but this was probably a typo.

marioo

Unregistered

6

Friday, May 6th 2005, 12:26pm

ok, again:

this code dont work:
QSound::play("sounds/" + listView->text() + "");

ERROR: text ist not a Element from QListView

// listView is my ListView

dimitri

Professional

  • "dimitri" is male

Posts: 1,311

Occupation: Engineer

  • Send private message

7

Friday, May 6th 2005, 12:29pm

As I said, text() is a member function of QListViewItem, not QListView:
QListViewItem::text(int)

This post has been edited 1 times, last edit by "dimitri" (May 6th 2005, 12:30pm)


marioo

Unregistered

8

Friday, May 6th 2005, 12:31pm

yes, thanks a lot, but could someboy tell me how i can solve my problem?

dimitri

Professional

  • "dimitri" is male

Posts: 1,311

Occupation: Engineer

  • Send private message

9

Friday, May 6th 2005, 12:32pm

Well, I told you. You should be able to find the solution by spending minimal time studying the documentation. Is anything unclear in the documentation?

marioo

Unregistered

10

Friday, May 6th 2005, 12:41pm

i dont have found a member that i can get the value from the Listview

for example:

Listview results:

frank Sinatro
Jenifer Lopez


if i click on Jenifer Lopez, i want to get the value "Jenifer Lopez" and put on my code:
QSound::play("sounds/" + Jenifer Lopez "");


i tried with a combobox and works very well:

QSound::play("sounds/" + sounds_cb->currentText() + "'");

I wana tell you that i am trying for 3 Days.And no solution

marioo

Unregistered

11

Friday, May 6th 2005, 1:02pm

i think this could be the member i am seraching,
but i have an error: +': 2 Pointers can not be sum(add)



QSound::play("sounds/" + listView->currentItem() + "");

Duffy73

Trainee

  • "Duffy73" is male

Posts: 54

Location: Burgkirchen, Germany

  • Send private message

12

Friday, May 6th 2005, 1:14pm

try this:

Source code

1
 QSound::play("sounds/" + ( listView->currentItem() )->text( 0 ) + "");
Servus,
Duffy

marioo

Unregistered

13

Friday, May 6th 2005, 1:22pm

thank you very much...
now i can continue my project..

:)