[mythtv] how to bind a numberPressed to myth

Leandro Dardini ldardini at tiscali.it
Sat Mar 22 18:43:19 EST 2003


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 *)));

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



More information about the mythtv-dev mailing list