本文整理汇总了C++中FontManager::addFonts方法的典型用法代码示例。如果您正苦于以下问题:C++ FontManager::addFonts方法的具体用法?C++ FontManager::addFonts怎么用?C++ FontManager::addFonts使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FontManager
的用法示例。
在下文中一共展示了FontManager::addFonts方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
// }
// QFile file_db(":/db.lua");
// QFile file_db_old( directory+"/db.lua" );
// if( ! file_db_old.setPermissions( QFile::WriteOwner | QFile::ReadOwner | QFile::ReadUser | QFile::WriteUser | QFile::ReadOther | QFile::WriteOther ) )
// {
// cout << "[ERROR] failed to set file permissions for the old version of db.lua" << endl;
// gSysErrors << "[ERROR] failed to set file permissions for the old version of db.lua";
// }
// else
// {
// cout << "[OK] successfully set file permissions for the old version of db.lua" << endl;
// }
// if( file_db_old.remove() )
// {
// cout << "[OK] old db.lua removed successfully" << endl;
// gSysErrors << "[INFO] old db.lua removed successfully";
// }
// else
// {
// cout << "[ERROR] failed to remove the old version of db.lua" << endl;
// gSysErrors << "[ERROR] failed to remove the old version of db.lua";
// }
// if( file_db.copy( directory+"/db.lua" ) )
// {
// cout << "[OK] new version of db.lua copied successfully" << endl;
// gSysErrors << "[INFO] db.lua restored successfully";
// QFile file_db_new(directory+"/db.lua");
// if( ! file_db_new.setPermissions( QFile::WriteOwner | QFile::ReadOwner | QFile::ReadUser | QFile::WriteUser | QFile::ReadOther | QFile::WriteOther ) )
// {
// cout << "[ERROR] failed to set file permissions for the new version of db.lua" << endl;
// gSysErrors << "[ERROR] failed to set file permissions for the new version of db.lua";
// }
// else
// {
// cout << "[OK] successfully set file permissions for the new version of db.lua" << endl;
// }
// }
startupMessage.append(" Done.\nLoading font files...");
splash.showMessage(startupMessage, Qt::AlignHCenter);
app.processEvents();
t.restart();
while( t.elapsed() < 1000 )
; // Do nothing here for a second
QFile file_f1(":/fonts/ttf-bitstream-vera-1.10/COPYRIGHT.TXT");
file_f1.copy( directory+"/COPYRIGHT.TXT" );
QFile file_f2(":/fonts/ttf-bitstream-vera-1.10/RELEASENOTES.TXT");
file_f2.copy( directory+"/RELEASENOTES.TXT" );
QFile file_f3(":/fonts/ttf-bitstream-vera-1.10/VeraMoIt.ttf");
file_f3.copy( directory+"/VeraMoIt.ttf" );
QFile file_f4(":/fonts/ttf-bitstream-vera-1.10/local.conf");
file_f4.copy( directory+"/local.conf" );
QFile file_f5(":/fonts/ttf-bitstream-vera-1.10/VeraMoBd.ttf");
file_f5.copy( directory+"/VeraMoBd.ttf" );
QFile file_f6(":/fonts/ttf-bitstream-vera-1.10/VeraMoBd.ttf");
file_f6.copy( directory+"/VeraMoBd.ttf" );
QFile file_f7(":/fonts/ttf-bitstream-vera-1.10/README.TXT");
file_f7.copy( directory+"/README.TXT" );
QFile file_f8(":/fonts/ttf-bitstream-vera-1.10/VeraMoBI.ttf");
file_f8.copy( directory+"/VeraMoBI.ttf" );
QFile file_f9(":/fonts/ttf-bitstream-vera-1.10/VeraMono.ttf");
file_f9.copy( directory+"/VeraMono.ttf" );
/*QFile file_f(":/fonts/ttf-bitstream-vera-1.10/");
file_f.copy( directory+"/" );
QFile file_f(":/fonts/ttf-bitstream-vera-1.10/");
file_f.copy( directory+"/" );
QFile file_f(":/fonts/ttf-bitstream-vera-1.10/");
file_f.copy( directory+"/" ); */
startupMessage.append(" Done.\nAll data has been loaded successfully.\nStarting...\n\n\nHave fun!");
splash.showMessage(startupMessage, Qt::AlignHCenter);
app.processEvents();
t.restart();
while( t.elapsed() < 1000 )
; // Do nothing here for a second
splash.finish( mudlet::self() ); // This seems to be the point at which instance of mudlet is created!!!
mudlet::debugMode = false;
HostManager::self();
FontManager fm;
fm.addFonts();
QString home = QDir::homePath()+"/.config/mudlet";
QString homeLink = QDir::homePath()+"/mudlet-data";
QFile::link(home, homeLink);
mudlet::self()->show();
app.exec();
}
示例2: main
//.........这里部分代码省略.........
// cout << "[OK] new version of LuaGlobal.lua copied successfully" << endl;
// gSysErrors << "[INFO] LuaGlobal.lua restored successfully";
// QFile file_lua_new(directory+"/LuaGlobal.lua");
// if( ! file_lua_new.setPermissions( QFile::WriteOwner | QFile::ReadOwner | QFile::ReadUser | QFile::WriteUser | QFile::ReadOther | QFile::WriteOther ) )
// {
// cout << "[ERROR] failed to set file permissions for the new version of LuaGlobal.lua" << endl;
// gSysErrors << "[ERROR] failed to set file permissions for the new version of LuaGlobal.lua";
// }
// else
// {
// cout << "[OK] successfully set file permissions for the new version of LuaGlobal.lua" << endl;
// }
// }
// QFile file_db(":/db.lua");
// QFile file_db_old( directory+"/db.lua" );
// if( ! file_db_old.setPermissions( QFile::WriteOwner | QFile::ReadOwner | QFile::ReadUser | QFile::WriteUser | QFile::ReadOther | QFile::WriteOther ) )
// {
// cout << "[ERROR] failed to set file permissions for the old version of db.lua" << endl;
// gSysErrors << "[ERROR] failed to set file permissions for the old version of db.lua";
// }
// else
// {
// cout << "[OK] successfully set file permissions for the old version of db.lua" << endl;
// }
// if( file_db_old.remove() )
// {
// cout << "[OK] old db.lua removed successfully" << endl;
// gSysErrors << "[INFO] old db.lua removed successfully";
// }
// else
// {
// cout << "[ERROR] failed to remove the old version of db.lua" << endl;
// gSysErrors << "[ERROR] failed to remove the old version of db.lua";
// }
// if( file_db.copy( directory+"/db.lua" ) )
// {
// cout << "[OK] new version of db.lua copied successfully" << endl;
// gSysErrors << "[INFO] db.lua restored successfully";
// QFile file_db_new(directory+"/db.lua");
// if( ! file_db_new.setPermissions( QFile::WriteOwner | QFile::ReadOwner | QFile::ReadUser | QFile::WriteUser | QFile::ReadOther | QFile::WriteOther ) )
// {
// cout << "[ERROR] failed to set file permissions for the new version of db.lua" << endl;
// gSysErrors << "[ERROR] failed to set file permissions for the new version of db.lua";
// }
// else
// {
// cout << "[OK] successfully set file permissions for the new version of db.lua" << endl;
// }
// }
QFile file_f1(":/fonts/ttf-bitstream-vera-1.10/COPYRIGHT.TXT");
file_f1.copy( directory+"/COPYRIGHT.TXT" );
QFile file_f2(":/fonts/ttf-bitstream-vera-1.10/RELEASENOTES.TXT");
file_f2.copy( directory+"/RELEASENOTES.TXT" );
QFile file_f3(":/fonts/ttf-bitstream-vera-1.10/VeraMoIt.ttf");
file_f3.copy( directory+"/VeraMoIt.ttf" );
QFile file_f4(":/fonts/ttf-bitstream-vera-1.10/local.conf");
file_f4.copy( directory+"/local.conf" );
QFile file_f5(":/fonts/ttf-bitstream-vera-1.10/VeraMoBd.ttf");
file_f5.copy( directory+"/VeraMoBd.ttf" );
QFile file_f6(":/fonts/ttf-bitstream-vera-1.10/VeraMoBd.ttf");
file_f6.copy( directory+"/VeraMoBd.ttf" );
QFile file_f7(":/fonts/ttf-bitstream-vera-1.10/README.TXT");
file_f7.copy( directory+"/README.TXT" );
QFile file_f8(":/fonts/ttf-bitstream-vera-1.10/VeraMoBI.ttf");
file_f8.copy( directory+"/VeraMoBI.ttf" );
QFile file_f9(":/fonts/ttf-bitstream-vera-1.10/VeraMono.ttf");
file_f9.copy( directory+"/VeraMono.ttf" );
/*QFile file_f(":/fonts/ttf-bitstream-vera-1.10/");
file_f.copy( directory+"/" );
QFile file_f(":/fonts/ttf-bitstream-vera-1.10/");
file_f.copy( directory+"/" );
QFile file_f(":/fonts/ttf-bitstream-vera-1.10/");
file_f.copy( directory+"/" ); */
splash.showMessage("All data has been loaded successfully.\n\nHave fun!");
QTime t;
t.start();
while( t.elapsed() < 1500 );
splash.finish( mudlet::self() );
mudlet::debugMode = false;
HostManager::self();
FontManager fm;
fm.addFonts();
mudlet::self()->show();
app.exec();
}
示例3: main
//.........这里部分代码省略.........
}
app->processEvents();
QString splash_message;
if (show_splash) {
splash_message.append("\n\nMudlet comes with\n"
"ABSOLUTELY NO WARRANTY!\n"
"This is free software, and you are\n"
"welcome to redistribute it under\n"
"certain conditions; select the\n"
"'About' item for details.\n\n");
splash_message.append("Locating profiles... ");
splash.showMessage(splash_message, Qt::AlignHCenter | Qt::AlignTop);
app->processEvents();
}
QString directory = QDir::homePath() + "/.config/mudlet";
QDir dir;
if (!dir.exists(directory)) {
dir.mkpath(directory);
}
if (show_splash) {
splash_message.append("Done.\n\nLoading font files... ");
splash.showMessage(splash_message, Qt::AlignHCenter | Qt::AlignTop);
app->processEvents();
}
if (!QFile::exists(directory + "/COPYRIGHT.TXT")) {
QFile file_f1(":/fonts/ttf-bitstream-vera-1.10/COPYRIGHT.TXT");
file_f1.copy(directory + "/COPYRIGHT.TXT");
}
if (!QFile::exists(directory + "/RELEASENOTES.TXT")) {
QFile file_f2(":/fonts/ttf-bitstream-vera-1.10/RELEASENOTES.TXT");
file_f2.copy(directory + "/RELEASENOTES.TXT");
}
if (!QFile::exists(directory + "/VeraMoIt.ttf")) {
QFile file_f3(":/fonts/ttf-bitstream-vera-1.10/VeraMoIt.ttf");
file_f3.copy(directory + "/VeraMoIt.ttf");
}
if (!QFile::exists(directory + "/local.conf")) {
QFile file_f4(":/fonts/ttf-bitstream-vera-1.10/local.conf");
file_f4.copy(directory + "/local.conf");
}
if (!QFile::exists(directory + "/VeraMoBd.ttf")) {
QFile file_f5(":/fonts/ttf-bitstream-vera-1.10/VeraMoBd.ttf");
file_f5.copy(directory + "/VeraMoBd.ttf");
}
if (!QFile::exists(directory + "/VeraMoBd.ttf")) {
QFile file_f6(":/fonts/ttf-bitstream-vera-1.10/VeraMoBd.ttf");
file_f6.copy(directory + "/VeraMoBd.ttf");
}
if (!QFile::exists(directory + "/README.TXT")) {
QFile file_f7(":/fonts/ttf-bitstream-vera-1.10/README.TXT");
file_f7.copy(directory + "/README.TXT");
}
if (!QFile::exists(directory + "/VeraMoBI.ttf")) {
QFile file_f8(":/fonts/ttf-bitstream-vera-1.10/VeraMoBI.ttf");
file_f8.copy(directory + "/VeraMoBI.ttf");
}
if (!QFile::exists(directory + "/VeraMono.ttf")) {
QFile file_f9(":/fonts/ttf-bitstream-vera-1.10/VeraMono.ttf");
file_f9.copy(directory + "/VeraMono.ttf");
}
if (show_splash) {
splash_message.append("Done.\n\n"
"All data has been loaded successfully.\n\n"
"Starting... Have fun!\n\n");
splash.showMessage(splash_message, Qt::AlignHCenter | Qt::AlignTop);
app->processEvents();
}
mudlet::debugMode = false;
FontManager fm;
fm.addFonts();
QString home = QDir::homePath() + "/.config/mudlet";
QString homeLink = QDir::homePath() + "/mudlet-data";
QFile::link(home, homeLink);
mudlet::start();
mudlet::self()->show();
if (show_splash) {
splash.finish(mudlet::self());
}
app->restoreOverrideCursor();
// NOTE: Must restore cursor - BEWARE DEBUGGERS if you terminate application
// without doing/reaching this restore - it can be quite hard to accurately
// click something in a parent process to the application when you are stuck
// with some OS's choice of wait cursor - you might wish to temparily disable
// the earlier setOverrideCursor() line and this one.
return app->exec();
}