Advertisement
Jgug

Ones and zeros validation part

May 14th, 2013
407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. void Window::on_pushButtonAdd_clicked()
  2. {
  3.   QRegExp rxp("[aA2-zZ9 ]");
  4.  
  5.   if (qstrLine.contains(rxp))
  6.     {
  7.       QErrorMessage err;
  8.       qDebug() << "Invalid";
  9.       (new QErrorMessage(this))->showMessage("Вводимая строка должна состоять из групп нулей и единиц");
  10.  
  11.     }
  12.   else
  13.     {
  14.       qDebug() << "Valid!";
  15.       ui->comboBoxExistingStrings->addItem(qstrLine);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement