frmProgress::frmProgress(QWidget * parent, Qt::WindowFlags f) : QWidget(parent, f) { qRegisterMetaType<QNapiSubtitleInfoList>("QNapiSubtitleInfoList"); ui.setupUi(this); setAttribute(Qt::WA_DeleteOnClose, false); setAttribute(Qt::WA_QuitOnClose, false); setBatchMode(false); connect(&getThread, SIGNAL(fileNameChange(const QString &)), ui.lbFileName, SLOT(setText(const QString &))); connect(&getThread, SIGNAL(actionChange(const QString &)), ui.lbAction, SLOT(setText(const QString &))); connect(&getThread, SIGNAL(progressChange(int, int, float)), this, SLOT(updateProgress(int, int, float))); connect(&getThread, SIGNAL(selectSubtitles(QString, QNapiSubtitleInfoList)), this, SLOT(selectSubtitles(QString, QNapiSubtitleInfoList))); connect(this, SIGNAL(subtitlesSelected(int)), &getThread, SLOT(subtitlesSelected(int))); connect(&getThread, SIGNAL(finished()), this, SLOT(downloadFinished())); QRect position = frameGeometry(); position.moveCenter(QDesktopWidget().availableGeometry().center()); move(position.topLeft()); }
frmProgress::frmProgress(QWidget * parent, Qt::WFlags f) : QWidget(parent, f) { qRegisterMetaType<QNapiSubtitleInfoList>("QNapiSubtitleInfoList"); ui.setupUi(this); #ifdef Q_WS_MAC setAttribute(Qt::WA_MacBrushedMetal, GlobalConfig().useBrushedMetal()); #endif setAttribute(Qt::WA_DeleteOnClose, false); setAttribute(Qt::WA_QuitOnClose, false); setBatchMode(false); connect(&getThread, SIGNAL(fileNameChange(const QString &)), ui.lbFileName, SLOT(setText(const QString &))); connect(&getThread, SIGNAL(actionChange(const QString &)), ui.lbAction, SLOT(setText(const QString &))); connect(&getThread, SIGNAL(progressChange(int, int, float)), this, SLOT(updateProgress(int, int, float))); connect(&getThread, SIGNAL(selectSubtitles(QString, QNapiSubtitleInfoList)), this, SLOT(selectSubtitles(QString, QNapiSubtitleInfoList))); connect(this, SIGNAL(subtitlesSelected(int)), &getThread, SLOT(subtitlesSelected(int))); connect(&getThread, SIGNAL(finished()), this, SLOT(downloadFinished())); }