当前位置: 首页>>代码示例>>C++>>正文


C++ SplashScreen::setFont方法代码示例

本文整理汇总了C++中SplashScreen::setFont方法的典型用法代码示例。如果您正苦于以下问题:C++ SplashScreen::setFont方法的具体用法?C++ SplashScreen::setFont怎么用?C++ SplashScreen::setFont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SplashScreen的用法示例。


在下文中一共展示了SplashScreen::setFont方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main


//.........这里部分代码省略.........
					{
                        MainWindow::Module serverModule;
						modules.at(0).toInt(&isNumber);

						//check if the argument starts with server id
						if(isNumber)
						{
                            serverModule.serverID = modules.at(0);
                            serverModule.modules = modules.at(1).split(",");
                            remoteModules.push_back(serverModule);
						}
					}

					command = argv[i+1];
				}
			}
		}
	}

	//initialises message handeler
	if(!debug)
	{
		qInstallMsgHandler(customMessageHandler);
	}

    //current Aquila verions
    QString version = "Aquila 2.0";

    //localhost name
    QString hostName = QHostInfo::localHostName();

    //minimum version of YARP required for full support
    QString yarpVersion = "2.3.20";

    //add active developers to the list
    QStringList developers;
    developers<<" Martin Peniak"<<" & Anthony Morse";

    //initialise YARP
    yarp::os::Network yarp;

    //initialises Aquila and loads its icon
    QApplication *a = new QApplication(argc, argv);
    a->setWindowIcon(QPixmap(":/images/icon.png"));
    a->setAttribute(Qt::AA_X11InitThreads);

    //initialise splash screen
    QPixmap pixmap(":/images/splash.png");
    SplashScreen *splash = new SplashScreen(pixmap, 4);
    splash->setFont(QFont("Ariel", 8, QFont::Bold));
    splash->show();

    //initialise GUI, probe yarpservers, its modules and add local modules to GUI
    MainWindow *w = new MainWindow(0, version, hostName, yarpVersion);
    splash->showMessage(QString("Initialising ")+version,Qt::AlignLeft | Qt::AlignBottom,Qt::white);
    QObject::connect(a, SIGNAL(aboutToQuit()), w, SLOT(aboutToQuit()));
    a->processEvents();
    splash->showMessage(QObject::tr("Detecting available modules on the local network"),Qt::AlignLeft | Qt::AlignBottom,Qt::white);
    w->probeServers(remoteServers);
    a->processEvents();

	//start local modules
	if(!localModules.isEmpty())
	{
		splash->showMessage(QObject::tr("Starting local modules"),Qt::AlignLeft | Qt::AlignBottom,Qt::white);
		w->addLocalModules(localModules);
		a->processEvents();
	}

	//start remote modules
    if(!remoteModules.isEmpty())
	{
        if(remoteServers)
        {
            splash->showMessage(QObject::tr("Starting remote modules"),Qt::AlignLeft | Qt::AlignBottom,Qt::white);
            w->addRemoteModules(remoteModules);
            a->processEvents();
        }
        else
        {
            qWarning(" - main_gui: '--localMode' argument prevented remote modules from loading during startup");
        }
	}

	//load graphial user interface, show credits and close the splash
    splash->showMessage(QObject::tr("Loading graphical user interface"),Qt::AlignLeft | Qt::AlignBottom,Qt::white);
    a->processEvents();
    QString credits("Developed by");
    for(int i=0; i<developers.size(); i++)
    {
        credits.append(developers.at(i));
    }
    splash->showMessage(credits,Qt::AlignLeft | Qt::AlignBottom,Qt::white);
    a->processEvents();
    splash->finish(w);

    //show graphial user interface
    w->show();
    return a->exec();
}
开发者ID:xufango,项目名称:contrib_bk,代码行数:101,代码来源:main.cpp


注:本文中的SplashScreen::setFont方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。