本文整理汇总了C++中QSplashScreen::repaint方法的典型用法代码示例。如果您正苦于以下问题:C++ QSplashScreen::repaint方法的具体用法?C++ QSplashScreen::repaint怎么用?C++ QSplashScreen::repaint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSplashScreen
的用法示例。
在下文中一共展示了QSplashScreen::repaint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
#ifndef Q_OS_MAC
Q_INIT_RESOURCE(SonicPi);
#endif
QApplication app(argc, argv);
qRegisterMetaType<SonicPiLog::MultiMessage>("SonicPiLog::MultiMessage");
QString systemLocale = QLocale::system().name();
QTranslator qtTranslator;
qtTranslator.load("qt_" + systemLocale, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
app.installTranslator(&qtTranslator);
QTranslator translator;
bool i18n = translator.load("sonic-pi_" + systemLocale, ":/lang/") || systemLocale.startsWith("en") || systemLocale == "C";
app.installTranslator(&translator);
app.setApplicationName(QObject::tr("Sonic Pi"));
app.setStyle("gtk");
#ifdef Q_OS_MAC
app.setAttribute( Qt::AA_UseHighDpiPixmaps );
QMainWindow* splashWindow = new QMainWindow(0, Qt::FramelessWindowHint);
QLabel* imageLabel = new QLabel();
splashWindow->setAttribute( Qt::WA_TranslucentBackground);
QPixmap image(":/images/[email protected]");
imageLabel->setPixmap(image);
splashWindow->setCentralWidget(imageLabel);
splashWindow->setMinimumHeight(image.height()/2);
splashWindow->setMaximumHeight(image.height()/2);
splashWindow->setMinimumWidth(image.width()/2);
splashWindow->setMaximumWidth(image.width()/2);
splashWindow->raise();
splashWindow->show();
MainWindow mainWin(app, i18n, splashWindow);
return app.exec();
#else
QPixmap pixmap(":/images/splash.png");
QSplashScreen *splash = new QSplashScreen(pixmap);
splash->setMask(pixmap.mask());
splash->show();
splash->repaint();
MainWindow mainWin(app, i18n, splash);
return app.exec();
#endif
}
示例2: main
int main(int argc, char *argv[])
{
//QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF8"));
QApplication a(argc, argv);
//QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
/*QTextCodec *codec = QTextCodec::codecForName("GB2312");
QTextCodec::setCodecForLocale(codec);
QTextCodec::codecForUtfText("GB2312");*/
QTextCodec *codec = QTextCodec::codecForName("GB18030");
QSplashScreen *splash = new QSplashScreen;
splash->setPixmap(QPixmap("start.png"));
splash->show();
for (int i = 0; i<300; i++)
{
splash->repaint();
}
#pragma region INVALID CODE
//QWidget *win0 = new QWidget(0);
/*
QtCreate *w1 = new QtCreate(win0);
w1->resize(1600, 1600);
MyTimeSolveProject *w2 = new MyTimeSolveProject(win0);
w2->resize(600, 600);
*/
/*MyTimeSolveProject *MyProject = new MyTimeSolveProject();
QtCreate *w = new QtCreate();
QHBoxLayout *lay = new QHBoxLayout();
lay->addWidget(w);
lay->addWidget(MyProject);
win0->setLayout(lay);
win0->show();*/
//QWidget *win0 = new QWidget(0);
//QtCreate *w = new QtCreate(win0);
#pragma endregion
QtCreate w;
w.setWindowTitle(codec->toUnicode("IMA环境下多任务实时性能最优化系统"));
w.show();
splash->finish(&w);
delete splash;
//MyTimeSolveProject MyProject(ui.GantWidget);
//MyTimeSolveProject MyPro(Ui::QtCreateClass);
////MyTimeSolveProject *myproject = new MyTimeSolveProject(this.ui.GantWidget);
//
////MyProject.show();
///*
//MyProject.show();
//*/
//MyTimeSolveProject MyProject;
//MyProject.show();
#pragma region VIDEOVIEW1
QWidget *widget1 = new QWidget;
widget1->resize(400, 300); //
widget1->setWindowTitle("View1");
QVBoxLayout *layout1 = new QVBoxLayout;
QMediaPlayer* player1 = new QMediaPlayer;
QVideoWidget* vw1 = new QVideoWidget;
layout1->addWidget(vw1);
widget1->setLayout(layout1);
player1->setVideoOutput(vw1);
QFile file1("Video02.AVI");
if (!file1.open(QIODevice::ReadOnly))
qDebug() << "Could not open file";
player1->setMedia(QUrl::fromLocalFile("Video02.AVI"));
player1->play();
widget1->show();
#pragma endregion
#pragma region VIDEOVIEW2
QWidget *widget2 = new QWidget;
widget2->resize(400, 300); //
widget2->setWindowTitle("View2");
QVBoxLayout *layout2 = new QVBoxLayout;
QMediaPlayer* player2 = new QMediaPlayer;
QVideoWidget* vw2 = new QVideoWidget;
layout2->addWidget(vw2);
widget2->setLayout(layout2);
player2->setVideoOutput(vw2);
QFile file2("Video03.AVI");
if (!file2.open(QIODevice::ReadOnly))
qDebug() << "Could not open file";
player2->setMedia(QUrl::fromLocalFile("Video03.AVI"));
//.........这里部分代码省略.........