QSplashScreen, how to add my QWidget!
Page |
2 |
Man that’s a complex task to do!
I made something like this:
- int main(int argc, char *argv[])
- {
- MainWindow w;
- DialogIniciandoSistema splash(0);
- splash.show();
- splash.raise();
- Database db(0);
- return a.exec();
- }
Well, when the “init()” is executed my animated icon on the Splash freezes!
I think that I will need user Threads!!!! Real theard…
the init() code:
- oid Database::init()
- {
- if (database.open()) {
- if (createTables(query))
- {
- if (populateTables(query))
- {
- qDebug() << "Populado com sucesso.";
- } else {
- qDebug() << "Erro ao popular tabelas. " << query.lastError() ;
- }
- } else {
- qDebug() << "Erro ao criar tabelas. " << query.lastError();
- }
- }
- }
- {
- return this->database;
- }
- {
- bool retorno = true;
- bool temp = false;
- for (int i=1; i<lista.length(); i++)
- {
- temp = query.exec( lista[i] );
- retorno &= temp;
- }
- return retorno;
- }
- {
- bool retorno = true;
- bool temp = false;
- for (int i=1; i<lista.length(); i++)
- {
- temp = query.exec( lista[i] );
- if (! temp)
- {
- qDebug() << query.lastError() << " --> SQL: " << lista[i];
- }
- retorno &= temp;
- }
- return retorno;
- }
- {
- {
- qDebug() << "error opening file: " << file.error();
- return "";
- }
- file.close();
- return createTable;
- }
- {
- {
- qDebug() << "error opening file: " << file.error();
- return "";
- }
- file.close();
- return populateTable;
- }
You must log in to post a reply. Not a member yet? Register here!



