本文整理汇总了C++中Home::show方法的典型用法代码示例。如果您正苦于以下问题:C++ Home::show方法的具体用法?C++ Home::show怎么用?C++ Home::show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Home
的用法示例。
在下文中一共展示了Home::show方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: returnHome
void Launcher::returnHome()
{
this->close();
Home *home = new Home(m_parent);
home->show();
}
示例2: onLoginClicked
void Login::onLoginClicked()
{
if(ui->lineEdit->text().isEmpty() || ui->lineEdit_2->text().isEmpty())
{
ui->label->show();
ui->lineEdit->clear();
ui->lineEdit_2->clear();
}else{
//here is the login section
QSqlDatabase *db2 = new QSqlDatabase();
*db2 = QSqlDatabase::database();
db2->setDatabaseName(Includes::Path());
if(!db2->open())
{
QMessageBox amsg;
amsg.setText("Unable To Connect To Database");
amsg.exec();
}
//Write the Tables to the database
QByteArray password;
password = ui->lineEdit_2->text().toUtf8();
password = QCryptographicHash::hash(password,QCryptographicHash::Sha3_512).toBase64();
QSqlQuery query;
query.prepare("SELECT username, password FROM user WHERE username =(?)");
query.bindValue(0, ui->lineEdit->text().toHtmlEscaped());
if( !query.exec() )
{
QMessageBox msg;
msg.setText("query 1 has an Error()");
msg.exec();
}
//compare the retrieved values and the entered one.
QString username1;
QString password1;
while(query.next())
{
username1 = query.value(0).toString();
password1 = query.value(1).toString();
}
if(username1 == ui->lineEdit->text()){
if(password1 == password){
Home *home = new Home();
home->show();;//if validate open the main app
this->close();
}else
{
ui->label->show();
ui->lineEdit->clear();
ui->lineEdit_2->clear();
}
}else
{
ui->label->show();
ui->lineEdit->clear();
ui->lineEdit_2->clear();
}
}
}
示例3: closeEvent
void Settings::closeEvent(QCloseEvent *event)
{
Home *home = new Home();
home->show();
}