#include "hotcitybtn.h"

HotcityBtn::HotcityBtn(QWidget *parent, QString name, QString code) : QPushButton(parent)
{
    this->resize(ViewVar::HOT_BTN);
    this->setText(name);
    this->setFocusPolicy(Qt::NoFocus); //设置焦点类型
    cityCode = code;
    connect(this, &HotcityBtn::clicked, this, &HotcityBtn::onHotCityClick);
    QPalette pal = this->palette();
    pal.setColor(QPalette::Button, Qt::transparent);
    this->setPalette(pal);
}

void HotcityBtn::onHotCityClick()
{
    emit hotCityClick(cityCode);
}
