From bb845f0455a3a73fa78bb69ed92b4dba544c6d55 Mon Sep 17 00:00:00 2001 From: mohanrex Date: Sat, 17 May 2014 22:35:03 +0530 Subject: [PATCH] splash scree initialization changed from main.cpp to angadiapp.cpp --- src/angadiapp.cpp | 12 ++++++++++++ src/connection.cpp | 4 ++-- src/main.cpp | 6 +++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/angadiapp.cpp b/src/angadiapp.cpp index 442b5fc..d7c0b4f 100644 --- a/src/angadiapp.cpp +++ b/src/angadiapp.cpp @@ -1,5 +1,6 @@ #include "angadiapp.h" #include +#include #include @@ -18,6 +19,17 @@ void AngadiApp::start() connect(login,SIGNAL(exitApp()),this,SLOT(exitApp())); connect(angadiMainWindow,SIGNAL(exit()),this,SLOT(exitApp())); // login->show(); + + QPixmap pix(":/images/icons/about_splash.png"); + QSplashScreen splash(pix); + splash.show(); + + QTime dieTime= QTime::currentTime().addSecs(3); + while( QTime::currentTime() < dieTime ) + QCoreApplication::processEvents(QEventLoop::AllEvents,50); + + splash.hide(); + angadiMainWindow->showMaximized(); } diff --git a/src/connection.cpp b/src/connection.cpp index 6940f63..5fcc41d 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -109,7 +109,7 @@ void Connection::createSqliteTables() ") ENGINE=InnoDB DEFAULT CHARSET=utf8;"); // default category - db.exec("INSERT INTO `categories` (`code`, `name`, `status`) VALUES ('0', 'GENERAL', 'A');"); + db.exec("INSERT INTO `categories` (`code`, `name`, `status`) VALUES ('1001', 'GENERAL', 'A');"); // customers table creation db.exec("CREATE TABLE IF NOT EXISTS `customers` (" @@ -141,7 +141,7 @@ void Connection::createSqliteTables() ") ENGINE=InnoDB DEFAULT CHARSET=utf8;"); // default customer - db.exec("INSERT INTO `customers` (`code`, `name`, `type`, `creditLimit`, `gender`, `status`) VALUES ('0', 'GENERAL', 'Retailer', '0', 'Male', 'A');"); + db.exec("INSERT INTO `customers` (`code`, `name`, `type`, `creditLimit`, `gender`, `status`) VALUES ('1001', 'GENERAL', 'Retailer', '0', 'Male', 'A');"); // products table creation db.exec("CREATE TABLE IF NOT EXISTS `products` (" diff --git a/src/main.cpp b/src/main.cpp index 7c506b9..03ecd02 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,15 +16,15 @@ int main(int argc, char *argv[]) // a.installTranslator(&translator); // } - QPixmap pix(":/images/icons/about_splash.png"); + /*QPixmap pix(":/images/icons/about_splash.png"); QSplashScreen splash(pix); splash.show(); QTime dieTime= QTime::currentTime().addSecs(3); while( QTime::currentTime() < dieTime ) - QCoreApplication::processEvents(QEventLoop::AllEvents, 100); + QCoreApplication::processEvents(QEventLoop::AllEvents,50); - splash.hide(); + splash.hide();*/ a.start(); return a.exec();