[mythtv] MythDialog->AddButton/SLOT Question
Jonatan
mythtv at comhem.se
Fri Mar 26 16:44:24 UTC 2010
George Galt wrote:
> I am banging my head against a wall on this one. I'm creating a
> simple dialog box that calls a slot for each button press (a simple
> thing that has been done in many of the plugins before me). Code is
> below. However, when I press the button, I get "QObject::connect:
> Cannot connect MythDialogBox::selected() to
> (null)::showPlayerSelectWin()".
>
> My code is modeled after a number of other plugins that seem to do
> this effectively. I've looked everywhere I can think of, but must be
> missing something obvious. It's clear that somehow I'm not
> effectively telling QObject that the "showPlayerSelectWin()" slot is
> owned by the parent window, but I can't think of what I am missing.
>
> Any help would be greatly appreciated.
>
> George
>
> Here is the relevant code:
>
> void MythSqueezeBox::slotPopupStateSection( void )
> {
> QString label = tr("Select Action");
>
> MythDialogBox *m_menuPopup = new MythDialogBox(label,
> m_popupStack, "mythsqueezeboxselectactionpopup");
>
> if (m_menuPopup->Create())
> {
> m_popupStack->AddScreen(m_menuPopup);
>
Correct me if I'm wrong, but I think you need to add a
m_menuPopup->SetReturnEvent(this, "something");
to make it work.
The m_ prefix is also usually used for private members.
/Jonatan
More information about the mythtv-dev
mailing list