[mythtv] Mouse events in MyThemedDialog
Martin van Es
martin at mrvanes.com
Sat May 8 06:54:54 EDT 2004
> > The MythThemedDialog object gives me headaches however.
>
> There's almost no notion of focus in MythThemedDialog
> (and myth UI*Type
> "widgets"), so doing this well would require some work.
>
> You should be able to inherit mousePressEvents in
> MythThemedDialog, and
> at least get the event. If that doesn't work, there's something a bit
> odd going on.
>
Ok, the ++ part of my C knowledge is a bit rusty but as far as I understand
MythMainWindow extends QDialog, MythDialog extends QFrame and
MythThemedDialog extends Mythdialog.
So as for 'inheritance' I don't see how MythThemedDialog could inherit
anything from MythMainWindow?
If you mean 'have a notion of', I am almost sure MythThemedDialog does not
'inherit' the mouse events.
Here's what I do:
I add a protected memberfunction mousePressEvent(QMouseEvent *) to the class
definition of MythMainWindow and the following code in mythdialogs.cpp:
void MythMainWindow::mousePressEvent(QMouseEvent *e)
{
int x = e->x();
int y = e->y();
qDebug("(x, y): (%d, %d)", x, y);
return;
}
This works, I 'see' the clicks debug output. Just like when I started
testing in MythThemedMenu.
If however I move the code into MythThemedDialog (and change all names
accordingly) all mouseclicks are ignored ;(
I wouldn't mind 'catching' the mouseEvents in MythMainWindow, if only I knew
how to get into the MythThemedDialog so I could find out where I clicked
(searching through UI*Type).
Is there a path from MythMainWindow to MythThemedDialog (via *child
perhaps?).
Could it be explained by the difference between QDialog and QFrame for both
classes?
Just to be sure: is the MythMusic interface I see really an instance of the
MythThemedDialog class?
Is it possible that MythThemedDialog just doesn't have the focus? And is
this possible for a Qframe?
Are MythTV code/objects documented anywhere so I don't have to bother the
list with this ignorant rambling?
Grtz,
Martin
More information about the mythtv-dev
mailing list