本文整理汇总了C++中QSplashScreen::hide方法的典型用法代码示例。如果您正苦于以下问题:C++ QSplashScreen::hide方法的具体用法?C++ QSplashScreen::hide怎么用?C++ QSplashScreen::hide使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSplashScreen
的用法示例。
在下文中一共展示了QSplashScreen::hide方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPixmap pixmap("/home/dev/temp/temp_text_viewer/text_viewer/src/temp.png");
QSplashScreen *splash = new QSplashScreen(pixmap);
QTextCodec *utfcodec = QTextCodec::codecForName("UTF-8");
QTextCodec::setCodecForTr(utfcodec);
QTextCodec::setCodecForCStrings(utfcodec);
splash->show();
loadModules(splash);
splash->hide();
MainWindow window;
window.showMaximized();
return app.exec();
}
示例2: main
//.........这里部分代码省略.........
// Process command-line arguments
for (int i=1; i<argc; i++)
{
// Flag to indicate first boot
if (strcmp(argv[i], "-runinstaller") == 0)
runinstaller = true;
// Enables use of GPIO 3 to force NOOBS to launch by pulling low
else if (strcmp(argv[i], "-gpiotriggerenable") == 0)
gpio_trigger = true;
// Disables use of keyboard to trigger recovery GUI
else if (strcmp(argv[i], "-keyboardtriggerdisable") == 0)
keyboard_trigger = false;
// Forces display of recovery GUI every time
else if (strcmp(argv[i], "-forcetrigger") == 0)
force_trigger = true;
// Allow default language to be specified in commandline
else if (strcmp(argv[i], "-lang") == 0)
{
if (argc > i+1)
defaultLang = argv[i+1];
}
// Allow default keyboard layout to be specified in commandline
else if (strcmp(argv[i], "-kbdlayout") == 0)
{
if (argc > i+1)
defaultKeyboard = argv[i+1];
}
// Allow default display mode to be specified in commandline
else if (strcmp(argv[i], "-dispmode") == 0)
{
if (argc > i+1)
defaultDisplay = --argv[i+1];
}
// Allow default boot partition to be specified in commandline
else if (strcmp(argv[i], "-partition") == 0)
{
if (argc > i+1)
defaultPartition = argv[i+1];
}
}
// Intercept right mouse clicks sent to the title bar
a.installEventFilter(&rbf);
#ifdef Q_WS_QWS
QWSServer::setCursorVisible(false);
#endif
// Set wallpaper and icon, if we have resource files for that
if (QFile::exists(":/icons/raspberry_icon.png"))
a.setWindowIcon(QIcon(":/icons/raspberry_icon.png"));
#ifdef Q_WS_QWS
QWSServer::setBackground(BACKGROUND_COLOR);
#endif
QSplashScreen *splash = new QSplashScreen(QPixmap(":/wallpaper.png"));
splash->show();
QApplication::processEvents();
// If -runinstaller is not specified, only continue if SHIFT is pressed, GPIO is triggered,
// or no OS is installed (/dev/mmcblk0p5 does not exist)
bool bailout = !runinstaller
&& !force_trigger
&& !(gpio_trigger && (gpio.value() == 0 ))
&& !(keyboard_trigger && KeyDetection::isF10pressed())
&& QFile::exists(FAT_PARTITION_OF_IMAGE);
// Keyboard detection done, load normal hid driver
//QProcess::execute("/sbin/modprobe usbhid");
// Default to booting first extended partition
putFileContents("/sys/module/bcm2708/parameters/reboot_part", "5\n");
if (bailout)
{
splash->hide();
reboot_to_extended(defaultPartition, true);
}
#ifdef Q_WS_QWS
QWSServer::setCursorVisible(true);
#endif
// Main window in the middle of screen
MainWindow mw(defaultDisplay, splash);
mw.setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, mw.size(), a.desktop()->availableGeometry()));
mw.show();
#ifdef ENABLE_LANGUAGE_CHOOSER
// Language chooser at the bottom center
LanguageDialog* ld = new LanguageDialog(defaultLang, defaultKeyboard);
ld->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignHCenter | Qt::AlignBottom, ld->size(), a.desktop()->availableGeometry()));
ld->show();
#endif
a.exec();
reboot_to_extended(defaultPartition, false);
return 0;
}
示例3: pixmap
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
// Setup UI components
ui->setupUi(this);
ui->tableTabWidget->tabBar()->tabButton(0, QTabBar::RightSide)->resize(0, 0);
QList<int> sizes;
sizes << 100 << 1000;
ui->splitter->setSizes(sizes);
// Start splash screen
QPixmap pixmap(":/images/resources/aperture_blue.png");
QSplashScreen *splash = new QSplashScreen(pixmap);
splash->show();
// Open Database
_dbManager = new DatabaseManager(this);
QString messageResult = _dbManager->openDB();
if(messageResult != NULL) {
QMessageBox::critical(this, tr("Database Error"), "The database could not be opened: \n" + messageResult);
ui->statusBar->showMessage("Open Database unsuccessful");
} else {
ui->statusBar->showMessage("Database Connected");
messageResult = _dbManager->createCustomerAndInvoiceTables();
if(messageResult != NULL){
QMessageBox::critical(this, tr("Database Error"), "The tables could not be created: \n" + messageResult);
}
// Load the customer List
_customerTableModel = new QSqlTableModel(this);
_customerTableModel->setTable("customer");
_customerTableModel->select();
ui->listView->setModel(_customerTableModel);
ui->listView->setModelColumn(1);
// _customerModel = _dbManager->loadCustomerList();
// if(_customerModel != NULL) {
// ui->listView->setModel(_customerModel);
// ui->statusBar->showMessage("Successfully loaded customer list");
// } else {
// QMessageBox::critical(this, tr("Database Error"), "The database could not load the customer list");
// ui->statusBar->showMessage("Database: Load customer list unsuccessful");
// }
// Load all Invoice table
_invoiceTableModel = new QSqlTableModel(this);
_invoiceTableModel->setTable("invoice");
_invoiceTableModel->select();
ui->tableView->setModel(_invoiceTableModel);
// _invoiceModel = _dbManager.loadInvoiceTable();
// if(_invoiceModel != NULL) {
// ui->tableView->setModel(_invoiceModel);
// ui->statusBar->showMessage("Successfully loaded invoice table");
// } else {
// QMessageBox::critical(this, tr("Database Error"), "The database could not load the invoice table");
// ui->statusBar->showMessage("Database: Load invoice table unsuccessful");
// }
}
//QThread::sleep(3);
splash->hide();
}
示例4: main
//.........这里部分代码省略.........
#ifdef Q_WS_QWS
QWSServer::setBackground(BACKGROUND_COLOR);
#endif
QSplashScreen *splash = new QSplashScreen(QPixmap(":/wallpaper.png"));
splash->show();
QApplication::processEvents();
// Wait for drive device to show up
QString drive;
bool driveReady = false;
QTime t;
t.start();
while (t.elapsed() < 10000)
{
if (drive.isEmpty())
{
/* We do not know the exact drive name to wait for */
drive = findRecoveryDrive();
if (!drive.isEmpty())
{
driveReady = true;
break;
}
}
else if (drive.startsWith("/dev"))
{
if (QFile::exists(drive))
{
driveReady = true;
break;
}
}
QApplication::processEvents(QEventLoop::WaitForMoreEvents, 100);
}
if (!driveReady)
{
QMessageBox::critical(NULL, "Files not found", QString("Cannot find the drive with NOOBS files %1").arg(drive), QMessageBox::Close);
return 1;
}
qDebug() << "NOOBS drive:" << drive;
// If -runinstaller is not specified, only continue if SHIFT is pressed, GPIO is triggered,
// or no OS is installed (/settings/installed_os.json does not exist)
bool bailout = !runinstaller
&& !force_trigger
&& !(gpio_trigger && (gpio.value() == 0 ))
&& hasInstalledOS(drive);
if (bailout && keyboard_trigger)
{
t.start();
while (t.elapsed() < 2000)
{
QApplication::processEvents(QEventLoop::WaitForMoreEvents, 10);
if (QApplication::queryKeyboardModifiers().testFlag(Qt::ShiftModifier))
{
bailout = false;
qDebug() << "Shift detected";
break;
}
if (hasTouchScreen && QApplication::mouseButtons().testFlag(Qt::LeftButton))
{
bailout = false;
qDebug() << "Tap detected";
break;
}
}
}
if (bailout)
{
splash->hide();
showBootMenu(drive, defaultPartition, true);
}
#ifdef Q_WS_QWS
QWSServer::setCursorVisible(true);
#endif
// Main window in the middle of screen
MainWindow mw(drive, defaultDisplay, splash);
mw.setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, mw.size(), a.desktop()->availableGeometry()));
mw.show();
#ifdef ENABLE_LANGUAGE_CHOOSER
// Language chooser at the bottom center
LanguageDialog* ld = new LanguageDialog(defaultLang, defaultKeyboard);
ld->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignHCenter | Qt::AlignBottom, ld->size(), a.desktop()->availableGeometry()));
ld->show();
#endif
a.exec();
showBootMenu(drive, defaultPartition, false);
return 0;
}
示例5: main
//.........这里部分代码省略.........
p.setColor(QPalette::Disabled, QPalette::Text, QColor::fromRgb(100,100,100));
p.setColor(QPalette::Link, QColor::fromRgb(192,192,255));
p.setColor(QPalette::LinkVisited, QColor::fromRgb(192,192,255));
a.setPalette(p);
#else
QString font1String("QApplication, QWidget, QDialog { font-family: \"Nimbus Sans L\"; font-size: 12px; }");
#endif
a.setStyleSheet(font1String + " QDialogButtonBox, QMessageBox { dialogbuttonbox-buttons-have-icons: 1; dialog-ok-icon: url(:/gfx/dialog_ok_apply.png); dialog-cancel-icon: url(:/gfx/dialog_close.png); dialog-close-icon: url(:/gfx/dialog_close.png); dialog-yes-icon: url(:/gfx/dialog_ok_apply.png); dialog-no-icon: url(:/gfx/dialog_close.png) }");
#ifdef ANDROID
//check if custom background pictures for the resolution are there. Otherwise create them!
QString UserDataDir = QString::fromUtf8(myConfig->readConfigString("UserDataDir").c_str());
QDesktopWidget dw;
int screenWidth = dw.screenGeometry().width();
int screenHeight = dw.screenGeometry().height();
QString customStartWindowBgFileString(UserDataDir+"/startwindowbg10_"+QString::number(screenWidth)+"x"+QString::number(screenHeight)+".png");
QString customWelcomePokerTHFileString(UserDataDir+"/welcomepokerth10_"+QString::number(screenWidth)+"x"+QString::number(screenHeight)+".png");
QFile customStartWindowBgFile(customStartWindowBgFileString);
QFile customWelcomePokerTHFile(customWelcomePokerTHFileString);
QSplashScreen preSplashFirstRun;
if(!customStartWindowBgFile.exists()) {
//load preSplashPix to show that PokerTH is already running during first time pics calculation
QPixmap prePixBase(":/gfx/logoChip3D.png");
QPixmap prePix(300, 200);
prePix.fill(Qt::transparent); // force alpha channel
{
QPainter painter(&prePix);
painter.drawPixmap(0, 0, prePixBase);
painter.setPen(Qt::white);
painter.drawText(10, 160, "loading ...");
}
preSplashFirstRun.setPixmap(prePix);
preSplashFirstRun.show();
QPixmap pix(":/android/android-data/gfx/gui/misc/startwindowbg10_mobile.png");
pix = pix.scaled(screenWidth, screenHeight, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
pix.save(customStartWindowBgFileString);
}
if(!customWelcomePokerTHFile.exists()) {
QPixmap base(customStartWindowBgFileString);
//scale overlay "have a lot of fun" at first
QPixmap overlay(":/android/android-data/gfx/gui/misc/welcomepokerth10_mobile.png");
overlay = overlay.scaled(screenWidth, screenHeight, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
QPixmap result(base.width(), base.height());
result.fill(Qt::transparent); // force alpha channel
{
QPainter painter(&result);
painter.drawPixmap(0, 0, base);
painter.drawPixmap(0, 0, overlay);
}
result.save(customWelcomePokerTHFileString);
preSplashFirstRun.hide();
}
QPixmap pixmap;
if(customWelcomePokerTHFile.exists()) {
pixmap.load(QFileInfo(customWelcomePokerTHFile).absoluteFilePath());
} else {
//if custom welcome pic could not be saved locally we need to scale it on the fly
pixmap.load(":/android/android-data/gfx/gui/misc/welcomepokerth10_mobile.png");
pixmap = pixmap.scaled(screenWidth, screenHeight, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
}
#else
QPixmap pixmap(myAppDataPath + "gfx/gui/misc/welcomepokerth10_desktop.png");
#endif
StartSplash splash(pixmap);
if(!myConfig->readConfigInt("DisableSplashScreenOnStartup")) {
splash.show();
splash.showMessage(QString("Version %1").arg(POKERTH_BETA_RELEASE_STRING), 0x0042, QColor(255,255,255));
}
//Set translations
QTranslator qtTranslator;
qtTranslator.load(QString(myAppDataPath +"translations/qt_") + QString::fromStdString(myConfig->readConfigString("Language")));
a.installTranslator(&qtTranslator);
QTranslator translator;
translator.load(QString(myAppDataPath +"translations/pokerth_") + QString::fromStdString(myConfig->readConfigString("Language")));
a.installTranslator(&translator);
qRegisterMetaType<unsigned>("unsigned");
qRegisterMetaType<boost::shared_ptr<Game> >("boost::shared_ptr<Game>");
qRegisterMetaType<ServerStats>("ServerStats");
qRegisterMetaType<DenyGameInvitationReason>("DenyGameInvitationReason");
///////////////////////////////////////////////////
startWindowImpl mainWin(myConfig,myLog);
#ifdef ANDROID
mainWin.show();
#else
a.setActivationWindow(&mainWin, true);
#endif
int retVal = a.exec();
curl_global_cleanup();
socket_cleanup();
return retVal;
}