This forum has been archived. All content is frozen. Please use KDE Discuss instead.

KListWidget's 'executed' SIGNAL fires twice

Tags: None
(comma "," separated)
User avatar
battler
Registered Member
Posts
5
Karma
0
OS
i have a:
Code: Select all
KListWidget* playlist;

which is connected via:
Code: Select all
connect(playlist, SIGNAL(executed(QListWidgetItem*)), this, SLOT(play(QListWidgetItem*)));

to:
Code: Select all
void Player::play(QListWidgetItem* item) {
   printf("play: %s\n", item->text().toStdString().c_str());
}


any time i double click on an item in the list (KDE is set to double click execute on my install), the play function is called twice. if i only click once, nothing happens as expected. i can't figure out why. any help would be greatly appreciated!

thanks all.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Try using the itemActivated() signal of http://doc.trolltech.com/4.6/qlistwidget.html instead. It has the same signature as the executed() signal.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
battler
Registered Member
Posts
5
Karma
0
OS
brilliant, thanks!


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]