QtCanpool 3.3.0
载入中...
搜索中...
未找到
QxApp::QxSplashScreen类 参考

A splash screen that reports how far the start-up has come. 更多...

#include <qxapp/qxsplashscreen.h>

类 QxApp::QxSplashScreen 继承关系图:

Public 成员函数

 QxSplashScreen (const QPixmap &logo=QPixmap(), const QString &applicationName=QString(), const QString &version=QString(), Qt::WindowFlags flags=Qt::WindowFlags())
 
 ~QxSplashScreen () override
 
QString applicationName () const
 
QString version () const
 
QString message () const
 
int progress () const
 Progress in percent, or -1 while it is unknown.
 
void setApplicationName (const QString &applicationName)
 
void setVersion (const QString &version)
 
void setMessage (const QString &message)
 
void setProgress (int progress)
 Sets the progress to 0..100 percent; a negative value means "unknown".
 
void step (int progress, const QString &message=QString())
 Sets the progress and the message in one call, then processes pending events so that the splash really updates while the start-up work keeps running on the main thread.
 

Protected 成员函数

void drawContents (QPainter *painter) override
 

详细描述

A splash screen that reports how far the start-up has come.

QSplashScreen can already show a message line, but an application that loads settings, a theme and a layout wants a progress bar next to it, and wants the splash to keep repainting while that work blocks the event loop. QxSplashScreen adds both:

QxSplashScreen splash(logo, QStringLiteral("MyApp"), QStringLiteral("3.0"));
splash.show();
splash.step(20, tr("Loading settings..."));
// ... more start-up work ...
splash.step(100, tr("Ready"));
splash.finish(&mainWindow);
A splash screen that reports how far the start-up has come.

The application name, the version, the message and the progress are drawn over the bottom of the artwork, so one logo image is enough. A null logo is replaced by a plain plate, which keeps the splash usable in tests and in applications that have no artwork yet.

在文件 qxsplashscreen.h 第 44 行定义.

构造及析构函数说明

◆ QxSplashScreen()

QxApp::QxSplashScreen::QxSplashScreen ( const QPixmap &  logo = QPixmap(),
const QString &  applicationName = QString(),
const QString &  version = QString(),
Qt::WindowFlags  flags = Qt::WindowFlags() 
)
explicit

在文件 qxsplashscreen.cpp 第 58 行定义.

◆ ~QxSplashScreen()

QxApp::QxSplashScreen::~QxSplashScreen ( )
override

在文件 qxsplashscreen.cpp 第 69 行定义.

成员函数说明

◆ applicationName()

QString QxApp::QxSplashScreen::applicationName ( ) const

在文件 qxsplashscreen.cpp 第 74 行定义.

◆ drawContents()

void QxApp::QxSplashScreen::drawContents ( QPainter *  painter)
overrideprotected

在文件 qxsplashscreen.cpp 第 154 行定义.

◆ message()

QString QxApp::QxSplashScreen::message ( ) const

在文件 qxsplashscreen.cpp 第 86 行定义.

◆ progress()

int QxApp::QxSplashScreen::progress ( ) const

Progress in percent, or -1 while it is unknown.

在文件 qxsplashscreen.cpp 第 92 行定义.

◆ setApplicationName()

void QxApp::QxSplashScreen::setApplicationName ( const QString &  applicationName)

在文件 qxsplashscreen.cpp 第 98 行定义.

◆ setMessage()

void QxApp::QxSplashScreen::setMessage ( const QString &  message)

在文件 qxsplashscreen.cpp 第 118 行定义.

◆ setProgress()

void QxApp::QxSplashScreen::setProgress ( int  progress)

Sets the progress to 0..100 percent; a negative value means "unknown".

在文件 qxsplashscreen.cpp 第 128 行定义.

◆ setVersion()

void QxApp::QxSplashScreen::setVersion ( const QString &  version)

在文件 qxsplashscreen.cpp 第 108 行定义.

◆ step()

void QxApp::QxSplashScreen::step ( int  progress,
const QString &  message = QString() 
)

Sets the progress and the message in one call, then processes pending events so that the splash really updates while the start-up work keeps running on the main thread.

An empty message keeps the current one.

在文件 qxsplashscreen.cpp 第 139 行定义.

◆ version()

QString QxApp::QxSplashScreen::version ( ) const

在文件 qxsplashscreen.cpp 第 80 行定义.


该类的文档由以下文件生成: