mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 09:13:08 -07:00
Improve splash screen code
This commit is contained in:
parent
155316c30e
commit
6d241270b5
1 changed files with 2 additions and 2 deletions
|
@ -263,9 +263,9 @@ int main(int argc, char *argv[]){
|
||||||
painter.setFont(QFont("Arial", 22, QFont::Black));
|
painter.setFont(QFont("Arial", 22, QFont::Black));
|
||||||
painter.drawText(224 - painter.fontMetrics().width(version), 270, version);
|
painter.drawText(224 - painter.fontMetrics().width(version), 270, version);
|
||||||
splash = new QSplashScreen(splash_img, Qt::WindowStaysOnTopHint);
|
splash = new QSplashScreen(splash_img, Qt::WindowStaysOnTopHint);
|
||||||
|
QTimer::singleShot(1500, splash, SLOT(deleteLater()));
|
||||||
splash->show();
|
splash->show();
|
||||||
app.processEvents();
|
app.processEvents();
|
||||||
QTimer::singleShot(2000, splash, SLOT(deleteLater()));
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// Set environment variable
|
// Set environment variable
|
||||||
|
@ -297,7 +297,7 @@ int main(int argc, char *argv[]){
|
||||||
#ifndef DISABLE_GUI
|
#ifndef DISABLE_GUI
|
||||||
MainWindow window(0, torrentCmdLine);
|
MainWindow window(0, torrentCmdLine);
|
||||||
if(!no_splash)
|
if(!no_splash)
|
||||||
QObject::connect(splash, SIGNAL(destroyed()), &window, SLOT(raise()));
|
window.raise();
|
||||||
QObject::connect(&app, SIGNAL(messageReceived(const QString&)),
|
QObject::connect(&app, SIGNAL(messageReceived(const QString&)),
|
||||||
&window, SLOT(processParams(const QString&)));
|
&window, SLOT(processParams(const QString&)));
|
||||||
app.setActivationWindow(&window);
|
app.setActivationWindow(&window);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue