[mythtv] How do I query HostCheckBox state?

Matthew Wire devel at mrwire.co.uk
Sun Aug 19 17:59:59 UTC 2007


I'm trying to query the state of a HostCheckBox and it seems that this
can't currently be done.

I see that HostCheckBox inherits CheckBoxSetting so I tried adding a
function to CheckBoxSetting:

settings.h
class MPUBLIC CheckBoxSetting: public BooleanSetting {
public:
    CheckBoxSetting(Storage *_storage) :
        BooleanSetting(_storage), widget(NULL) { }
    virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget*
parent,
                                  const char* widgetName = 0);
    virtual void setEnabled(bool b);
    virtual bool isChecked(void);

protected:
    MythCheckBox *widget;
};

settings.cpp:
bool CheckBoxSetting::isChecked(void)
{
    if (widget)
        return widget->isChecked();
    return false;
}

This compiles but doesn't work since I get this error when I try and
call it:
globalsettings.cpp:3596: error: request for member ‘isChecked’ in
‘MythControlsVolume’, which is of non-class type ‘HostCheckBox* ()()’

I'll admit my understanding of inheritance is a little poor at times but
I'm doing my best.  If anyone has any advice it would be appreciated!

Thankyou,
Matthew




More information about the mythtv-dev mailing list