thefatladysingsopera
8th November 2011, 12:13
I have the following function.
void haal::authenticate()
{
remoteDB();
QSqlQuery query("SELECT * FROM princess");
int ttwo = query.record().indexOf("two");
int tthree = query.record().indexOf("three");
int ffour = query.record().indexOf("four");
int ffive = query.record().indexOf("five");
int ssix = query.record().indexOf("six");
int sseven = query.record().indexOf("seven");
int eeight = query.record().indexOf("eight");
while (query.next()) {
QString aa = query.value(ttwo).toString();
QString bb = query.value(tthree).toString();
QString cc = query.value(ffour).toString();
QString dd = query.value(ffive).toString();
QString ee = query.value(ssix).toString();
QString ff = query.value(sseven).toString();
QString gg = query.value(eeight).toString();
if(aa != ui.validator->text())
{
QMessageBox msgBox;
msgBox.setText("That Key Is Not Valid.");
QPushButton *connectButton = msgBox.addButton(tr("Ok"), QMessageBox::AcceptRole);
msgBox.exec();
if (msgBox.clickedButton() == connectButton)
{
//close();//exit the application
//qApp->exit(0);...stop further processing;exit the application
//how should it be done..
}
}
if(aa == ui.validator->text())
{
if (msgBox.clickedButton() == connectButton)
{
QMessageBox msgBox;
msgBox.setText("That Key Is Valid.");
}
QString kaad = getID();
QSqlQuery query;
query.prepare("INSERT INTO princess (one,two,three,four,five,six,seven) "
"VALUES (:one, :two, :three,:four,:five,:six,:seven)");
query.bindValue(":one", 78);
query.bindValue(":two", 7843251);
query.bindValue(":three",79);
query.bindValue(":four",80);
query.bindValue(":five",81);
query.bindValue(":six", 82);
query.bindValue(":seven",kaad);
query.exec();
}
}
}
I need to stop the processing here:
if (msgBox.clickedButton() == connectButton)
{
//close();//exit the application
//qApp->exit(0);...stop further processing;exit the application
//nothing to be executed below this line
}
void haal::authenticate()
{
remoteDB();
QSqlQuery query("SELECT * FROM princess");
int ttwo = query.record().indexOf("two");
int tthree = query.record().indexOf("three");
int ffour = query.record().indexOf("four");
int ffive = query.record().indexOf("five");
int ssix = query.record().indexOf("six");
int sseven = query.record().indexOf("seven");
int eeight = query.record().indexOf("eight");
while (query.next()) {
QString aa = query.value(ttwo).toString();
QString bb = query.value(tthree).toString();
QString cc = query.value(ffour).toString();
QString dd = query.value(ffive).toString();
QString ee = query.value(ssix).toString();
QString ff = query.value(sseven).toString();
QString gg = query.value(eeight).toString();
if(aa != ui.validator->text())
{
QMessageBox msgBox;
msgBox.setText("That Key Is Not Valid.");
QPushButton *connectButton = msgBox.addButton(tr("Ok"), QMessageBox::AcceptRole);
msgBox.exec();
if (msgBox.clickedButton() == connectButton)
{
//close();//exit the application
//qApp->exit(0);...stop further processing;exit the application
//how should it be done..
}
}
if(aa == ui.validator->text())
{
if (msgBox.clickedButton() == connectButton)
{
QMessageBox msgBox;
msgBox.setText("That Key Is Valid.");
}
QString kaad = getID();
QSqlQuery query;
query.prepare("INSERT INTO princess (one,two,three,four,five,six,seven) "
"VALUES (:one, :two, :three,:four,:five,:six,:seven)");
query.bindValue(":one", 78);
query.bindValue(":two", 7843251);
query.bindValue(":three",79);
query.bindValue(":four",80);
query.bindValue(":five",81);
query.bindValue(":six", 82);
query.bindValue(":seven",kaad);
query.exec();
}
}
}
I need to stop the processing here:
if (msgBox.clickedButton() == connectButton)
{
//close();//exit the application
//qApp->exit(0);...stop further processing;exit the application
//nothing to be executed below this line
}