/***************************************************************************
 **
 **  Copyright (C) 2018-2023 wangjianjun <wangjianjun1018@qq.com>
 **  Contact: https://blog.csdn.net/wocanimei007?type=blog
 **
 **
****************************************************************************/
#include "fancymode.h"



FancyMode::FancyMode(QObject *parent)
    : QObject(parent),
      m_isEnabled(true)
{
}

FancyMode::~FancyMode()
{
    if (m_menu) {
        delete m_menu;
    }
    if (m_widget) {
        delete m_widget;
    }
}

void FancyMode::setEnabled(bool enabled)
{
    if (m_isEnabled == enabled) {
        return;
    }
    m_isEnabled = enabled;
    emit enabledStateChanged(m_isEnabled);
}

bool FancyMode::isEnabled() const
{
    return m_isEnabled;
}

QWidget *FancyMode::widget()
{
    if (!m_widget) {
        m_widget = new QWidget();
    }
    return m_widget;
}
