void MainWindow::UpdateProgram(){ QNetworkAccessManager *manager = new QNetworkAccessManager(this); connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(UpdateReply(QNetworkReply*))); manager->get(QNetworkRequest(QUrl(appUpdateUrl + "/" + appUpdateVersionFileName))); QTimer::singleShot(1000*10*1, this, SLOT(UpdateProgram()));}
#ifndef MAINWINDOW_H#define MAINWINDOW_H#include <QMainWindow>namespace Ui {class MainWindow;}class MainWindow : public QMainWindow{ Q_OBJECTpublic: explicit MainWindow(QWidget *parent = 0); ~MainWindow();public slots: void UpdateProgram(); void UpdateReply(QNetworkReply *reply);private: Ui::MainWindow *ui;};#endif // MAINWINDOW_H
void MainWindow::UpdateReply(QNetworkReply *reply){}
connect(mybutton, &QPushButton::clicked, this->viewport(), QWidget::update);
connect(mybutton, &QPushButton::clicked, this->viewport(), static_cast<void (QWidget::*)()>&(QWidget::update));
connect(mybutton, &QPushButton::clicked, this->viewport(), QOverload<>::of(&QWidget::update));