当前位置: 代码迷 >> 综合 >> qt设置简单的对话框 QInputDialog::getText();
  详细解决方案

qt设置简单的对话框 QInputDialog::getText();

热度:49   发布时间:2024-02-13 03:26:14.0

qt设置简单的对话框 QInputDialog::getText();

qt 对话框 用户输入密码,对密码进行判断

bool isOK;
QString text = QInputDialog::getText(NULL, "Input Dialog","Please input your password",QLineEdit::Normal,"",//输入框的提示&isOK);
if(isOK) {std::string strpassword = text.toStdString();if(strpassword=="password"){ReadAndWrite( path, IntOffsetx1, IntOffsety2, IntOffsetx2, IntOffsety2,IntAngelOffset);QMessageBox::information(NULL,"提示","修改成功");}else{QMessageBox::information(NULL,"提示","密码错误");}
}

效果图:
在这里插入图片描述