#include "climate.h" #include "ui_climate.h" #include #include "weather.h" climate::climate(QWidget *parent) : QMainWindow(parent) , ui(new Ui::climate) { ui->setupUi(this); Weather = new weather(ui); // quint16 c4[]={0x2103,0}; // Unicode温度符号 // 字体大小 30 // ui->label_2->setText("23"+QString::fromUtf16(c4)); // ui->label_3->setText("雷阵雨 23"+QString::fromUtf16(c4) + "/30"+QString::fromUtf16(c4)); //Weather->http_sent(); floatingbutton= new FloatingButton (this); // 将悬浮球的pressed()信号连接到槽函数onButtonPressed()上 connect(floatingbutton, &FloatingButton::pressed, this, &climate::onButtonPressed); } climate::~climate() { delete ui; } void climate::onButtonPressed() { emit climate_close(false); qDebug() << "悬浮球被按下了!"; }