[mythtv] how to bind a numberPressed to myth

Eric Andresen ruler111 at cox.net
Sat Mar 22 11:32:06 EST 2003


On Sat, 2003-03-22 at 10:43, Leandro Dardini wrote:
> As you know I never touch a cpp programs before and I know less about QT
> widget, but mythtv is a big teacher...
> 
> In programs/mythfrontend/playbackbox.cpp I found the connections of some
> keys to some actions
> 
> ...
>     connect(listview, SIGNAL(selectionChanged(QListViewItem *)), this,
>             SLOT(changed(QListViewItem *)));
>     connect(listview, SIGNAL(deletePressed(QListViewItem *)), this,
>             SLOT(remove(QListViewItem *)));
>     connect(listview, SIGNAL(playPressed(QListViewItem *)), this,
>             SLOT(play(QListViewItem *)));
> ...
> 
> Waiting for a nicer solution I'd like to add some mencoder manipulation
> (translate to avi) to the listed file in playbackbox connected to the press
> of some numeric keys (different keys, different resolution and bitrate): I
> see they are already defined in libs/libmyth/mythwidgets.cpp
> 
> So I try to add a row as follows
> 
>     connect(listview, SIGNAL(numberPressed(QListViewItem *,0)), this,
>             SLOT(translatetoavi(QListViewItem *)));
> 

The problem is that you cannot specify a value for the second parameter.
You must check for the value you are looking for in the SLOT function,
instead. Signal emits two variables, the SLOT should receive both.

> I have correctly added translatoavi to programs/mythfrontend/playbackbox.h
> 
> If I try to press the key 0, translatetoavi is not triggered. I think the
> problem is in my wrong way to use the numberPressed function because if I
> try to substitute it with infoPressed then translatetoavi is called right
> way.
> 
> 
> Leandro

Cheers.

-- 
--Eric Andresen
  ndiin at asu.edu



More information about the mythtv-dev mailing list